nvim lsp updates, ricing
This commit is contained in:
22
.gitignore
vendored
22
.gitignore
vendored
@@ -1,15 +1,29 @@
|
||||
# install
|
||||
tmp
|
||||
*.deb
|
||||
logs/*
|
||||
# custom functions
|
||||
!files/.config/fish/functions/nvm.fish
|
||||
|
||||
# install artefacts
|
||||
tmp
|
||||
logs/*
|
||||
**/*.deb
|
||||
|
||||
# setup files
|
||||
**/plugged
|
||||
**/autoload
|
||||
**/functions
|
||||
**/completions
|
||||
**/conf.d
|
||||
**/fish_variables
|
||||
**/gcloud
|
||||
**/coc
|
||||
**/configstore
|
||||
**/wslu
|
||||
**/TabNine
|
||||
**/firebase
|
||||
|
||||
# pytest
|
||||
**/__pycache__
|
||||
**/.pytest_cache
|
||||
|
||||
# ssh env
|
||||
**/id_rsa*
|
||||
**/known_hosts*
|
||||
|
||||
@@ -1,2 +1,4 @@
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
||||
|
||||
[ -f ~/.fzf.bash ] && source ~/.fzf.bash
|
||||
|
||||
@@ -9,3 +9,4 @@ end
|
||||
# Fish specific
|
||||
# ---------------------------------------------------------------------------- #
|
||||
set fish_greeting
|
||||
base16-seti
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fishpkg/fish-prompt-mono
|
||||
acomagu/fish-async-prompt
|
||||
b4b4r07/enhancd
|
||||
matchai/fish-mock
|
||||
edc/bass
|
||||
tomyun/base16-fish
|
||||
|
||||
3
files/.config/fish/functions/nvm.fish
Normal file
3
files/.config/fish/functions/nvm.fish
Normal file
@@ -0,0 +1,3 @@
|
||||
function nvm
|
||||
bass source $NVM_DIR/nvm.sh ';' nvm $argv
|
||||
end
|
||||
@@ -1,16 +1,16 @@
|
||||
set fileencoding=utf-8
|
||||
" ============================================================================ "
|
||||
" === EDITING OPTIONS === "
|
||||
" ============================================================================ "
|
||||
|
||||
" default encoding
|
||||
set encoding=utf-8
|
||||
set fileencoding=utf-8
|
||||
set fileformat=unix
|
||||
filetype on
|
||||
filetype plugin on
|
||||
syntax on
|
||||
|
||||
|
||||
" ============================================================================ "
|
||||
" === EDITING OPTIONS === "
|
||||
" ============================================================================ "
|
||||
|
||||
" Remap leader key to <SPACE>
|
||||
" Leader key <SPACE>
|
||||
let g:mapleader=' '
|
||||
|
||||
" Yank and paste with the system clipboard
|
||||
@@ -19,8 +19,6 @@ set clipboard=
|
||||
" Hides buffers instead of closing them
|
||||
set hidden
|
||||
|
||||
set smartindent
|
||||
|
||||
" et = expandtab (spaces instead of tabs)
|
||||
" ts = tabstop (the number of spaces that a tab equates to)
|
||||
" sw = shiftwidth (the number of spaces to use when indenting
|
||||
@@ -32,10 +30,9 @@ set foldenable
|
||||
set foldmethod=indent
|
||||
set foldlevel=99
|
||||
|
||||
set cursorline
|
||||
set cursorcolumn
|
||||
set conceallevel=1
|
||||
|
||||
set nonumber
|
||||
set number
|
||||
set relativenumber
|
||||
|
||||
" do not wrap long lines by default
|
||||
@@ -44,6 +41,8 @@ set nowrap
|
||||
" two lines for command line
|
||||
set cmdheight=2
|
||||
|
||||
set updatetime=300
|
||||
|
||||
" ============================================================================ "
|
||||
" === UI === "
|
||||
" ============================================================================ "
|
||||
@@ -51,11 +50,9 @@ set cmdheight=2
|
||||
" Enable true color support
|
||||
set termguicolors
|
||||
|
||||
" Change vertical split character to be a space (essentially hide it)
|
||||
set fillchars+=vert:.
|
||||
|
||||
" Set preview window to appear at bottom
|
||||
" Set preview window to appear at bottom and right
|
||||
set splitbelow
|
||||
set splitright
|
||||
|
||||
" Don't dispay mode in command line (airilne already shows it)
|
||||
set noshowmode
|
||||
@@ -77,12 +74,6 @@ set ignorecase
|
||||
" if the search string has an upper case letter in it, the search will be case sensitive
|
||||
set smartcase
|
||||
|
||||
" Automatically re-read file if a change was detected outside of vim
|
||||
set autoread
|
||||
|
||||
" Enable line numbers
|
||||
set number
|
||||
|
||||
" Enable spellcheck for markdown files
|
||||
autocmd BufRead,BufNewFile *.md setlocal spell
|
||||
|
||||
@@ -95,3 +86,7 @@ endif
|
||||
set backupdir=$XDG_DATA_HOME/nvim/backup " Don't put backups in current dir
|
||||
set backup
|
||||
set noswapfile
|
||||
|
||||
" Some servers have issues with backup files, see #649.
|
||||
" set nobackup
|
||||
" set nowritebackup
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
if &compatible
|
||||
set nocompatible
|
||||
endif
|
||||
|
||||
" ============================================================================ "
|
||||
" === Load files === "
|
||||
" ============================================================================ "
|
||||
source $XDG_CONFIG_HOME/nvim/base.vim
|
||||
|
||||
source $XDG_CONFIG_HOME/nvim/plugins.vim
|
||||
source $XDG_CONFIG_HOME/nvim/plugins-config.vim
|
||||
|
||||
source $XDG_CONFIG_HOME/nvim/mappings.vim
|
||||
|
||||
@@ -1,20 +1,36 @@
|
||||
" No arrow keys
|
||||
noremap <Up> <NOP>
|
||||
noremap <Down> <NOP>
|
||||
noremap <Left> <NOP>
|
||||
noremap <Right> <NOP>
|
||||
noremap <Up> <NOP>
|
||||
noremap <Down> <NOP>
|
||||
noremap <Left> <NOP>
|
||||
noremap <Right> <NOP>
|
||||
inoremap <Up> <NOP>
|
||||
inoremap <Down> <NOP>
|
||||
inoremap <Left> <NOP>
|
||||
inoremap <Right> <NOP>
|
||||
|
||||
" Quick window switching
|
||||
nmap <C-h> <C-w>h
|
||||
nmap <C-j> <C-w>j
|
||||
nmap <C-k> <C-w>k
|
||||
nmap <C-l> <C-w>l
|
||||
|
||||
"fzf
|
||||
" Quick window switching
|
||||
" Ctrl-[hjkl]
|
||||
nnoremap <silent> <C-h> <C-w>h
|
||||
nnoremap <silent> <C-j> <C-w>j
|
||||
nnoremap <silent> <C-k> <C-w>k
|
||||
nnoremap <silent> <C-l> <C-w>l
|
||||
|
||||
|
||||
" Distraction free typing
|
||||
" <l>l - Toggle Goyo and Limelight
|
||||
nnoremap <silent> <leader>l :Goyo<cr>
|
||||
autocmd! User GoyoEnter Limelight
|
||||
autocmd! User GoyoLeave Limelight!
|
||||
|
||||
|
||||
" fzf
|
||||
" <l>p - Search files in current workdir
|
||||
" <l>P - Search files in $HOME
|
||||
" <l>g - Search commits for current buffer
|
||||
" <l>G - Search commits in current workdir
|
||||
" <l>f - Search source in current workdir
|
||||
" <l>; - Search buffers
|
||||
nnoremap <silent> <leader>p :Files<cr>
|
||||
nnoremap <silent> <leader>P :Files ~<cr>
|
||||
nnoremap <silent> <leader>g :BCommits<cr>
|
||||
@@ -23,35 +39,87 @@ nnoremap <silent> <leader>f :Rg<cr>
|
||||
nnoremap <silent> <leader>; :Buffers<cr>
|
||||
|
||||
|
||||
" === Nerdtree shorcuts === "
|
||||
" <leader>e - Toggle NERDTree on/off
|
||||
" <leader>E - Opens current file location in NERDTree
|
||||
nmap <leader>e :NERDTreeToggle<CR>
|
||||
nmap <leader>E :NERDTreeFind<CR>
|
||||
" NERDTree
|
||||
" <l>e - Toggle NERDTree on/off
|
||||
" <l>E - Open current file location in NERDTree
|
||||
nnoremap <silent> <leader>e :NERDTreeToggle<cr>
|
||||
nnoremap <silent> <leader>E :NERDTreeFind<cr>
|
||||
|
||||
" === coc.nvim === "
|
||||
" <leader>dd - Jump to definition of current symbol
|
||||
" <leader>dr - Jump to references of current symbol
|
||||
" <leader>dj - Jump to implementation of current symbol
|
||||
" <leader>ds - Fuzzy search current project symbols
|
||||
nmap <silent> <leader>dd <Plug>(coc-definition)
|
||||
nmap <silent> <leader>dr <Plug>(coc-references)
|
||||
nmap <silent> <leader>dj <Plug>(coc-implementation)
|
||||
nnoremap <silent> <leader>ds :<C-u>CocList -I -N --top symbols<CR>
|
||||
|
||||
" === vim-better-whitespace === "
|
||||
" <leader>y - Automatically remove trailing whitespace
|
||||
nmap <leader>y :StripWhitespace<CR>
|
||||
" coc.nvim
|
||||
" Ctrl-n - Go to previous diagnostic
|
||||
" Ctrl-p - Go to next diagnostic
|
||||
" <l>d - Jump to definition of current symbol
|
||||
" <l>r - Jump to references of current symbol
|
||||
" <l>j - Jump to implementation of current symbol
|
||||
" <l>s - Fuzzy search current project symbols
|
||||
" <l>n - Symbol renaming
|
||||
" <l>y - Format selected code
|
||||
nnoremap <silent> <C-n> <Plug>(coc-diagnostic-prev)
|
||||
nnoremap <silent> <C-p> <Plug>(coc-diagnostic-next)
|
||||
nnoremap <silent> <leader>d <Plug>(coc-definition)
|
||||
nnoremap <silent> <leader>r <Plug>(coc-references)
|
||||
nnoremap <silent> <leader>j <Plug>(coc-implementation)
|
||||
nnoremap <silent> <leader>s :<C-u>CocList -I -N --top symbols<cr>
|
||||
nnoremap <silent> <leader>n <Plug>(coc-rename)
|
||||
nnoremap <silent> <leader>y <Plug>(coc-format-selected)
|
||||
|
||||
" === Search shorcuts === "
|
||||
" <leader>h - Find and replace
|
||||
" <leader>/ - Claer highlighted search terms while preserving history
|
||||
map <leader>h :%s///<left><left>
|
||||
nmap <silent> <leader>/ :nohlsearch<CR>
|
||||
|
||||
" === Easy-motion shortcuts ==="
|
||||
" <leader>w - Easy-motion highlights first word letters bi-directionally
|
||||
map <leader>w <Plug>(easymotion-bd-w)
|
||||
" Search shorcuts
|
||||
" <l>h - Find and replace
|
||||
" <l>/ - Clear highlighted search terms while preserving history
|
||||
nnoremap <leader>h :%s///<left><left>
|
||||
nnoremap <silent> <leader>/ :nohlsearch<cr>
|
||||
|
||||
|
||||
" Easy-motion shortcut
|
||||
" <l>w - move to word bi-directionally
|
||||
" <l>W{char} - move to {char}
|
||||
nnoremap <silent> <leader>w <Plug>(easymotion-bd-w)
|
||||
nnoremap <silent> <leader>W <Plug>(easymotion-bd-f)
|
||||
|
||||
|
||||
|
||||
" use <tab> for trigger completion and navigate to next complete item
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~ '\s'
|
||||
endfunction
|
||||
|
||||
" Use <c-space> to trigger completion.
|
||||
if has('nvim')
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
else
|
||||
inoremap <silent><expr> <c-@> coc#refresh()
|
||||
endif
|
||||
|
||||
" Use K to show documentation in preview window.
|
||||
nnoremap <silent> K :call <SID>show_documentation()<cr>
|
||||
|
||||
function! s:show_documentation()
|
||||
if (index(['vim','help'], &filetype) >= 0)
|
||||
execute 'h '.expand('<cword>')
|
||||
elseif (coc#rpc#ready())
|
||||
call CocActionAsync('doHover')
|
||||
else
|
||||
execute '!' . &keywordprg . " " . expand('<cword>')
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Highlight the symbol and its references when holding the cursor.
|
||||
autocmd CursorHold * silent call CocActionAsync('highlight')
|
||||
|
||||
augroup mygroup
|
||||
autocmd!
|
||||
" Setup formatexpr specified filetype(s).
|
||||
autocmd FileType typescript,json setl formatexpr=CocAction('formatSelected')
|
||||
" Update signature help on jump placeholder.
|
||||
autocmd User CocJumpPlaceholder call CocActionAsync('showSignatureHelp')
|
||||
augroup end
|
||||
|
||||
|
||||
" Allows you to save files you opened without write permissions via sudo
|
||||
cmap w!! w !sudo tee %
|
||||
|
||||
29
files/.config/nvim/plugins-config.vim
Normal file
29
files/.config/nvim/plugins-config.vim
Normal file
@@ -0,0 +1,29 @@
|
||||
" Colourscheme
|
||||
set background=dark
|
||||
colorscheme base16-seti
|
||||
|
||||
" Coc.nvim
|
||||
|
||||
" Close preview window when completion is done.
|
||||
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
|
||||
|
||||
" Disable deprecated python2 provider
|
||||
let g:loaded_python_provider = 0
|
||||
|
||||
" Call method on window enter
|
||||
augroup WindowManagement
|
||||
autocmd!
|
||||
autocmd WinEnter * call Handle_Win_Enter()
|
||||
augroup END
|
||||
|
||||
" Change highlight group of preview window when open
|
||||
function! Handle_Win_Enter()
|
||||
if &previewwindow
|
||||
setlocal winhighlight=Normal:MarkdownError
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" Reload icons after init source
|
||||
if exists('g:loaded_webdevicons')
|
||||
call webdevicons#refresh()
|
||||
endif
|
||||
@@ -1,29 +1,90 @@
|
||||
" ============================================================================ "
|
||||
" === PLUGINS === "
|
||||
" ============================================================================ "
|
||||
call plug#begin('~/.config/nvim/plugged')
|
||||
|
||||
" === Editor === "
|
||||
|
||||
" Sensible (?) defaults
|
||||
" sensible defaults
|
||||
Plug 'tpope/vim-sensible'
|
||||
|
||||
" colorschemes
|
||||
Plug 'flazz/vim-colorschemes'
|
||||
" colorscheme
|
||||
Plug 'chriskempson/base16-vim'
|
||||
|
||||
" dev icons
|
||||
Plug 'ryanoasis/vim-devicons'
|
||||
" {{{
|
||||
let g:webdevicons_enable_nerdtree = 1
|
||||
let g:webdevicons_conceal_nerdtree_brackets = 1
|
||||
|
||||
" file explorer sidebar
|
||||
let g:webdevicons_enable_airline_tabline = 1
|
||||
let g:webdevicons_enable_airline_statusline = 1
|
||||
|
||||
let g:webdevicons_enable_startify = 1
|
||||
" }}}
|
||||
|
||||
" explorer sidebar
|
||||
Plug 'scrooloose/nerdtree'
|
||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||
" {{{
|
||||
" Show hidden files/directories
|
||||
let g:NERDTreeShowHidden = 1
|
||||
|
||||
" Remove bookmarks and help text from NERDTree
|
||||
let g:NERDTreeMinimalUI = 1
|
||||
let g:NERDTreeMinimalMenu = 1
|
||||
|
||||
" Remove icons for expandable/expanded directories
|
||||
let g:NERDTreeDirArrowExpandable = ''
|
||||
let g:NERDTreeDirArrowCollapsible = ''
|
||||
|
||||
" Hide certain files and directories from NERDTree
|
||||
let g:NERDTreeIgnore = ['\.git$[[dir]]']
|
||||
" }}}
|
||||
|
||||
" status line
|
||||
Plug 'vim-airline/vim-airline'
|
||||
Plug 'vim-airline/vim-airline-themes'
|
||||
" {{{
|
||||
" Enable extensions
|
||||
let g:airline_extensions = ['branch', 'coc', 'hunks']
|
||||
|
||||
" indent guides
|
||||
Plug 'nathanaelkane/vim-indent-guides'
|
||||
" Do not draw separators for empty sections (only for the active window) >
|
||||
let g:airline_skip_empty_sections = 1
|
||||
|
||||
" Smartly uniquify buffers names with similar filename, suppressing common parts of paths.
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
|
||||
|
||||
" Custom setup that removes filetype/whitespace from default vim airline bar
|
||||
" let g:airline#extensions#default#layout = [['a', 'b', 'c'], ['x', 'z', 'warning', 'error']]
|
||||
|
||||
" Customize vim airline per filetype
|
||||
" 'nerdtree' - Hide nerdtree status line
|
||||
" 'list' - Only show file type plus current line number out of total
|
||||
let g:airline_filetype_overrides = {
|
||||
\ 'coc-explorer': [ 'CoC Explorer', '' ],
|
||||
\ 'fugitive': ['fugitive', '%{airline#util#wrap(airline#extensions#branch#get_head(),80)}'],
|
||||
\ 'help': [ 'Help', '%f' ],
|
||||
\ 'startify': [ 'startify', '' ],
|
||||
\ 'vim-plug': [ 'Plugins', '' ],
|
||||
\ 'nerdtree': [ get(g:, 'NERDTreeStatusline', ''), '' ],
|
||||
\ 'list': [ '%y', '%l/%L'],
|
||||
\ }
|
||||
|
||||
" Enable powerline fonts
|
||||
let g:airline_powerline_fonts = 1
|
||||
|
||||
" Enable caching of syntax highlighting groups
|
||||
let g:airline_highlighting_cache = 1
|
||||
" }}}
|
||||
|
||||
" Print function signatures in echo area
|
||||
Plug 'Shougo/echodoc.vim'
|
||||
" {{{
|
||||
" Enable echodoc on startup
|
||||
let g:echodoc#enable_at_startup = 1
|
||||
" }}}
|
||||
|
||||
" start screen
|
||||
Plug 'mhinz/vim-startify'
|
||||
|
||||
" distraction-free typing
|
||||
Plug 'junegunn/goyo.vim'
|
||||
Plug 'junegunn/limelight.vim'
|
||||
|
||||
" DOcumentation GEneraton
|
||||
Plug 'kkoomen/vim-doge'
|
||||
@@ -32,253 +93,62 @@ Plug 'kkoomen/vim-doge'
|
||||
Plug 'rstacruz/vim-closer'
|
||||
Plug 'tpope/vim-endwise'
|
||||
|
||||
" Improved motion in Vim
|
||||
" better motion
|
||||
Plug 'easymotion/vim-easymotion'
|
||||
Plug 'tpope/vim-surround'
|
||||
|
||||
" Snippet support
|
||||
Plug 'Shougo/neosnippet'
|
||||
Plug 'Shougo/neosnippet-snippets'
|
||||
|
||||
" Print function signatures in echo area
|
||||
Plug 'Shougo/echodoc.vim'
|
||||
|
||||
" Enable git changes to be shown in sign column
|
||||
Plug 'mhinz/vim-signify'
|
||||
Plug 'tpope/vim-fugitive'
|
||||
|
||||
" Comment out lines
|
||||
Plug 'svermeulen/vim-subversive'
|
||||
Plug 'godlygeek/tabular'
|
||||
Plug 'tpope/vim-commentary'
|
||||
|
||||
" git tools
|
||||
Plug 'mhinz/vim-signify'
|
||||
" {{{
|
||||
let g:signify_sign_delete = '-'
|
||||
" }}}
|
||||
Plug 'tpope/vim-fugitive'
|
||||
|
||||
" fzf
|
||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||
Plug 'junegunn/fzf.vim'
|
||||
" {{{
|
||||
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.9 } }
|
||||
let g:fzf_preview_window = ['right:66%', 'ctrl-/']
|
||||
|
||||
let g:fzf_buffers_jump = 1
|
||||
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
|
||||
|
||||
" === Languages === "
|
||||
" Intellisense Engine
|
||||
let $FZF_DEFAULT_OPTS="--ansi --layout reverse --margin=1,4 --preview 'batcat --color=always --style=header,grid --line-range :300 {}'"
|
||||
let $FZF_DEFAULT_COMMAND = 'rg --files --ignore-case --hidden -g "!{.git,node_modules,vendor}/*"'
|
||||
command! -bang -nargs=? -complete=dir Files
|
||||
\ call fzf#vim#files(<q-args>, { 'options': $FZF_DEFAULT_OPTS}, <bang>0)
|
||||
" }}}
|
||||
|
||||
" coc
|
||||
Plug 'neoclide/coc.nvim', {'do': 'yarn install --frozen-lockfile'}
|
||||
" {{{
|
||||
" Keep in sync with below
|
||||
let g:coc_global_extensions = [
|
||||
\ 'coc-css',
|
||||
\ 'coc-eslint',
|
||||
\ 'coc-git',
|
||||
\ 'coc-html',
|
||||
\ 'coc-json',
|
||||
\ 'coc-prettier',
|
||||
\ 'coc-python',
|
||||
\ 'coc-tabnine',
|
||||
\ 'coc-tsserver',
|
||||
\ 'coc-yaml',
|
||||
\]
|
||||
" }}}
|
||||
Plug 'neoclide/coc-css', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-eslint', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-git', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-html', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-json', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-prettier', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-python', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-tabnine', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}
|
||||
Plug 'neoclide/coc-yaml', {'do': 'yarn install --frozen-lockfile'}
|
||||
|
||||
" lint
|
||||
Plug 'dense-analysis/ale'
|
||||
|
||||
" Trailing whitespace highlighting & automatic fixing
|
||||
Plug 'ntpeters/vim-better-whitespace'
|
||||
|
||||
" Languages
|
||||
Plug 'sheerun/vim-polyglot'
|
||||
|
||||
" elm
|
||||
Plug 'elmcast/elm-vim'
|
||||
|
||||
" json
|
||||
Plug 'elzr/vim-json'
|
||||
|
||||
" html
|
||||
Plug 'mattn/emmet-vim'
|
||||
|
||||
" js
|
||||
Plug 'othree/yajs.vim'
|
||||
Plug 'pangloss/vim-javascript'
|
||||
Plug 'mxw/vim-jsx'
|
||||
|
||||
" Python
|
||||
Plug 'numirias/semshi', {'do': ':UpdateRemotePlugins'}
|
||||
Plug 'Vimjas/vim-python-pep8-indent'
|
||||
|
||||
" Initialize plugin system
|
||||
call plug#end()
|
||||
|
||||
|
||||
" ============================================================================ "
|
||||
" === PLUGIN SETUP === "
|
||||
" ============================================================================ "
|
||||
|
||||
colorscheme badwolf
|
||||
|
||||
" Show hidden files/directories
|
||||
let g:NERDTreeShowHidden = 1
|
||||
|
||||
" Remove bookmarks and help text from NERDTree
|
||||
let g:NERDTreeMinimalUI = 1
|
||||
|
||||
" Custom icons for expandable/expanded directories
|
||||
let g:NERDTreeDirArrowExpandable = ''
|
||||
let g:NERDTreeDirArrowCollapsible = ''
|
||||
|
||||
" Hide certain files and directories from NERDTree
|
||||
let g:NERDTreeIgnore = ['\.git$[[dir]]']
|
||||
|
||||
let g:elm_setup_keybindings = 0
|
||||
|
||||
let g:ale_lint_on_text_changed = 'always'
|
||||
let g:ale_lint_delay = 1000
|
||||
let g:ale_sign_error = '>>'
|
||||
let g:ale_sign_warning = '--'
|
||||
|
||||
" Do not display non-specified linter warnings
|
||||
let g:ale_linters_explicit = 1
|
||||
let g:ale_linters = {
|
||||
\ 'python': ['flake8', 'pylint'],
|
||||
\ 'typescript': ['prettier', 'tslint'],
|
||||
\ 'javascript': ['prettier', 'eslint'],
|
||||
\ 'scss': ['prettier'],
|
||||
\ 'html': ['prettier'],
|
||||
\}
|
||||
|
||||
let g:ale_fixers = {
|
||||
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||
\ 'cpp': ['clang'],
|
||||
\ 'css': ['prettier'],
|
||||
\ 'python': ['yapf'],
|
||||
\ 'typescript': ['prettier', 'tslint'],
|
||||
\ 'javascript': ['prettier', 'eslint'],
|
||||
\ 'scss': ['prettier'],
|
||||
\ 'html': ['prettier'],
|
||||
\}
|
||||
let g:ale_fix_on_save = 1
|
||||
|
||||
|
||||
let g:airline_theme='badwolf'
|
||||
|
||||
|
||||
" Wrap in try/catch to avoid errors on initial install before plugin is available
|
||||
try
|
||||
" === Coc.nvim === "
|
||||
" use <tab> for trigger completion and navigate to next complete item
|
||||
function! s:check_back_space() abort
|
||||
let col = col('.') - 1
|
||||
return !col || getline('.')[col - 1] =~ '\s'
|
||||
endfunction
|
||||
|
||||
inoremap <silent><expr> <TAB>
|
||||
\ pumvisible() ? "\<C-n>" :
|
||||
\ <SID>check_back_space() ? "\<TAB>" :
|
||||
\ coc#refresh()
|
||||
|
||||
"Close preview window when completion is done.
|
||||
autocmd! CompleteDone * if pumvisible() == 0 | pclose | endif
|
||||
|
||||
" Allow use of :Prettier
|
||||
command! -nargs=0 Prettier :CocCommand prettier.formatFile
|
||||
|
||||
call coc#config('python', {
|
||||
\ 'jediEnabled': v:false,
|
||||
\ 'venvPath': '~/.cache/pypoetry/virtualenvs'
|
||||
\ })
|
||||
|
||||
" Disable deprecated python2 provider
|
||||
let g:loaded_python_provider = 0
|
||||
|
||||
" === NeoSnippet === "
|
||||
" Map <C-k> as shortcut to activate snippet if available
|
||||
imap <C-k> <Plug>(neosnippet_expand_or_jump)
|
||||
smap <C-k> <Plug>(neosnippet_expand_or_jump)
|
||||
xmap <C-k> <Plug>(neosnippet_expand_target)
|
||||
|
||||
" Load custom snippets from snippets folder
|
||||
let g:neosnippet#snippets_directory='~/.config/nvim/snippets'
|
||||
|
||||
let g:neosnippet#enable_conceal_markers = 0
|
||||
|
||||
" === Vim airline ==== "
|
||||
" Enable extensions
|
||||
let g:airline_extensions = ['branch', 'hunks', 'coc']
|
||||
|
||||
" Update section z to just have line number
|
||||
let g:airline_section_z = airline#section#create(['linenr'])
|
||||
|
||||
" Do not draw separators for empty sections (only for the active window) >
|
||||
let g:airline_skip_empty_sections = 1
|
||||
|
||||
" Smartly uniquify buffers names with similar filename, suppressing common parts of paths.
|
||||
let g:airline#extensions#tabline#formatter = 'unique_tail'
|
||||
|
||||
" Custom setup that removes filetype/whitespace from default vim airline bar
|
||||
let g:airline#extensions#default#layout = [['a', 'b', 'c'], ['x', 'z', 'warning', 'error']]
|
||||
|
||||
" Customize vim airline per filetype
|
||||
" 'nerdtree' - Hide nerdtree status line
|
||||
" 'list' - Only show file type plus current line number out of total
|
||||
let g:airline_filetype_overrides = {
|
||||
\ 'nerdtree': [ get(g:, 'NERDTreeStatusline', ''), '' ],
|
||||
\ 'list': [ '%y', '%l/%L'],
|
||||
\ }
|
||||
|
||||
" Enable powerline fonts
|
||||
let g:airline_powerline_fonts = 1
|
||||
|
||||
" Enable caching of syntax highlighting groups
|
||||
let g:airline_highlighting_cache = 1
|
||||
|
||||
" Define custom airline symbols
|
||||
if !exists('g:airline_symbols')
|
||||
let g:airline_symbols = {}
|
||||
endif
|
||||
|
||||
" Don't show git changes to current file in airline
|
||||
let g:airline#extensions#hunks#enabled=0
|
||||
|
||||
catch
|
||||
echo 'Airline not installed. It should work after running :PlugInstall'
|
||||
endtry
|
||||
|
||||
" === echodoc === "
|
||||
" Enable echodoc on startup
|
||||
let g:echodoc#enable_at_startup = 1
|
||||
|
||||
" === vim-javascript === "
|
||||
" Enable syntax highlighting for JSDoc
|
||||
let g:javascript_plugin_jsdoc = 1
|
||||
|
||||
" === vim-jsx === "
|
||||
" Highlight jsx syntax even in non .jsx files
|
||||
let g:jsx_ext_required = 0
|
||||
|
||||
" === javascript-libraries-syntax === "
|
||||
let g:used_javascript_libs = 'underscore,requirejs,chai,jquery'
|
||||
|
||||
" === Signify === "
|
||||
let g:signify_sign_delete = '-'
|
||||
|
||||
" Fzf
|
||||
let g:fzf_preview_window = 'right:60%'
|
||||
let g:fzf_buffers_jump = 1
|
||||
let g:fzf_commits_log_options = '--graph --color=always --format="%C(auto)%h%d %s %C(black)%C(bold)%cr"'
|
||||
let g:fzf_layout = { 'window': { 'width': 0.9, 'height': 0.9 } }
|
||||
|
||||
let $FZF_DEFAULT_OPTS="--ansi --preview-window 'right:60%' --layout reverse --margin=1,4 --preview 'batcat --color=always --style=header,grid --line-range :300 {}'"
|
||||
let $FZF_DEFAULT_COMMAND = 'rg --files --ignore-case --hidden -g "!{.git,node_modules,vendor}/*"'
|
||||
command! -bang -nargs=? -complete=dir Files
|
||||
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
|
||||
|
||||
|
||||
" Call method on window enter
|
||||
augroup WindowManagement
|
||||
autocmd!
|
||||
autocmd WinEnter * call Handle_Win_Enter()
|
||||
augroup END
|
||||
|
||||
" Change highlight group of preview window when open
|
||||
function! Handle_Win_Enter()
|
||||
if &previewwindow
|
||||
setlocal winhighlight=Normal:MarkdownError
|
||||
endif
|
||||
endfunction
|
||||
|
||||
|
||||
" Reload icons after init source
|
||||
if exists('g:loaded_webdevicons')
|
||||
call webdevicons#refresh()
|
||||
endif
|
||||
|
||||
let g:indent_guides_enable_on_vim_startup = 1
|
||||
let g:indent_guides_start_level = 2
|
||||
let g:indent_guides_guide_size = 1
|
||||
|
||||
let g:user_emmet_leader_key='<Tab>'
|
||||
let g:user_emmet_settings = {
|
||||
\ 'javascript.jsx' : {
|
||||
\ 'extends' : 'jsx',
|
||||
\ },
|
||||
\}
|
||||
|
||||
@@ -46,3 +46,5 @@ if [ -z "$PROFILE_LOCK" ]; then
|
||||
export PATH="$YARN_DIR/bin:$PATH"
|
||||
|
||||
fi
|
||||
|
||||
alias vim='nvim'
|
||||
|
||||
@@ -7,7 +7,8 @@ if not_installed "nvm"; then
|
||||
printf "Installing nvm...\n"
|
||||
|
||||
# Install nvm
|
||||
run "https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh" \
|
||||
mkdir -p $NVM_DIR
|
||||
run "https://raw.githubusercontent.com/nvm-sh/nvm/v0.36.0/install.sh" \
|
||||
"bash"
|
||||
source "$NVM_DIR/nvm.sh"
|
||||
nvm alias default node
|
||||
|
||||
@@ -85,7 +85,6 @@ export -f clean update upgrade install install_file add_ppa add_key run \
|
||||
# ---------------------------------------------------------------------------- #
|
||||
# Shell colours
|
||||
# ---------------------------------------------------------------------------- #
|
||||
|
||||
C_BLACK='\033[0;30m'
|
||||
C_DGRAY='\033[1;30m'
|
||||
C_RED='\033[0;31m'
|
||||
|
||||
Reference in New Issue
Block a user