My .vimrc

(Last Update: ) 3 minute read

set nocompatible
let mapleader=" "

set all&
set hi=100
set loadplugins
set ma "set modifiable

filetype on
filetype plugin indent on
syntax on
au FileType * setlocal formatoptions-=cro

" Encoding
set encoding=utf-8
set fenc=utf-8
set fencs=utf-8,cp949,cp932,euc-jp,shift-jis,big5,ucs-2le,latin1

""""""""""""""""""""""""""""""""""""""""""
" configuration for vundle
""""""""""""""""""""""""""""""""""""""""""
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#rc()
"""""""""""""""""""""""""""""""""""""""""""
Bundle 'gmarik/Vundle.vim'
""""""""""""""""""""""""""""""""""""""""""
Bundle 'vim-airline/vim-airline'
Bundle 'vim-airline/vim-airline-themes'
""""""""""""""""""""""""""""""""""""""""""
let g:airline_powerline_fonts=1
let g:airline_theme='wombat'
let g:airline#extensions#tabline#enabled=1
""""""""""""""""""""""""""""""""""""""""""
Bundle 'matchparenpp'
""""""""""""""""""""""""""""""""""""""""""
Bundle 'The-NERD-tree'
""""""""""""""""""""""""""""""""""""""""""
let g:NERDChristmasTree=1
let g:NERDTreeAutoCenter=1
let g:NERDTreeChDirMode=1
let g:NERDTreeHighlightCursorline=1
let g:NERDTreeSortOrder=['\.py$', '\.m$', '\.pyc$', '*']
let g:NERDTreeBookmarksFile = $HOME.'/.vim/NERDTreeBookmarks'
let g:NERDTreeIgnore=['\.vim$', '\~$']
let g:NERDTreeWinSize=40
let g:NERDTreeMinimalUI=1
let g:NERDTreeShowHidden=1
let g:NERDTreeShowLineNumbers=1
let g:NERDTreeQuitOnOpen=1
let g:NERDTreeShowFiles=1
let g:NERDTreeWinPos="left"
""""""""""""""""""""""""""""""""""""""""""
Bundle 'Valloric/YouCompleteMe'
""""""""""""""""""""""""""""""""""""""""""
Bundle 'vim-multiple-cursors'
""""""""""""""""""""""""""""""""""""""""""
let g:multi_cursor_use_default_mapping=0
" Default mapping
let g:multi_cursor_start_word_key      = '<C-n>'
let g:multi_cursor_select_all_word_key = '<A-n>'
let g:multi_cursor_start_key           = 'g<C-n>'
let g:multi_cursor_select_all_key      = 'g<A-n>'
let g:multi_cursor_next_key            = '<C-n>'
let g:multi_cursor_prev_key            = '<C-p>'
let g:multi_cursor_skip_key            = '<C-x>'
let g:multi_cursor_quit_key            = '<leader><Esc>'

"""""""""""""""""""""""""""""""""""""""""""
" Appearance
"""""""""""""""""""""""""""""""""""""""""""
set t_Co=256
colorscheme wombat256mod " color Theme

"""""""""""""""""""""""""""""""""""""""""""
" UI
"""""""""""""""""""""""""""""""""""""""""""
set cursorcolumn                            " highlight the current column
set cursorline                              " highlight current line
set incsearch                               " BUT do highlight as you type you search phrase
set laststatus=2                            " always show the status line
set lazyredraw                              " do not redraw while running macros
set linespace=0                             " don't insert any extra pixel line betweens rows
"set list                                   " we do what to show tabs, to ensure we get them out of my files
"set listchars=tab:>-,trail:.,extends:>     " show tabs and trailing
set matchtime=5                             " how many tenths of a second to blink matching brackets for
set hlsearch                                " do not highlight searched for phrases
set nostartofline                           " leave my cursor where it was
set novisualbell                            " don't blink
set noerrorbells                            " don't beep
set number                                  " turn on line numbers
set numberwidth=5                           " We are good up to 99999 lines
set report=0                                " tell us when anything is changed via :...
set ruler                                   " Always show current positions along the bottom
set scrolloff=10                            " Keep 10 lines (top/bottom) for scope
set shortmess=aOstT                         " shortens messages to avoid 'press a key' prompt
set showcmd                                 " show the command being typed
set showmatch                               " show matching brackets
set sidescrolloff=10
set statusline+=%#warningmsg#
set statusline+=%*

"""""""""""""""""""""""""""""""""""""""""""
" Smart Setting
"""""""""""""""""""""""""""""""""""""""""""
set backspace=2
set smartindent
set autoindent
set copyindent
set cindent
set nobackup
set mouse=a
set noto ttimeout
set autoread
"set completeopt=                           " don't use a pop up menu for completions
set expandtab                               " no real tabs please!
set formatoptions-=cro                      " Automatically insert comment leader on return, and let gq format comments
"set ignorecase                             " case insensitive by default
set infercase                               " case inferred by default
set nowrap                                  " do not wrap line
set shiftround                              " when at 3 spaces, and I hit > ... go to 4, not 5
set smartcase                               " if there are caps, go case-sensitive
set shiftwidth=4                            " auto-indent amount when using cindent, >>, << and stuff like that
set shiftround                              " use multiple of shiftwidth when indenting with '<' and '>'
set softtabstop=4                           " when hitting tab or backspace, how many spaces should a tab be (see expandtab)
set tabstop=4                               " real tabs should be 8, and they will show with set list on
set ww=h,l,b                                " move the cursor left/right to move to the previous/next line when the cursor is on the first/last character in the line
set sol                                     " when moving cursor(ex:<C-d>), move the cursor to the start of line
set wmh=0                                   " minium hegith of window
set title                                   " change name of terminal
set pastetoggle=<leader>p                   " toggle vim into past mode
set ttyfast                                 " fast keyboard
set timeout timeoutlen=1000 ttimeoutlen=50  " fast keyboard

" Buffer setting
set hidden                                  
" prev buffer
nnoremap <silent><C-j> :bp<cr>              
" next buffer
nnoremap <silent><C-k> :bn<cr>
" quit buffer and move to prev buffer
nnoremap <silent><leader>D :bp<BAR>bd #<cr>
" list buffer
nnoremap <silent><C-l> :ls<cr>

""""""""""""""""""""""""""""""""""""""""""
" MAPPINGS
""""""""""""""""""""""""""""""""""""""""""
inoremap jj <Esc>
nnoremap <leader>s :so ~/.vimrc<CR>

" Toggle NERDTree
nmap <leader>n :NERDTreeToggle<CR> 
nnoremap <silent><leader>/ :nohlsearch<Bar>:echo<CR>

Leave a Comment