diff --git a/make.symlinks.sh b/make.symlinks.sh index 9159337..308d780 100755 --- a/make.symlinks.sh +++ b/make.symlinks.sh @@ -5,7 +5,6 @@ rm -r /etc/updated-motd.d/welcome.sh rm -r /etc/profile.d/welcome.sh rm -r /etc/ssh/sshd_config rm -r ~/.config/nvim/init.vim -rm -r ~/.config/nvim/init.lua ln -s $(pwd)/git.config/.gitconfig ~/.gitconfig @@ -17,4 +16,4 @@ ln -s $(pwd)/sshd.ssh.config/welcome.sh /etc/profile.d/welcome.sh ln -s $(pwd)/sshd.ssh.config/sshd_config /etc/ssh/sshd_config ln -s $(pwd)/vim.config/init.vim ~/.config/nvim/init.vim -ln -s $(pwd)/vim.config/init.lua ~/.config/nvim/init.lua + diff --git a/vim.config/init.vim b/vim.config/init.vim index dc13467..070243a 100644 --- a/vim.config/init.vim +++ b/vim.config/init.vim @@ -94,6 +94,12 @@ call plug#begin() " https://github.com/romgrk/barbar.nvim Plug 'romgrk/barbar.nvim' + " vim-visual-multi - multiline editing + " It's called vim-visual-multi in analogy with visual-block + " but the plugin works mostly from normal mode. + " https://github.com/mg979/vim-visual-multi + Plug 'mg979/vim-visual-multi', {'branch': 'master'} + " vscode.nvim (formerly codedark.nvim) is a Lua port of vim-code-dark colorscheme " for neovim with VScode's light and dark theme " https://github.com/Mofiqul/vscode.nvim @@ -144,15 +150,83 @@ call plug#begin() " loading lua scripts + " bufferline loading + + au VimEnter * lua require("bufferline").setup({ + \ ioptions = { + \ buffer_close_icon = "", + \ close_command = "bdelete %d", + \ close_icon = "", + \ indicator = { + \ style = "icon", + \ icon = " ", + \ }, + \ left_trunc_marker = "", + \ modified_icon = "●", + \ offsets = { { filetype = "NvimTree", text = "EXPLORER", text_align = "center" } }, + \ right_mouse_command = "bdelete! %d", + \ right_trunc_marker = "", + \ show_close_icon = false, + \ show_tab_indicators = true, + \ }, + \ highlights = { + \ fill = { + \ fg = { attribute = "fg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "StatusLineNC" }, + \ }, + \ background = { + \ fg = { attribute = "fg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "StatusLine" }, + \ }, + \ buffer_visible = { + \ fg = { attribute = "fg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "Normal" }, + \ }, + \ buffer_selected = { + \ fg = { attribute = "fg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "Normal" }, + \ }, + \ separator = { + \ fg = { attribute = "bg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "StatusLine" }, + \ }, + \ separator_selected = { + \ fg = { attribute = "fg", highlight = "Special" }, + \ bg = { attribute = "bg", highlight = "Normal" }, + \ }, + \ separator_visible = { + \ fg = { attribute = "fg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "StatusLineNC" }, + \ }, + \ close_button = { + \ fg = { attribute = "fg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "StatusLine" }, + \ }, + \ close_button_selected = { + \ fg = { attribute = "fg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "Normal" }, + \ }, + \ close_button_visible = { + \ fg = { attribute = "fg", highlight = "Normal" }, + \ bg = { attribute = "bg", highlight = "Normal" }, + \ }, + \ }, + \ }) + + " lualine loading au VimEnter * lua require("lualine").setup() - " toggleterm loading au VimEnter * lua require("toggleterm").setup() + " toggleterm configuration + + " au VimEnter * lua require("toggleterm.config") + " au VimEnter * lua vim.cmd("autocmd! TermOpen term://*toggleterm#* lua set_terminal_keymaps()") + " nvimtree loading au VimEnter * lua require("nvim-tree").setup() @@ -236,62 +310,91 @@ call plug#begin() " Move to previous/next - nnoremap BufferPrevious - nnoremap BufferNext + nnoremap BufferPrevious + nnoremap BufferNext - " Re-order to previous/next - nnoremap BufferMovePrevious - nnoremap > BufferMoveNext + " Re-order to previous/next + + nnoremap BufferMovePrevious + nnoremap > BufferMoveNext - " Goto buffer in position... - nnoremap BufferGoto 1 - nnoremap BufferGoto 2 - nnoremap BufferGoto 3 - nnoremap BufferGoto 4 - nnoremap BufferGoto 5 - nnoremap BufferGoto 6 - nnoremap BufferGoto 7 - nnoremap BufferGoto 8 - nnoremap BufferGoto 9 - nnoremap BufferLast + " Goto buffer in position... + + nnoremap BufferGoto 1 + nnoremap BufferGoto 2 + nnoremap BufferGoto 3 + nnoremap BufferGoto 4 + nnoremap BufferGoto 5 + nnoremap BufferGoto 6 + nnoremap BufferGoto 7 + nnoremap BufferGoto 8 + nnoremap BufferGoto 9 + nnoremap BufferLast - " Pin/unpin buffer - nnoremap BufferPin + " Pin/unpin buffer + + nnoremap BufferPin - " Close buffer - nnoremap BufferClose - " Restore buffer - nnoremap BufferRestore + " Close buffer + + nnoremap BufferClose + + " Restore buffer + + nnoremap BufferRestore - " Wipeout buffer - " :BufferWipeout - " Close commands - " :BufferCloseAllButCurrent - " :BufferCloseAllButVisible - " :BufferCloseAllButPinned - " :BufferCloseAllButCurrentOrPinned - " :BufferCloseBuffersLeft - " :BufferCloseBuffersRight + " Wipeout buffer + " :BufferWipeout + " Close commands + " :BufferCloseAllButCurrent + " :BufferCloseAllButVisible + " :BufferCloseAllButPinned + " :BufferCloseAllButCurrentOrPinned + " :BufferCloseBuffersLeft + " :BufferCloseBuffersRight - " Magic buffer-picking mode - nnoremap BufferPick - nnoremap BufferPickDelete + " Magic buffer-picking mode + + nnoremap BufferPick + nnoremap BufferPickDelete - " Sort automatically by... - nnoremap bb BufferOrderByBufferNumber - nnoremap bd BufferOrderByDirectory - nnoremap bl BufferOrderByLanguage - nnoremap bw BufferOrderByWindowNumber + " Sort automatically by... + + nnoremap bb BufferOrderByBufferNumber + nnoremap bd BufferOrderByDirectory + nnoremap bl BufferOrderByLanguage + nnoremap bw BufferOrderByWindowNumber - " Other: - " :BarbarEnable - enables barbar (enabled by default) - " :BarbarDisable - very bad command, should never be used + " Other: + " :BarbarEnable - enables barbar (enabled by default) + " :BarbarDisable - very bad command, should never be used " ToggleTerm shortcuts + autocmd TermEnter term://*toggleterm#* + \ tnoremap exe v:count1 . "ToggleTerm" + nnoremap exe v:count1 . "ToggleTerm" inoremap exe v:count1 . "ToggleTerm" + " Ctrl + \ + Ctrl + n - exit form terminal mode + + " vim-visual-multi - multiline editing shortcuts + " https://github.com/mg979/vim-visual-multi/wiki/Quick-start + + " ESC - exit mode + " Ctrl + n - select the word under cursor + " Ctrl + n - from visual mode, without word boundaries + " Ctrl + Down - create cursors vertically down + " Ctrl + Up - create cursors vertically up + " \\A - select all occurences of word + " \\/ - create section with regex search + " \\\ - add single cursor at current position + " \\gS - reselect set of regions of last VM session + + " Ctrl + LeftMouse - create a cursor where clicked + " Ctrl + RightMouse - select a word where clicked + " Alt + Ctrl + RightMouse - create column, from current cursot to clicekd position " Initialize plugin system " - Automatically executes `filetype plugin indent on` and `syntax enable`.