Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- "" neovim-settings
- " Setting tabs to 2 spaces
- "
- set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
- set number
- "" bind ALT + direction keys to switch windows
- nmap <silent> <M-k> :wincmd k<CR>
- nmap <silent> <M-j> :wincmd j<CR>
- nmap <silent> <M-h> :wincmd h<CR>
- nmap <silent> <M-l> :wincmd l<CR>
- "" Binds space to esc
- nnoremap <C-Space> i
- inoremap <C-Space> <Esc>
- "" Plugins
- call plug#begin('~/.local/share/nvim/plugged')
- Plug 'scrooloose/nerdtree' " File-tree
- Plug 'jiangmiao/auto-pairs' " Auto-pairing brackets
- Plug 'mattn/emmet-vim' " Emmet
- Plug 'pangloss/vim-javascript' " JavaScript syntax-highlighting
- Plug 'mxw/vim-jsx' " JSX syntax-highlighting
- Plug 'alampros/vim-styled-jsx' " Emmet-snippets for style-jsx
- Plug 'w0rp/ale' " Linter
- Plug 'SirVer/ultisnips' " Snippetsmanager
- Plug 'honza/vim-snippets' " Snippets to go with ultisnips
- Plug 'ervandew/supertab' " Tool to make tab usable between plugins
- Plug 'wokalski/autocomplete-flow' " Enables tab completion for everything, blazing fast
- " post install (yarn install | npm install) then load plugin only for editing supported files
- Plug 'prettier/vim-prettier', {
- \ 'do': 'yarn install',
- \ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] }
- Plug 'vim-airline/vim-airline' " Theme for status bar etc
- Plug 'vim-airline/vim-airline-themes' " Additional themes for airline
- Plug 'edkolev/tmuxline.vim' " tmux-line, gives TMUX airline-theme
- Plug 'ryanoasis/vim-devicons' " Devicons <3
- Plug 'Valloric/YouCompleteMe' " Snippets
- call plug#end()
- """ AutocompleteFlow settings
- let g:autocomplete_flow#insert_paren_after_function = 0
- """ Nerdtree settings
- " Set nerdtree to open when nvim opens
- autocmd vimenter * NERDTree
- " Set nerdtree to open, even if no filename was specified
- autocmd StdinReadPre * let s:std_in=1
- autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
- " Exit vim if nerdtree is the only window open
- autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
- " NERDTree File highlighting
- map <C-M-O> :NERDTreeToggle<CR>
- function! NERDTreeHighlightFile(extension, fg, bg, guifg, guibg)
- exec 'autocmd filetype nerdtree highlight ' . a:extension .' ctermbg='. a:bg .' ctermfg='. a:fg .' guibg='. a:guibg .' guifg='. a:guifg
- exec 'autocmd filetype nerdtree syn match ' . a:extension .' #^\s\+.*'. a:extension .'$#'
- endfunction
- call NERDTreeHighlightFile('jade', 'green', 'none', 'green', '#151515')
- call NERDTreeHighlightFile('ini', 'yellow', 'none', 'yellow', '#151515')
- call NERDTreeHighlightFile('md', 'blue', 'none', '#3366FF', '#151515')
- call NERDTreeHighlightFile('yml', 'yellow', 'none', 'yellow', '#151515')
- call NERDTreeHighlightFile('config', 'yellow', 'none', 'yellow', '#151515')
- call NERDTreeHighlightFile('conf', 'yellow', 'none', 'yellow', '#151515')
- call NERDTreeHighlightFile('json', 'yellow', 'none', 'yellow', '#151515')
- call NERDTreeHighlightFile('html', 'yellow', 'none', 'yellow', '#151515')
- call NERDTreeHighlightFile('styl', 'cyan', 'none', 'cyan', '#151515')
- call NERDTreeHighlightFile('css', 'cyan', 'none', 'cyan', '#151515')
- call NERDTreeHighlightFile('coffee', 'Red', 'none', 'red', '#151515')
- call NERDTreeHighlightFile('js', 'Red', 'none', '#ffa500', '#151515')
- call NERDTreeHighlightFile('php', 'Magenta', 'none', '#ff00ff', '#151515')
- """ emmet-vim settings
- " Makes it pleasant to use with jsx files
- let g:user_emmet_settings = {
- \ 'javascript.jsx' : {
- \ 'extends' : 'jsx',
- \ },
- \}
- """ ale settings
- " some tweaks to make it less agressive
- let g:ale_sign_error = '●' " Less aggressive than the default '>>'
- let g:ale_sign_warning = '.'
- let g:ale_lint_on_enter = 0 " Less distracting when opening a new file
- let g:ale_lint_on_save = 1
- let g:ale_lint_on_text_changed = 0
- """ prettier settings
- let g:prettier#quickfix_enabled = 0 " Disable quickfix
- let g:prettier#quickfix_auto_focus = 0 " Disables focus on quickfix ( Might be overkill )
- let g:prettier#autoformat = 0 " Stops formatting, triggering async-formatting in command below
- autocmd BufWritePre *.js,*.jsx,*.mjs,*.ts,*.tsx,*.css,*.less,*.scss,*.json,*.graphql,*.md,*.vue,*.yaml,*.html PrettierAsync
- let g:prettier#config#semi = 'true' " Disables auto-insert of ;
- let g:prettier#config#single_quote = 'true' " Changes doublequotes to singles on format
- let g:prettier#config#trailing_comma = 'none' " disable auto-insert comma's
- let g:prettier#config#config_precedence = 'prefer-file'
- """ Ultisnips settings
- let g:UltiSnipsSnippetDirectories = ['/home/kjetil/Documents/Configs/UltiSnips', 'UltiSnips']
- "" better key bindings for UltiSnipsExpandTrigger
- let g:UltiSnipsExpandTrigger = "<tab>"
- let g:UltiSnipsJumpForwardTrigger = "<tab>"
- let g:UltiSnipsJumpBackwardTrigger = "<s-tab>"
- """ Vim-airline settings
- let g:airline_powerline_fonts = 1
- let g:airline_theme='murmur'
- """ YCM settings
- " make YCM compatible with UltiSnips (using supertab)
- let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
- let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
- let g:SuperTabDefaultCompletionType = '<C-n>'
- if exists("g:loaded_webdevicons")
- call webdevicons#refresh()
- endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement