nvim lsp updates, ricing
This commit is contained in:
22
.gitignore
vendored
22
.gitignore
vendored
@@ -1,15 +1,29 @@
|
|||||||
# install
|
# custom functions
|
||||||
tmp
|
!files/.config/fish/functions/nvm.fish
|
||||||
*.deb
|
|
||||||
logs/*
|
|
||||||
|
|
||||||
|
# install artefacts
|
||||||
|
tmp
|
||||||
|
logs/*
|
||||||
|
**/*.deb
|
||||||
|
|
||||||
|
# setup files
|
||||||
**/plugged
|
**/plugged
|
||||||
**/autoload
|
**/autoload
|
||||||
**/functions
|
**/functions
|
||||||
**/completions
|
**/completions
|
||||||
**/conf.d
|
**/conf.d
|
||||||
**/fish_variables
|
**/fish_variables
|
||||||
|
**/gcloud
|
||||||
|
**/coc
|
||||||
|
**/configstore
|
||||||
|
**/wslu
|
||||||
|
**/TabNine
|
||||||
|
**/firebase
|
||||||
|
|
||||||
# pytest
|
# pytest
|
||||||
**/__pycache__
|
**/__pycache__
|
||||||
**/.pytest_cache
|
**/.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/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
|
||||||
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
|
[ -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
|
# Fish specific
|
||||||
# ---------------------------------------------------------------------------- #
|
# ---------------------------------------------------------------------------- #
|
||||||
set fish_greeting
|
set fish_greeting
|
||||||
|
base16-seti
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
fishpkg/fish-prompt-mono
|
fishpkg/fish-prompt-mono
|
||||||
acomagu/fish-async-prompt
|
acomagu/fish-async-prompt
|
||||||
b4b4r07/enhancd
|
|
||||||
matchai/fish-mock
|
matchai/fish-mock
|
||||||
edc/bass
|
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
|
set fileformat=unix
|
||||||
filetype on
|
filetype on
|
||||||
filetype plugin on
|
filetype plugin on
|
||||||
syntax on
|
syntax on
|
||||||
|
|
||||||
|
" Leader key <SPACE>
|
||||||
" ============================================================================ "
|
|
||||||
" === EDITING OPTIONS === "
|
|
||||||
" ============================================================================ "
|
|
||||||
|
|
||||||
" Remap leader key to <SPACE>
|
|
||||||
let g:mapleader=' '
|
let g:mapleader=' '
|
||||||
|
|
||||||
" Yank and paste with the system clipboard
|
" Yank and paste with the system clipboard
|
||||||
@@ -19,8 +19,6 @@ set clipboard=
|
|||||||
" Hides buffers instead of closing them
|
" Hides buffers instead of closing them
|
||||||
set hidden
|
set hidden
|
||||||
|
|
||||||
set smartindent
|
|
||||||
|
|
||||||
" et = expandtab (spaces instead of tabs)
|
" et = expandtab (spaces instead of tabs)
|
||||||
" ts = tabstop (the number of spaces that a tab equates to)
|
" ts = tabstop (the number of spaces that a tab equates to)
|
||||||
" sw = shiftwidth (the number of spaces to use when indenting
|
" sw = shiftwidth (the number of spaces to use when indenting
|
||||||
@@ -32,10 +30,9 @@ set foldenable
|
|||||||
set foldmethod=indent
|
set foldmethod=indent
|
||||||
set foldlevel=99
|
set foldlevel=99
|
||||||
|
|
||||||
set cursorline
|
set conceallevel=1
|
||||||
set cursorcolumn
|
|
||||||
|
|
||||||
set nonumber
|
set number
|
||||||
set relativenumber
|
set relativenumber
|
||||||
|
|
||||||
" do not wrap long lines by default
|
" do not wrap long lines by default
|
||||||
@@ -44,6 +41,8 @@ set nowrap
|
|||||||
" two lines for command line
|
" two lines for command line
|
||||||
set cmdheight=2
|
set cmdheight=2
|
||||||
|
|
||||||
|
set updatetime=300
|
||||||
|
|
||||||
" ============================================================================ "
|
" ============================================================================ "
|
||||||
" === UI === "
|
" === UI === "
|
||||||
" ============================================================================ "
|
" ============================================================================ "
|
||||||
@@ -51,11 +50,9 @@ set cmdheight=2
|
|||||||
" Enable true color support
|
" Enable true color support
|
||||||
set termguicolors
|
set termguicolors
|
||||||
|
|
||||||
" Change vertical split character to be a space (essentially hide it)
|
" Set preview window to appear at bottom and right
|
||||||
set fillchars+=vert:.
|
|
||||||
|
|
||||||
" Set preview window to appear at bottom
|
|
||||||
set splitbelow
|
set splitbelow
|
||||||
|
set splitright
|
||||||
|
|
||||||
" Don't dispay mode in command line (airilne already shows it)
|
" Don't dispay mode in command line (airilne already shows it)
|
||||||
set noshowmode
|
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
|
" if the search string has an upper case letter in it, the search will be case sensitive
|
||||||
set smartcase
|
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
|
" Enable spellcheck for markdown files
|
||||||
autocmd BufRead,BufNewFile *.md setlocal spell
|
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 backupdir=$XDG_DATA_HOME/nvim/backup " Don't put backups in current dir
|
||||||
set backup
|
set backup
|
||||||
set noswapfile
|
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/base.vim
|
||||||
|
|
||||||
source $XDG_CONFIG_HOME/nvim/plugins.vim
|
source $XDG_CONFIG_HOME/nvim/plugins.vim
|
||||||
|
source $XDG_CONFIG_HOME/nvim/plugins-config.vim
|
||||||
|
|
||||||
source $XDG_CONFIG_HOME/nvim/mappings.vim
|
source $XDG_CONFIG_HOME/nvim/mappings.vim
|
||||||
|
|||||||
@@ -8,13 +8,29 @@ inoremap <Down> <NOP>
|
|||||||
inoremap <Left> <NOP>
|
inoremap <Left> <NOP>
|
||||||
inoremap <Right> <NOP>
|
inoremap <Right> <NOP>
|
||||||
|
|
||||||
|
|
||||||
" Quick window switching
|
" Quick window switching
|
||||||
nmap <C-h> <C-w>h
|
" Ctrl-[hjkl]
|
||||||
nmap <C-j> <C-w>j
|
nnoremap <silent> <C-h> <C-w>h
|
||||||
nmap <C-k> <C-w>k
|
nnoremap <silent> <C-j> <C-w>j
|
||||||
nmap <C-l> <C-w>l
|
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
|
" 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>P :Files ~<cr>
|
nnoremap <silent> <leader>P :Files ~<cr>
|
||||||
nnoremap <silent> <leader>g :BCommits<cr>
|
nnoremap <silent> <leader>g :BCommits<cr>
|
||||||
@@ -23,35 +39,87 @@ nnoremap <silent> <leader>f :Rg<cr>
|
|||||||
nnoremap <silent> <leader>; :Buffers<cr>
|
nnoremap <silent> <leader>; :Buffers<cr>
|
||||||
|
|
||||||
|
|
||||||
" === Nerdtree shorcuts === "
|
" NERDTree
|
||||||
" <leader>e - Toggle NERDTree on/off
|
" <l>e - Toggle NERDTree on/off
|
||||||
" <leader>E - Opens current file location in NERDTree
|
" <l>E - Open current file location in NERDTree
|
||||||
nmap <leader>e :NERDTreeToggle<CR>
|
nnoremap <silent> <leader>e :NERDTreeToggle<cr>
|
||||||
nmap <leader>E :NERDTreeFind<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 === "
|
" coc.nvim
|
||||||
" <leader>y - Automatically remove trailing whitespace
|
" Ctrl-n - Go to previous diagnostic
|
||||||
nmap <leader>y :StripWhitespace<CR>
|
" 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 ==="
|
" Search shorcuts
|
||||||
" <leader>w - Easy-motion highlights first word letters bi-directionally
|
" <l>h - Find and replace
|
||||||
map <leader>w <Plug>(easymotion-bd-w)
|
" <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,206 +1,66 @@
|
|||||||
" ============================================================================ "
|
|
||||||
" === PLUGINS === "
|
|
||||||
" ============================================================================ "
|
|
||||||
call plug#begin('~/.config/nvim/plugged')
|
call plug#begin('~/.config/nvim/plugged')
|
||||||
|
|
||||||
" === Editor === "
|
" sensible defaults
|
||||||
|
|
||||||
" Sensible (?) defaults
|
|
||||||
Plug 'tpope/vim-sensible'
|
Plug 'tpope/vim-sensible'
|
||||||
|
|
||||||
" colorschemes
|
" colorscheme
|
||||||
Plug 'flazz/vim-colorschemes'
|
Plug 'chriskempson/base16-vim'
|
||||||
|
|
||||||
" dev icons
|
" dev icons
|
||||||
Plug 'ryanoasis/vim-devicons'
|
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 'scrooloose/nerdtree'
|
||||||
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
|
||||||
|
" {{{
|
||||||
" status line
|
|
||||||
Plug 'vim-airline/vim-airline'
|
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
|
||||||
|
|
||||||
" indent guides
|
|
||||||
Plug 'nathanaelkane/vim-indent-guides'
|
|
||||||
|
|
||||||
" DOcumentation GEneraton
|
|
||||||
Plug 'kkoomen/vim-doge'
|
|
||||||
|
|
||||||
" auto-close plugins
|
|
||||||
Plug 'rstacruz/vim-closer'
|
|
||||||
Plug 'tpope/vim-endwise'
|
|
||||||
|
|
||||||
" Improved motion in Vim
|
|
||||||
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 'tpope/vim-commentary'
|
|
||||||
|
|
||||||
" fzf
|
|
||||||
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
|
|
||||||
Plug 'junegunn/fzf.vim'
|
|
||||||
|
|
||||||
|
|
||||||
" === Languages === "
|
|
||||||
" Intellisense Engine
|
|
||||||
Plug 'neoclide/coc.nvim', {'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
|
" Show hidden files/directories
|
||||||
let g:NERDTreeShowHidden = 1
|
let g:NERDTreeShowHidden = 1
|
||||||
|
|
||||||
" Remove bookmarks and help text from NERDTree
|
" Remove bookmarks and help text from NERDTree
|
||||||
let g:NERDTreeMinimalUI = 1
|
let g:NERDTreeMinimalUI = 1
|
||||||
|
let g:NERDTreeMinimalMenu = 1
|
||||||
|
|
||||||
" Custom icons for expandable/expanded directories
|
" Remove icons for expandable/expanded directories
|
||||||
let g:NERDTreeDirArrowExpandable = ''
|
let g:NERDTreeDirArrowExpandable = ''
|
||||||
let g:NERDTreeDirArrowCollapsible = ''
|
let g:NERDTreeDirArrowCollapsible = ''
|
||||||
|
|
||||||
" Hide certain files and directories from NERDTree
|
" Hide certain files and directories from NERDTree
|
||||||
let g:NERDTreeIgnore = ['\.git$[[dir]]']
|
let g:NERDTreeIgnore = ['\.git$[[dir]]']
|
||||||
|
" }}}
|
||||||
|
|
||||||
let g:elm_setup_keybindings = 0
|
" status line
|
||||||
|
Plug 'vim-airline/vim-airline'
|
||||||
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
|
" Enable extensions
|
||||||
let g:airline_extensions = ['branch', 'hunks', 'coc']
|
let g:airline_extensions = ['branch', 'coc', 'hunks']
|
||||||
|
|
||||||
" 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) >
|
" Do not draw separators for empty sections (only for the active window) >
|
||||||
let g:airline_skip_empty_sections = 1
|
let g:airline_skip_empty_sections = 1
|
||||||
|
|
||||||
" Smartly uniquify buffers names with similar filename, suppressing common parts of paths.
|
" Smartly uniquify buffers names with similar filename, suppressing common parts of paths.
|
||||||
let g:airline#extensions#tabline#formatter = 'unique_tail'
|
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
|
||||||
|
|
||||||
" Custom setup that removes filetype/whitespace from default vim airline bar
|
" Custom setup that removes filetype/whitespace from default vim airline bar
|
||||||
let g:airline#extensions#default#layout = [['a', 'b', 'c'], ['x', 'z', 'warning', 'error']]
|
" let g:airline#extensions#default#layout = [['a', 'b', 'c'], ['x', 'z', 'warning', 'error']]
|
||||||
|
|
||||||
" Customize vim airline per filetype
|
" Customize vim airline per filetype
|
||||||
" 'nerdtree' - Hide nerdtree status line
|
" 'nerdtree' - Hide nerdtree status line
|
||||||
" 'list' - Only show file type plus current line number out of total
|
" 'list' - Only show file type plus current line number out of total
|
||||||
let g:airline_filetype_overrides = {
|
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', ''), '' ],
|
\ 'nerdtree': [ get(g:, 'NERDTreeStatusline', ''), '' ],
|
||||||
\ 'list': [ '%y', '%l/%L'],
|
\ 'list': [ '%y', '%l/%L'],
|
||||||
\ }
|
\ }
|
||||||
@@ -210,75 +70,85 @@ let g:airline_powerline_fonts = 1
|
|||||||
|
|
||||||
" Enable caching of syntax highlighting groups
|
" Enable caching of syntax highlighting groups
|
||||||
let g:airline_highlighting_cache = 1
|
let g:airline_highlighting_cache = 1
|
||||||
|
" }}}
|
||||||
|
|
||||||
" Define custom airline symbols
|
" Print function signatures in echo area
|
||||||
if !exists('g:airline_symbols')
|
Plug 'Shougo/echodoc.vim'
|
||||||
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
|
" Enable echodoc on startup
|
||||||
let g:echodoc#enable_at_startup = 1
|
let g:echodoc#enable_at_startup = 1
|
||||||
|
" }}}
|
||||||
|
|
||||||
" === vim-javascript === "
|
" start screen
|
||||||
" Enable syntax highlighting for JSDoc
|
Plug 'mhinz/vim-startify'
|
||||||
let g:javascript_plugin_jsdoc = 1
|
|
||||||
|
|
||||||
" === vim-jsx === "
|
" distraction-free typing
|
||||||
" Highlight jsx syntax even in non .jsx files
|
Plug 'junegunn/goyo.vim'
|
||||||
let g:jsx_ext_required = 0
|
Plug 'junegunn/limelight.vim'
|
||||||
|
|
||||||
" === javascript-libraries-syntax === "
|
" DOcumentation GEneraton
|
||||||
let g:used_javascript_libs = 'underscore,requirejs,chai,jquery'
|
Plug 'kkoomen/vim-doge'
|
||||||
|
|
||||||
" === Signify === "
|
" auto-close plugins
|
||||||
|
Plug 'rstacruz/vim-closer'
|
||||||
|
Plug 'tpope/vim-endwise'
|
||||||
|
|
||||||
|
" better motion
|
||||||
|
Plug 'easymotion/vim-easymotion'
|
||||||
|
Plug 'tpope/vim-surround'
|
||||||
|
Plug 'svermeulen/vim-subversive'
|
||||||
|
Plug 'godlygeek/tabular'
|
||||||
|
Plug 'tpope/vim-commentary'
|
||||||
|
|
||||||
|
" git tools
|
||||||
|
Plug 'mhinz/vim-signify'
|
||||||
|
" {{{
|
||||||
let g:signify_sign_delete = '-'
|
let g:signify_sign_delete = '-'
|
||||||
|
" }}}
|
||||||
|
Plug 'tpope/vim-fugitive'
|
||||||
|
|
||||||
|
" fzf
|
||||||
|
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-/']
|
||||||
|
|
||||||
" Fzf
|
|
||||||
let g:fzf_preview_window = 'right:60%'
|
|
||||||
let g:fzf_buffers_jump = 1
|
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_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_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}/*"'
|
let $FZF_DEFAULT_COMMAND = 'rg --files --ignore-case --hidden -g "!{.git,node_modules,vendor}/*"'
|
||||||
command! -bang -nargs=? -complete=dir Files
|
command! -bang -nargs=? -complete=dir Files
|
||||||
\ call fzf#vim#files(<q-args>, fzf#vim#with_preview(), <bang>0)
|
\ 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'}
|
||||||
|
|
||||||
" Call method on window enter
|
call plug#end()
|
||||||
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"
|
export PATH="$YARN_DIR/bin:$PATH"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
alias vim='nvim'
|
||||||
|
|||||||
@@ -7,7 +7,8 @@ if not_installed "nvm"; then
|
|||||||
printf "Installing nvm...\n"
|
printf "Installing nvm...\n"
|
||||||
|
|
||||||
# Install nvm
|
# 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"
|
"bash"
|
||||||
source "$NVM_DIR/nvm.sh"
|
source "$NVM_DIR/nvm.sh"
|
||||||
nvm alias default node
|
nvm alias default node
|
||||||
|
|||||||
@@ -85,7 +85,6 @@ export -f clean update upgrade install install_file add_ppa add_key run \
|
|||||||
# ---------------------------------------------------------------------------- #
|
# ---------------------------------------------------------------------------- #
|
||||||
# Shell colours
|
# Shell colours
|
||||||
# ---------------------------------------------------------------------------- #
|
# ---------------------------------------------------------------------------- #
|
||||||
|
|
||||||
C_BLACK='\033[0;30m'
|
C_BLACK='\033[0;30m'
|
||||||
C_DGRAY='\033[1;30m'
|
C_DGRAY='\033[1;30m'
|
||||||
C_RED='\033[0;31m'
|
C_RED='\033[0;31m'
|
||||||
|
|||||||
Reference in New Issue
Block a user