dotenv/configs/vimrc-config
2022-09-17 11:49:26 -07:00

72 lines
2.0 KiB
Plaintext

" Line Numbers
set number
" Invisibles
set linebreak
set showbreak=+++
set list
set listchars=tab:→\ ,space:·,nbsp:␣,precedes:«,extends:»,trail:·
set nowrap
" Search
set showmatch
set visualbell
set hlsearch
set smartcase
set ignorecase
set incsearch
" Tabs
set autoindent
set shiftwidth=2
set smartindent
set smarttab
set softtabstop=2
set et
%retab!
" Ruler
set ruler
set textwidth=80
set undolevels=1000
set backspace=indent,eol,start
set colorcolumn=80
" Colors
syntax enable
set background=dark
colorscheme delek
" Start NERDTree when vim starts
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * NERDTree | if argc() > 0 || exists('s:std_in') | wincmd p | endif
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif
" If another buffer tries to replace NERDTree, put it in the other window, and bring back NERDTree.
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
" Hide line numbers within term tabs.
autocmd TermOpen * setlocal nonumber norelativenumber
augroup nvim_terminal | au!
" Start terminal in insert mode
autocmd TermOpen term://* startinsert
autocmd BufEnter term://* startinsert
" Auto press key when terminal closes (to skip prompt)
au TermClose * call feedkeys("i")
augroup end
" Launch Terminal when pressing CTRL+T
command! -nargs=* HoriTerm belowright split | resize 6 | term bash
map <C-t> :HoriTerm<CR>
" Press Esc to leave terminal
tnoremap <Esc> <C-\><C-n><CR><C-w><Up><CR>
" Press CTRL+B to toggle NerdTree
map <C-b> :NERDTreeToggle<CR>