Skip to content

Instantly share code, notes, and snippets.

@bfulop
Last active March 21, 2019 16:06
Show Gist options
  • Save bfulop/f0995e5be149a4066e9c4f4f6660d9e0 to your computer and use it in GitHub Desktop.
Save bfulop/f0995e5be149a4066e9c4f4f6660d9e0 to your computer and use it in GitHub Desktop.
My init.vim
set nonumber
set ignorecase
set smartcase
" set relativenumber
set expandtab
set tabstop=2
set shiftwidth=2
set foldmethod=syntax
set nocompatible
set inccommand=nosplit
" needed for limelight on Gui apps
set termguicolors
filetype plugin on
set hidden
" set cmdheight=1
set signcolumn=no
set noshowmode
" set laststatus=2
" parcel hot module reload (?):
set backupcopy=yes
let g:vn_font = 'Hack'
let g:vn_font_size = 14
let g:vn_line_height = '1.5'
let $PATH .= ':/Users/bfulop/.nodenv/versions/11.11.0/bin/'
call plug#begin('~/config/.nvim/plugged')
Plug 'neoclide/coc.nvim', {'do': 'yarn install'}
Plug 'tmsvg/pear-tree'
Plug 'pangloss/vim-javascript'
Plug 'machakann/vim-highlightedyank'
Plug 'morhetz/gruvbox'
Plug 'wellle/targets.vim'
Plug 'tpope/vim-unimpaired'
Plug 'tpope/vim-projectionist'
Plug 'othree/csscomplete.vim'
Plug 'jsit/sasscomplete.vim'
" Plug 'othree/jsdoc-syntax.vim'
" Plug 'mustache/vim-mustache-handlebars'
" Plug 'othree/javascript-libraries-syntax.vim'
" Plug 'othree/es.next.syntax.vim'
Plug 'mattn/emmet-vim'
Plug 'prettier/vim-prettier', { 'do': 'npm install' }
Plug 'sheerun/vim-polyglot'
Plug 'plasticboy/vim-markdown'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-commentary'
" Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
" Plug 'junegunn/fzf.vim'
" Plug 'Shougo/denite.nvim'
Plug 'yuttie/comfortable-motion.vim'
Plug 'junegunn/limelight.vim'
Plug 'itchyny/lightline.vim'
Plug 'aereal/vim-colors-japanesque'
Plug 'AlessandroYorba/Despacio'
Plug 'BrainDeath0/Hypsteria'
Plug 'yuttie/inkstained-vim'
Plug 'vim-scripts/Sift'
Plug 'equalsraf/neovim-gui-shim'
Plug 'akiyosi/gonvim-fuzzy'
" Plug 'metakirby5/codi.vim'
call plug#end()
" Pear tree don't erase temporarly the closing brackets
let g:pear_tree_repeatable_expand = 0
" Lightline config for narrow windows
let g:lightline = {
\ 'colorscheme': 'inkstained',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
\ ['buffernum', 'cocstatus', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component': {
\ 'buffernum': 'b:%n'
\ },
\ 'component_function': {
\ 'fileformat': 'LightlineFileformat',
\ 'filetype': 'LightlineFiletype',
\ 'cocstatus': 'coc#status'
\ },
\ }
function! LightlineFileformat()
return winwidth(0) > 100 ? &fileformat : ''
endfunction
function! LightlineFiletype()
return winwidth(0) > 100 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
endfunction
" autocmd BufNewFile,BufRead *.js set filetype=javascript
" let g:jsx_ext_required = 1
" autocmd FileType css,sass,scss,Scss setlocal omnifunc=sasscomplete#CompleteSass noci
set background=light
colorscheme my-inkstained
let g:comfortable_motion_scroll_down_key = "j"
let g:comfortable_motion_scroll_up_key = "k"
let g:prettier#exec_cmd_path = "/usr/local/bin/prettier"
nnoremap gp :silent %!prettier --stdin --stdin-filepath % --trailing-comma all --single-quote<CR>
" Limelight start on startup
autocmd VimEnter * Limelight
" Color name (:help cterm-colors) or ANSI code
" let g:limelight_conceal_ctermfg = 'gray'
" let g:limelight_conceal_ctermfg = 240
" " Color name (:help gui-colors) or RGB color
" let g:limelight_conceal_guifg = 'DarkGray'
" let g:limelight_conceal_guifg = '#777777'
" CoC completion setup
" Shortcuts for coc nvim interface
" Show symbols of current buffer
nnoremap <silent> sl :<C-u>CocList<cr>
" Remap for rename current word
nmap <leader>sr <Plug>(coc-rename)
" Remap keys for gotos
nmap <silent> sd <Plug>(coc-definition)
" nmap <silent> gy <Plug>(coc-type-definition)
nmap <silent> si <Plug>(coc-implementation)
nmap <silent> sf <Plug>(coc-references)
" Search symbols of current workspace
" nnoremap <silent> <space>t :<C-u>Denite coc-workspace<cr>
" " Show diagnostics of current workspace
" nnoremap <silent> <space>a :<C-u>Denite coc-diagnostic<cr>
" " Show available commands
" nnoremap <silent> <space>c :<C-u>Denite coc-command<cr>
" " Show available services
" nnoremap <silent> <space>s :<C-u>Denite coc-service<cr>
" " Show links of current buffer
" nnoremap <silent> <space>l :<C-u>Denite coc-link<cr>
" Change file/rec command.
" call denite#custom#var('file/rec', 'command',
" \ ['ag', '--follow', '--nocolor', '--nogroup', '-g', ''])
" " Note: It is slower than ag
" call denite#custom#var('file/rec', 'command',
" \ ['rg', '--files', '--glob', '!.git'])
" Ag command on grep source
" call denite#custom#var('grep', 'command', ['ag'])
" call denite#custom#var('grep', 'default_opts',
" \ ['-i', '--vimgrep'])
" call denite#custom#var('grep', 'recursive_opts', [])
" call denite#custom#var('grep', 'pattern_opt', [])
" call denite#custom#var('grep', 'separator', ['--'])
" call denite#custom#var('grep', 'final_opts', [])
" Denite show command history
" nnoremap <leader>t :<C-u>Denite command_history<cr>
" Projectionist jump to alternate file
nnoremap <leader>d :A <CR>
" Turn on JS syntax folding
augroup twig_folding
au!
au FileType html.twig setlocal foldmethod=indent
augroup END
" Prettier Config
" print semicolons
" Prettier default: true
let g:prettier#config#semi = 'false'
" single quotes over double quotes
" Prettier default: false
let g:prettier#config#single_quote = 'true'
" print spaces between brackets
" Prettier default: true
let g:prettier#config#bracket_spacing = 'true'
" Prettier default: none
let g:prettier#config#trailing_comma = 'none'
" Emmet change leader key
let g:user_emmet_leader_key = '<leader>a'
" projectionist
let g:projectionist_heuristics = {
\ "src/*.js": {
\ "type": "source",
\ "alternate": "src/{}.test.js"
\ },
\ "src/*.test.js": {
\ "type": "test",
\ "alternate": "src/{}.js"
\ }
\ }
" nno <silent> ,f :GonvimFuzzyFiles<cr>
" nno <silent> ,e :Veonim explorer<cr>
" nno <silent> ,b :GonvimFuzzyBuffers<cr>
" nno <silent> ,d :Veonim change-dir<cr>
" nno <silent> <space>fa :Veonim grep<cr>
" nno <silent> <space>fa :GonvimFuzzyAg<cr>
" nno <silent> <space>fb :Veonim buffer-search<cr>
" nno <silent> <space>fb :GonvimFuzzyBLines<cr>
" nno <silent> <space>ff :GonvimFuzzyBuffers<cr>
" nno <silent> <c-t>p :call Veonim('vim-create-dir', g:vn_project_root)<cr>
" nno <silent> <c-t>p :GonvimWorkspaceNew<cr>
" nno <silent> ,r :call Veonim('change-dir', g:vn_project_root)<cr>
" " multiplexed vim instance management
" nno <silent> <c-t>c :Veonim vim-create<cr>
" nno <silent> <c-g> :Veonim vim-switch<cr>
" nno <leader>b <c-g> :GonvimWorkspaceSwitch<cr>
" nno <leader>b :GonvimWorkspaceNext<cr>
" nno <leader>j :GonvimWorkspacePrevious<cr>
" nno <silent> <c-t>, :Veonim vim-rename<cr>
" let g:gonvim_fuzzy_ag_cmd = 'pt --nogroup --column --nocolor'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment