diff options
Diffstat (limited to '.config/nvim')
-rw-r--r-- | .config/nvim/lua/user/coderunner.lua | 2 | ||||
-rw-r--r-- | .config/nvim/lua/user/lsp/common.lua | 11 | ||||
-rw-r--r-- | .config/nvim/lua/user/plugins.lua | 17 | ||||
-rw-r--r-- | .config/nvim/lua/user/remaps.lua | 7 |
4 files changed, 22 insertions, 15 deletions
diff --git a/.config/nvim/lua/user/coderunner.lua b/.config/nvim/lua/user/coderunner.lua index 3049893..8dea6b4 100644 --- a/.config/nvim/lua/user/coderunner.lua +++ b/.config/nvim/lua/user/coderunner.lua @@ -6,7 +6,7 @@ require('code_runner').setup({ focus = true, startinsert = true, filetype = { - rust = 'cargo check; if [ \\$? -ne 0 ]; then echo cargo check failed; else cargo run; if [ \\$? -ne 0 ]; then cargo test --test-threads=1; sleep 1; fi; fi; echo $file > /dev/null', + rust = 'cargo check; if [ \\$? -ne 0 ]; then echo cargo check failed; else cargo run || cargo test -- --nocapture --test-threads=1; fi; echo $file > /dev/null', cpp = function() local script = 'echo $file > /dev/null;' .. diff --git a/.config/nvim/lua/user/lsp/common.lua b/.config/nvim/lua/user/lsp/common.lua index 1b1920c..91a663c 100644 --- a/.config/nvim/lua/user/lsp/common.lua +++ b/.config/nvim/lua/user/lsp/common.lua @@ -3,13 +3,14 @@ -- nvim diagnostics setup local define_sign = function(options) - vim.fn.sign_define(options.name, { texthl = options.name, text = options.textm, numhl = '' }) + vim.fn.sign_define(options.name, { texthl = options.name, text = options.text, numhl = options.hl }) end -define_sign({name = "DiagnosticSignError", text = ''}) -define_sign({name = "DiagnosticSignWarn", text = ''}) -define_sign({name = "DiagnosticSignHint", text = ''}) -define_sign({name = "DiagnosticSignInfo", text = ''}) +define_sign({name = "DiagnosticSignError", text = '', hl = 'ErrorMsg'}) +define_sign({name = "DiagnosticSignWarn", text = '', hl = 'IncSearch'}) +define_sign({name = "DiagnosticSignHint", text = '', hl = 'Search'}) +-- define_sign({name = "DiagnosticSignInfo", text = ''}) +vim.fn.sign_define("DiagnosticSignInfo", { texthl="Ignore", text = "", numhl = 'TermCursor' }) vim.diagnostic.config{ virtual_text = true, diff --git a/.config/nvim/lua/user/plugins.lua b/.config/nvim/lua/user/plugins.lua index 94b1035..7b7e31d 100644 --- a/.config/nvim/lua/user/plugins.lua +++ b/.config/nvim/lua/user/plugins.lua @@ -34,9 +34,10 @@ plugins = { "neovim/nvim-lspconfig", -- LSP configuration event = { "InsertEnter" }, }, - { - "simrat39/rust-tools.nvim", + { + "FabijanZulj/blame.nvim", -- git blame integration }, + { "simrat39/rust-tools.nvim" }, -- no commments -- { "hrsh7th/vim-vsnip" }, -- snippet engine @@ -49,16 +50,16 @@ plugins = { event = { "InsertEnter" }, }, { - "rafamadriz/friendly-snippets", -- predefined snippets + "rafamadriz/friendly-snippets", -- predefined snippets event = { "InsertEnter" }, }, { - "CRAG666/code_runner.nvim", + "CRAG666/code_runner.nvim", -- TODO: setup magic filenames to be executed per-project config = true, }, { - "akinsho/toggleterm.nvim", + "akinsho/toggleterm.nvim", -- a terminal, horaaaay config = true, }, @@ -134,4 +135,8 @@ lazy.setup(plugins, opts) -- miscellanous plugin setup require('bufferline').setup{} - +require('blame').setup{ + width = 16, + date_format = "%H:%M:%S %Y-%m-%d", + merge_consecutive = true, +} diff --git a/.config/nvim/lua/user/remaps.lua b/.config/nvim/lua/user/remaps.lua index ad1e2eb..8839890 100644 --- a/.config/nvim/lua/user/remaps.lua +++ b/.config/nvim/lua/user/remaps.lua @@ -72,11 +72,12 @@ map("n", "<leader>pl", ":Lazy<CR>", opt) -- open plugin manager -- Old mappings for the terminal -- 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("", "<leader>t", ":ToggleTerm<CR>", opt) -- open ToggleTerm -map("t", "<leader>t", ":ToggleTerm<CR>", opt) -- close ToggleTerm +map("", "<leader>t", "<cmd>ToggleTerm<CR>", opt) +map("t", "<leader>t", "<cmd>ToggleTerm<CR>", opt) -- miscellaneous -map("c", "w!!", "w !sudo tee % > /dev/null", opt) +map("c", "w!!", "w !sudo tee % > /dev/null", opt) -- sudo write +map("n", "gb", "<cmd>ToggleBlame virtual<CR>", opt) -- git blame -- better G and gg map("n", "G", "G$", opt) |