Skip to content

Instantly share code, notes, and snippets.

@kikuchi-m
Last active April 20, 2022 03:55
Show Gist options
  • Select an option

  • Save kikuchi-m/13d65a9ae88b0002e6fff68730c4da14 to your computer and use it in GitHub Desktop.

Select an option

Save kikuchi-m/13d65a9ae88b0002e6fff68730c4da14 to your computer and use it in GitHub Desktop.
.vimrc
"using vim-plug
call plug#begin('~/.vim/plugged')
Plug 'scrooloose/nerdtree'
"Plug 'editorconfig/editorconfig-vim'
"Plug 'embear/vim-localvimrc'
Plug 'udalov/kotlin-vim'
Plug 'Vimjas/vim-python-pep8-indent'
Plug 'tpope/vim-fugitive'
"Plug 'pangloss/vim-javascript'
"Plug 'leafgarland/typescript-vim'
"Plug 'google/vim-maktaba'
"Plug 'google/vim-codefmt'
"Plug 'google/vim-glaive'
Plug 'fatih/vim-go'
Plug 'nvie/vim-flake8'
Plug 'kamykn/spelunker.vim'
call plug#end()
"filetype plugin indent on
set history=1000
set expandtab
set tabstop=2
set laststatus=2
set background=dark
" for mac
syntax on
set hlsearch
noh
let NERDTreeShowHidden=1
let NERDTreeDirArrowExpandable='+'
let NERDTreeDirArrowCollapsible='-'
let NERDTreeIgnore=['\.swp$', '\.swo$', '\~$', '\.pyc$', '__pycache__']
" hi Directory ctermfg=5
set statusline=%f%m%=\ %l/%3L,%c\ \ %P
augroup CursorLine
au!
au VimEnter,WinEnter,BufWinEnter * setlocal cursorline
au WinLeave * setlocal nocursorline
augroup End
noremap <silent> <F5> :let _p=getpos(".") <Bar> :let _s=@/ <Bar> :%s/\s\+$//e <Bar> :let @/=_s <Bar> :nohl <Bar> :unlet _s <Bar> :call setpos(".", _p) <Bar> :unlet _p <CR>
"spelunker
"let g:spelunker_target_min_char_len = 3
highlight SpelunkerSpellBad cterm=None ctermbg=124
highlight SpelunkerComplexOrCompoundWord cterm=None ctermbg=124
autocmd FileType sh set tabstop=2 shiftwidth=2 smartindent
autocmd FileType yaml set tabstop=2 shiftwidth=2 indentexpr=GetYAMLIndent(v:lnum)-2
autocmd FileType java set tabstop=4 shiftwidth=4 smartindent
"autocmd FileType python set tabstop=4 shiftwidth=4 autoindent smartindent
autocmd BufRead CERYLE,*.ceryle set filetype=python
autocmd BufWritePost *.py call flake8#Flake8()
autocmd BufWritePre *.go GoFmt
autocmd FileType javascript set tabstop=2 shiftwidth=2 smartindent
autocmd FileType typescript set tabstop=2 shiftwidth=2 smartindent
autocmd FileType json set tabstop=4 shiftwidth=4 smartindent
autocmd FileType scss set tabstop=2 shiftwidth=2 indentexpr= autoindent
autocmd BufRead *.ts,*.tsx set filetype=javascript
autocmd FileType sql set tabstop=4 shiftwidth=4
autocmd BufRead *nginx.conf set syntax=nginx
"reload spellfile
" :e ~/.vim/spell/en.utf-8.add
" :mkspell! %
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment