2023-10-20 21:06:44 -04:00
|
|
|
" by default, the indent is 2 spaces.
|
2023-10-20 23:10:58 -04:00
|
|
|
set smartindent
|
|
|
|
set expandtab
|
2023-10-20 21:06:44 -04:00
|
|
|
set shiftwidth=2
|
|
|
|
set softtabstop=2
|
|
|
|
set tabstop=2
|
|
|
|
|
|
|
|
" for html/rb files, 2 spaces
|
|
|
|
autocmd Filetype html setlocal ts=2 sw=2 expandtab
|
|
|
|
autocmd Filetype ruby setlocal ts=2 sw=2 expandtab
|
|
|
|
|
|
|
|
" for js/coffee/jade files, 4 spaces
|
|
|
|
autocmd Filetype javascript setlocal ts=4 sw=4 sts=0 expandtab
|
|
|
|
autocmd Filetype coffeescript setlocal ts=4 sw=4 sts=0 expandtab
|
|
|
|
autocmd Filetype jade setlocal ts=4 sw=4 sts=0 expandtab
|
|
|
|
|
2023-09-18 23:21:45 -04:00
|
|
|
set number
|
|
|
|
set relativenumber
|
|
|
|
|
|
|
|
set undofile
|
|
|
|
set undodir=/home/matt/.cache/nvim/
|
|
|
|
|
|
|
|
" set dot icon in place of trailing whitespaces
|
|
|
|
set list listchars=tab:\ \ ,nbsp:␣,trail:•,extends:⟩,precedes:⟨
|
|
|
|
|
|
|
|
" use vscode keybinds for snippets completion
|
|
|
|
inoremap <silent><expr> <TAB>
|
|
|
|
\ coc#pum#visible() ? coc#_select_confirm() :
|
|
|
|
\ coc#expandableOrJumpable() ? "\<C-r>=coc#rpc#request('doKeymap', ['snippets-expand-jump',''])\<CR>" :
|
|
|
|
\ CheckBackspace() ? "\<TAB>" :
|
|
|
|
\ coc#refresh()
|
|
|
|
|
|
|
|
function! CheckBackspace() abort
|
|
|
|
let col = col('.') - 1
|
|
|
|
return !col || getline('.')[col - 1] =~# '\s'
|
|
|
|
endfunction
|
|
|
|
|
|
|
|
let g:coc_snippet_next = '<tab>'
|
|
|
|
|
|
|
|
" support scss @
|
|
|
|
autocmd FileType scss setl iskeyword+=@-@
|
2023-09-22 14:48:03 -04:00
|
|
|
|
2023-09-30 19:51:53 -04:00
|
|
|
" remove highlight on words
|
2023-09-22 14:48:03 -04:00
|
|
|
nnoremap <silent> <esc> :noh<cr><esc>
|
2023-09-30 03:02:15 -04:00
|
|
|
|
2023-09-30 23:48:25 -04:00
|
|
|
" Auto open Neo-Tree on big enough window
|
|
|
|
function! OpenTree() abort
|
2023-10-12 01:02:29 -04:00
|
|
|
if &columns > 100
|
2023-09-30 23:48:25 -04:00
|
|
|
Neotree show
|
|
|
|
Neotree close
|
|
|
|
Neotree show
|
|
|
|
endif
|
2023-10-22 04:14:22 -04:00
|
|
|
lua MiniMap.open()
|
2023-09-30 23:48:25 -04:00
|
|
|
endfunction
|
|
|
|
|
|
|
|
autocmd VimEnter * call OpenTree()
|