summaryrefslogtreecommitdiff
path: root/.vimrc
diff options
context:
space:
mode:
authorSyndamia <kamen.d.mladenov@protonmail.com>2021-01-22 09:54:12 +0200
committerSyndamia <kamen.d.mladenov@protonmail.com>2021-01-22 09:54:12 +0200
commit6f4aee8a813f2a416ca56d1cb81a90ddaf655bc4 (patch)
tree685103736ad2186bc29f17579043116295323081 /.vimrc
parent60a243d1adf895df9d2e2f55e8e75cfe10e7f27f (diff)
downloaddotfiles-6f4aee8a813f2a416ca56d1cb81a90ddaf655bc4.tar
dotfiles-6f4aee8a813f2a416ca56d1cb81a90ddaf655bc4.tar.gz
dotfiles-6f4aee8a813f2a416ca56d1cb81a90ddaf655bc4.zip
Updated comments, updated identation setup, added tabman plugin, improved lightline (has enable collection and tab names have limited size)
Diffstat (limited to '.vimrc')
-rw-r--r--.vimrc40
1 files changed, 25 insertions, 15 deletions
diff --git a/.vimrc b/.vimrc
index eea39bc..1e3daf9 100644
--- a/.vimrc
+++ b/.vimrc
@@ -16,7 +16,7 @@ Plug 'tomtom/tcomment_vim' " Toggle comments (gc, gcc)
Plug 'godlygeek/tabular' " Line up text by a given character (:Tabularize /CHAR)
Plug 'vim-syntastic/syntastic' " Syntax error checker
Plug 'neoclide/coc.nvim', {'branch': 'release'} " IntelliSense practically
-Plug 'itchyny/lightline.vim' " Statusline for Vim
+Plug 'itchyny/lightline.vim' " Statusline and tabline for Vim
Plug 'tpope/vim-fugitive' " git integration
Plug 'mbbill/undotree' " Easily interact with undo history
Plug 'OmniSharp/omnisharp-vim' " C# tools (autocompletion, ...)
@@ -28,7 +28,8 @@ Plug 'pseewald/vim-anyfold' " Better folding
Plug 'editorconfig/editorconfig-vim' " Support for EditorConfig
Plug 'tpope/vim-eunuch' " Easy UNIX shell commands
Plug 'mg979/vim-visual-multi' " Multiple line cursor (and other stuff)
-Plug 'zivyangll/git-blame.vim'
+Plug 'zivyangll/git-blame.vim' " Show who last edited a line
+Plug 'kien/tabman.vim' " Show open buffers
""""""""""""""""""""""""""""""""
@@ -68,7 +69,7 @@ nmap <C-z> u
imap <C-r> <ESC><C-r>i
"imap <C-S-z> <C-r> An impossible dream
imap <C-s> <ESC>:w<CR>a
-
+
" Use Ctrl + hjkl for navigation in insert mode
inoremap <C-h> <Left>
inoremap <C-j> <Down>
@@ -81,7 +82,7 @@ ca ва wa
ca ь x
ca ьа xa
-" The following work the same as usual (as :x and :xa), but can also close running jobs (e.g. terminal windows)
+" The following works almost the same as normal :x and :xa, but can also close running jobs (e.g. terminal windows)
ca x w <bar> q!
ca xa wa <bar> qa!
@@ -108,10 +109,9 @@ set mouse=a " Mouse support
set tabstop=4 " Show tabs as 4 wide
set shiftwidth=4 " Indent with 4 spaces
-" set expandtab " Convert tabs to spaces
filetype plugin indent on
autocmd BufRead,BufNewFile *.component.css set filetype=css
-autocmd FileType css,ts setlocal ts=2 sw=2 sts=0 expandtab " Show CSS tabs as 2 spaces
+autocmd FileType css,ts setlocal ts=2 sw=2 sts=0 expandtab " Show CSS and TS tabs as 2 spaces
" When you press F6 it will toggle a "spell check mode",
" spell is activated and the colorscheme is changed
@@ -147,7 +147,6 @@ endfunction
tmap <silent> <ScrollWheelUp> <c-w>:call EnterNormalMode()<CR>
-
"""""""""""""""""""""""""""""""
" Color scheme settings
"""""""""""""""""""""""""""""""
@@ -198,6 +197,13 @@ if !exists('g:undotree_DiffCommand')
endif
"""""""""""""""""""""""""""""""
+" Tabman
+"""""""""""""""""""""""""""""""
+
+let g:tabman_toggle = '<S-Tab>'
+let g:tabman_side = 'right'
+
+"""""""""""""""""""""""""""""""
" Syntastic settings
"""""""""""""""""""""""""""""""
@@ -219,7 +225,6 @@ syntax on
autocmd Filetype * AnyFoldActivate " activate for all filetypes
set foldlevel=99 " Open all folds by default
-
"""""""""""""""""""""""""""""""
" Lighline settings
"""""""""""""""""""""""""""""""
@@ -231,6 +236,10 @@ if !has('gui_running')
endif
let g:lightline = {
+ \ 'enable': {
+ \ 'statusline': 1,
+ \ 'tabline': 1
+ \ },
\ 'colorscheme': 'wombat',
\ 'active': {
\ 'left': [ [ 'mode', 'paste' ],
@@ -257,8 +266,7 @@ let g:lightline = {
\ 'tab_component_function': {
\ 'iconFilename': 'LightlineTabFilename',
\ 'iconReadonly': 'LightlineTabReadonly',
- \ 'iconModified': 'LightlineTabModified',
- \ 'iconClose': 'LightlineTabIconClose'
+ \ 'iconModified': 'LightlineTabModified'
\ },
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': '', 'right': '' },
@@ -290,12 +298,16 @@ function! LightlineFileType()
return strlen(&filetype) ? WebDevIconsGetFileTypeSymbol() . ' ' . &filetype : ''
endfunction
-" Adds the filetype icon in tabs
+" Adds the filetype icon in tabs and limit their width
function! LightlineTabFilename(n) abort
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
- let _ = expand('#'.buflist[winnr - 1].':t')
- return WebDevIconsGetFileTypeSymbol(_) . ' ' . ( _ !=# '' ? _ : '[No Name]' )
+ let _ = (expand('#'.buflist[winnr - 1].':t') !=# '' ? expand('#'.buflist[winnr - 1].':t') : '[No Name]')
+
+ " Limit the width of tabs, so they don't go out of the screen
+ let tabNameLengthMax = &columns/((tabpagenr('$') > 0 ? tabpagenr('$') : 0) + 5)
+
+ return WebDevIconsGetFileTypeSymbol(_) . ' ' . _[0:tabNameLengthMax]
endfunction
function! LightlineTabReadonly(n) abort
@@ -313,7 +325,6 @@ endfunction
"""""""""""""""""""""""""""""""
" Omni completion supports C, HTML, CSS, JavaScript, PHP, Python, Ruby, SQL, XML
-
filetype plugin on
set omnifunc=syntaxcomplete#Complete " Completion for all supported languages
@@ -498,4 +509,3 @@ nnoremap <silent><nowait> <space>j :<C-u>CocNext<CR>
nnoremap <silent><nowait> <space>k :<C-u>CocPrev<CR>
" Resume latest coc list.
nnoremap <silent><nowait> <space>p :<C-u>CocListResume<CR>
-