updates vim config
This commit is contained in:
+36
-36
@@ -148,8 +148,8 @@ map("n", "<C-j>", "<C-w>-", { noremap = true })
|
|||||||
map("n", "<C-k>", "<C-w>+", { noremap = true })
|
map("n", "<C-k>", "<C-w>+", { noremap = true })
|
||||||
map("n", "<C-l>", "<C-w>>", { noremap = true })
|
map("n", "<C-l>", "<C-w>>", { noremap = true })
|
||||||
-- quickfix window
|
-- quickfix window
|
||||||
-- map("n", "<C-n>", ":cp<cr>", { noremap = true })
|
map("n", "<C-n>", ":cp<cr>", { noremap = true })
|
||||||
-- map("n", "<C-m>", ":cn<cr>", { noremap = true })
|
map("n", "<C-m>", ":cn<cr>", { noremap = true })
|
||||||
-- remove buffer
|
-- remove buffer
|
||||||
map("n", "<M-d>", ":bprev<bar>:bd#<cr>", { noremap = true })
|
map("n", "<M-d>", ":bprev<bar>:bd#<cr>", { noremap = true })
|
||||||
map("n", "<M-D>", ":bprev<bar>:bd!#<cr>", { noremap = true })
|
map("n", "<M-D>", ":bprev<bar>:bd!#<cr>", { noremap = true })
|
||||||
@@ -172,6 +172,7 @@ require("packer").startup {function(use)
|
|||||||
-- tpope
|
-- tpope
|
||||||
use {"tpope/vim-sensible"} -- sensible default
|
use {"tpope/vim-sensible"} -- sensible default
|
||||||
use {"tpope/vim-commentary"} -- comment out stuff
|
use {"tpope/vim-commentary"} -- comment out stuff
|
||||||
|
use {"tpope/vim-surround"}
|
||||||
use {"tpope/vim-repeat"} -- repeat vim-surround with .
|
use {"tpope/vim-repeat"} -- repeat vim-surround with .
|
||||||
use {"tpope/vim-eunuch"} -- Move, Rename etc
|
use {"tpope/vim-eunuch"} -- Move, Rename etc
|
||||||
use {"farmergreg/vim-lastplace"} -- keep location upon reopening
|
use {"farmergreg/vim-lastplace"} -- keep location upon reopening
|
||||||
@@ -210,7 +211,7 @@ require("packer").startup {function(use)
|
|||||||
["n <leader>gu"] = [[<cmd>lua require("gitsigns").undo_stage_hunk()<cr>]],
|
["n <leader>gu"] = [[<cmd>lua require("gitsigns").undo_stage_hunk()<cr>]],
|
||||||
["n <leader>gx"] = [[<cmd>lua require("gitsigns").reset_hunk()<cr>]],
|
["n <leader>gx"] = [[<cmd>lua require("gitsigns").reset_hunk()<cr>]],
|
||||||
["v <leader>gx"] = [[<cmd>lua require("gitsigns").reset_hunk({vim.fn.line("."), vim.fn.line("v")})<cr>]],
|
["v <leader>gx"] = [[<cmd>lua require("gitsigns").reset_hunk({vim.fn.line("."), vim.fn.line("v")})<cr>]],
|
||||||
["n <leader>gp"] = [[<cmd>lua require("gitsigns").preview_hunk()<cr>]],
|
["n <leader>gi"] = [[<cmd>lua require("gitsigns").preview_hunk()<cr>]],
|
||||||
["n <leader>gb"] = [[<cmd>lua require("gitsigns").blame_line(true)<cr>]],
|
["n <leader>gb"] = [[<cmd>lua require("gitsigns").blame_line(true)<cr>]],
|
||||||
|
|
||||||
-- Text objects
|
-- Text objects
|
||||||
@@ -242,25 +243,26 @@ require("packer").startup {function(use)
|
|||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
use {"kyoz/purify", rtp = "vim", }
|
|
||||||
use {"sonph/onehalf", rtp = "vim", }
|
use {"sonph/onehalf", rtp = "vim", }
|
||||||
use {"rakr/vim-one", }
|
|
||||||
use {"tomasr/molokai", }
|
use {"tomasr/molokai", }
|
||||||
use {"morhetz/gruvbox", }
|
use {"morhetz/gruvbox", }
|
||||||
use {"jnurmine/Zenburn", }
|
use {"jnurmine/Zenburn", }
|
||||||
use {"jacoborus/tender.vim", }
|
|
||||||
use {"nanotech/jellybeans.vim", }
|
use {"nanotech/jellybeans.vim", }
|
||||||
use {"mhartington/oceanic-next", }
|
use {"mhartington/oceanic-next", }
|
||||||
use {"NLKNguyen/papercolor-theme", }
|
use {"NLKNguyen/papercolor-theme", }
|
||||||
use {"drewtempelmeyer/palenight.vim", }
|
use {"drewtempelmeyer/palenight.vim", }
|
||||||
use {"altercation/vim-colors-solarized", }
|
use {"altercation/vim-colors-solarized", }
|
||||||
|
use {"rakr/vim-one",
|
||||||
|
config = function()
|
||||||
|
vim.g.one_allow_italics = 1
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
use {"ayu-theme/ayu-vim",
|
use {"ayu-theme/ayu-vim",
|
||||||
config = function()
|
config = function()
|
||||||
-- vim.g.ayucolor = "light"
|
-- vim.g.ayucolor = "light"
|
||||||
-- vim.g.ayucolor = "mirage"
|
-- vim.g.ayucolor = "mirage"
|
||||||
vim.g.ayucolor = "dark"
|
vim.g.ayucolor = "dark"
|
||||||
vim.cmd "colorscheme ayu"
|
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -280,6 +282,7 @@ require("packer").startup {function(use)
|
|||||||
vim.g.seoul256_background = 235
|
vim.g.seoul256_background = 235
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
vim.cmd "colorscheme zenburn"
|
||||||
|
|
||||||
-- coloring of colornames
|
-- coloring of colornames
|
||||||
use {"rrethy/vim-hexokinase",
|
use {"rrethy/vim-hexokinase",
|
||||||
@@ -377,7 +380,7 @@ require("packer").startup {function(use)
|
|||||||
sections = {
|
sections = {
|
||||||
lualine_a = {"mode"},
|
lualine_a = {"mode"},
|
||||||
lualine_b = {"branch"},
|
lualine_b = {"branch"},
|
||||||
lualine_c = {{"filename", file_status = true, path = 1}},
|
lualine_c = {{"filename", file_status = true, path = 1}, {"diff", colored=false}, { "diagnostics", sources = {"nvim_lsp"}}},
|
||||||
lualine_x = {"encoding", "fileformat", "filetype"},
|
lualine_x = {"encoding", "fileformat", "filetype"},
|
||||||
lualine_y = {"progress"},
|
lualine_y = {"progress"},
|
||||||
lualine_z = {"location"}
|
lualine_z = {"location"}
|
||||||
@@ -390,16 +393,23 @@ require("packer").startup {function(use)
|
|||||||
lualine_y = {"progress"},
|
lualine_y = {"progress"},
|
||||||
lualine_z = {}
|
lualine_z = {}
|
||||||
},
|
},
|
||||||
-- TODO tabline func https://blog.inkdrop.info/how-to-set-up-neovim-0-5-modern-plugins-lsp-treesitter-etc-542c3d9c9887
|
}
|
||||||
tabline = {
|
end
|
||||||
lualine_a = {"filename"},
|
}
|
||||||
lualine_b = {{ "diagnostics", sources = {"nvim_lsp"}}},
|
|
||||||
lualine_c = {{"diff", colored=false}},
|
use {"akinsho/nvim-bufferline.lua",
|
||||||
lualine_x = {},
|
requires = {"kyazdani42/nvim-web-devicons"},
|
||||||
lualine_y = {},
|
config = function()
|
||||||
lualine_z = {{"filename", file_status = true, path = 2}}
|
require("bufferline").setup{
|
||||||
|
options = {
|
||||||
|
diagnostics = "nvim_lsp",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
local map = vim.api.nvim_set_keymap
|
||||||
|
map("n", "<M-J>", ":BufferLineCyclePrev<cr>", { noremap = true, silent=true })
|
||||||
|
map("n", "<M-K>", ":BufferLineCycleNext<cr>", { noremap = true, silent=true })
|
||||||
|
map("n", "<M-N>", ":BufferLineMovePrev<cr>", { noremap = true, silent=true })
|
||||||
|
map("n", "<M-M>", ":BufferLineMoveNext<cr>", { noremap = true, silent=true })
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,9 +429,6 @@ require("packer").startup {function(use)
|
|||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.configs").setup {
|
require("nvim-treesitter.configs").setup {
|
||||||
ensure_installed = "all",
|
ensure_installed = "all",
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
end
|
end
|
||||||
@@ -550,36 +557,34 @@ require("packer").startup {function(use)
|
|||||||
local bmap = vim.api.nvim_buf_set_keymap
|
local bmap = vim.api.nvim_buf_set_keymap
|
||||||
local opts = { noremap = true }
|
local opts = { noremap = true }
|
||||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
|
vim.lsp.set_log_level("error")
|
||||||
-- workspaces
|
-- workspaces
|
||||||
bmap(bufnr, "n", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<cr>", opts)
|
bmap(bufnr, "n", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<cr>", opts)
|
||||||
bmap(bufnr, "n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<cr>", opts)
|
bmap(bufnr, "n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<cr>", opts)
|
||||||
bmap(bufnr, "n", "<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<cr>", opts)
|
bmap(bufnr, "n", "<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<cr>", opts)
|
||||||
-- jump
|
-- jump
|
||||||
bmap(bufnr, "n", "gl", "<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>", opts)
|
bmap(bufnr, "n", "gl", "<cmd>lua vim.lsp.diagnostic.set_loclist({severity_limit='Warning'})<cr>", opts)
|
||||||
bmap(bufnr, "n", "<M-i>", ":Lspsaga show_line_diagnostics<cr>", opts)
|
bmap(bufnr, "n", "<M-i>", "<cmd>lua vim.lsp.diagnostic.show_line_diagnostics({show_header=false})<cr>", opts)
|
||||||
bmap(bufnr, "n", "<M-m>", ":Lspsaga diagnostic_jump_next<cr>", opts)
|
bmap(bufnr, "n", "<M-m>", "<cmd>lua vim.lsp.diagnostic.goto_next({severity_limit='Warning', popup_opts={show_header=false}})<cr>", opts)
|
||||||
bmap(bufnr, "n", "<M-n>", ":Lspsaga diagnostic_jump_prev<cr>", opts)
|
bmap(bufnr, "n", "<M-n>", "<cmd>lua vim.lsp.diagnostic.goto_prev({severity_limit='Warning', popup_opts={show_header=false}})<cr>", opts)
|
||||||
-- popups
|
-- popups
|
||||||
bmap(bufnr, "n", "<M-x>", ":Lspsaga signature_help<cr>", opts)
|
bmap(bufnr, "n", "<M-x>", "<cmd>lua vim.lsp.buf.signature_help()<cr>", opts)
|
||||||
bmap(bufnr, "i", "<M-x>", "<cmd>lua require('lspsaga.signaturehelp').signature_help()<cr>", opts)
|
bmap(bufnr, "i", "<M-x>", "<cmd>lua vim.lsp.buf.signature_help()<cr>", opts)
|
||||||
bmap(bufnr, "n", "<C-f>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<cr>", opts)
|
bmap(bufnr, "n", "<C-f>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(1)<cr>", opts)
|
||||||
bmap(bufnr, "n", "<C-b>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<cr>", opts)
|
bmap(bufnr, "n", "<C-b>", "<cmd>lua require('lspsaga.action').smart_scroll_with_saga(-1)<cr>", opts)
|
||||||
-- actions
|
|
||||||
bmap(bufnr, "n", "<leader>ll", ":Lspsaga range_code_action<cr>", opts)
|
|
||||||
bmap(bufnr, "v", "<leader>ll", ":<C-U>Lspsaga range_code_action<cr>", opts)
|
|
||||||
-- other
|
-- other
|
||||||
if client.resolved_capabilities.goto_definition then
|
if client.resolved_capabilities.goto_definition then
|
||||||
bmap(bufnr, "n", "gd", ":Lspsaga preview_definition<cr>", opts)
|
bmap(bufnr, "n", "gd", ":Lspsaga preview_definition<cr>", opts)
|
||||||
bmap(bufnr, "n", "gD", ":lua vim.lsp.buf.definition()<cr>", opts)
|
bmap(bufnr, "n", "gD", ":lua vim.lsp.buf.definition()<cr>", opts)
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.find_references then
|
if client.resolved_capabilities.find_references then
|
||||||
bmap(bufnr, "n", "gh", ":Lspsaga lsp_finder<cr>", opts)
|
bmap(bufnr, "n", "gr", ":Lspsaga lsp_finder<cr>", opts)
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.hover then
|
if client.resolved_capabilities.hover then
|
||||||
bmap(bufnr, "n", "K", ":Lspsaga hover_doc<cr>", opts)
|
bmap(bufnr, "n", "K", ":Lspsaga hover_doc<cr>", opts)
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.rename then
|
if client.resolved_capabilities.rename then
|
||||||
bmap(bufnr, "n", "gr", ":Lspsaga rename<cr>", opts)
|
bmap(bufnr, "n", "<M-r>", ":Lspsaga rename<cr>", opts)
|
||||||
end
|
end
|
||||||
if client.resolved_capabilities.document_formatting or client.resolved_capabilities.document_range_formatting then
|
if client.resolved_capabilities.document_formatting or client.resolved_capabilities.document_range_formatting then
|
||||||
vim.api.nvim_command [[augroup Format]]
|
vim.api.nvim_command [[augroup Format]]
|
||||||
@@ -622,7 +627,7 @@ require("packer").startup {function(use)
|
|||||||
python = {
|
python = {
|
||||||
analysis = {
|
analysis = {
|
||||||
diagnosticMode = "workspace",
|
diagnosticMode = "workspace",
|
||||||
logLevel = "Error",
|
logLevel = "Warning",
|
||||||
typeCheckingMode = "strict",
|
typeCheckingMode = "strict",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -651,11 +656,6 @@ require("packer").startup {function(use)
|
|||||||
formatCommand = "isort --stdout --profile black --force-single-line-imports -",
|
formatCommand = "isort --stdout --profile black --force-single-line-imports -",
|
||||||
formatStdin = true
|
formatStdin = true
|
||||||
},
|
},
|
||||||
{
|
|
||||||
lintCommand = "mypy --show-column-numbers --ignore-missing-imports",
|
|
||||||
lintFormats = { "%f:%l:%c: %trror: %m", "%f:%l:%c: %tarning: %m", "%f:%l:%c: %tote: %m" },
|
|
||||||
lintSource = "mypy"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
formatCommand = "black --fast -",
|
formatCommand = "black --fast -",
|
||||||
formatStdin = true
|
formatStdin = true
|
||||||
|
|||||||
Reference in New Issue
Block a user