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