From 09af16ae97c7c485e88ea4c76e1af87bf255b91b Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Thu, 2 Mar 2023 15:35:21 -0500 Subject: [PATCH 1/3] . --- .vimrc.bundles | 62 +++++++++++++++++--------------------------------- 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 0e9da69..5a20f87 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -1,20 +1,12 @@ -" If anything not work as expected. Please make sure all plugins -" are installed by running: -" :PlugInstall +" (jump to the topic) " -" Content -" ('#' jump to the topic) -" -" Plugin_Install -" Plugin_Preferences -" Theme_Appearance -" Key_Mappings -" Useful_Info +" PLUGIN_INSTALL +" PLUGIN_CONFIGURATION +" THEME_CONFIGURATION +" KEY_MAPS +" OTHER_CONFIGS -" Environment { -" } - -" Plugin_Install +" PLUGIN_INSTALL " { " Plugin environment let g:mydotfiles_directory = expand('~/.dotfiles/') @@ -75,7 +67,6 @@ " The bottom buffer display Plug 'Donaldttt/vim-bufferline' Plug 'ryanoasis/vim-devicons' - " Plug 'lambdalisue/nerdfont.vim' Plug 'sainnhe/everforest' endif @@ -83,14 +74,10 @@ Plug 'neoclide/coc.nvim', Cond(!exists('g:vscode'), {'branch': 'release'}) endif - " only work with nvim > 0.5 - " For other versions, just loading the plugin may - " cause error if g:vim_type == 'nvim' if g:vim_version >= 0.5 Plug 'xiyaowong/nvim-transparent', Cond(!exists('g:vscode')) Plug 'lukas-reineke/indent-blankline.nvim', Cond(!exists('g:vscode')) - " nvim theme Plug 'EdenEast/nightfox.nvim', Cond(!exists('g:vscode')) Plug 'projekt0n/github-nvim-theme', Cond(!exists('g:vscode'), { 'tag': 'v0.0.7' }) @@ -122,7 +109,7 @@ call plug#end() - " Automatically install missing plugins on startup + " Automatically install missing plugins at startup autocmd VimEnter * \ if len(filter(values(g:plugs), '!isdirectory(v:val.dir)')) \| PlugInstall --sync | q @@ -144,7 +131,7 @@ function! HasPlug(plug_name, ...) return v:false endfunction -" Plugin_Preferences +" PLUGIN_CONFIGURATION " { " Yggdroot/indentLine { if HasPlug('indentLine') @@ -460,7 +447,7 @@ endfunction " } " } -" Theme_Appearance +" THEME_CONFIGURATION " { " " debug function print out highlight group of cursor position @@ -751,7 +738,7 @@ endfunction " } -" Key_Mappings +" KEY_MAPS " (This doesn't include plugin specific mapping. " For them please check plugin Preferences) " { @@ -772,22 +759,14 @@ endfunction " leader num change tab " only for vim or nvim without lualine if g:vim_type == 'vim' || (g:vim_type == 'nvim' && g:vim_version < 0.5) - nnoremap 1 :call bufferline#jump(1) - nnoremap 2 :call bufferline#jump(2) - nnoremap 3 :call bufferline#jump(3) - nnoremap 4 :call bufferline#jump(4) - nnoremap 5 :call bufferline#jump(5) - nnoremap 6 :call bufferline#jump(6) - nnoremap 7 :call bufferline#jump(7) - nnoremap 8 :call bufferline#jump(8) - nnoremap 9 :call bufferline#jump(9) - nnoremap 10 :call bufferline#jump(10) - nnoremap 11 :call bufferline#jump(11) - nnoremap 12 :call bufferline#jump(12) - nnoremap 13 :call bufferline#jump(13) - nnoremap 14 :call bufferline#jump(14) - nnoremap 15 :call bufferline#jump(15) - nnoremap 16 :call bufferline#jump(16) + for i in range(1, 9) + execute "nnoremap " . i . + \ " :call bufferline#jump(" . i . ")" + endfor + for i in range(10, 20) + execute "nnoremap " . i . + \ " :call bufferline#jump(" . i . ")" + endfor end " split window comform with other window management shortcuts @@ -801,7 +780,8 @@ endfunction execute('source ' . g:mydotfiles_directory . '/.vimrc.lua') endif " -" Useful_Info{ +" OTHER_CONFIGS +" { " show mapping info " :verbose map ,cf " } From 6c53b5cf17bc7cafcd611e027cc0ab77d2c8b980 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Thu, 2 Mar 2023 15:39:26 -0500 Subject: [PATCH 2/3] . --- .vimrc.bundles | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.vimrc.bundles b/.vimrc.bundles index 5a20f87..de97a6f 100644 --- a/.vimrc.bundles +++ b/.vimrc.bundles @@ -528,10 +528,9 @@ endfunction endfunction " Change bottom airline/lualine theme - " Currently only support airline function! SetStatusLineTheme(theme) if g:vim_type == 'nvim' && g:vim_version >= 0.5 - "execute('AirlineTheme ' . a:theme) + " lualine will change theme automatically else if HasPlug('vim-airline') && HasPlug('vim-airline-themes') execute('AirlineTheme ' . a:theme) @@ -540,7 +539,6 @@ endfunction endfunction " Fix colorscheme not working correctly under transparent background - " There is no plugin for this for nvim < 0.5 or vim without lua support function! TransparentBackgroundFix() if !has('nvim') || g:vim_version < 0.5 endif From 45350b57a7f21f72569007fb3a2bfb58c8c8b212 Mon Sep 17 00:00:00 2001 From: Nachuan Tang Date: Thu, 2 Mar 2023 16:15:29 -0500 Subject: [PATCH 3/3] stop adding comment leader when press o or O --- .tmux.conf | 3 +++ .vimrc | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.tmux.conf b/.tmux.conf index 5baa5e4..de700aa 100644 --- a/.tmux.conf +++ b/.tmux.conf @@ -3,6 +3,9 @@ set-option -sg escape-time 10 set -g default-terminal "xterm-256color" set-option -g history-limit 6000 +# turn off status line +set -g status off + set-option -sa terminal-overrides ',xterm-256color:RGB' setw -g mode-keys vi bind-key -T copy-mode-vi 'v' send -X begin-selection diff --git a/.vimrc b/.vimrc index f8db73a..13074c7 100644 --- a/.vimrc +++ b/.vimrc @@ -145,6 +145,9 @@ " set nolist " let vim not showing '$' or other sign set list " Display unprintable characters f12 - switches + " stop inserting the current comment leader after hitting 'o' or 'O' in Normal mode + au FileType java setlocal formatoptions-=o + set listchars=tab:•\ ,trail:•,extends:»,precedes:« " Unprintable chars mapping "Remove all trailing whitespace by pressing ws