From 7eafb322155af9f90c76c7e37c4ba6307c3ff0f9 Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Tue, 8 Mar 2022 22:49:34 -0800 Subject: [PATCH] update nvim config --- nvim/init.vim | 6 +- nvim/keybindings.vim | 2 +- nvim/plugin-confs/lspconfig.lua | 2 +- nvim/plugin-confs/lualine.lua | 105 ++++++++++++++++--------------- nvim/plugin-confs/null-ls.lua | 9 +-- nvim/plugin-confs/onedarkpro.lua | 4 +- 6 files changed, 66 insertions(+), 62 deletions(-) diff --git a/nvim/init.vim b/nvim/init.vim index 0d9e1c2..a2301b7 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -30,7 +30,7 @@ set showmatch set list set listchars=tab:\ ,trail: " set path from current directory and all directories under -set path=$PWD/** +" set path=$PWD/** set encoding=UTF-8 set guifont=FiraCode\ Nerd\ Font\ 18 set expandtab @@ -78,6 +78,7 @@ let g:maplocalleader = ',' if has('nvim') Plug 'nvim-lua/plenary.nvim' Plug 'nvim-lua/popup.nvim' + Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} " Plug 'nvim-telescope/telescope.nvim' " Plug 'TimUntersberger/neogit' @@ -91,7 +92,6 @@ if has('nvim') Plug 'lewis6991/gitsigns.nvim' Plug 'lewis6991/gitsigns.nvim' Plug 'nvim-lualine/lualine.nvim' - Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} Plug 'ojroques/nvim-lspfuzzy' Plug 'L3MON4D3/LuaSnip' @@ -139,6 +139,7 @@ if has('nvim') let g:fzf_command = 'fzf --height 90% --width=85% --layout=reverse --preview "bat --color=always {}"' source ~/.config/nvim/keybindings.vim + " nvim plugins source ~/.config/nvim/plugin-confs/bufferline.lua source ~/.config/nvim/plugin-confs/dashboard-art.vim source ~/.config/nvim/plugin-confs/dashboard-nvim.lua @@ -163,6 +164,7 @@ if has('nvim') source ~/.config/nvim/plugin-confs/symbols-outline.lua source ~/.config/nvim/plugin-confs/trouble.lua + " nvim and vim plugins source ~/.vim/plugin-confs/floaterm.vim source ~/.vim/plugin-confs/fzf.vim source ~/.vim/plugin-confs/lightline.vim diff --git a/nvim/keybindings.vim b/nvim/keybindings.vim index 259c3a9..948e7e9 100644 --- a/nvim/keybindings.vim +++ b/nvim/keybindings.vim @@ -93,7 +93,7 @@ nmap ob :FloatermNew --title=bpytop --opener=vsplit bpytop nmap od :FloatermNew --title=lazydocker --opener=vsplit lazydocker nmap on :FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp nmap or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD" -nmap ot :FloatermNew --title=floaterm --name=vsplit-term --wintype=vsplit --position=botright --width=0.5 +nmap ot :FloatermNew --title=floaterm --name=vsplit-term --opener=edit --wintype=vsplit --position=botright --width=0.5 nmap r :NvimTreeRefresh diff --git a/nvim/plugin-confs/lspconfig.lua b/nvim/plugin-confs/lspconfig.lua index fd45c82..7c0c9b7 100644 --- a/nvim/plugin-confs/lspconfig.lua +++ b/nvim/plugin-confs/lspconfig.lua @@ -176,7 +176,7 @@ end) -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches -local servers = { 'pyright', 'bashls', 'sqls', 'vimls', 'yamlls', 'dockerls', 'html', 'sumneko_lua', 'jsonls', 'dotls', 'rust_analyzer', 'clangd' } +local servers = { 'pyright', 'bashls', 'vimls', 'yamlls', 'dockerls', 'html', 'sumneko_lua', 'dotls', 'rust_analyzer', 'clangd' } for _, lsp in pairs(servers) do require('lspconfig')[lsp].setup { on_attach = on_attach, diff --git a/nvim/plugin-confs/lualine.lua b/nvim/plugin-confs/lualine.lua index fa0c9e2..d24b0aa 100644 --- a/nvim/plugin-confs/lualine.lua +++ b/nvim/plugin-confs/lualine.lua @@ -1,52 +1,53 @@ -require('lualine').setup { - options = { - icons_enabled = true, - theme = 'codedark', - -- theme = 'dracula', - -- theme = 'horizon', - -- theme = 'onedark', - component_separators = { left = '', right = ''}, - section_separators = { left = '', right = ''}, - disabled_filetypes = {}, - always_divide_middle = true, - }, - sections = { - lualine_a = { 'mode' }, - lualine_b = {'branch', 'diff'}, - lualine_c = {'filename'}, - lualine_x = { - { - 'diagnostics', - 'fileformat', - symbols = { - unix = '', -- e712 - dos = '', -- e70f - mac = '', -- e711 - } - }, 'encoding', 'fileformat', {'filetype', colored=true, icon_only=false}}, - lualine_y = {'progress'}, - lualine_z = {'location'} - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_c = { - { - 'filename', - file_status = true, -- Displays file status (readonly status, modified status) - path = 0, -- 0: Just the filename - shorting_target = 40, -- Shortens path to leave 40 spaces in the window - symbols = { - modified = '[+]', -- Text to show when the file is modified. - readonly = '[-]', -- Text to show when the file is non-modifiable or readonly. - unnamed = '[No Name]', -- Text to show for unnamed buffers. - } - }, - }, - lualine_x = {'location'}, - lualine_y = {}, - lualine_z = {} - }, - tabline = {}, - extensions = {'quickfix', 'fzf', 'nvim-tree', 'symbols-outline', 'fugitive'} -} +require('lualine').setup { + options = { + icons_enabled = true, + theme = 'codedark', + -- theme = 'dracula', + -- theme = 'horizon', + -- theme = 'onedark', + component_separators = { left = '', right = '' }, + section_separators = { left = '', right = ''}, + -- section_separators = { left = '', right = '' }, + disabled_filetypes = {}, + always_divide_middle = true, + }, + sections = { + lualine_a = { 'mode' }, + lualine_b = { 'branch', 'diff' }, + lualine_c = { 'filename' }, + lualine_x = { + { + 'diagnostics', + 'fileformat', + symbols = { + unix = '', -- e712 + dos = '', -- e70f + mac = '', -- e711 + } + }, 'encoding', 'fileformat', { 'filetype', colored = true, icon_only = false } }, + lualine_y = { 'progress' }, + lualine_z = { 'location' } + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_c = { + { + 'filename', + file_status = true, -- Displays file status (readonly status, modified status) + path = 0, -- 0: Just the filename + shorting_target = 40, -- Shortens path to leave 40 spaces in the window + symbols = { + modified = '[+]', -- Text to show when the file is modified. + readonly = '[-]', -- Text to show when the file is non-modifiable or readonly. + unnamed = '[No Name]', -- Text to show for unnamed buffers. + } + }, + }, + lualine_x = { 'location' }, + lualine_y = {}, + lualine_z = {} + }, + tabline = {}, + extensions = { 'quickfix', 'fzf', 'nvim-tree', 'symbols-outline', 'fugitive' } +} diff --git a/nvim/plugin-confs/null-ls.lua b/nvim/plugin-confs/null-ls.lua index f1e1fc6..c9bf64c 100644 --- a/nvim/plugin-confs/null-ls.lua +++ b/nvim/plugin-confs/null-ls.lua @@ -20,7 +20,7 @@ require("null-ls").setup({ require("null-ls").builtins.diagnostics.cppcheck, require("null-ls").builtins.diagnostics.gitlint, require("null-ls").builtins.diagnostics.jsonlint, - require("null-ls").builtins.diagnostics.luacheck, + -- require("null-ls").builtins.diagnostics.luacheck, require("null-ls").builtins.diagnostics.markdownlint, require("null-ls").builtins.diagnostics.pylint, require("null-ls").builtins.diagnostics.pydocstyle.with({ @@ -28,13 +28,14 @@ require("null-ls").setup({ }), require("null-ls").builtins.diagnostics.vint, require("null-ls").builtins.formatting.json_tool, - require("null-ls").builtins.formatting.lua_format, + -- require("null-ls").builtins.formatting.lua_format, require("null-ls").builtins.formatting.markdownlint, require("null-ls").builtins.formatting.prettier, - require("null-ls").builtins.formatting.rustfmt, + -- handled by lsp server + -- require("null-ls").builtins.formatting.rustfmt, require("null-ls").builtins.formatting.shfmt.with({ filetypes = {"sh", "bash"}, - extra_args = { "-i", "4", "-ci", "-sr" } + extra_args = { "-i", "0", "-ci", "-sr" } }), require("null-ls").builtins.diagnostics.shellcheck.with({ extra_args = { "-s", "bash", "-o", "check-extra-masked-returns, check-set-e-suppressed, check-unassigned-uppercase, deprecate-which, quote-safe-variables" } diff --git a/nvim/plugin-confs/onedarkpro.lua b/nvim/plugin-confs/onedarkpro.lua index abe8859..60512a5 100644 --- a/nvim/plugin-confs/onedarkpro.lua +++ b/nvim/plugin-confs/onedarkpro.lua @@ -20,8 +20,8 @@ onedarkpro.setup({ styles = { comments = "italic", functions = "bold", - keywords = "bold,italic", - strings = "italic", + keywords = "italic,bold", + strings = "NONE", variables = "bold" }, options = {