Skip to content

Instantly share code, notes, and snippets.

@leonascimento
Created August 17, 2018 11:28
Show Gist options
  • Save leonascimento/59e97d595da3ae8dce743201d68156f4 to your computer and use it in GitHub Desktop.
Save leonascimento/59e97d595da3ae8dce743201d68156f4 to your computer and use it in GitHub Desktop.
my vimrc
" ----------------------CONFIGURE PREFERENCES---------------------------
" Showing line numbers
set number
" Enable mouse on vim
set mouse=a
" Disabling swap files creation in vim
set noswapfile
set autoindent
filetype plugin indent on
autocmd Filetype php setlocal sts=4 sw=4 expandtab
autocmd Filetype blade setlocal sts=2 sw=2 expandtab
autocmd Filetype perl setlocal sts=4 sw=4 expandtab
autocmd Filetype sh setlocal sts=4 sw=4 expandtab
autocmd Filetype javascript setlocal sts=2 sw=2 expandtab
autocmd Filetype sql setlocal sts=2 sw=2 expandtab
autocmd Filetype lua setlocal sts=2 sw=2 expandtab
autocmd Filetype haskell setlocal sts=2 sw=2 expandtab
autocmd Filetype scss setlocal sts=2 sw=2 expandtab
autocmd Filetype html setlocal sts=2 sw=2 expandtab
autocmd Filetype python setlocal sts=4 sw=4 expandtab
autocmd Filetype c setlocal sts=4 sw=4 expandtab
autocmd Filetype ruby setlocal sts=2 sw=2 expandtab
autocmd Filetype vcl setlocal sts=4 sw=4 expandtab
autocmd Filetype json setlocal sts=2 sw=2 expandtab
autocmd Filetype erb setlocal sts=4 sw=4 expandtab
" ----------------------CONFIGURE Plugins---------------------------
" -------------------------------------------------
" Pathogen
execute pathogen#infect()
syntax on
filetype plugin indent on
" -------------------------------------------------
" -------------------------------------------------
" Nerd Tree key map
map <C-n> :NERDTreeToggle<CR>
" -------------------------------------------------
" -------------------------------------------------
" Ctrl P plugin
let g:ctrlp_map = '<c-p>'
let g:ctrlp_cmd = 'CtrlP'
set runtimepath^=~/.vim/bundle/ctrlp.vim
" -------------------------------------------------
" -------------------------------------------------
" NERD COMMENTER
" Add spaces after comment delimiters by default
let g:NERDSpaceDelims = 1
" -------------------------------------------------
" -------------------------------------------------
" Setting onedark theme
" syntax on
"colorscheme onedark
" let g:airline_theme='onedark'
"let g:onedark_termcolors=256
set tabstop=2 softtabstop=0 expandtab shiftwidth=2 smarttab
"Use 24-bit (true-color) mode in Vim/Neovim when outside tmux.
"If you're using tmux version 2.2 or later, you can remove the outermost $TMUX check and use tmux's 24-bit color support
"(see < http://sunaku.github.io/tmux-24bit-color.html#usage > for more information.)
if (empty($TMUX))
if (has("nvim"))
"For Neovim 0.1.3 and 0.1.4 < https://github.com/neovim/neovim/pull/2198 >
let $NVIM_TUI_ENABLE_TRUE_COLOR=1
endif
"For Neovim > 0.1.5 and Vim > patch 7.4.1799 < https://github.com/vim/vim/commit/61be73bb0f965a895bfb064ea3e55476ac175162 >
"Based on Vim patch 7.4.1770 (`guicolors` option) < https://github.com/vim/vim/commit/8a633e3427b47286869aa4b96f2bfc1fe65b25cd >
" < https://github.com/neovim/neovim/wiki/Following-HEAD#20160511 >
if (has("termguicolors"))
set termguicolors
endif
endif
" -------------------------------------------------
" -------------------------------------------------
"Emment plugin
" the key map is <ctrl + y> after ,"
let g:user_emment_install_global=0
autocmd FileType html,css EmmentInstaler
let g:user__emmet_leader_key='<C-Y>'
" Tutorial https://raw.githubusercontent.com/mattn/emmet-vim/master/TUTORIAL
" -------------------------------------------------
" ------------------------------------------------
" Vim airline plugin
let g:airline#extensions#tab1#enabled = 1
set t_Co=256
" -----------------------------------------------
" ------------------------------------------------
" Vim fugitive
autocmd QuickFixCmdPost *grep* cwindow
" ------------------------------------------------
" ------------------------------------------------
" Vim easy motion
" ------------------------------------------------
let g:EasyMotion_do_mapping = 0 " Disable default mappings
" nmap s <Plug>(easymotion-overwin-f)
" " or
" " `s{char}{char}{label}`
" " Need one more keystroke, but on average, it may be more comfortable.
" nmap s <Plug>(easymotion-overwin-f2)
" " Turn on case insensitive feature
let g:EasyMotion_smartcase = 1
"
" " JK motions: Line motions
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
set background=dark
colorscheme palenight
let g:indent_guides_enable_on_vim_startup = 1
let g:ctrlp_custom_ignore = 'node_modules\|DS_Store\|git'
let g:user_emmet_install_global = 0
autocmd FileType html,css EmmetInstall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment