Last active
October 6, 2023 09:40
-
-
Save grammy-jiang/162f271c59a97a424d228f0de10d05e9 to your computer and use it in GitHub Desktop.
$HOME/.vimrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" =========================================================================== " | |
" Github URL | |
" https://gist.githubusercontent.com/grammy-jiang/162f271c59a97a424d228f0de10d05e9/raw | |
" Shorten URL | |
" https://git.io/JvpSM | |
" =========================================================================== " | |
set encoding=utf-8 | |
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC | |
endif | |
call plug#begin('~/.vim/plugged') | |
" ======== theme ============================================================ " | |
" https://github.com/vim-airline/vim-airline | |
Plug 'vim-airline/vim-airline' | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline#extensions#tabline#formatter = 'unique_tail' | |
" https://github.com/vim-airline/vim-airline-themes | |
Plug 'vim-airline/vim-airline-themes' | |
let g:airline_theme='solarized' | |
let g:airline_solarized_bg='dark' | |
" https://github.com/altercation/vim-colors-solarized | |
Plug 'altercation/vim-colors-solarized' | |
" https://github.com/Yggdroot/indentLine | |
Plug 'Yggdroot/indentLine' | |
" ======== autocomplete ===================================================== " | |
" https://github.com/jiangmiao/auto-pairs | |
Plug 'jiangmiao/auto-pairs' | |
" https://github.com/ycm-core/YouCompleteMe | |
let g:ycm_python_interpreter_path = '' | |
let g:ycm_python_sys_path = [] | |
let g:ycm_extra_conf_vim_data = [ | |
\ 'g:ycm_python_interpreter_path', | |
\ 'g:ycm_python_sys_path' | |
\] | |
let g:ycm_global_ycm_extra_conf = '~/global_extra_conf.py' | |
Plug 'ycm-core/YouCompleteMe', {'do': './install.py && pip install --no-cache-dir --upgrade jedi'} | |
" ======== search =========================================================== " | |
" https://github.com/ctrlpvim/ctrlp.vim | |
Plug 'ctrlpvim/ctrlp.vim' | |
" https://github.com/tpope/vim-commentary | |
Plug 'tpope/vim-commentary' | |
" https://github.com/easymotion/vim-easymotion | |
Plug 'easymotion/vim-easymotion' | |
" ======== syntax highlight ================================================= " | |
" https://github.com/sheerun/vim-polyglot | |
Plug 'sheerun/vim-polyglot' | |
" https://github.com/tmux-plugins/vim-tmux | |
Plug 'tmux-plugins/vim-tmux' | |
" ======== git ============================================================== " | |
" https://github.com/tpope/vim-fugitive | |
Plug 'tpope/vim-fugitive' | |
" https://github.com/airblade/vim-gitgutter | |
Plug 'airblade/vim-gitgutter' | |
call plug#end() | |
" ======== altercation/vim-colors-solarized ================================= " | |
syntax enable | |
let g:solarized_termcolors=256 | |
colorscheme solarized | |
if has('gui_running') | |
set background=light | |
else | |
set background=dark | |
endif | |
" ======== easymotion/vim-easymotion ======================================== " | |
let g:EasyMotion_do_mapping = 0 " Disable default mappings | |
let g:EasyMotion_smartcase = 1 " type `l` and match `l`&`L` | |
let g:EasyMotion_use_smartsign_us = 1 " Smartsign (type `3` and match `3`&`#`) | |
" Replace the default search of Vim | |
map / <Plug>(easymotion-sn) | |
omap / <Plug>(easymotion-tn) | |
map n <Plug>(easymotion-next) | |
map N <Plug>(easymotion-prev) | |
" JK motions: Line motions | |
map <Leader>j <Plug>(easymotion-j) | |
map <Leader>k <Plug>(easymotion-k) | |
" ======== auto reload the vimrc when it changes ============================ " | |
if has ('autocmd') " Remain compatible with earlier versions | |
augroup vimrc " Source vim configuration upon save | |
autocmd! BufWritePost $MYVIMRC source % | echom "Reloaded " . $MYVIMRC | redraw | |
autocmd! BufWritePost $MYGVIMRC if has('gui_running') | so % | echom "Reloaded " . $MYGVIMRC | endif | redraw | |
augroup END | |
endif " has autocmd | |
highlight CursorLine term=bold cterm=bold ctermbg=234 | |
highlight CursorLineNR term=bold cterm=bold ctermbg=234 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The python interpreter path is configured to use the one managed by pyenv.
Before running vim
Create SWAP Partition
Install dependencies for YouCompleteMe
sudo -- sh -c "apt-get install -y build-essential cmake vim-nox python3-dev wget && apt-get install --yes libtinfo5"
Usage
Related
TODO
Add the following plugins:
Reference