Created
April 29, 2019 16:07
-
-
Save marschhuynh/1963c85a2e1c50cbcac326ab51b0a6ef to your computer and use it in GitHub Desktop.
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
call plug#begin('~/.config/nvim/plugged') | |
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } | |
Plug 'Xuyuanp/nerdtree-git-plugin' | |
Plug 'tpope/vim-commentary' | |
Plug 'tpope/vim-fugitive' | |
Plug 'dracula/vim' | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'bronson/vim-trailing-whitespace' | |
Plug 'rakr/vim-one' | |
Plug 'sheerun/vim-polyglot' | |
Plug 'joshdick/onedark.vim' | |
Plug 'airblade/vim-gitgutter' | |
Plug 'yggdroot/indentline' | |
Plug 'ap/vim-css-color' | |
Plug 'chiel92/vim-autoformat' | |
Plug 'gregsexton/matchtag' | |
Plug 'tpope/vim-fugitive' | |
Plug 'pangloss/vim-javascript' | |
Plug 'maxmellon/vim-jsx-pretty' | |
"" Fuzy search | |
Plug 'cloudhead/neovim-fuzzy' | |
Plug 'mxw/vim-jsx' | |
Plug 'mhartington/nvim-typescript', {'do': './install.sh'} | |
Plug 'Shougo/deoplete.nvim' | |
Plug 'Shougo/denite.nvim' | |
"" python | |
Plug 'davidhalter/jedi-vim' | |
"" javascript | |
"" Javascript Bundle | |
Plug 'jelera/vim-javascript-syntax' | |
call plug#end() | |
"" Setup tab | |
:set tabstop=4 | |
:set shiftwidth=4 | |
:set expandtab | |
"" Fuzy search | |
"" Theme | |
syntax on | |
colorscheme onedark | |
let g:onedark_termcolors=256 | |
set number | |
"" Vim arline | |
let g:airline_theme = 'deus' | |
let g:airline#extensions#syntastic#enabled = 1 | |
let g:airline#extensions#branch#enabled = 1 | |
let g:airline#extensions#tabline#enabled = 1 | |
let g:airline#extensions#tagbar#enabled = 1 | |
let g:airline_skip_empty_sections = 1 | |
let g:airline_solarized_bg='dark' | |
""***************************************************************************** | |
"" Basic Setup | |
""***************************************************************************** | |
"" Encoding | |
set encoding=utf-8 | |
set fileencodings=utf-8 | |
set bomb | |
set binary | |
"" Indent | |
let g:indentLine_color_term = 239 | |
"" Fix backspace indent | |
set backspace=indent,eol,start | |
"" vim-airline | |
let g:airline#extensions#virtualenv#enabled = 1 | |
""Use syntax highlighting | |
let g:airline#extensions#tabline#enabled = 1 | |
"" NERDTree configuration | |
let g:NERDTreeChDirMode=2 | |
let g:NERDTreeIgnore=['\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__'] | |
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$'] | |
let g:NERDTreeShowBookmarks=1 | |
let g:nerdtree_tabs_focus_on_files=1 | |
let g:NERDTreeMapOpenInTabSilent = '<RightMouse>' | |
let g:NERDTreeWinSize = 50 | |
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite | |
nnoremap <silent> <F2> :NERDTreeFind<CR> | |
map <C-n> :NERDTreeToggle<CR> | |
"" close vim if the only window left open is a NERDTree? | |
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif | |
"" Open NERDTree automatically when vim starts up on opening a directory. | |
autocmd StdinReadPre * let s:std_in=1 | |
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif | |
let NERDTreeStatusline="%{exists('b:NERDTree')?fnamemodify(b:NERDTree.root.path.str(), ':~'):''}" | |
"" python | |
"" vim-python | |
augroup vimrc-python | |
autocmd! | |
autocmd FileType python setlocal expandtab shiftwidth=4 tabstop=4 | |
\ formatoptions+=croq softtabstop=4 smartindent | |
\ cinwords=if,elif,else,for,while,try,except,finally,def,class,with | |
augroup END | |
"" jedi-vim | |
let g:jedi#popup_on_dot = 0 | |
let g:jedi#goto_assignments_command = "<leader>g" | |
let g:jedi#goto_definitions_command = "<leader>d" | |
let g:jedi#documentation_command = "K" | |
let g:jedi#usages_command = "<leader>n" | |
let g:jedi#rename_command = "<leader>r" | |
let g:jedi#show_call_signatures = "0" | |
let g:jedi#completions_command = "<C-Space>" | |
let g:jedi#smart_auto_mappings = 0 | |
"" Switching windows | |
noremap <C-j> <C-w>j | |
noremap <C-k> <C-w>k | |
noremap <C-l> <C-w>l | |
noremap <C-h> <C-w>h | |
"" Switch buffer | |
map <C-k> :bn<Cr> | |
map <C-j> :bp<Cr> | |
"" Turn-on dracula color scheme | |
syntax on | |
color onedark | |
"***************************************************************************** | |
"" Autocmd Rules | |
"***************************************************************************** | |
"" The PC is fast enough, do syntax highlight syncing from start | |
augroup vimrc-sync-fromstart | |
autocmd! | |
autocmd BufEnter * :syntax sync fromstart | |
augroup END | |
"" Remember cursor position | |
augroup vimrc-remember-cursor-position | |
autocmd! | |
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif | |
augroup END | |
" Disable Arrow keys in Escape mode | |
map <up> <nop> | |
map <down> <nop> | |
map <left> <nop> | |
map <right> <nop> | |
" Disable Arrow keys in Insert mode | |
imap <up> <nop> | |
imap <down> <nop> | |
imap <left> <nop> | |
imap <right> <nop> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
good 💯