You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

150 lines
4.2 KiB
VimL

filetype plugin indent on
" show existing tab with 4 spaces width
" editing to be more usual
" set tabstop=4
" set shiftwidth=4
" set expandtab
" set backspace=indent,eol,start
set ts=4 sts=4 sw=4 expandtab
set backspace=indent,eol,start
3 years ago
" basics
2 years ago
set nu rnu
let mapleader=' '
2 years ago
set nocompatible
3 years ago
" setting color theme stuff
3 years ago
set background=dark
3 years ago
syntax enable
3 years ago
colorscheme hybrid
" default transparent bg
hi Normal guibg=NONE ctermbg=NONE
let t:is_transparent = 1
"toggle func
function! ToggleTransparent()
if t:is_transparent == 0
hi Normal guibg=NONE ctermbg=NONE
let t:is_transparent = 1
else
set background=dark
2 years ago
syntax enable
let t:is_transparent = 0
endif
endfunction
nnoremap <silent> <leader>b : call ToggleTransparent()<CR>
3 years ago
" syntax highlighting for go
2 years ago
let g:go_highlight_types=1
let g:go_highlight_fields=1
let g:go_highlight_functions=1
let g:go_highlight_function_calls=1
let g:go_highlight_operators=1
let g:go_highlight_extra_types=1
" vimmarkdown config
let g:vim_markdown_folding_disabled = 1
let g:vim_markdown_math = 1
let g:vim_markdown_strikethrough = 1
" let g:vim_markdown_new_list_item_indent = 4
2 years ago
" use md for vim wiki and disable global linking
let g:vimwiki_list = [{'path': '~/vimwiki/',
\ 'syntax': 'markdown', 'ext': '.md'}]
" let g:vimwiki_global_ext = 0
2 years ago
" calcurse markdown support
autocmd BufRead,BufNewFile /tmp/calcurse* set filetype=markdown
autocmd BufRead,BufNewFile ~/.local/share/calcurse/notes/* set filetype=markdown
2 years ago
" airline settings
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" setting nf symbols
let g:airline_symbols.linenr = ''
let g:airline_symbols.maxlinenr = ''
let g:airline_symbols.dirty = ''
2 years ago
" nerdtree settings
let NERDTreeHighlightCursorLine=1
let NERDTreeQuitOnOpen=1
" nerdtree tab settings
let g:nerdtree_tabs_open_on_console_startup=2
let g:nerdtree_tabs_autoclose=1
let g:nerdtree_tabs_smart_startup_focus=1
"let g:nerd
autocmd StdinReadPre * let s:std_in=1
" auto open on empty
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" prevent replacing the buffer
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
2 years ago
" nerdtree binds
nnoremap <silent> <leader>t :NERDTreeMirrorToggle<CR>
nnoremap <silent> <leader>n :NERDTreeFocusToggle<CR>
" nnoremap <C-f> :NERDTreeFocus<CR> going to conflict with fzf and I dont use
" this anyway
"
" vimtex configuration
let g:vimtex_view_method = 'zathura'
let g:tex_flavor='latex'
let g:vimtex_quickfix_mode=0
" fzf settings
set rtp+=~/.fzf
if exists('$TMUX')
let g:fzf_layout = { 'tmux': '-p60%,70%' }
else
let g:fzf_layout = { 'window': { 'width': 0.6, 'height' : 0.7 }}
endif
" fzf default find
command! -bang -nargs=? -complete=dir Files
\ call fzf#run(fzf#wrap(
\ { 'source': 'find * -type f',
\ 'dir': <q-args>,
\ 'options': [
\ '--layout=reverse',
\ '--info=inline',
\ '--preview', 'bat --color=always {}']},
\ <bang>0))
" git support via filtering
command! -bang -nargs=? -complete=dir GFiles
\ call fzf#run(fzf#wrap(
\ { 'source': 'git ls-files',
\ 'dir': <q-args>,
\ 'options': [
\ '--layout=reverse',
\ '--info=inline',
\ '--preview', 'bat --color=always {}']},
\ <bang>0))
nnoremap <silent> <leader>f :Files<cr>
nnoremap <silent> <leader>g :GFiles<CR>
" nnoremap <silent> <leader>s :GFiles?<CR>
2 years ago
" tweaking timeout to quit instatnly via esc
set ttimeout
set ttimeoutlen=100
" time to learn vim
noremap <up> :echoerr "Umm, use k instead"<cr>
noremap <down>:echoerr "Umm,use j instead"<cr>
noremap <left>:echoerr "Umm,use h instead"<cr>
noremap <right>:echoerr "Umm,use l instead"<cr>
inoremap <up> <NOP>
inoremap <down> <NOP>
inoremap <left> <NOP>
inoremap <right> <NOP>
2 years ago
" " ale fixing for ts
" let g:ale_fixers = {
" \ '*': ['remove_trailing_lines', 'trim_whitespace'],
" \ 'typescript': ['eslint'],
" \}
" let g:ale_fix_on_save = 1