From ca9a774280fd1e3e8d3dfbeb6396fbdd54598b64 Mon Sep 17 00:00:00 2001 From: ManjaroOne666 Date: Thu, 28 Dec 2017 21:01:58 +0000 Subject: [PATCH] better line numbering, colorcolumns --- vim/.netrwhist | 6 +++++- vim/colors/customred256.vim | 26 +++++++++++++++++--------- vimrc | 29 ++++++++++++++++++++--------- 3 files changed, 42 insertions(+), 19 deletions(-) diff --git a/vim/.netrwhist b/vim/.netrwhist index d1df77f..22f6433 100644 --- a/vim/.netrwhist +++ b/vim/.netrwhist @@ -1,4 +1,8 @@ let g:netrw_dirhistmax =10 -let g:netrw_dirhist_cnt =2 +let g:netrw_dirhist_cnt =6 let g:netrw_dirhist_1='/home/ray/.screenlayout' let g:netrw_dirhist_2='/home/ray/.config/i3status' +let g:netrw_dirhist_3='/home/ray/Projects/Vue/vx/src/components' +let g:netrw_dirhist_4='/home/ray/Projects/Vue/vx/src' +let g:netrw_dirhist_5='/home/ray/Projects/Vue/vx/src/sass' +let g:netrw_dirhist_6='/home/ray/Projects/Vue/vx/src/components' diff --git a/vim/colors/customred256.vim b/vim/colors/customred256.vim index 4c36b34..49b6493 100644 --- a/vim/colors/customred256.vim +++ b/vim/colors/customred256.vim @@ -1,15 +1,15 @@ " Vim color file -set bg=dark +set background=dark hi clear Normal hi clear -if exists("syntax_on") +if exists('syntax_on') syntax reset endif set fillchars=stl:\ ,stlnc:\ ,vert:\ -let colors_name = "customred256" +let colors_name = 'customred256' hi Normal ctermfg=246 ctermbg=none @@ -317,22 +317,30 @@ hi StatusLine ctermfg=255 ctermbg=239 term=none cterm=none hi StatusLineNC ctermfg=238 ctermbg=233 term=none cterm=none " set status to change the status line based on mode if version >= 700 - au InsertEnter * hi StatusLine ctermfg=233 ctermbg=255 - au InsertLeave * hi StatusLine ctermfg=255 ctermbg=239 + augroup statuscursorlines + au InsertEnter * hi StatusLine ctermfg=233 ctermbg=255 + au InsertLeave * hi StatusLine ctermfg=255 ctermbg=239 - au InsertEnter * set cursorline - au InsertLeave * set nocursorline + au InsertEnter * set cursorline + au InsertLeave * set nocursorline + augroup END endif -hi VertSplit ctermfg=233 ctermbg=233 term=none cterm=none +hi VertSplit ctermfg=16 ctermbg=16 term=none cterm=none hi Folded ctermfg=243 ctermbg=232 cterm=bold term=bold -hi FoldColumn ctermfg=239 ctermbg=232 cterm=bold term=bold +hi FoldColumn ctermfg=239 ctermbg=none cterm=bold term=bold hi LineNr ctermfg=239 ctermbg=none cterm=none hi CursorLineNr ctermfg=243 ctermbg=none cterm=none hi EndOfBuffer ctermfg=233 ctermbg=none hi ColorColumn ctermbg=233 hi SignColumn ctermfg=255 ctermbg=none +augroup linenrcolor + au InsertEnter * hi LineNr ctermfg=236 + au InsertEnter * hi CursorLineNr ctermfg=248 + au InsertLeave * hi LineNr ctermfg=239 + au InsertLeave * hi CursorLineNr ctermfg=243 +augroup END hi DiffAdd guibg=darkblue ctermbg=darkblue term=none cterm=none hi DiffChange guibg=darkmagenta ctermbg=magenta cterm=none diff --git a/vimrc b/vimrc index 7c85272..1895949 100644 --- a/vimrc +++ b/vimrc @@ -232,9 +232,6 @@ set statusline+=%* " always show statusline set laststatus=2 -" set a right margin and it's colour -set colorcolumn=80 - set foldmethod=manual set autoindent @@ -259,11 +256,13 @@ set pastetoggle= set showmode " set custom syntax highlighting -autocmd BufNewFile,BufRead *.html set syntax=html_custom -autocmd BufNewFile,BufRead *.php set syntax=php_custom -autocmd BufNewFile,BufRead *.vue set syntax=vue_custom -autocmd BufNewFile,BufRead *.vue syntax sync fromstart -autocmd BufNewFile,BufRead *.js set syntax=pangloss_javascript_custom +augroup syntaxhighlighting + autocmd BufNewFile,BufRead *.html set syntax=html_custom + autocmd BufNewFile,BufRead *.php set syntax=php_custom + autocmd BufNewFile,BufRead *.vue set syntax=vue_custom + autocmd BufNewFile,BufRead *.vue syntax sync fromstart + autocmd BufNewFile,BufRead *.js set syntax=pangloss_javascript_custom +augroup END " fix higlight problems such as vertical-align etc augroup VimCSS3Syntax @@ -279,7 +278,17 @@ augroup coloreload au BufWritePost customred256.vim so $MYVIMRC augroup end +augroup linenumbering + autocmd InsertEnter * :set norelativenumber + autocmd InsertLeave * :set number relativenumber + autocmd WinEnter * :set number relativenumber + autocmd WinLeave * set norelativenumber +augroup END +augroup colorcolumns + autocmd WinEnter * set colorcolumn=80 + autocmd WinLeave * set colorcolumn=0 +augroup END " Automatically reload .vimrc if chanaged augroup myvimrc @@ -389,7 +398,9 @@ let g:UltiSnipsJumpBackwardTrigger='' nnoremap :NERDTreeFocus nnoremap nt :NERDTreeFocus " allow closing if only window open is a NERDTree -autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +augroup nerdtreewindow + autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif +augroup END let NERDTreeQuitOnOpen = 1 " TagBar