" Don't try to be vi compatible set nocompatible " Helps force plugins to load correctly when it is turned back on below filetype off set rtp+=~/.vim/bundle/Vundle.vim call vundle#begin() Plugin 'VundleVim/Vundle.vim' Plugin 'tpope/vim-surround' Plugin 'scrooloose/nerdtree' " status line Plugin 'vim-airline/vim-airline' Plugin 'vim-airline/vim-airline-themes' " find files Plugin 'junegunn/fzf' Plugin 'junegunn/fzf.vim' call vundle#end() " Turn on syntax highlighting syntax on " For plugins to load correctly filetype plugin indent on let mapleader = " " " Cursor shape set guicursor=n-v-c:block,i-ci-ve:ver25,r-cr:hor20,o:hor50 let &t_SI = "\[5 q" " blinking I-beam in insert mode let &t_SR = "\[3 q" " blinking underline in replace mode let &t_EI = "\[ q" " default cursor (usually blinking block) otherwise if &term =~ 'xterm\\|rxvt' let &t_SI = "\e[6 q" " Use a vertical bar (line) for insert mode let &t_EI = "\e[2 q" " Use a block cursor for normal mode let &t_SR = "\e[4 q" " Use underline cursor for replace mode endif set ttimeout set ttimeoutlen=1 set ttyfast " Security set modelines=0 " Show line numbers set number set relativenumber " Show file stats set ruler " Blink cursor on error instead of beeping (grr) " set visualbell set cursorline " Encoding set encoding=utf-8 " Whitespace set nowrap " do not automatically wrap on load set formatoptions-=t " do not automatically wrap text when typing set tabstop=4 set shiftwidth=4 set softtabstop=4 set expandtab set noshiftround " Cursor motion set scrolloff=3 set backspace=indent,eol,start set matchpairs+=<:> " use % to jump between pairs runtime! macros/matchit.vim " Move up/down editor lines nnoremap j gj nnoremap k gk " Allow hidden buffers set hidden " Rendering set ttyfast " Status bar set laststatus=2 " Last line set showmode set showcmd " Searching nnoremap / /\v vnoremap / /\v set hlsearch set incsearch set ignorecase set smartcase set showmatch map :let @/='' " clear search " Remap help key. inoremap :set invfullscreena nnoremap :set invfullscreen vnoremap :set invfullscreen " Textmate holdouts " Others " https://vi.stackexchange.com/questions/22547/how-to-prevent-vim-from-making-a-flashy-screen-effect-when-pressing-esc-or set belloff=esc " Formatting map q gqip " Visualize tabs and newlines set listchars=tab:▸\ ,eol:¬ " Uncomment this to enable by default: " set list " To enable by default " Or use your leader key + l to toggle on/off " map l :set list! " Toggle tabs and EOL " Color scheme (terminal) set t_Co=256 set background=dark let g:solarized_termcolors=256 let g:solarized_termtrans=1 " put https://raw.github.com/altercation/vim-colors-solarized/master/colors/solarized.vim " in ~/.vim/colors/ and uncomment: colorscheme quiet " colorscheme base16-default-dark " colorscheme catppuccin_mocha " plugin " nerdtree let g:NERDTreeWinPos = "right" " Mapping " map :noh noremap - :Ex " Open local-directory browser tnoremap " test " siwtch window map j tnoremap j map k tnoremap k map h tnoremap h map l tnoremap l " https://stackoverflow.com/questions/5933568/disable-blinking-at-the-first-last-line-of-the-file noremap k ((line('.')==1)?'':'k') noremap j ((line('.')==line('$'))?'':'j') " term noremap tt :term ++curwin " buffer noremap :bn noremap :bp noremap x :bd " noremap b :ls:b " save noremap :w map p :set paste map np :set nopaste " nerdtree function MyNerdToggle() if &filetype == 'nerdtree' :NERDTreeToggle else :NERDTreeFind endif endfunction map e :call MyNerdToggle() " Open local-directory browser " fzf map ff :Files map fw :Rg map b :Buffers map ct ::Filetypes