This commit is contained in:
bvn13 2023-12-05 23:26:18 +03:00
commit a8bdc4e515
9 changed files with 2985 additions and 0 deletions

2812
autoload/plug.vim Normal file

File diff suppressed because it is too large Load Diff

1
plugged/dwm.vim Submodule

@ -0,0 +1 @@
Subproject commit 6149e58fdd81f69e4e6a3f239842f3dc23e4872b

@ -0,0 +1 @@
Subproject commit 8a61bdfa351d4df9a9118ee1d3f45edbed617072

1
plugged/nerdtree Submodule

@ -0,0 +1 @@
Subproject commit fc85a6f07c2cd694be93496ffad75be126240068

1
plugged/vim-airline Submodule

@ -0,0 +1 @@
Subproject commit 78abec3b83b5fb1bef51fcdddbcbebd7d4293685

@ -0,0 +1 @@
Subproject commit 0514af606a3b41bbe82c33875179b53300a3cb86

@ -0,0 +1 @@
Subproject commit 724bd53adfbaf32e129b001658b45d4c5c29ca1a

1
plugged/vim-yankstack Submodule

@ -0,0 +1 @@
Subproject commit 157a659c1b101c899935d961774fb5c8f0775370

166
vimrc.vim Normal file
View File

@ -0,0 +1,166 @@
colorscheme desert
set encoding=utf8
set noerrorbells
let mapleader = "\\" " map leader to comma
syntax enable
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set expandtab " tabs are spaces
set number " show line numbers
set relativenumber " show relative line numbers
set showcmd " show command in bottom bar
set cursorline " highlight current line
filetype indent on " load filetype-specific indent files
set wildmenu " visual autocomplete for command menu
set lazyredraw " redraw only when we need to.
set showmatch " highlight matching [{()}]
set ignorecase
set smartcase
set incsearch " search as characters are entered
set hlsearch " highlight matches
" turn off search highlight
nnoremap <leader><space> :nohlsearch<CR>
set foldenable " enable folding
set foldlevelstart=10 " open most folds by default
set foldnestmax=10 " 10 nested fold max
" space open/closes folds
nnoremap <space> za
set foldmethod=indent " fold based on indent level
" switching over buffers
map gn :bn<cr>
map gp :bp<cr>
map gd :bd<cr>
" move vertically by visual line
nnoremap j gj
nnoremap k gk
" move to beginning/end of line
nnoremap B ^
nnoremap E $
" $/^ doesn't do anything
nnoremap $ <nop>
nnoremap ^ <nop>
" highlight last inserted text
nnoremap gV `[v`]
" using tabs
map <C-j> <C-W>j
map <C-k> <C-W>k
map <C-h> <C-W>h
map <C-l> <C-W>l
" toggle between number and relativenumber
function! ToggleNumber()
if(&relativenumber == 1)
set norelativenumber
set number
else
set relativenumber
endif
endfunc
" strips trailing whitespace at the end of files. this
" is called on buffer write in the autogroup above.
function! <SID>StripTrailingWhitespaces()
" save last search & cursor position
let _s=@/
let l = line(".")
let c = col(".")
%s/\s\+$//e
let @/=_s
call cursor(l, c)
endfunction
augroup configgroup
autocmd!
autocmd VimEnter * highlight clear SignColumn
autocmd BufWritePre *.php,*.py,*.js,*.txt,*.hs,*.java,*.md
\:call <SID>StripTrailingWhitespaces()
autocmd FileType java setlocal noexpandtab
autocmd FileType java setlocal list
autocmd FileType java setlocal listchars=tab:+\ ,eol:-
autocmd FileType java setlocal formatprg=par\ -w80\ -T4
autocmd FileType php setlocal expandtab
autocmd FileType php setlocal list
autocmd FileType php setlocal listchars=tab:+\ ,eol:-
autocmd FileType php setlocal formatprg=par\ -w80\ -T4
autocmd FileType ruby setlocal tabstop=2
autocmd FileType ruby setlocal shiftwidth=2
autocmd FileType ruby setlocal softtabstop=2
autocmd FileType ruby setlocal commentstring=#\ %s
autocmd FileType python setlocal commentstring=#\ %s
autocmd BufEnter *.cls setlocal filetype=java
autocmd BufEnter *.zsh-theme setlocal filetype=zsh
autocmd BufEnter Makefile setlocal noexpandtab
autocmd BufEnter *.sh setlocal tabstop=2
autocmd BufEnter *.sh setlocal shiftwidth=2
autocmd BufEnter *.sh setlocal softtabstop=2
augroup END
set backup
set backupdir=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set backupskip=/tmp/*,/private/tmp/*
set directory=~/.vim-tmp,~/.tmp,~/tmp,/var/tmp,/tmp
set writebackup
set statusline= " clear the statusline for when vimrc is reloaded
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%m%r%w " flags
set statusline+=[%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{strlen(&fenc)?&fenc:&enc}, " encoding
set statusline+=%{&fileformat}] " file format
set statusline+=%= " right align
set statusline+=%{synIDattr(synID(line('.'),col('.'),1),'name')}\ " highlight
set statusline+=%b,0x%-8B\ " current char
set statusline+=%-14.(%l,%c%V%)\ %<%P " offset
set laststatus=2
" Plugins will be downloaded under the specified directory.
call plug#begin(has('nvim') ? stdpath('data') . '/plugged' : '~/.vim/plugged')
" Declare the list of plugins.
" ':PlugInstall' to install plugins
Plug 'spolu/dwm.vim'
Plug 'preservim/nerdtree'
Plug 'mg979/vim-visual-multi', {'branch': 'master'}
Plug 'vim-airline/vim-airline'
Plug 'jeetsukumaran/vim-buffergator'
Plug 'rhysd/git-messenger.vim'
Plug 'maxbrunsfeld/vim-yankstack'
" List ends here. Plugins become visible to Vim after this call.
call plug#end()
" NERDTree plugin
nmap <F6> :NERDTree<CR>
nnoremap <leader>n :NERDTreeFocus<CR>
" nnoremap <C-n> :NERDTree<CR>
nnoremap <F7> :NERDTreeToggle<CR>
nnoremap <C-f> :NERDTreeFind<CR>
" DWM plugin
nmap <C-P> <Plug>DWMNew
" Splitted window size changing
nnoremap <F2> 5<C-w><
nnoremap <F3> 5<C-w>>
nnoremap <F4> 1<C-w>+
nnoremap <F5> 1<C-w>-
" useful combination
noremap <leader>r :source ~/.vimrc<CR>