diff options
Diffstat (limited to 'dotfiles')
-rw-r--r-- | dotfiles/vim/ftplugin/rust.lua | 18 | ||||
-rw-r--r-- | dotfiles/vim/lua/vim-dev.lua | 75 |
2 files changed, 71 insertions, 22 deletions
diff --git a/dotfiles/vim/ftplugin/rust.lua b/dotfiles/vim/ftplugin/rust.lua deleted file mode 100644 index 23a46f1..0000000 --- a/dotfiles/vim/ftplugin/rust.lua +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | -- TODO: suffixes, includes | ||
2 | |||
3 | vim.bo.expandtab = true | ||
4 | vim.bo.shiftwidth = 4 | ||
5 | vim.bo.softtabstop = 4 | ||
6 | vim.bo.textwidth = 99 | ||
7 | |||
8 | vim.opt_local.comments = { | ||
9 | "s0:/*!", | ||
10 | "ex:*/", | ||
11 | "s1:/*", | ||
12 | "mb:*", | ||
13 | "ex:*/", | ||
14 | ":///", | ||
15 | "://!", | ||
16 | "://", | ||
17 | } | ||
18 | vim.bo.commentstring = "// %s" | ||
diff --git a/dotfiles/vim/lua/vim-dev.lua b/dotfiles/vim/lua/vim-dev.lua index 84f3f89..41d94fd 100644 --- a/dotfiles/vim/lua/vim-dev.lua +++ b/dotfiles/vim/lua/vim-dev.lua | |||
@@ -1,10 +1,73 @@ | |||
1 | local on_attach = require('myConfig.exports').on_attach | 1 | local on_attach = require('myConfig.exports').on_attach |
2 | 2 | ||
3 | require("rust-tools").setup { | 3 | vim.g.rustaceanvim = { |
4 | -- Plugin configuration | ||
5 | tools = { | ||
6 | }, | ||
7 | -- LSP configuration | ||
4 | server = { | 8 | server = { |
5 | cmd = { vim.g.rust_analyzer_path }, | 9 | -- cmd = { vim.g.rust_analyzer_path }, |
10 | on_attach = function(client, bufnr) | ||
11 | on_attach(client, bufnr) | ||
12 | |||
13 | vim.keymap.set( | ||
14 | -- {"n", "v"}, | ||
15 | "n", | ||
16 | "J", | ||
17 | function() vim.cmd.RustLsp('joinLines') end, | ||
18 | { | ||
19 | silent = true, | ||
20 | buffer = bufnr, | ||
21 | desc = "rust-analyzer join lines", | ||
22 | } | ||
23 | ) | ||
24 | |||
25 | vim.keymap.set( | ||
26 | "n", | ||
27 | "<M-Up>", | ||
28 | function() vim.cmd.RustLsp({ "moveItem", "up" }) end, | ||
29 | { | ||
30 | silent = true, | ||
31 | buffer = bufnr, | ||
32 | desc = "rust-analyzer move item up", | ||
33 | } | ||
34 | ) | ||
35 | |||
36 | vim.keymap.set( | ||
37 | "n", | ||
38 | "<M-Down>", | ||
39 | function() vim.cmd.RustLsp({ "moveItem", "down" }) end, | ||
40 | { | ||
41 | silent = true, | ||
42 | buffer = bufnr, | ||
43 | desc = "rust-analyzer move item down", | ||
44 | } | ||
45 | ) | ||
46 | |||
47 | vim.keymap.set( | ||
48 | "n", | ||
49 | "<leader>sR", | ||
50 | function() vim.cmd.RustLsp('runnables') end, | ||
51 | { | ||
52 | silent = true, | ||
53 | buffer = bufnr, | ||
54 | desc = "rust-analyzer runnables", | ||
55 | } | ||
56 | ) | ||
57 | |||
58 | vim.keymap.set( | ||
59 | "n", | ||
60 | "<leader>sx", | ||
61 | function() vim.cmd.RustLsp('explainError') end, | ||
62 | { | ||
63 | silent = true, | ||
64 | buffer = bufnr, | ||
65 | desc = "rust-analyzer explain error", | ||
66 | } | ||
67 | ) | ||
68 | end, | ||
6 | settings = { | 69 | settings = { |
7 | ["rust-analyzer"] = { | 70 | ['rust-analyzer'] = { |
8 | checkOnSave = { | 71 | checkOnSave = { |
9 | command = "clippy", | 72 | command = "clippy", |
10 | }, | 73 | }, |
@@ -13,7 +76,6 @@ require("rust-tools").setup { | |||
13 | }, | 76 | }, |
14 | }, | 77 | }, |
15 | }, | 78 | }, |
16 | on_attach = on_attach, | ||
17 | }, | 79 | }, |
18 | } | 80 | } |
19 | 81 | ||
@@ -63,3 +125,8 @@ vim.g["pandoc#formatting#extra_equalprg"] = "--reference-links --reference-locat | |||
63 | 125 | ||
64 | -- Actions preview | 126 | -- Actions preview |
65 | require("actions-preview").setup() | 127 | require("actions-preview").setup() |
128 | |||
129 | -- DAP | ||
130 | require("dapui").setup() | ||
131 | require("nvim-dap-virtual-text").setup() | ||
132 | require('telescope').load_extension('dap') | ||