dotfiles/vim/.vimrc

80 lines
2.1 KiB
VimL
Raw Normal View History

2019-02-10 11:29:26 +00:00
set nocompatible " be iMproved, required
" filetype off " required
filetype plugin indent on
" show existing tab with 4 spaces width
set tabstop=4
" when indenting with '>', use 4 spaces width
set shiftwidth=4
" On pressing tab, insert 4 spaces
set expandtab
2019-02-10 11:29:26 +00:00
so ~/.vim/plugins.vim
2023-06-11 18:56:35 +01:00
let mapleader = "," " map leader to comma
2019-02-10 11:29:26 +00:00
set laststatus=2
set noshowmode
2019-02-10 13:19:07 +00:00
set showmatch
set ignorecase
set smartcase
" Allow backspacing over autoindent, line breaks and start of insert action
set backspace=indent,eol,start
" When opening a new line and no filetype-specific indenting is enabled, keep
" the same indent as the line you're currently on. Useful for READMEs, etc.
set autoindent
" Stop certain movements from always going to the first character of a line.
" While this behaviour deviates from that of Vi, it does what most users
" coming from other editors would expect.
set nostartofline
" Display the cursor position on the last line of the screen or in the status
" line of a window
set ruler
" Enable use of the mouse for all modes
set mouse=a
2019-02-10 13:19:07 +00:00
let g:lightline = {
\ 'colorscheme': 'srcery_drk',
\ }
inoremap " ""<left>
inoremap ' ''<left>
inoremap ( ()<left>
inoremap [ []<left>
inoremap < <><left>
inoremap { {}<left>
inoremap {<CR> {<CR>}<ESC>O
inoremap {;<CR> {<CR>};<ESC>O
2023-06-11 18:56:35 +01:00
nnoremap <leader>n :NERDTreeFocus<CR>
nnoremap <C-n> :NERDTree<CR>
nnoremap <C-t> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
2019-02-10 13:19:07 +00:00
set number
syntax on
let g:NERDTreeDirArrowExpandable = '▸'
let g:NERDTreeDirArrowCollapsible = '▾'
2023-06-11 18:56:35 +01:00
" Start NERDTree when Vim is started without file arguments.
2019-02-10 13:19:07 +00:00
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
2023-06-11 18:56:35 +01:00
" Exit Vim if NERDTree is the only window remaining in the only tab.
2019-02-10 13:19:07 +00:00
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
2023-06-11 18:56:35 +01:00
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0