110 lines
2.6 KiB
VimL
110 lines
2.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 'ojroques/vim-oscyank'
|
|
Plug 'sjl/vitality.vim'
|
|
|
|
Plug 'dense-analysis/ale'
|
|
Plug 'tpope/vim-commentary'
|
|
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
|
|
Plug 'lifepillar/vim-mucomplete'
|
|
|
|
Plug 'wellle/context.vim'
|
|
Plug 'airblade/vim-gitgutter'
|
|
Plug 'Yggdroot/indentLine'
|
|
|
|
Plug 'lambdalisue/fern.vim'
|
|
|
|
if executable('ctags')
|
|
Plug 'ludovicchabant/vim-gutentags'
|
|
endif
|
|
|
|
Plug 'pangloss/vim-javascript'
|
|
Plug 'vim-ruby/vim-ruby'
|
|
call plug#end()
|
|
|
|
" ale
|
|
let b:ale_fixers = ['prettier', 'eslint']
|
|
let g:ale_fix_on_save = 1
|
|
|
|
" prettier
|
|
let g:prettier#autoformat_config_present = 1
|
|
|
|
" javascript
|
|
let g:javascript_plugin_jsdoc = 1
|
|
let g:javascript_conceal_function = "ƒ"
|
|
|
|
" mucomplete
|
|
set completeopt+=menuone
|
|
set completeopt+=noselect
|
|
set shortmess+=c " Shut off completion messages
|
|
set belloff+=ctrlg " If Vim beeps during completion
|
|
let g:mucomplete#enable_auto_at_startup = 1
|
|
|
|
" indentLine
|
|
let g:indentLine_char_list = ['|', '¦', '┆', '┊']
|
|
|
|
" fern
|
|
nnoremap <Leader>` :Fern . -reveal=%<CR>
|
|
|
|
" oscyank
|
|
autocmd TextYankPost * if v:event.operator is 'y' && v:event.regname is '+' | OSCYankReg + | endif
|