diff options
Diffstat (limited to '.config/nvim/lua')
-rw-r--r-- | .config/nvim/lua/user/plugins.lua | 8 | ||||
-rw-r--r-- | .config/nvim/lua/user/remaps.lua | 48 |
2 files changed, 39 insertions, 17 deletions
diff --git a/.config/nvim/lua/user/plugins.lua b/.config/nvim/lua/user/plugins.lua index 2344087..ee7dea7 100644 --- a/.config/nvim/lua/user/plugins.lua +++ b/.config/nvim/lua/user/plugins.lua @@ -4,9 +4,14 @@ -- plugins to be installed plugins = { "folke/lazy.nvim", -- plugin manager + "nvim-lua/popup.nvim", -- some functions for other plugins + "nvim-lua/plenary.nvim", -- some functions for other plugins "folke/which-key.nvim", -- pretty self-descriptive name "rafi/awesome-vim-colorschemes", -- same here - "tpope/vim-commentary" -- gc & gcc for commenting + "tpope/vim-commentary", -- gc & gcc for commenting + "tpope/vim-surround", -- replace quotes e.t.c + "nvim-treesitter/nvim-treesitter", -- folding code, advanced syntax highlighting & sitting on a tree + "preservim/nerdtree", -- file explorer } -- options for lazy @@ -32,4 +37,5 @@ vim.opt.rtp:prepend(lazypath) -- initialization lazy = require("lazy") lazy.setup(plugins, opts) +-- lazy.load('nerdtree') diff --git a/.config/nvim/lua/user/remaps.lua b/.config/nvim/lua/user/remaps.lua index 742e967..a047392 100644 --- a/.config/nvim/lua/user/remaps.lua +++ b/.config/nvim/lua/user/remaps.lua @@ -7,34 +7,45 @@ local map = vim.api.nvim_set_keymap map("", "\\", "<Nop>", opt) vim.g.mapleader = "\\" --- some minor commands -map("c", "w!!", "w !sudo tee % > /dev/null", opt) -- remap j and k --- i refuse to elaborate +-- I refuse to elaborate map("n", "j", "<Up>", opt) map("n", "k", "<Down>", opt) +map("n", "dj", "d<Up>", opt) +map("n", "dk", "d<Down>", opt) -- window navigation -map("n", "<C-l>", "<C-w>l", opt) map("n", "<C-j>", "<C-w>k", opt) -- SWITCHED K AND J map("n", "<C-k>", "<C-w>j", opt) -- SWITCHED K AND J +map("n", "<C-l>", "<C-w>l", opt) map("n", "<C-h>", "<C-w>h", opt) +-- buffer navigation +map("n", "gn", ":bn<Cr>", opt) +map("n", "gp", ":bp<Cr>", opt) + -- Insert mode navigation map("i", "<C-h>", "<Left>", opt) map("i", "<C-j>", "<Up>", opt) -- SWITCHED K AND J map("i", "<C-k>", "<Down>", opt) -- SWITCHED K AND J map("i", "<C-l>", "<Right>", opt) +map("i", "<C-w>", "<C-Right>", opt) +map("i", "<C-W>", "<Esc>Wi", opt) +map("i", "<C-b>", "<C-Left>", opt) +map("i", "<C-B>", "<Esc>Bi", opt) + +-- Terminal mode +map("t", "<Esc>", "<C-\\><C-n>" , opt) -- lexer options..? -map("n", "<leader>e", ":Lex 49<cr>", opt) +map("n", "<leader>e", ":NERDTreeToggle<CR>", opt) -- resizing options -map("n", "<C-Left>", ":vertical resize -5<cr>", opt) -map("n", "<C-Up>", ":resize +5<cr>", opt) -map("n", "<C-Right>", ":vertical resize +5<cr>", opt) -map("n", "<C-Down>", ":resize -5<cr>", opt) +map("n", "<C-Left>", ":vertical resize -4<cr>", opt) +map("n", "<C-Up>", ":resize +1<cr>", opt) +map("n", "<C-Right>", ":vertical resize +4<cr>", opt) +map("n", "<C-Down>", ":resize -1<cr>", opt) -- better indentation map("v", "<", "<gv", opt) @@ -45,14 +56,19 @@ map("n", "<A-j>", ":m .-2<CR>==", opt) -- SWITCHED K AND J map("n", "<A-k>", ":m .+1<CR>==", opt) -- SWITCHED K AND J -- duplicating lines -map("n", "<C-Up>", ":.,.t.-1<CR>==", opt) -map("n", "<C-Down>", ":.,.t.<CR>==", opt) +map("n", "<C-A-Up>", ":.,.t.-1<CR>==", opt) +map("n", "<C-A-Down>", ":.,.t.<CR>==", opt) -- leader remaps -map("n", "<leader>/", ":nohlsearch<CR>", opt) -- discard search highlighting -map("n", "<leader>T", ":term<CR>", opt) -- open terminal fullscreen with \T -map("n", "<leader>t", ":vsplit term <CR>", opt) -- split to terminal with \t -map("n", "<leader>pl", ":Lazy<CR>", opt) -- open plugin manager +map("n", "<leader>/", ":nohlsearch<CR>", opt) -- discard search highlighting +map("n", "<leader>t", ":split<CR>:terminal<CR>:resize 4<CR>", opt) -- open terminal fullscreen with \T +map("n", "<leader>T", ":vsplit<CR>:terminal<CR>", opt) -- split to terminal with \t +map("n", "<leader>pl", ":Lazy<CR>", opt) -- open plugin manager -- miscellaneous -map("n", "<leader>relaod", ":luafile ~/.config/nvim/lua/init.lua", {noremap = false}) +map("c", "w!!", "w !sudo tee % > /dev/null", opt) + +-- better G and gg +map("n", "G", "G$", opt) +map("n", "gg", "gg0", opt) + |