summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/neovim.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/modules/neovim.nix b/modules/neovim.nix
index 1897223..1984029 100644
--- a/modules/neovim.nix
+++ b/modules/neovim.nix
@@ -8,6 +8,55 @@
8 vimAlias = true; 8 vimAlias = true;
9 vimdiffAlias = true; 9 vimdiffAlias = true;
10 extraConfig = builtins.readFile ./init.vim; 10 extraConfig = builtins.readFile ./init.vim;
11 extraLuaConfig = ''
12 vim.g.mapleader = " "
13 vim.keymap.set("n", "<leader>n", vim.cmd.Ex)
14
15 vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
16 vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
17
18 vim.keymap.set("n", "J", "mzJ`z")
19 vim.keymap.set("n", "<C-d>", "<C-d>zz")
20 vim.keymap.set("n", "<C-u>", "<C-u>zz")
21 vim.keymap.set("n", "n", "nzzzv")
22 vim.keymap.set("n", "N", "Nzzzv")
23
24 -- greatest remap ever
25 vim.keymap.set("x", "<leader>p", [["_dP]])
26
27 -- next greatest remap ever : asbjornHaland
28 vim.keymap.set({"n", "v"}, "<leader>y", [["+y]])
29 vim.keymap.set("n", "<leader>Y", [["+Y]])
30
31 vim.keymap.set({"n", "v"}, "<leader>d", [["_d]])
32
33 vim.keymap.set("n", "<leader>f", vim.lsp.buf.format)
34
35 vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
36 vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
37 vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
38 vim.keymap.set("n", "<leader>j", "<cmd>lprev<CR>zz")
39
40 vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
41 vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { silent = true })
42
43 vim.keymap.set("n", "<leader><tab>", ":FZF<CR>")
44 vim.keymap.set("n", "<leader>q", ":wq<CR>")
45 vim.keymap.set("n", "<leader>w", ":w<CR>")
46
47 vim.keymap.set("n", "<C-h>", "<C-w>h")
48 vim.keymap.set("n", "<C-j>", "<C-w>j")
49 vim.keymap.set("n", "<C-k>", "<C-w>k")
50 vim.keymap.set("n", "<C-l>", "<C-w>l")
51
52 vim.keymap.set("n", "S", ":%s//gI<Left><Left><Left>")
53
54 -- bujo
55 vim.keymap.set("n", "<C-n>", "<Plug>BujoAddnormal")
56 vim.keymap.set("i", "<C-n>", "<Plug>BujoAddinsert")
57 vim.keymap.set("n", "<C-p>", "<Plug>BujoChecknormal")
58 vim.keymap.set("i", "<C-p>", "<Plug>BujoCheckinsert")
59 '';
11 plugins = with pkgs.vimPlugins; [ 60 plugins = with pkgs.vimPlugins; [
12 # lsp 61 # lsp
13 nvim-lspconfig 62 nvim-lspconfig