2021-09-12 15:54:45 +07:00
|
|
|
set nocompatible
|
|
|
|
set showcmd
|
|
|
|
set rnu
|
|
|
|
|
|
|
|
syntax on
|
|
|
|
filetype on
|
|
|
|
filetype plugin on
|
|
|
|
filetype indent on
|
|
|
|
|
|
|
|
colorscheme onedark
|
|
|
|
hi Comment guifg=#b7ffbd ctermfg=102
|
|
|
|
hi Normal guifg=#eeeeee guibg=#00000ee
|
|
|
|
|
|
|
|
let g:airline#extensions#tabline#enabled = 1
|
|
|
|
let g:airline_powerline_fonts = 1
|
|
|
|
|
|
|
|
" --BACKUP
|
|
|
|
set backup
|
|
|
|
set backupdir=~/.vim/backup/
|
|
|
|
set writebackup
|
|
|
|
set backupcopy=yes
|
|
|
|
au BufWritePre * let &bex = '@' . strftime("%F.%H:%M")
|
|
|
|
|
|
|
|
" --Display
|
|
|
|
set mouse=ar
|
|
|
|
set title
|
|
|
|
set number "Line numbers
|
|
|
|
set ruler
|
|
|
|
set wrap
|
|
|
|
set scrolloff=3
|
|
|
|
set lazyredraw
|
|
|
|
set termguicolors
|
|
|
|
set foldmethod=indent
|
|
|
|
set foldlevelstart=8 "Don't fold automatically unless really nested
|
|
|
|
|
|
|
|
" --Search
|
|
|
|
set ignorecase
|
|
|
|
set smartcase
|
|
|
|
set incsearch
|
|
|
|
set hlsearch
|
|
|
|
|
|
|
|
" --Tab
|
|
|
|
set tabstop=4
|
|
|
|
set shiftwidth=4
|
|
|
|
set softtabstop=0
|
|
|
|
|
|
|
|
" --Beep
|
|
|
|
set visualbell
|
|
|
|
set noerrorbells
|
|
|
|
|
|
|
|
set backspace=indent,eol,start
|
|
|
|
|
|
|
|
set hidden
|
|
|
|
|
|
|
|
" --Svelte files are essentially HTML
|
|
|
|
autocmd BufRead,BufNewFile *.svelte set filetype=html
|
|
|
|
|
|
|
|
" --My cute shortcuts
|
|
|
|
noremap // :nohls<CR>
|
|
|
|
inoremap jj <Esc>
|
|
|
|
|
|
|
|
" (q)uit, (w)ith path edit, (e)dit, (r)eload
|
|
|
|
noremap ,q :wqa<CR>
|
2021-12-21 13:06:08 +07:00
|
|
|
noremap ,w :edit<SPACE>
|
|
|
|
noremap ,e :Files<CR>
|
2021-09-12 15:54:45 +07:00
|
|
|
noremap ,r :so ~/.vimrc<CR>
|
|
|
|
" (h)elp
|
2021-12-21 13:06:08 +07:00
|
|
|
noremap ,f :CocCommand explorer --toggle<CR>
|
2021-09-12 15:54:45 +07:00
|
|
|
noremap ,h :help<SPACE>
|
|
|
|
|
|
|
|
noremap <C-j> :bn<CR>
|
|
|
|
noremap <C-k> :bp<CR>
|
|
|
|
|
|
|
|
autocmd FileType cpp noremap ,c :!g++<SPACE>
|
|
|
|
autocmd FileType cpp map ,cf ,c"%"<CR>
|
|
|
|
autocmd FileType cpp map ,r ,c-o a ;./a;rm a<C-Left><C-Left>
|
|
|
|
autocmd FileType cpp map ,rf ,r"%"<CR>
|