vim-settings/vim/dot_vimrc

90 lines
1.8 KiB
Plaintext

"Allow arrow keys
set nocompatible
"tab functionality
"tabs inserted as 4 spaces
"backspace deletes all spaces
"autoindent enabled
set expandtab
set tabstop=4
set shiftwidth=4
set softtabstop=4
set autoindent
filetype indent on
set virtualedit=onemore " allow for cursor beyond last character
set scrolljump=5 " lines to scroll when cursor leaves screen
set scrolloff=3 " minimum lines to keep above and below cursor
"Enable search highlighting
set hls
"Highlights the line the cursor is on
set cursorline
:hi CursorLine cterm=NONE ctermbg=darkred guibg=darkred guifg=white
"Toggle highlighting with \hr (highlight row)
nnoremap <Leader>hr :set cursorline!<CR>
"enable line numbers
set nu
"Toggle Line numbers with Ctrl+N double tap
nmap <C-N><C-N> :set invnumber<CR>
nmap <leader>ln :set invnumber<CR>
"Toggle line wrap with Ctrl+L double tap
nmap <C-L><C-L> :set wrap!<CR>
nmap <leader>lw :set wrap!<CR>
"Allows filetype detection
filetype on
"editing multiple files
"Ctrl+j maximizes split below
"Ctrl+k maximizes split above
"allows size 0 splits
"map <C-J> <C-W>j<C-W>_
"map <C-K> <C-W>k<C-W>_
"set wmh=0
"Move between splits using Ctrl+hjkl
map <C-k> <C-w>k
map <C-j> <C-w>j
map <C-l> <C-w>l
map <C-h> <C-w>h
" map Shift+U to redo
map <S-u> <C-r>
" Buffet shortcut
nnoremap <silent> <F2> :Bufferlist<CR>
"CTags List
nnoremap <silent> <F8> :TlistToggle<CR>
let Tlist_Exit_OnlyWindow=1
let Tlist_Winwidth=30
"Syntax Hightlighting
syntax on
"Remap jk to esc
inoremap jk <esc>
"Remap Ctrl+Space for auto Complete
inoremap <C-Space> <C-n>
inoremap <Nul> <C-n>
" Stupid shift key fixes
"cmap W w
cmap WQ wq
cmap Wq wq
"cmap Q q
"clearing highlighted search
nmap <silent> <leader>/ :nohlsearch<CR>
" Change Working Directory to that of the current file
cmap cwd lcd %:p:h
cmap cd. lcd %:p:h