Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """""""""""""""""""
- " NEOVIM SETTINGS "
- """""""""""""""""""
- set nocompatible
- set encoding=UTF-8
- syntax on
- filetype on
- filetype plugin on
- filetype indent on
- set copyindent " copy the previous indentation on autoindenting
- "" Detect line endings, but prefer Unix endings
- set fileformats=unix,dos,mac
- "" Default formatting when not detected
- "set autoindent smartindent softtabstop=4 tabstop=4 shiftwidth=4
- set autoindent softtabstop=4 tabstop=4 shiftwidth=4
- """ Default to spaces when not detected
- set expandtab
- "" Features
- set number
- set backspace=eol,start,indent
- set whichwrap+=<,>,h,l,[,]
- set colorcolumn=80
- "set cursorline " Slow
- set completeopt=longest,menuone " Preview mode causes flickering
- "" Match braces
- "set showmatch
- "set matchtime=2
- " Kepp lines above or below the cursor at all times
- set scrolloff=5
- "" Increase command height for echodoc
- "set cmdheight=2
- "" Wildmode
- set wildmenu
- set wildmode=list:longest,full
- "" Hide buffers when abandoned
- set hidden
- "" Regex settings
- set ignorecase
- set smartcase
- set hlsearch
- set incsearch
- "" Folds
- set foldmethod=indent
- set foldnestmax=3
- "" Graphical
- set termguicolors
- "set lazyredraw
- "" Use system clipboard
- "set clipboard
- """"""""""""""""
- " LOAD PLUGINS "
- """"""""""""""""
- call plug#begin('~/.config/nvim/plugged')
- "" Modules
- Plug 'w0rp/ale'
- Plug 'scrooloose/nerdtree'
- Plug 'vim-airline/vim-airline'
- Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
- Plug 'farmergreg/vim-lastplace'
- Plug 'sirver/ultisnips'
- Plug 'honza/vim-snippets'
- Plug 'airblade/vim-gitgutter'
- Plug 'ap/vim-css-color'
- Plug 'Chiel92/vim-autoformat'
- Plug 'tpope/vim-surround'
- "Plug 'Shougo/echodoc.vim'
- Plug 'tpope/vim-sleuth'
- Plug 'jiangmiao/auto-pairs'
- Plug 'autozimu/LanguageClient-neovim', {
- \ 'branch': 'next',
- \ 'do': 'bash install.sh',
- \ }
- Plug 'tpope/vim-sensible'
- Plug 'editorconfig/editorconfig-vim'
- Plug 'junegunn/fzf', { 'do': './install --bin' }
- Plug 'junegunn/fzf.vim'
- "" Syntax / File Support
- Plug 'sheerun/vim-polyglot'
- Plug 'JulesWang/css.vim'
- "" Autocompletion
- Plug 'carlitux/deoplete-ternjs', { 'for': ['javascript', 'javascript.jsx'] }
- Plug 'ternjs/tern_for_vim', { 'for': ['javascript', 'javascript.jsx'] }
- Plug 'othree/jspc.vim', { 'for': ['javascript', 'javascript.jsx'] }
- Plug 'Shougo/neoinclude.vim'
- Plug 'Shougo/neco-vim'
- Plug 'othree/csscomplete.vim'
- Plug 'othree/html5.vim'
- Plug 'othree/xml.vim'
- Plug 'lvht/phpcd.vim', { 'for': 'php', 'do': 'composer install' }
- "" Themes
- Plug 'ayu-theme/ayu-vim'
- Plug 'rakr/vim-one'
- Plug 'ryanoasis/vim-devicons'
- Plug 'Yggdroot/indentLine'
- call plug#end()
- let g:plugs_shallow = 1
- """"""""""
- " THEMES "
- """"""""""
- "" Colorscheme
- let ayucolor="dark"
- set background=dark
- colorscheme ayu
- let g:one_allow_italics = 1
- "" This will repair colors in Tmux.
- let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum"
- let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum"
- set signcolumn=yes
- set numberwidth=5
- set timeoutlen=1000
- set ttimeoutlen=0
- set noshowmode
- set nofoldenable
- set mouse=a
- set switchbuf=usetab,newtab
- set autoread
- au FocusGained,BufEnter * :checktime
- "" Airline
- let g:airline_theme = 'ayu'
- let g:airline_powerline_fonts = 1
- let g:airline#extensions#tabline#enabled = 1
- let g:airline#extensions#ale#enabled = 1
- "let g:airline_skip_empty_sections = 1
- if !exists('g:airline_symbols')
- let g:airline_symbols = {}
- endif
- let g:airline_mode_map = {
- \ '__' : '-',
- \ 'c' : 'C',
- \ 'i' : 'I',
- \ 'ic' : 'I',
- \ 'ix' : 'I',
- \ 'n' : 'N',
- \ 'ni' : 'N',
- \ 'no' : 'N',
- \ 'R' : 'R',
- \ 'Rv' : 'R',
- \ 's' : 'S',
- \ 'S' : 'S',
- \ '' : 'S',
- \ 't' : 'T',
- \ 'v' : 'V',
- \ 'V' : 'V',
- \ '' : 'V',
- \ }
- "call airline#parts#define_accent('mode', 'none')
- "" Indent Lines
- let g:indentLine_char = '▏'
- let g:indentLine_first_char = '▏'
- let g:indentLine_showFirstIndentLevel = 1
- let g:indentLine_setColors = 0
- let g:indentLine_color_term = 255
- "let g:indentline_setconceal = 0
- "let g:indentline_conceallevel = 1
- "let g:indentline_concealcursor = ''
- """"""""""""
- " NERDTREE "
- """"""""""""
- let NERDTreeShowHidden = 1
- let NERDTreeMinimalUI = 1
- let NERDTreeAutoDeleteBuffer = 1
- let g:NERDTreeDirArrowExpandable = '' " '▶'
- let g:NERDTreeDirArrowCollapsible = '' " '▼'
- autocmd StdinReadPre * let s:std_in=1
- " Open NERDTree when no files specified
- autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
- " Open NERDTree when opening a directory
- autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | endif
- " Close vim if the only window left open is NERDTree
- autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
- map <C-n> :NERDTreeToggle<CR>
- """"""""""""
- " DEOPLETE "
- """"""""""""
- let g:deoplete#enable_at_startup = 1
- ""Deoplete per-autocompleter settings
- """ TernJS
- let g:tern_request_timeout = 1
- let g:deoplete#sources#ternjs#depths = 1
- let g:deoplete#sources#ternjs#types = 1
- let g:deoplete#sources#ternjs#docs = 1
- let g:tern#command = ["tern"]
- let g:tern#arguments = ["--persistent"]
- """ PHP
- let g:deoplete#ignore_sources = get(g:, 'deoplete#ignore_sources', {})
- let g:deoplete#ignore_sources.php = ['omni']
- """ Omnifunctions
- let g:deoplete#omni#functions = {}
- let g:deoplete#omni#functions.javascript = [
- \ 'tern#Complete',
- \ 'jspc#omni',
- \ 'javascriptcomplete#CompleteJS'
- \]
- let g:deoplete#omni#functions.css = 'csscomplete#CompleteCSS'
- let g:deoplete#omni#functions.html = [
- \ 'htmlcomplete#CompleteTags',
- \ 'xmlcomplete#CompleteTags'
- \]
- let g:deoplete#omni#functions.xml = 'xmlcomplete#CompleteTags'
- "let g:deoplete#omni#functions.php = 'phpcd#CompletePHP'
- """"""""""""""""""""
- " LANGUAGE SERVERS "
- """"""""""""""""""""
- "let g:LanguageClient_serverCommands = {
- " \ 'javascript': ['javascript-typescript-stdio'],
- " \ 'vue': ['vls'],
- " \ }
- "nnoremap <F5> :call LanguageClient_contextMenu()<CR>
- "nnoremap <silent> K :call LanguageClient#textDocument_hover()<CR>
- "nnoremap <silent> gd :call LanguageClient#textDocument_definition()<CR>
- "nnoremap <silent> <F2> :call LanguageClient#textDocument_rename()<CR>
- """""""
- " ALE "
- """""""
- let g:ale_set_highlights = 0
- let g:ale_sign_error = '' " Less aggressive than the default '>>'
- let g:ale_sign_warning = ''
- let g:ale_linters = {
- \ 'javascript': ['standard'],
- \ 'php': ['php'],
- \}
- let g:ale_fixers = {'javascript': ['standard']}
- let g:ale_php_phpcs_standard = 'PSR2'
- let g:ale_linters_explicit = 1
- hi ALEWarningSign ctermfg=yellow ctermbg=none guifg=#FFEB3B guibg=none
- hi ALEErrorSign ctermfg=red ctermbg=none guifg=#F44336 guibg=none
- """""""""""""
- " ULTISNIPS "
- """""""""""""
- """""""""""""""""""""""""""""""""""""
- " SUPERTAB (AND COMPLETION HOTKEYS) "
- """""""""""""""""""""""""""""""""""""
- let g:SuperTabDefaultCompletionType = '<C-x><C-o>'
- let g:UltiSnipsExpandTrigger = '<C-j>'
- " Map Tab and Enter to autocompletion
- inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
- inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<CR>"
- """""""""""""""""""""""""
- " SYNTAX / FILE SUPPORT "
- """""""""""""""""""""""""
- "" Enable JSDoc syntax highlighting
- let g:javascript_plugin_jsdoc = 1
- let g:vue_disable_pre_processors=1
- autocmd FileType vue syntax sync fromstart
- nnoremap <C-p> :Files<CR>
- let g:AutoPairsFlyMode = 1
- let g:vim_json_syntax_conceal = 0
- let g:enable_bold_font = 1
- let g:enable_italic_font = 1
- " Customize fzf colors to match your color scheme
- let g:fzf_colors =
- \ { 'fg': ['fg', 'Normal'],
- \ 'bg': ['bg', 'Normal'],
- \ 'hl': ['fg', 'Comment'],
- \ 'fg+': ['fg', 'CursorLine', 'CursorColumn', 'Normal'],
- \ 'bg+': ['bg', 'CursorLine', 'CursorColumn'],
- \ 'hl+': ['fg', 'Statement'],
- \ 'info': ['fg', 'PreProc'],
- \ 'border': ['fg', 'Ignore'],
- \ 'prompt': ['fg', 'Conditional'],
- \ 'pointer': ['fg', 'Exception'],
- \ 'marker': ['fg', 'Keyword'],
- \ 'spinner': ['fg', 'Label'],
- \ 'header': ['fg', 'Comment'] }
- autocmd! FileType fzf
- autocmd FileType fzf set laststatus=0 noruler
- \| autocmd BufLeave <buffer> set laststatus=2 ruler
- let g:WebDevIconsUnicodeDecorateFolderNodes = 1
- "let g:WebDevIconsUnicodeDecorateFolderNodeDefaultSymbol = ''
- "let g:WebDevIconsNerdTreeAfterGlyphPadding = ' '
- let g:jsx_ext_required = 0
- let g:mta_filetypes = {
- \ 'javascript.jsx' : 1,
- \}
- set shortmess=a
- let g:formatdef_standard = '"standard --fix"'
- let g:formatters_javascript = ['standard']
- "remove trailing whitespaces on save
- autocmd BufWritePre * %s/\s\+$//e
- " Use ctrl-[hjkl] to select the active split!
- nmap <silent> <c-k> :wincmd k<CR>
- nmap <silent> <c-j> :wincmd j<CR>
- nmap <silent> <c-h> :wincmd h<CR>
- nmap <silent> <c-l> :wincmd l<CR>
- map <F9> :bprevious<CR>
- map <F10> :bnext<CR>
- noremap <F3> :Autoformat<CR>
- "set guicursor=n-v-c:block-Cursor/lCursor-blinkon0,i-ci:ver25-Cursor/lCursor,r-cr:hor20-Cursor/lCursor
- set guicursor=n-v-c-sm:block-blinkon500,i-ci-ve:ver25-blinkon500,r-cr-o:hor20
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement