Skip to content

Instantly share code, notes, and snippets.

@huilapman
Last active September 28, 2018 03:51
Show Gist options
  • Save huilapman/6603ad7846e526f5c81ee4f059a0a2d6 to your computer and use it in GitHub Desktop.
Save huilapman/6603ad7846e526f5c81ee4f059a0a2d6 to your computer and use it in GitHub Desktop.
set nocompatible " required
filetype off " required
set nofoldenable
" set foldlevel=99
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'tmhedberg/SimpylFold'
Plugin 'scrooloose/syntastic'
Plugin 'nvie/vim-flake8'
Plugin 'altercation/vim-colors-solarized'
Plugin 'scrooloose/nerdtree'
Plugin 'jistr/vim-nerdtree-tabs'
Plugin 'Lokaltog/powerline', {'rtp': 'powerline/bindings/vim/'}
Plugin 'isRuslan/vim-es6'
" Add all your plugins here (note older versions of Vundle used Bundle instead of Plugin)
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
"set exrc
"set secure
"set paste
"set tabstop=4
set softtabstop=4
"set shiftwidth=4
"set noexpandtab
set tags+=~/.vim/tags/cpp_src/tags
set expandtab
set autoindent
set smartindent
"set bg=dark
set nowrap
set ai
"set background=dark
set cursorline
set enc=utf8
set hls
set mouse=nv
set number
"set relativenumber
set ic
set expandtab
set tabstop=2
set shiftwidth=2
set wrap
"set nowrap
set noeb
set autochdir
set scrolloff=3
set foldenable
set foldmethod=indent
set foldcolumn=1
set foldlevel=5
set shell=/bin/bash
set cursorline
"set cursorcolumn
"filetype off
syntax enable " Use syntax highlighting
" Pathogen
execute pathogen#infect()
syntax on
filetype plugin indent on
" NERDTree
map <C-n> :NERDTree<CR>
" MiniBufExplorer
"let g:miniBufExplMaxSize = 2
" Taglist
let Tlist_Show_One_File=1
let Tlist_Exit_OnlyWindow=1
let Tlist_Use_Right_Window=1
let Tlist_Sort_Type="name"
" OmniCppComplete
set completeopt=longest,menu
let OmniCpp_NamespaceSearch = 2
let OmniCpp_ShowPrototypeInAbbr = 1
let OmniCpp_MayCompleteScope = 1
let OmniCpp_DefaultNamespaces = ["std", "_GLIBCXX_STD"]
let g:ycm_global_ycm_extra_conf = '/Users/sysroot/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
"split navigations
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set clipboard=unnamed
augroup filetype javascript syntax=javascript
set nocompatible
filetype off "required for Vundle"
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim'
Plugin 'Valloric/YouCompleteMe'
Plugin 'scrooloose/nerdtree'
Plugin 'tagbar'
"additional C++ highlighting"
Plugin 'octol/vim-cpp-enhanced-highlight'
"ctags"
Plugin 'universal-ctags/ctags'
Bundle 'https://github.com/freeo/vim-kalisi'
Bundle 'jistr/vim-nerdtree-tabs'
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'bling/vim-bufferline'
Plugin 'vim-ctrlspace/vim-ctrlspace'
call vundle#end()
"youcompleteme settings"
filetype plugin indent on
let g:ycm_seed_identifiers_with_syntax=1
let g:ycm_global_ycm_extra_conf = '~/.vim/bundle/YouCompleteMe/third_party/ycmd/cpp/ycm/.ycm_extra_conf.py'
let g:ycm_confirm_extra_conf=0
let g:ycm_collect_identifiers_from_tag_files = 1
set completeopt=longest,menu
"syntax and filetype autodetection"
filetype plugin indent on " Filetype auto-detection
syntax on
"color scheme"
colorscheme kalisi
set background=dark
"line numbers"
set number
"get back normal backspace behavior"
set backspace=indent,eol,start
"nerdtree settings"
let g:nerdtree_tabs_open_on_console_startup=1
"mouse settings"
set mouse=a
set ttyfast
"highlight extra whitespaces"
highlight ExtraWhitespace ctermbg=red guibg=red
autocmd! BufWinEnter * match ExtraWhitespace /\s\+$/
"enable spellcheck"
set spell spelllang=en_us
"show tabs"
set listchars=trail:·,tab:»·
set list
set tabstop=4
"Tagbar toggler"
nmap <F8> :TagbarToggle<CR>
"improve default search"
set ignorecase
set smartcase
set hlsearch
"ctrlp settings"
set nocompatible
set hidden
"make left/right cursor keys move to the previous/next line"
set whichwrap+=<,>,h,l,[,]
set -g default-terminal "screen-256color"
# remap prefix to Control + a
set -g prefix C-a
# bind 'C-a C-a' to type 'C-a'
bind C-a send-prefix
unbind C-b
set -g status-keys vi
set -g history-limit 10000
#setw -g mode-keys vi
#set -g mouse on
# setw -g mode-mouse on
setw -g monitor-activity on
# Mouse support ------------------------------------------------
set -g mouse on
#bind-key -T copy-mode-vi WheelUpPane send -X scroll-up
#bind-key -T copy-mode-vi WheelDownPane send -X scroll-down
# # Vi copypaste
setw -g mode-keys vi
set-option -g default-command "reattach-to-user-namespace -l bash"
# New 2.4 version:
bind-key -T copy-mode-vi 'v' send -X begin-selection
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "reattach-to-user-namespace pbcopy"
# End Mouse support --------------------------------------------
bind -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind -n WheelDownPane select-pane -t= \; send-keys -M
bind -n C-WheelUpPane select-pane -t= \; copy-mode -e \; send-keys -M
bind -T copy-mode-vi C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-vi C-WheelDownPane send-keys -X halfpage-down
bind -T copy-mode-emacs C-WheelUpPane send-keys -X halfpage-up
bind -T copy-mode-emacs C-WheelDownPane send-keys -X halfpage-down
bind-key v split-window -h
bind-key s split-window -v
bind-key J resize-pane -D 5
bind-key K resize-pane -U 5
bind-key H resize-pane -L 5
bind-key L resize-pane -R 5
bind-key M-j resize-pane -D
bind-key M-k resize-pane -U
bind-key M-h resize-pane -L
bind-key M-l resize-pane -R
# Vim style pane selection
bind h select-pane -L
bind j select-pane -D
bind k select-pane -U
bind l select-pane -R
# Use Alt-vim keys without prefix key to switch panes
bind -n M-h select-pane -L
bind -n M-j select-pane -D
bind -n M-k select-pane -U
bind -n M-l select-pane -R
# Use Alt-arrow keys without prefix key to switch panes
bind -n M-Left select-pane -L
bind -n M-Right select-pane -R
bind -n M-Up select-pane -U
bind -n M-Down select-pane -D
# Shift arrow to switch windows
bind -n S-Left previous-window
bind -n S-Right next-window
# No delay for escape key press
set -sg escape-time 0
# Reload tmux config
bind R source-file ~/.tmux.conf \; display-message "tmux.conf reloaded"
# THEME
set -g status-bg black
set -g status-fg white
set -g window-status-current-bg white
set -g window-status-current-fg black
set -g window-status-current-attr bold
set -g status-interval 60
set -g status-left-length 30
set -g status-left '#[fg=green](#S) #(whoami)'
set -g status-right '#[fg=yellow]#(cut -d " " -f 1-3 /proc/loadavg)#[default] #[fg=white]%H:%M#[default]'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment