Fix lsp keybinds

This commit is contained in:
Kristofers Solo 2022-08-03 15:39:34 +03:00
parent a741113bc1
commit 4b0b507cf5
9 changed files with 45 additions and 54 deletions

View File

@ -6,6 +6,7 @@ set icons true
set ignorecase true set ignorecase true
set previewer "~/.config/lf/preview" set previewer "~/.config/lf/preview"
set cleaner "~/.config/lf/cleaner" set cleaner "~/.config/lf/cleaner"
set scrolloff 8
# Custom Functions # Custom Functions
@ -62,7 +63,6 @@ map '"'
map d map d
map c map c
map p map p
map c $vscodium "$f"
map au unarchive map au unarchive
@ -74,7 +74,7 @@ map <enter> open
map <c-f> $lf -remote "send $id select '$(sk)'" map <c-f> $lf -remote "send $id select '$(sk)'"
map <f-2> rename map <f-2> rename
map <c-n> push :mkdir<space> map <c-n> push :mkdir<space>
map DD delete map D delete
map dd cut map dd cut
map mv moveto map mv moveto
map cp copyto map cp copyto
@ -83,6 +83,8 @@ map mf push :mkfile<space>
map md push :mkdir<space> map md push :mkdir<space>
map <c-l> clear map <c-l> clear
map bg setwallpaper map bg setwallpaper
map c $vscodium "$f"
map e $nvim "$f"
# Movement # Movement

View File

@ -18,8 +18,8 @@ g.indent_blankline_filetype_exclude = {
} }
g.indentLine_enabled = 1 g.indentLine_enabled = 1
-- g.indent_blankline_char = '│' -- g.indent_blankline_char = '│'
g.indent_blankline_char = "" -- g.indent_blankline_char = "▏"
-- g.indent_blankline_char = '▎' g.indent_blankline_char = ""
g.indent_blankline_show_trailing_blankline_indent = false g.indent_blankline_show_trailing_blankline_indent = false
g.indent_blankline_show_first_indent_level = true g.indent_blankline_show_first_indent_level = true
g.indent_blankline_use_treesitter = true g.indent_blankline_use_treesitter = true
@ -49,25 +49,28 @@ g.indent_blankline_context_patterns = {
-- HACK: work-around for https://github.com/lukas-reineke/indent-blankline.nvim/issues/59 -- HACK: work-around for https://github.com/lukas-reineke/indent-blankline.nvim/issues/59
vim.wo.colorcolumn = "99999" vim.wo.colorcolumn = "99999"
cmd([[highlight IndentBlanklineIndent1 guifg=#E06C75 gui=nocombine]]) cmd([[highlight IndentBlanklineIndent1 guifg=#C678DD gui=nocombine]])
cmd([[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]]) cmd([[highlight IndentBlanklineIndent2 guifg=#E5C07B gui=nocombine]])
cmd([[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]]) cmd([[highlight IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]]) cmd([[highlight IndentBlanklineIndent4 guifg=#56B6C2 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]]) cmd([[highlight IndentBlanklineIndent5 guifg=#61AFEF gui=nocombine]])
cmd([[highlight IndentBlanklineIndent6 guifg=#C678DD gui=nocombine]]) cmd([[highlight IndentBlanklineIndent6 guifg=#E06C75 gui=nocombine]])
opt.list = true opt.list = true
opt.listchars:append("space:⋅") opt.listchars:append("space:⋅")
-- opt.listchars:append 'space:' -- opt.listchars:append 'space:'
opt.listchars:append("eol:↴") opt.listchars:append("eol:↴")
indent_blankline.setup({ indent_blankline.setup({
-- show_end_of_line = true, show_end_of_line = true,
-- space_char_blankline = ' ', space_char_blankline = " ",
show_current_context = true, show_current_context = true,
-- show_current_context_start = true, show_current_context_start = true,
-- char_highlight_list = { char_highlight_list = {
-- 'IndentBlanklineIndent1', "IndentBlanklineIndent1",
-- 'IndentBlanklineIndent2', "IndentBlanklineIndent2",
-- 'IndentBlanklineIndent3', "IndentBlanklineIndent3",
-- }, "IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
},
}) })

View File

@ -69,4 +69,4 @@ keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts)
-- Shortcutting -- -- Shortcutting --
-- Substitute -- Substitute
keymap("n", "C-f", ":%s//<Left>", {}) keymap("n", "S", ":%s//<Left>", {})

View File

@ -5,7 +5,7 @@ end
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
local servers = { "jsonls", "sumneko_lua", "pyright", "rust_analyzer" } local servers = { "jsonls", "sumneko_lua", "pyright" }
lsp_installer.setup({ lsp_installer.setup({
ensure_installed = servers, ensure_installed = servers,

View File

@ -60,20 +60,20 @@ end
local function lsp_keymaps(bufnr) local function lsp_keymaps(bufnr)
local opts = { noremap = true, silent = true } local opts = { noremap = true, silent = true }
api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua lsp.buf.declaration()<CR>", opts) api.nvim_buf_set_keymap(bufnr, "n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua lsp.buf.definition()<CR>", opts) api.nvim_buf_set_keymap(bufnr, "n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua lsp.buf.hover()<CR>", opts) api.nvim_buf_set_keymap(bufnr, "n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua lsp.buf.implementation()<CR>", opts) api.nvim_buf_set_keymap(bufnr, "n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "<C-k>", "<cmd>lua lsp.buf.signature_help()<CR>", opts) api.nvim_buf_set_keymap(bufnr, "n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>", opts)
-- api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', '<cmd>lua lsp.buf.rename()<CR>', opts) -- api.nvim_buf_set_keymap(bufnr, "n", "<leader>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua lsp.buf.references()<CR>", opts) api.nvim_buf_set_keymap(bufnr, "n", "gr", "<cmd>lua vim.lsp.buf.references()<CR>", opts)
-- api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua lsp.buf.code_action()<CR>', opts) -- api.nvim_buf_set_keymap(bufnr, "n", "<leader>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", opts)
-- api.nvim_buf_set_keymap(bufnr, 'n', '<leader>f', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) -- api.nvim_buf_set_keymap(bufnr, "n", "<leader>f", "<cmd>lua vim.diagnostic.open_float()<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "[d", '<cmd>lua vim.diagnostic.goto_prev({ border = "rounded" })<CR>', opts) api.nvim_buf_set_keymap(bufnr, "n", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next({ border = 'rounded' })<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "gl", '<cmd>lua vim.diagnostic.open_float({ border = "rounded" })<CR>', opts) api.nvim_buf_set_keymap(bufnr, "n", "[d", "<cmd>lua vim.lsp.diagnostic.goto_prev({ border = 'rounded' })<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "]d", '<cmd>lua vim.diagnostic.goto_next({ border = "rounded" })<CR>', opts) api.nvim_buf_set_keymap(bufnr, "n", "gl", "<cmd>lua vim.diagnostic.open_float({ border = 'rounded' })<CR>", opts)
api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts) api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.lsp.diagnostic.set_loclist()<CR>", opts)
vim.cmd([[ command! Format execute 'lua lsp.buf.format{async=true}' ]]) vim.cmd([[ command! Format execute "lua vim.lsp.buf.formatting()" ]])
end end
M.on_attach = function(client, bufnr) M.on_attach = function(client, bufnr)

View File

@ -1,15 +0,0 @@
return {
settings = {
["rust_analyzer"] = {
cargo = {
loadOutDirsFromCheck = true,
},
checkOnSave = {
command = "clippy",
},
experimental = {
procAttrMacros = true,
},
},
},
}

View File

@ -99,7 +99,7 @@ telescope.setup({
media_files = { media_files = {
-- filetypes whitelist -- filetypes whitelist
-- defaults to {"png", "jpg", "mp4", "webm", "pdf"} -- defaults to {"png", "jpg", "mp4", "webm", "pdf"}
filetypes = { "png", "webp", "jpg", "jpeg" }, filetypes = { "png", "webp", "jpg", "jpeg", "mp4", "pdf" },
find_cmd = "rg", -- find command (defaults to `fd`) find_cmd = "rg", -- find command (defaults to `fd`)
}, },
}, },

View File

@ -93,7 +93,7 @@ local mappings = {
"<cmd>lua require('telescope.builtin').find_files({hidden=true}, require('telescope.themes').get_dropdown{previewer = false})<CR>", "<cmd>lua require('telescope.builtin').find_files({hidden=true}, require('telescope.themes').get_dropdown{previewer = false})<CR>",
"Find files", "Find files",
}, },
["F"] = { "<cmd>Telescope live_grep theme=ivy hidden=true<CR>", "Find Text" }, ["F"] = { "<cmd>Telescope live_grep theme=ivy<CR>", "Find Text" },
["P"] = { "<cmd>lua require('telescope').extensions.projects.projects()<CR>", "Projects" }, ["P"] = { "<cmd>lua require('telescope').extensions.projects.projects()<CR>", "Projects" },
p = { p = {
@ -131,15 +131,15 @@ local mappings = {
l = { l = {
name = "LSP", name = "LSP",
a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "Code Action" }, a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "Code Action" },
d = { -- d = {
"<cmd>Telescope lsp_document_diagnostics<CR>", -- "<cmd>Telescope lsp_document_diagnostics<CR>",
"Document Diagnostics", -- "Document Diagnostics",
}, -- },
w = { w = {
"<cmd>Telescope lsp_workspace_diagnostics<CR>", "<cmd>Telescope diagnostics<CR>",
"Workspace Diagnostics", "Workspace Diagnostics",
}, },
f = { "<cmd>lua vim.lsp.buf.format{async=true}<CR>", "Format" }, f = { "<cmd>lua vim.lsp.buf.formatting()<CR>", "Format" },
i = { "<cmd>LspInfo<CR>", "Info" }, i = { "<cmd>LspInfo<CR>", "Info" },
I = { "<cmd>LspInstallInfo<CR>", "Installer Info" }, I = { "<cmd>LspInstallInfo<CR>", "Installer Info" },
j = { j = {

View File

@ -33,7 +33,8 @@ alias \
g="git" \ g="git" \
ga="git add" \ ga="git add" \
gc="git commit" \ gc="git commit" \
gp="git push" \ gP="git push" \
gp="git pull" \
e="$EDITOR" \ e="$EDITOR" \
v="$EDITOR" \ v="$EDITOR" \
battery="acpi" \ battery="acpi" \