syntax on "Syntax ON
set re=0
set noimd "Revert back to English when on different language
set nocompatible "Latest Vim Setting used
set encoding=utf-8
so ~/.vim/plugins.vim "Source the plugins
filetype plugin indent on
"-------------GENERAL SETTINGS-------------
runtime macros
:filetype indent on
set t_CO=256 "Number of colours
set display+=lastline "Show long lines"
set autoindent "Copy indent from previous line
set smartindent "Smart indenting when { is used
set autoread "Auto refresh when file has been changed
set ignorecase "Ignores case when searching
set smartcase "Disables ignorecase when capitals used
set so=10 "Keep cursor to not touch the bottom or top"
set backspace=indent,eol,start "Make backspace as normal
hi clear SignColumn "Disable signcolumn
set noerrorbells visualbell t_vb= "No error bells
set autowriteall "Automatically writes file
set complete=.,w,b,u "Set autocomplete
set shortmess=a "Get rid of Please press enter when opening a file"
set backupcopy=yes "Overwrite backupto original
set noswapfile "Dont create swapfiles
set confirm "Dont prompt when nonsaved quits
set mouse=a "Click to position cursor always"
set splitbelow "Horizontal split to below
set splitright "Vertical split to right
set hlsearch "highlight search
set incsearch "Show preview of search
set diffopt+=vertical "Set split and diff to vertical
let mapleader = ',' "The default leader is '\'
"GUI Adjust"
hi LineNr ctermbg=0 guibg=bg
hi vertsplit ctermbg=0 guibg=bg
hi foldcolumn ctermbg=0 guibg=bg guifg=white
hi clear SignColumn
"----------VISUALS---------
set guifont=FiraCode\ Nerd\ Font:h12 "Set font family
set linespace=10 "Set line space
set wrapmargin=0 "line number margins
set textwidth=0 "Set text width"
set nonumber "No line numbers
"set number Set line numbers"
"set relativenumber Set relative numbers"
set ttyfast "Set typing fast/ scroll fast option"
set guioptions-=e "Disable tabline
set guioptions-=l "Disable scrollbars
set guioptions-=L
set guioptions-=r
set guioptions-=R
set tabstop=4 "Default tabs
set expandtab "Use space as a tab
set softtabstop=4 "Width applied by tab
set shiftwidth=4 "Width of tab in normal mode
let &t_SI.="\e[5 q" "Cursor shape change in different mode
let &t_SR.="\e[4 q"
let &t_EI.="\e[1 q"
if has('linebreak')
set breakindent
let &showbreak = '↳ '
set cpo+=n
let &breakat = " \t;:,])}"
end
set list lcs=trail:·,tab:»»,nbsp:~ "Show whitespaces with symbol
"Mappings
map ; :
noremap ;; ;
nmap j gj
nmap k gk
vmap j gj
vmap k gk
nnoremap ∆ :m .+1<CR>==
nnoremap ˚ :m .-2<CR>==
inoremap ∆ <Esc>:m .+1<CR>==gi
inoremap ˚ <Esc>:m .-2<CR>==gi
vnoremap ∆ :m '>+1<CR>gv=gv
vnoremap ˚ :m '<-2<CR>gv=gv
"highlight word under cursor - more options :so $VIMRUNTIME/syntax/hitest.vim
":autocmd CursorMoved * exe printf('match SpellLocal /\V\%%%dl\@!\<%s\>/', line('.'), escape(expand('<cword>'), '/\'))
"Folding
set foldmethod=syntax
:setlocal foldcolumn=0
let javascript_fold=1
set foldlevelstart=99
set fillchars=fold:\
"Space to toggle folds
nnoremap <silent> <Space> @=(foldlevel('.')?'za':"\<Space>")<CR>
"Neat Folding
function! NeatFoldText()
let line = '' . substitute(getline(v:foldstart), '^\s*"\?\s*\|\s*"\?\s*{{' . '{\d*\s*', '', 'g') . ' '
let lines_count = v:foldend - v:foldstart + 1
let lines_count_text = '|' . printf("%10s", lines_count . ' lines') . '|'
let foldchar = matchstr(&fillchars, 'fold:\zs.')
let foldtextstart = strpart('+' . repeat(foldchar, v:foldlevel*2). line, 0, (winwidth(0)*2)/3)
let foldtextend = lines_count_text . repeat(foldchar, 8)
let foldtextlength = strlen(substitute(foldtextstart . foldtextend, '.', 'x', 'g')) + &foldcolumn
return foldtextstart . repeat(foldchar, winwidth(0)-foldtextlength) . foldtextend
endfunction
set foldtext=NeatFoldText()
"-------------SYNTAX HIGHLIGHTING-------------
"Python Syntax
let g:python_highlight_all = 1
"Custom ext highlighting
au BufNewFile,BufRead *.ejs,*.vue,*hbs set filetype=html
au BufNewFile,BufRead *.jsx set filetype=javascriptreact
au BufNewFile,BufRead *.tsx set filetype=typescriptreact
au BufRead,BufNewFile .py,.pyw,*.c,*.h match BadWhitespace /\s\+$/
"---------------THEMES---------------
set background=dark
let g:gruvbox_material_background = 'hard'
colorscheme gruvbox-material
hi clear SignColumn
hi RedundantSpaces ctermbg=red guibg=red
hi ExtraWhitespace ctermbg=red guibg=red
2match RedundantSpaces /\s\+$/
2match ExtraWhitespace /\s\+$/
let g:airline_theme='gruvbox_material'
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#show_buffers = 0
let g:airline#extensions#tabline#show_splits = 0
let g:airline#extensions#tabline#show_tabs = 1
let g:airline#extensions#tabline#close_symbol = '×'
let g:airline#extensions#tabline#show_close_button = 1
let g:airline#extensions#tabline#formatter = 'unique_tail_improved'
let g:asyncrun_open = 8
let g:asyncrun_status = ''
let g:airline_section_error = airline#section#create_right(['%{g:asyncrun_status}'])
map <F10> :echo "hi<" . synIDattr(synID(line("."),col("."),1),"name") . '> trans<'
\ . synIDattr(synID(line("."),col("."),0),"name") . "> lo<"
\ . synIDattr(synIDtrans(synID(line("."),col("."),1)),"name") . ">"<CR>
let g:terminal_ansi_colors = [ '#546d79', '#ff5151', '#69f0ad', '#ffd73f', '#40c4fe', '#ff3f80', '#64fcda', '#fefefe', '#b0bec4', '#ff8980', '#b9f6c9', '#ffe47e', '#80d7fe', '#ff80ab', '#a7fdeb', '#fefefe',]
"black, dark red, dark green, dark yellow, dark blue, dark magenta, dark cyan, light grey, dark grey, red, green, yellow, blue, magenta, cyan, white
"-----AUTO-COMMANDS------"
"Auto sourcing self
augroup autosourcing
autocmd!
autocmd BufWritePost $MYVIMRC source $MYVIMRC
autocmd BufWritePost $MYVIMRC AirlineRefresh
augroup END
Steps to reproduce this bug using minimal vimrc
Open a long complex file (e.g. Line length 260 .tsx file)
Actual behaviour
Takes about 1~2 seconds to load the page
Expected behaviour
Take less than 1 seconds to open the file (my previous theme kristijanhusak/vim-hybrid-material used to take less than 1sec)
echo $TERM
: xterm-256colortmux -V
:vim --version
ornvim --version
:Minimal vimrc that can reproduce this bug
Steps to reproduce this bug using minimal vimrc
Open a long complex file (e.g. Line length 260 .tsx file)
Actual behaviour
Takes about 1~2 seconds to load the page
Expected behaviour
Take less than 1 seconds to open the file (my previous theme kristijanhusak/vim-hybrid-material used to take less than 1sec)