first commit
This commit is contained in:
62
nvim-termux/.config/nvim/lua/maps.lua
Normal file
62
nvim-termux/.config/nvim/lua/maps.lua
Normal file
@@ -0,0 +1,62 @@
|
||||
vim.keymap.set('n', '<M-h>', '5<C-w><', { desc = 'Resize left' })
|
||||
vim.keymap.set('n', '<M-j>', '5<C-w>+', { desc = 'Resize down' })
|
||||
vim.keymap.set('n', '<M-k>', '5<C-w>-', { desc = 'Resize up' })
|
||||
vim.keymap.set('n', '<M-l>', '5<C-w>>', { desc = 'Resize right' })
|
||||
|
||||
vim.api.nvim_set_keymap('n', '<leader>ev', ':edit $MYVIMRC<CR>', { noremap = true })
|
||||
|
||||
-- Map Ctrl+Shift+h/j/k/l to resize panes
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
-- nnn
|
||||
vim.api.nvim_set_keymap('n', '<C-f>', ':NnnPicker %:p:h<CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('t', '<C-f>', '<cmd>NnnPicker %:p:h<CR>', { noremap = true })
|
||||
|
||||
-- nvim-tree
|
||||
vim.api.nvim_set_keymap('n', '<C-b>', '<cmd>NvimTreeToggle <CR>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', '<leader>b', ':NvimTreeResize ', { noremap = true })
|
||||
|
||||
-- Telescope
|
||||
vim.keymap.set('n', '<C-l>', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<C-k>', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<C-p>', builtin.commands, {})
|
||||
|
||||
-- etc
|
||||
vim.keymap.set('n', '?', ':WhichKey<CR>', {})
|
||||
|
||||
-- zen mode
|
||||
vim.keymap.set('n', '<leader>z', ':ZenMode<CR>', { silent = true })
|
||||
|
||||
-- Language shortcuts
|
||||
vim.keymap.set('i', '<C-e>', 'if err != nil {}<Left>', { noremap = true })
|
||||
|
||||
vim.cmd [[autocmd BufWritePre *.go lua vim.lsp.buf.format()]]
|
||||
|
||||
-- Change Tabs
|
||||
vim.keymap.set('n', '<leader>1', '1gt', {})
|
||||
vim.keymap.set('n', '<leader>2', '2gt', {})
|
||||
vim.keymap.set('n', '<leader>3', '3gt', {})
|
||||
vim.keymap.set('n', '<leader>4', '4gt', {})
|
||||
vim.keymap.set('n', '<leader>5', '5gt', {})
|
||||
vim.keymap.set('n', '<leader>6', '6gt', {})
|
||||
vim.keymap.set('n', '<leader>7', '7gt', {})
|
||||
vim.keymap.set('n', '<leader>8', '8gt', {})
|
||||
vim.keymap.set('n', '<leader>9', '9gt', {})
|
||||
|
||||
-- DAP
|
||||
vim.api.nvim_set_keymap('n', '<leader>d', ':DapViewToggle<cr>', { noremap = true })
|
||||
vim.api.nvim_set_keymap('n', '<leader>w', ':DapViewWatch<cr>', { noremap = true })
|
||||
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
|
||||
vim.keymap.set('n', '<F6>', function() require('dap').restart() end)
|
||||
vim.keymap.set('n', '<F10>', function() require('dap').step_over() end)
|
||||
vim.keymap.set('n', '<F11>', function() require('dap').step_into() end)
|
||||
vim.keymap.set('n', '<F12>', function() require('dap').step_out() end)
|
||||
vim.keymap.set('n', '<leader>b', function() require('dap').toggle_breakpoint() end)
|
||||
|
||||
-- Copilot
|
||||
vim.api.nvim_set_keymap('n', '<C-C>', ':CopilotChatToggle <CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('i', '<C-J>', 'copilot#Accept("<CR>")', { expr=true, noremap = true, silent = true })
|
||||
vim.keymap.set('i', '<C-H>', '<Plug>(copilot-accept-word)', { noremap=true, silent=true })
|
||||
vim.keymap.set("i", "<C-U>", '<Plug>(copilot-next)', { noremap=true, silent=true })
|
||||
vim.keymap.set("i", "<C-B>", '<Plug>(copilot-previous)', { noremap=true, silent=true })
|
||||
vim.g.copilot_no_tab_map = true
|
||||
113
nvim-termux/.config/nvim/lua/plugins.lua
Normal file
113
nvim-termux/.config/nvim/lua/plugins.lua
Normal file
@@ -0,0 +1,113 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Install Plugins
|
||||
require('lazy').setup({
|
||||
-- LSP
|
||||
'luukvbaal/nnn.nvim',
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
'nvim-telescope/telescope.nvim',
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
{
|
||||
"nvim-orgmode/orgmode",
|
||||
dependencies = {
|
||||
"lukas-reineke/headlines.nvim",
|
||||
},
|
||||
event = 'VeryLazy',
|
||||
ft = { 'org' },
|
||||
config = function()
|
||||
require("orgmode").setup({
|
||||
org_startup_indented = true, -- ← this gives Emacs-style virtual indentation under headings (huge for legibility)
|
||||
org_agenda_files = '~/org/**/*',
|
||||
org_default_notes_file = '~/org/scratch.org',
|
||||
org_startup_indented = true,
|
||||
org_deadline_warning_days = 0,
|
||||
org_agenda_custom_commands = {
|
||||
w = {
|
||||
description = "Work",
|
||||
types = {
|
||||
{
|
||||
type = 'agenda',
|
||||
org_agenda_tag_filter_preset = 'work'
|
||||
}
|
||||
}
|
||||
},
|
||||
p = {
|
||||
description = "Personal",
|
||||
types = {
|
||||
{
|
||||
type = 'agenda',
|
||||
org_agenda_tag_filter_preset = 'personal'
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
require("headlines").setup({
|
||||
org = {
|
||||
fat_headlines = false, -- ← no more huge blocks
|
||||
headline_highlights = { "Headline1", "Headline2", "Headline3", "Headline4" },
|
||||
quote_string = "│", -- thinner vertical bar for quotes (optional but nicer)
|
||||
quote_highlight = "Quote",
|
||||
},
|
||||
})
|
||||
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- Initialize Plugins
|
||||
require('nnn').setup({
|
||||
picker = {
|
||||
cmd = "nnn -C",
|
||||
style = { border = "rounded" },
|
||||
fullscreen = false,
|
||||
},
|
||||
})
|
||||
local function tree_on_attach(bufnr)
|
||||
local api = require('nvim-tree.api')
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
vim.keymap.del('n', '<C-e>', { buffer = bufnr })
|
||||
vim.keymap.set("n", "<M-h>", function() api.tree.resize({ relative = -5 }) end, { buffer = bufnr })
|
||||
vim.keymap.set("n", "<M-l>", function() api.tree.resize({ relative = 5 }) end, { buffer = bufnr })
|
||||
end
|
||||
require('nvim-tree').setup({
|
||||
on_attach = tree_on_attach,
|
||||
view = {
|
||||
side = "left",
|
||||
},
|
||||
tab = {
|
||||
sync = {
|
||||
open = true,
|
||||
close = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
file_ignore_patterns = {
|
||||
"%.git/",
|
||||
"node_modules/",
|
||||
"%.DS_Store",
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
find_files = {
|
||||
hidden = true,
|
||||
no_ignore = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
require("telescope").load_extension("ui-select")
|
||||
52
nvim-termux/.config/nvim/lua/settings.lua
Normal file
52
nvim-termux/.config/nvim/lua/settings.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
vim.o.mouse = "a"
|
||||
vim.o.shiftwidth = 4
|
||||
vim.o.tabstop = 4
|
||||
vim.o.expandtab = true
|
||||
vim.o.autoindent = true
|
||||
vim.o.foldmethod = "indent"
|
||||
vim.o.foldlevel = 99
|
||||
vim.o.wrap = false
|
||||
vim.wo.number = true
|
||||
vim.wo.relativenumber = true
|
||||
vim.g.mapleader = ' '
|
||||
vim.o.splitright = true
|
||||
-- vim.o.scrolloff = 999
|
||||
-- vim.o.clipboard="unnamedplus"
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "markdown",
|
||||
command = "setlocal wrap linebreak",
|
||||
})
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "org",
|
||||
command = "setlocal shiftwidth=2 tabstop=2 expandtab",
|
||||
})
|
||||
|
||||
-- Highlighting for orgmode files with highlight.nvim
|
||||
vim.api.nvim_create_autocmd("ColorScheme", {
|
||||
callback = function()
|
||||
local cursorline = vim.api.nvim_get_hl(0, { name = "CursorLine" })
|
||||
local sep = vim.api.nvim_get_hl(0, { name = "WinSeparator" }).fg
|
||||
or vim.api.nvim_get_hl(0, { name = "Comment" }).fg
|
||||
|
||||
vim.api.nvim_set_hl(0, "Headline1", { bg = cursorline.bg, underline = true, sp = sep })
|
||||
vim.api.nvim_set_hl(0, "Headline2", { bg = cursorline.bg, underline = true, sp = sep })
|
||||
vim.api.nvim_set_hl(0, "Headline3", { bg = cursorline.bg, underline = true, sp = sep })
|
||||
vim.api.nvim_set_hl(0, "Headline4", { bg = cursorline.bg, underline = true, sp = sep })
|
||||
end,
|
||||
})
|
||||
|
||||
-- Global colorscheme based on terminal colors
|
||||
vim.cmd([[
|
||||
autocmd ColorScheme * highlight Statement cterm=bold ctermfg=5
|
||||
autocmd ColorScheme * highlight Keyword ctermfg=5
|
||||
autocmd ColorScheme * highlight Type ctermfg=6
|
||||
autocmd ColorScheme * highlight Function cterm=bold ctermfg=4
|
||||
autocmd ColorScheme * highlight Constant ctermfg=3
|
||||
autocmd ColorScheme * highlight String ctermfg=2
|
||||
" autocmd ColorScheme * highlight Comment cterm=italic ctermfg=lightgray
|
||||
|
||||
syntax on
|
||||
set notermguicolors
|
||||
colorscheme default
|
||||
]])
|
||||
Reference in New Issue
Block a user