Skip to content

Commit

Permalink
Add :FixTabs command to vim
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxattax97 committed Jul 17, 2024
1 parent b029db1 commit 2552600
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions config/nvim/includes/bindings.vim
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ nnoremap <F12> :ALEFix<CR>
" NOTE: Use command ':verbose imap <tab>' to make sure tab is not mapped by
" other plugin before putting this into your config.
inoremap <silent><expr> <TAB>
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
\ coc#pum#visible() ? coc#pum#next(1) :
\ CheckBackspace() ? "\<Tab>" :
\ coc#refresh()
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
" Make <CR> to accept selected completion item or notify coc.nvim to format
" <C-g>u breaks current undo, please make your own choice.
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm()
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
\: "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
" Break undo chain is <C-g>u
"inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
Expand Down Expand Up @@ -129,3 +129,6 @@ nmap <silent> <leader>T :TestFile<CR>
nnoremap <leader>gd :Gvdiffsplit!<CR>
nnoremap gdh :diffget //2<CR>
nnoremap gdl :diffget //3<CR>
" Create a custom command to fix indentation, convert tabs to spaces, and set tab settings
command! FixTabs execute 'set tabstop=4 shiftwidth=4 expandtab' | execute 'normal! gg=G' | retab

0 comments on commit 2552600

Please sign in to comment.