Skip to content

Instantly share code, notes, and snippets.

@christalib

christalib/init.vim

Last active Aug 16, 2020
Embed
What would you like to do?
nvim configuration
let mapleader=","
call plug#begin()
" colorschemes
Plug 'ayu-theme/ayu-vim'
Plug 'logico/typewriter-vim'
Plug 'rafalbromirski/vim-aurora'
Plug 'sainnhe/sonokai'
" syntax helpers
Plug 'jparise/vim-graphql'
Plug 'mxw/vim-jsx'
Plug 'styled-components/vim-styled-components', { 'branch': 'main' }
" linters
Plug 'dense-analysis/ale'
" code
Plug 'fatih/vim-go', {'do': ':GoInstallBinaries'}
Plug 'pangloss/vim-javascript'
Plug 'sebdah/vim-delve'
" helpers
Plug 'jiangmiao/auto-pairs'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'junegunn/goyo.vim'
Plug 'mattn/emmet-vim'
Plug 'psliwka/vim-smoothie'
Plug 'scrooloose/nerdcommenter'
Plug 'scrooloose/nerdtree'
Plug 'tpope/vim-surround'
Plug 'camspiers/animate.vim'
" git
Plug 'airblade/vim-gitgutter'
Plug 'itchyny/vim-gitbranch'
Plug 'junegunn/gv.vim'
Plug 'tpope/vim-fugitive'
call plug#end()
set termguicolors " enable true colors support
" let ayucolor="mirage"
" colorscheme ayu
let g:sonokai_style = 'atlantis'
let g:sonokai_enable_italic = 0
let g:sonokai_disable_italic_comment = 1
colorscheme sonokai
set cursorline
set autoindent
set autoread
set backspace=indent,eol,start
set clipboard=unnamedplus
set complete-=i
set completeopt+=noselect
set confirm
set expandtab
set hidden
set hlsearch
set incsearch
"set laststatus=2
set mouse+=a
set nobackup
"set noshowmode
set nu
set ruler
set shiftwidth=4
set smartindent
set smarttab
set so=10
set softtabstop=4
set tabstop=4
set textwidth=80
set title
set updatetime=100
set wildmenu
set wrap
filetype plugin on
set omnifunc=ale#completion#OmniFunc
" set virtualedit=all
map <Leader>, :w<CR>
inoremap <Leader>, <ESC>:w<CR>i
map <C-J> <C-W><C-J>
map <C-K> <C-W><C-K>
map <C-L> <C-W><C-L>
map <C-H> <C-W><C-H>
map <Leader>[ :bprevious<CR>
map <Leader>] :bnext<CR>
map <Leader>l :buffers list<CR>
inoremap <Leader>F <ESC>:FZF<CR>
nnoremap <Leader>F <ESC>:FZF<CR>
inoremap <Leader>G <ESC>:Rg<CR>
nnoremap <Leader>G :Rg<CR>
map <Leader>k :NERDTreeToggle <CR>
"let NERDTreeQuitOnOpen = 1
inoremap jj <ESC>:w<CR>
inoremap kk <ESC>:w<CR>
map <F7> gg=G<C-o><C-o>
nnoremap <C-n> :norm
map <silent> <C-n> <Plug>(ale_previous_wrap)
map <silent> <C-m> <Plug>(ale_next_wrap)
map <F4> :noh<CR>
map <leader>a :cclose <bar> lclose <bar> pclose<CR>
map <leader>s <C-w>s<CR><C-w><C-J>:term<CR>i
map <leader>v <C-w>v<CR><C-w><C-L>:term<CR>i
map <leader>~ :set spell spelllang=en_gb<CR>
let g:user_emmet_mode='a'
let g:user_emmet_leader_key='<Tab>'
let g:user_emmet_settings= {
\ 'javascript.jsx' : {
\ 'extends': 'jsx',
\ },
\}
" These mappings will make it so that going to the next one in a search will
" center on the line it's found in.
nnoremap n nzzzv
nnoremap N Nzzzv
" Set this variable to 1 to fix files when you save them.
let g:ale_fixers = {
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
\ 'css': ['prettier', 'stylelint'],
\ 'javascript': ['eslint', 'prettier'],
\ 'python': ['isort', 'black'],
\ 'HTML': ['HTMLHint', 'proselint'],
\ 'ruby': ['rubocop'],
\ 'go': ['gofmt', 'goimports'],
\}
let g:ale_linters = {
\ 'go': ['staticcheck'],
\ 'ruby': ['solargraph'],
\}
let g:ale_fix_on_save = 1
let g:go_highlight_structs = 1
let g:go_highlight_interfaces = 1
let g:go_highlight_methods = 1
let g:go_highlight_functions = 1
let g:go_highlight_operators = 1
let g:go_highlight_build_constraints = 1
let g:go_highlight_extra_types = 1
let g:go_highlight_function_parameters = 1
let g:go_highlight_function_calls = 1
let g:go_highlight_types = 1
let g:go_hightlight_fields = 1
let g:go_highlight_generate_tags = 1
let g:go_highlight_variable_declarations = 1
let g:go_highlight_variable_assignments = 1
let g:go_addtags_transform = "camelcase"
" nerdCommenter
let g:NERDSpaceDelims = 1
let g:NERDCompactSexyComs = 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.