This repository has been archived on 2023-06-18. You can view files and clone it, but cannot push or open issues or pull requests.
nvim-config/init.vim

89 lines
1.8 KiB
VimL
Raw Normal View History

" vim: set tw=80 :
" SETTINGS
if !has('nvim')
setlocal cm=blowfish2
end
2018-12-10 19:36:10 +00:00
" set relative line numbers
set number relativenumber
" set highlighting and continous search
2018-12-10 19:36:10 +00:00
set hlsearch incsearch
" show n-column limiter when textwidth is set
2018-12-10 19:36:10 +00:00
set colorcolumn=+1
if has('nvim')
" prevent terminal buffers to be closed when changing buffer
autocmd TermOpen * set bufhidden=hide
" remove line numbers to terminale
autocmd TermOpen * set nornu nonu
end
" set autoindent on`
set autoindent
" Make :find work on all files in :pwd
set path+=**
set wildignore+=**/node_modules/**
" ADDITIONAL COMMANDS
2018-12-18 09:15:06 +00:00
" make escape work in terminal and send ESC to terminal with C-Esc
tnoremap <Esc> <C-\><C-n>
tnoremap <C-Esc> <Esc>
" clear search with F2
nnoremap <F2> noh
2018-12-27 12:20:34 +00:00
" Use "," as leader
let mapleader = ","
2018-12-27 12:20:34 +00:00
" Switch between Windows with: Leader w
nnoremap <Leader>w <C-w><C-w>
" Show next buffer with: Leader n
nnoremap <Leader>n :bn<cr>
" Delete buffer with: Leader d
nnoremap <Leader>d :bd<cr>
" clear trailing spaces with: Leader t s
nnoremap <Leader>ts :%s/\s *$//g<CR>
" Reload config with: Leader R
nnoremap <Leader>R :source ~/.config/nvim/init.vim<cr>
" show Vim's true competitor with: Leader r c m
nnoremap <Leader>rcm :!open https://youtu.be/jn40Ugz0vuk<CR><CR>
2018-12-30 19:06:41 +00:00
autocmd FileType typescript imap <tab> <C-x><C-o>
" COLORSCHEME
2018-12-27 12:20:34 +00:00
" set colorscheme to onedark.im for nvim and airline
packadd! onedark.vim
colorscheme onedark
let g:airline_theme='onedark'
" PACKAGES
" vim-fish setup
2018-12-18 09:15:06 +00:00
syntax enable
filetype plugin indent on
" Set up :make to use fish for syntax checking.
autocmd FileType fish compiler fish
2018-12-10 19:36:10 +00:00
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file (restore to previous version)
if has('persistent_undo')
set undofile " keep an undo file (undo changes after closing)
endif
endif