1
1
Fork 0
dotfiles/nvim/init.vim
2021-04-09 00:25:47 -05:00

70 lines
1.6 KiB
VimL

" - Config -
"" Encoding
set encoding=utf8
"" Disable modeline
set nomodeline
"" System undo levels
set undofile
set undolevels=100
"" Indenting
set tabstop=2
set softtabstop=2
set shiftwidth=2
set expandtab
"" Disable error sounds
set noerrorbells
"" Stop word wrapping
set nowrap
"" Show invisible characters
set conceallevel=1
"" Enable search highlighting
set hlsearch
"" Line Numbers
set number relativenumber
"" Top/Bottom scroll padding
set scrolloff=3
set sidescrolloff=5
"" Enable autoread if file changes
set autoread
"" Hide Buffers
set hidden
"" Statusline
set laststatus=0
" - Mappings -
"" Map Leader to spacebar
let mapleader=" "
"" Shortcut to save
nnoremap <Leader>w :w<CR>
"" Moving current lines up/down
nnoremap <Leader>k :<c-u>execute 'move -1-'. v:count1<cr>
nnoremap <Leader>j :<c-u>execute 'move +'. v:count1<cr>
"" Buffers Next/Previous
nnoremap <Tab> :bnext<CR>
nnoremap <S-Tab> :bprev<CR>
"" Shortcut to close buffer
nnoremap <Esc><Esc> :bd<CR>
"" Shortcut to reopen closed buffer
nmap <Leader><Leader> <c-^>
" auto-install vim-plug
if empty(glob('~/.config/nvim/autoload/plug.vim'))
silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"autocmd VimEnter * PlugInstall
"autocmd VimEnter * PlugInstall | source $MYVIMRC
endif
" ale before
let g:ale_completion_enabled = 1
let g:ale_completion_autoimport = 1
call plug#begin('~/.config/nvim/autoload/plugged')
Plug 'dense-analysis/ale'
Plug 'tpope/vim-commentary'
Plug 'ludovicchabant/vim-gutentags'
call plug#end()
" ale
let b:ale_fixers = ['prettier', 'eslint']
let g:ale_fix_on_save = 1