Skip to content

Instantly share code, notes, and snippets.

@prkstaff
Last active October 26, 2022 20:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prkstaff/f0048f800aa1010d0e5f6a32d123a552 to your computer and use it in GitHub Desktop.
Save prkstaff/f0048f800aa1010d0e5f6a32d123a552 to your computer and use it in GitHub Desktop.
My Init.vim
" close buffer without closing window using leader q
map <leader>q :bp<bar>sp<bar>bn<bar>bd<CR>
" nice indent for yaml files:
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
"
" nice indent for html files:
autocmd FileType html setlocal ts=2 sts=2 sw=2 expandtab
" spell checks
setlocal spell spelllang=en_us,pt_br
autocmd FileType yaml,json,vim setlocal nospell
" enable undo even after closing buffers
set undofile
call plug#begin('~/.vim/plugged')
" vscode plugins
" be sure to have npm and node inside your distro
Plug 'neoclide/coc.nvim', {'branch': 'release'}
" Plugins to install with coc:
" python: coc-pyright
" json: coc-json
" yaml: coc-yaml
" docker: coc-docker
" tag management
Plug 'preservim/tagbar'
" Paper Color theme
Plug 'NLKNguyen/papercolor-theme'
" undo diff tool
Plug 'mbbill/undotree'
" status bar
Plug 'vim-airline/vim-airline'
" lint
Plug 'dense-analysis/ale'
" html development, I commented it because it was lagging autocomplete with ctrl+y
" expand key: <ctrl-y> and then ,
" Plug 'mattn/emmet-vim'
" Telescope
Plug 'nvim-lua/plenary.nvim'
Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' }
" Find files using Telescope command-line sugar.
nnoremap <leader>ff <cmd>Telescope find_files<cr>
nnoremap <leader>fg <cmd>Telescope live_grep<cr>
nnoremap <leader>fb <cmd>Telescope buffers<cr>
nnoremap <leader>fh <cmd>Telescope help_tags<cr>
" terraform
Plug 'hashivim/vim-terraform'
" Git
Plug 'tpope/vim-fugitive'
" Wiki
Plug 'vimwiki/vimwiki'
call plug#end()
" pip install vimwiki-markdown
let g:vimwiki_list = [{
\ 'path': '~/vimwiki',
\ 'template_path': '~/vimwiki/templates/',
\ 'template_default': 'default',
\ 'syntax': 'markdown',
\ 'ext': '.md',
\ 'path_html': '/home/rprado/Insync/prkstaff@gmail.com/Google Drive/VIMWIKI/',
\ 'custom_wiki2html': 'vimwiki_markdown',
\ 'template_ext': '.tpl'}]
" Turn on PaperColor theme
set background=dark
colorscheme PaperColor
" set line numbers
set number
" toggle undo history using leader h
nnoremap <leader>h :UndotreeToggle<CR>
" set netrw default size
let g:netrw_winsize = 20
" enable netrw in tree view
let g:netrw_liststyle=3
" Netrw open in side
map <leader>n :Explore<CR>
" Tagbar Toggle
nmap <leader>t :TagbarToggle<CR>
" Will add 4 spaces when >> and 4 spaces when tab
set tabstop=4 shiftwidth=4 expandtab
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment