From bd5a858817e06a3071b0aee1b7769ab6c23d7cc7 Mon Sep 17 00:00:00 2001 From: Daniel Falbo <39460524+danielfalbo@users.noreply.github.com> Date: Mon, 22 Jun 2020 12:43:07 +0200 Subject: Cut airline show_tab_type command redundancy It's line 12 --- themes/airline.vim | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/airline.vim b/themes/airline.vim index 828e726c..85c27b20 100644 --- a/themes/airline.vim +++ b/themes/airline.vim @@ -13,7 +13,6 @@ let g:airline#extensions#tabline#show_tab_type = 0 let g:airline#extensions#tabline#show_tab_nr = 0 let g:airline#extensions#tabline#fnamecollapse = 1 -let g:airline#extensions#tabline#show_tab_type = 0 let g:airline#extensions#tabline#buffers_label = '' let g:airline#extensions#tabline#tabs_label = '' -- cgit v1.2.3 From bd30daefeaf23b206ab778e8123c8a08d524ccc8 Mon Sep 17 00:00:00 2001 From: Gharbi Mohamed Date: Wed, 15 Jul 2020 02:59:35 +0100 Subject: add a config file for vim commentary --- plug-config/vim-commentary.vim | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 plug-config/vim-commentary.vim diff --git a/plug-config/vim-commentary.vim b/plug-config/vim-commentary.vim new file mode 100644 index 00000000..c9637e69 --- /dev/null +++ b/plug-config/vim-commentary.vim @@ -0,0 +1,9 @@ +function! Comment() + if (mode() == "n" ) + execute "Commentary" + else + execute "'<,'>Commentary" + endif + endfunction +vnoremap / :call Comment() +autocmd filetype javascript.jsx setlocal commentstring={/*\ %s\ */} -- cgit v1.2.3 From f3ba68b3cc03cbd07b5145c62b885db5a1ba0177 Mon Sep 17 00:00:00 2001 From: Gharbi Mohamed Date: Wed, 15 Jul 2020 03:03:47 +0100 Subject: create a function to handle multi line comment --- plug-config/vim-commentary.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plug-config/vim-commentary.vim b/plug-config/vim-commentary.vim index c9637e69..f672715d 100644 --- a/plug-config/vim-commentary.vim +++ b/plug-config/vim-commentary.vim @@ -1,3 +1,4 @@ +" this function check whether vim is in normal mode or not and comment appropriately function! Comment() if (mode() == "n" ) execute "Commentary" @@ -5,5 +6,5 @@ function! Comment() execute "'<,'>Commentary" endif endfunction -vnoremap / :call Comment() +vnoremap / :call Comment() autocmd filetype javascript.jsx setlocal commentstring={/*\ %s\ */} -- cgit v1.2.3 From 82286eca1918daea625fd40e12f2d4c43b70a9ee Mon Sep 17 00:00:00 2001 From: Gharbi Mohamed Date: Wed, 15 Jul 2020 03:05:11 +0100 Subject: modify '/' mapping to call the Comment function --- keys/which-key.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keys/which-key.vim b/keys/which-key.vim index 661882c1..cc0c41a2 100644 --- a/keys/which-key.vim +++ b/keys/which-key.vim @@ -25,7 +25,7 @@ autocmd FileType which_key set laststatus=0 noshowmode noruler " Single mappings -let g:which_key_map['/'] = [ ':Commentary' , 'comment' ] +let g:which_key_map['/'] = [ ':call Comment()' , 'comment' ] let g:which_key_map['.'] = [ ':e $MYVIMRC' , 'open init' ] let g:which_key_map[';'] = [ ':Commands' , 'commands' ] let g:which_key_map['='] = [ '=' , 'balance windows' ] -- cgit v1.2.3 From 51d9b8841d45992d7d0e66d51844f50ac428541a Mon Sep 17 00:00:00 2001 From: Gharbi Mohamed Date: Wed, 15 Jul 2020 03:05:56 +0100 Subject: comment out nerd-comment config and add vim-commentary config file --- init.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/init.vim b/init.vim index c6456734..8205e455 100644 --- a/init.vim +++ b/init.vim @@ -24,7 +24,8 @@ else source $HOME/.config/nvim/themes/airline.vim source $HOME/.config/nvim/plug-config/rnvimr.vim source $HOME/.config/nvim/plug-config/fzf.vim - source $HOME/.config/nvim/plug-config/nerd-commenter.vim + "source $HOME/.config/nvim/plug-config/nerd-commenter.vim switching to vim-commentary + source $HOME/.config/nvim/plug-config/vim-commentary.vim source $HOME/.config/nvim/plug-config/rainbow.vim source $HOME/.config/nvim/plug-config/codi.vim source $HOME/.config/nvim/plug-config/quickscope.vim -- cgit v1.2.3 From 537cb980c524b15ebf5b09fbb8a066483f63d562 Mon Sep 17 00:00:00 2001 From: Gharbi Mohamed Date: Wed, 15 Jul 2020 08:40:39 +0100 Subject: add vim-jsx-pretty and vim-context-commentstring plugins --- vim-plug/plugins.vim | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vim-plug/plugins.vim b/vim-plug/plugins.vim index 6b580108..7369468a 100644 --- a/vim-plug/plugins.vim +++ b/vim-plug/plugins.vim @@ -8,6 +8,10 @@ endif call plug#begin('~/.config/nvim/autoload/plugged') + " jsx syntax support + Plug 'maxmellon/vim-jsx-pretty' + + Plug 'suy/vim-context-commentstring' " Change dates fast Plug 'tpope/vim-speeddating' " Convert binary, hex, etc.. -- cgit v1.2.3 From 4843a3bcd4d0851812923e3f85b0a1912211edf4 Mon Sep 17 00:00:00 2001 From: Gharbi Mohamed Date: Wed, 15 Jul 2020 08:42:33 +0100 Subject: remove unnecessary autocmd --- plug-config/vim-commentary.vim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plug-config/vim-commentary.vim b/plug-config/vim-commentary.vim index f672715d..b6758b38 100644 --- a/plug-config/vim-commentary.vim +++ b/plug-config/vim-commentary.vim @@ -1,4 +1,3 @@ -" this function check whether vim is in normal mode or not and comment appropriately function! Comment() if (mode() == "n" ) execute "Commentary" @@ -6,5 +5,4 @@ function! Comment() execute "'<,'>Commentary" endif endfunction -vnoremap / :call Comment() -autocmd filetype javascript.jsx setlocal commentstring={/*\ %s\ */} +vnoremap / :call Comment() -- cgit v1.2.3