Skip to content

Instantly share code, notes, and snippets.

@Mozart2234
Created April 3, 2019 18:58
Show Gist options
  • Save Mozart2234/9c52752e6c8f7f9c18e4d7d8ec01fcd8 to your computer and use it in GitHub Desktop.
Save Mozart2234/9c52752e6c8f7f9c18e4d7d8ec01fcd8 to your computer and use it in GitHub Desktop.
My personal config .vimrc
" ----------- BASIC CONFIGURATION --------------------
set encoding=UTF-8
set directory=~/.vim/swap//
set undofile
set undodir=~/.vim/undodir//
map <up> <nop>
map <down> <nop>
map <left> <nop>
map <right> <nop>
set laststatus=2
set showcmd
set nocompatible
set nowrap
" ----------------------------------------------------
" ----------- CODING CONFIGURATION -------------------
syntax on " Enable syntax highlighting.
filetype plugin indent on " Enable file type based indentation.
set autoindent " Respect indentation when starting a new line.
set expandtab " Expand tabs to spaces. Essential in Python.
set tabstop=2 " Number of spaces tab is counted for.
set shiftwidth=2 " Number of spaces to use for autoindent.
set backspace=2 " Fix backspace behavior on most terminals.
autocmd FileType python setlocal ts=4 sts=4 sw=4
set number
set ruler
set hlsearch
" set foldmethod=syntax
" set foldcolumn=1
" let ruby_fold=1
" set nofoldenable
let mapleader = "\<space>" " Map the leader key to a space
" ---------------------------------------------------
" ----------- COPYNG CONFIG -------------------------
set clipboard=unnamed
" --------------------------------------------------
" ----------- SPLIT NAVIGATION -----------------------
noremap <c-h> <c-w><c-h>
noremap <c-j> <c-w><c-j>
noremap <c-k> <c-w><c-k>
noremap <c-l> <c-w><c-l>
" ---------------------------------------------------
" ----------- BUFFERS CONFIGURATION ------------------
"
" ----------------------------------------------------
" ------------ PLUGINS (Manage with vim-plug) --------
call plug#begin()
" Utility
Plug 'scrooloose/nerdtree'
Plug 'majutsushi/tagbar'
Plug 'easymotion/vim-easymotion'
Plug '/usr/local/opt/fzf'
Plug 'junegunn/fzf.vim'
Plug 'tpope/vim-surround'
Plug 'nathanaelkane/vim-indent-guides'
Plug 'tpope/vim-unimpaired'
Plug 'valloric/youcompleteme'
Plug 'terryma/vim-multiple-cursors'
" Theming
Plug 'ryanoasis/vim-devicons'
Plug 'ayu-theme/ayu-vim'
Plug 'dracula/vim', {'as':'dracula'}
Plug 'vim-airline/vim-airline'
Plug 'tomasr/molokai'
" HTML
Plug 'mattn/emmet-vim'
Plug 'othree/html5.vim'
" Ruby
Plug 'vim-ruby/vim-ruby'
Plug 'tpope/vim-rails'
"Javascript
Plug 'pangloss/vim-javascript'
Plug 'mxw/vim-jsx'
call plug#end()
" -------------------------------------------------
" ----------- UI CONFIG ----------------------------
set termguicolors "enable true colors support
" let ayucolor="mirage"
colorscheme molokai
" -------------------------------------------------
" ------------- PLUGINS CONFIG ---------------------
" 1. NERDTREE
map <C-e> :NERDTreeToggle<CR>
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif " Autoclose NERDTree if it's the only open window left.
" --------------------------------------------------
" 2. FZF
map ; :Files<CR>
" -------------------------------------------------
" 3. VIM INDENT-GUIDES
let g:indent_guides_guide_size = 1
let g:indent_guides_enable_on_vim_startup = 1
" -------------------------------------------------
" 4 YOUCOMPLETEME
let g:ycm_seed_identifiers_with_syntax = 1
let g:ycm_semantic_triggers = {
\ 'css': [ 're!^', 're!^\s+', ': ' ],
\ 'scss': [ 're!^', 're!^\s+', ': ' ],
\ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment