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

View File

@ -18,8 +18,8 @@ g.indent_blankline_filetype_exclude = {
}
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_show_trailing_blankline_indent = false
g.indent_blankline_show_first_indent_level = 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
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 IndentBlanklineIndent3 guifg=#98C379 gui=nocombine]])
cmd([[highlight IndentBlanklineIndent4 guifg=#56B6C2 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.listchars:append("space:⋅")
-- opt.listchars:append 'space:'
opt.listchars:append("eol:↴")
indent_blankline.setup({
-- show_end_of_line = true,
-- space_char_blankline = ' ',
show_end_of_line = true,
space_char_blankline = " ",
show_current_context = true,
-- show_current_context_start = true,
-- char_highlight_list = {
-- 'IndentBlanklineIndent1',
-- 'IndentBlanklineIndent2',
-- 'IndentBlanklineIndent3',
-- },
show_current_context_start = true,
char_highlight_list = {
"IndentBlanklineIndent1",
"IndentBlanklineIndent2",
"IndentBlanklineIndent3",
"IndentBlanklineIndent4",
"IndentBlanklineIndent5",
"IndentBlanklineIndent6",
},
})

View File

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

View File

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

View File

@ -60,20 +60,20 @@ end
local function lsp_keymaps(bufnr)
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 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", "gi", "<cmd>lua 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', '<leader>rn', '<cmd>lua 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', '<leader>ca', '<cmd>lua 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", "[d", '<cmd>lua vim.diagnostic.goto_prev({ 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.diagnostic.goto_next({ border = "rounded" })<CR>', opts)
api.nvim_buf_set_keymap(bufnr, "n", "<leader>q", "<cmd>lua vim.diagnostic.setloclist()<CR>", opts)
vim.cmd([[ command! Format execute 'lua lsp.buf.format{async=true}' ]])
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 vim.lsp.buf.definition()<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 vim.lsp.buf.implementation()<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 vim.lsp.buf.rename()<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 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", "]d", "<cmd>lua vim.lsp.diagnostic.goto_next({ 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", "gl", "<cmd>lua vim.diagnostic.open_float({ border = 'rounded' })<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 vim.lsp.buf.formatting()" ]])
end
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 = {
-- filetypes whitelist
-- 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`)
},
},

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>",
"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 = {
@ -131,15 +131,15 @@ local mappings = {
l = {
name = "LSP",
a = { "<cmd>lua vim.lsp.buf.code_action()<CR>", "Code Action" },
d = {
"<cmd>Telescope lsp_document_diagnostics<CR>",
"Document Diagnostics",
},
-- d = {
-- "<cmd>Telescope lsp_document_diagnostics<CR>",
-- "Document Diagnostics",
-- },
w = {
"<cmd>Telescope lsp_workspace_diagnostics<CR>",
"<cmd>Telescope diagnostics<CR>",
"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>LspInstallInfo<CR>", "Installer Info" },
j = {

View File

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