Created
March 31, 2021 14:32
-
-
Save maghorbani/27c8716b785dc96a8ff7d93465757a41 to your computer and use it in GitHub Desktop.
my vimrc
This file contains 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
" maps key sequence jk to <ESC> | |
inoremap jk <ESC> | |
" changes leader key from \ to ' | |
let mapleader = "'" | |
" some editting related stuff | |
syntax enable | |
set number | |
set noswapfile | |
set hlsearch | |
set ignorecase | |
set incsearch | |
set ts=4 sw=4 | |
set cursorline | |
hi CursorLine term=bold cterm=bold guibg=Grey40 | |
" vim plug plugins | |
call plug#begin() | |
Plug 'preservim/nerdtree' | |
Plug 'junegunn/fzf' | |
Plug 'junegunn/fzf.vim' | |
Plug 'mattn/emmet-vim' | |
" coc | |
Plug 'neoclide/coc.nvim', {'branch': 'release'} | |
Plug 'dsznajder/vscode-es7-javascript-react-snippets', { 'do': 'yarn install --frozen-lockfile && yarn compile' } | |
Plug 'prettier/vim-prettier', { | |
\ 'do': 'yarn install', | |
\ 'for': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'graphql', 'markdown', 'vue', 'yaml', 'html'] } | |
Plug 'vim-airline/vim-airline' | |
Plug 'vim-airline/vim-airline-themes' | |
Plug 'pangloss/vim-javascript' | |
Plug 'mxw/vim-jsx' | |
Plug 'digitaltoad/vim-pug' | |
Plug 'mhartington/oceanic-next' | |
Plug 'ryanoasis/vim-devicons' | |
call plug#end() | |
" nerd tree maps | |
nnoremap <leader>n :NERDTreeFocus<CR> | |
nnoremap <C-t> :NERDTreeToggle<CR> | |
nnoremap <C-f> :NERDTreeFind<CR> | |
" exit from terminal | |
tnoremap <C-w> <C-\><C-n> | |
tnoremap <ESC> <C-\><C-n> | |
" windows shoercuts | |
nnoremap <C-h> <C-w><C-h> | |
nnoremap <C-j> <C-w><C-j> | |
nnoremap <C-k> <C-w><C-k> | |
nnoremap <C-l> <C-w><C-l> | |
" fzf maps | |
nnoremap ff :Files<CR> | |
" nerdtree start stop behavior | |
autocmd VimEnter * NERDTree | wincmd p | |
autocmd StdinReadPre * let s:std_in=1 | |
autocmd VimEnter * if argc() == 0 && !exists('s:std_in') | NERDTree | endif | |
" Exit Vim if NERDTree is the only window left. | |
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | | |
\ quit | endif | |
" airline configs | |
let g:airline_theme='oceanicnext' | |
let g:airline_powerline_fonts = 1 | |
let g:airline#extensions#tabline#enabled = 1 | |
" vim-javascript configs | |
let g:javascript_plugin_jsdoc = 1 | |
let g:javascript_plugin_ngdoc = 1 | |
let g:javascript_plugin_flow = 1 | |
augroup javascript_folding | |
au! | |
au FileType javascript setlocal foldmethod=syntax | |
augroup END | |
" oceanic-next | |
if (has("termguicolors")) | |
set termguicolors | |
endif | |
colorscheme OceanicNext |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment