Skip to content

Instantly share code, notes, and snippets.

@0x9900
Last active January 6, 2024 02:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0x9900/40814a2ff4dc35020187716396695dd0 to your computer and use it in GitHub Desktop.
Save 0x9900/40814a2ff4dc35020187716396695dd0 to your computer and use it in GitHub Desktop.
.vimrc file
"
" First install vim-plug using the following command
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
"
"
filetype plugin indent on
autocmd! bufwritepost .vimrc source ~/.vimrc
"set list lcs=tab:·⁖,trail:¶
set listchars=tab:⇤–⇥,trail:¶,precedes:⇠,extends:⇢,nbsp:×
set encoding=utf-8
set fileencoding=utf-8
syntax on
set tabstop=4
set shiftwidth=4
set softtabstop=4
set smarttab
set smartindent
set autoindent
set expandtab
set hidden
set wrap
set complete+=kspell
set nospell
set spelllang=en_us
set fileformat=unix
set cursorline
set incsearch
set ignorecase
set smartcase
set clipboard=unnamed
call plug#begin()
Plug 'preservim/nerdtree', { 'on': 'NERDTreeToggle' }
" Plug 'rdnetto/YCM-Generator', { 'branch': 'stable' }
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
" Plug 'jreybert/vimagit'
Plug 'NLKNguyen/papercolor-theme'
Plug 'davidhalter/jedi-vim'
Plug 'kamykn/spelunker.vim'
Plug 'vim-scripts/indentpython.vim'
Plug 'aperezdc/vim-template'
call plug#end()
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
nnoremap <F2> :set paste!<cr>
let g:jedi#completions_command = "<TAB>"
let g:airline#extensions#tabline#enabled = 1
let g:airline_theme = 'papercolor'
let g:airline_powerline_fonts = 1
let g:NERDTreeQuitOnOpen = 1
let g:NERDTreeIgnore=['\.pyc$', '\~$'] "ignore files in NERDTree
let g:solarized_termcolors = 256
let g:solarized_termtrans = 1
let g:solarized_contrast = "high"
let g:solarized_visibility= "high"
" SPELUNKER CONFIG ====================
let g:enable_spelunker_vim = 1
let g:spelunker_disable_auto_group = 1
let g:spelunker_check_type = 2
let g:spelunker_disable_uri_checking = 1
let g:spelunker_disable_email_checking = 1
let g:spelunker_disable_account_name_checking = 1
let g:spelunker_disable_backquoted_checking = 1
" USED BY vim-templates ==============
let g:license = 'BSD 3-Clause'
let g:email = 'github-fred@hidzz.com'
let g:PaperColor_Theme_Options = {
\ 'theme': {
\ 'default.dark': {
\ 'transparent_background': 1
\ }
\ }
\ }
set background=dark
colorscheme PaperColor
augroup spelunker
autocmd!
" Setting for g:spelunker_check_type = 1:
autocmd BufWinEnter,BufWritePost *.vim,*.py,*.yaml,*.markdown,*.md call spelunker#check()
" Setting for g:spelunker_check_type = 2:
autocmd CursorHold *.vim,*.py,*.yaml,*markdown,*.md call spelunker#check_displayed_words()
augroup END
" Override highlight group name of incorrectly spelled words. (default: 'SpelunkerSpellBad')
let g:spelunker_spell_bad_group = 'SpelunkerSpellBad'
" Override highlight group name of complex or compound words. (default: 'SpelunkerComplexOrCompoundWord')
let g:spelunker_complex_or_compound_word_group = 'SpelunkerComplexOrCompoundWord'
" Spelling mistakes will also be colored red if you uncomment the colors.
highlight SpellBad cterm=underline ctermfg=203 guifg=#ff5f5f
highlight SpellLocal cterm=underline ctermfg=203 guifg=#ff5f5f
highlight SpellRare cterm=underline ctermfg=203 guifg=#ff5f5f
highlight SpellCap cterm=underline ctermfg=203 guifg=#ff5f5f
highlight CursorLine ctermbg=234
highlight Pmenu ctermfg=214 ctermbg=238
highlight PmenuSel ctermfg=238 ctermbg=250
iab <expr> ddate strftime("%c")
iab <expr> ttime strftime("%H:%M")
iab <expr> ptime strftime("%x %H:%M")
function TrimEndLines()
let save_cursor = getpos(".")
silent! %s#\($\n\s*\)\+\%$##
call setpos('.', save_cursor)
endfunction
autocmd FileType python,markdown,javascript,yaml,json,vim, autocmd BufWritePre <buffer> %s/\s\+$//e
autocmd BufWritePre * call TrimEndLines()
augroup python
autocmd!
autocmd FileType python highlight Excess ctermbg=DarkGrey guibg=red
autocmd FileType python setlocal nowrap colorcolumn=101
autocmd FileType python setlocal tabstop=2 softtabstop=2 shiftwidth=2 smarttab expandtab smartindent textwidth=100 fileformat=unix
augroup END
augroup javascript
autocmd!
autocmd Filetype javascript setlocal tabstop=4 softtabstop=2 shiftwidth=2 expandtab fileformat=unix
autocmd FileType javascript setlocal nowrap colorcolumn=101
augroup END
augroup bind
autocmd!
autocmd BufNewFile,BufRead *.db
\ set tabstop=8 |
\ set softtabstop=8 |
\ set shiftwidth=8 |
\ set listchars=eol:¬,tab:▸\ ,trail:␠
augroup END
augroup webfiles
autocmd BufNewFile,BufRead *.html, *.css, *.yaml
\ set tabstop=4 |
\ set softtabstop=4 |
\ set shiftwidth=4 |
augroup END
set exrc
" EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment