Update nvim config
This commit is contained in:
parent
f1a20c9dff
commit
d385a16636
|
@ -9,6 +9,7 @@
|
|||
"go.nvim": { "branch": "master", "commit": "d73ea5bc00f0d7b726b0ddfc29cea17a544459ba" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "477c62493c82684ed510c4f70eaf83802e398898" },
|
||||
"guihua.lua": { "branch": "master", "commit": "5ad8dba19ce9b9fd8965598984dfdc9c119f97e4" },
|
||||
"jester": { "branch": "main", "commit": "424b96970ac49da7b1298502e03143a8f11d5bcf" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "4c75c8eeb957a99aa44ce8e526c04340ab358c5e" },
|
||||
"lsp-zero.nvim": { "branch": "v3.x", "commit": "22d2186bee730d68f6fd3bb2d19a389784c37a96" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "7533b0ead663d80452210c0c089e5105089697e5" },
|
||||
|
|
|
@ -9,12 +9,13 @@ lsp_zero.on_attach(function(_, bufnr)
|
|||
lsp_zero.default_keymaps({buffer = bufnr})
|
||||
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
vim.keymap.set("n", "<leader>vc", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vr", function() vim.lsp.buf.rename() end, opts)
|
||||
vim.keymap.set("n", "<leader>vc", vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set("n", "<leader>vr", vim.lsp.buf.rename, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>en", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "<leader>ep", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
vim.keymap.set("n", "<leader>en", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "<leader>ep", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "<leader>ei", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("i", "<C-h>", vim.lsp.buf.signature_help, opts)
|
||||
|
||||
vim.keymap.set("n", "gr", function() telescope.lsp_references({
|
||||
include_declaration = false,
|
||||
|
@ -53,7 +54,7 @@ lspconfig.lua_ls.setup(lsp_zero.nvim_lua_ls())
|
|||
-- python
|
||||
lspconfig.pylsp.setup({})
|
||||
-- typescript
|
||||
-- lspconfig.eslint.setup({})
|
||||
lspconfig.eslint.setup({})
|
||||
lspconfig.tsserver.setup({})
|
||||
local prettier = {
|
||||
formatCommand = 'prettierd "${INPUT}"',
|
||||
|
|
|
@ -75,16 +75,29 @@ require('telescope').setup({
|
|||
|
||||
local telescope = require('telescope.builtin')
|
||||
|
||||
local git_files = function()
|
||||
telescope.git_files({
|
||||
local files =function() xpcall(
|
||||
function() telescope.git_files{
|
||||
show_untracked = true,
|
||||
use_git_root = false,
|
||||
})
|
||||
end
|
||||
} end,
|
||||
function() telescope.find_files{
|
||||
hidden = true,
|
||||
} end
|
||||
)end
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', git_files, opts)
|
||||
vim.keymap.set('n', '<c-p>', git_files, opts)
|
||||
vim.keymap.set('n', '<leader>fp', function() telescope.find_files({hidden=true}) end, opts)
|
||||
vim.keymap.set('n', '<leader>rg', telescope.live_grep, opts)
|
||||
vim.keymap.set('n', '<leader>ff', files, opts)
|
||||
vim.keymap.set('n', '<c-p>', files, opts)
|
||||
vim.keymap.set('n', '<leader>rg', function()
|
||||
telescope.grep_string{ shorten_path = true, word_match = "-w", only_sort_text = true, search = '' }
|
||||
end, opts)
|
||||
vim.keymap.set('n', '<leader>fb', telescope.buffers, opts)
|
||||
vim.keymap.set('n', '<leader>fh', telescope.help_tags, opts)
|
||||
|
||||
-- Neotest
|
||||
local jester = require("jester")
|
||||
vim.keymap.set("n", "<leader>tt", jester.run, opts)
|
||||
vim.keymap.set("n", "<leader>tl", jester.run_last, opts)
|
||||
vim.keymap.set("n", "<leader>tf", jester.run_file, opts)
|
||||
vim.keymap.set("n", "<leader>tdt", jester.debug, opts)
|
||||
vim.keymap.set("n", "<leader>tdl", jester.debug_last, opts)
|
||||
vim.keymap.set("n", "<leader>tdf", jester.debug_file, opts)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
{
|
||||
"David-Kunz/jester",
|
||||
config = function()
|
||||
require('jester').setup({
|
||||
cmd = "yarn test -t '$result' $file",
|
||||
terminal_cmd = ":15split | terminal",
|
||||
})
|
||||
end
|
||||
},
|
||||
}
|
|
@ -33,3 +33,4 @@ vim.opt.undodir = "/home/pavle/.local/share/nvim/undodir"
|
|||
vim.opt.scrolloff = 8
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
||||
vim.opt.shell = '/usr/bin/zsh'
|
||||
|
|
Loading…
Reference in New Issue