My vim configuration
Vim will have separate colorschemes and configurations in GUI, Terminal and tty in this setup.
- Terminal
- colorscheme: hybrid [dark]
- tty
- colorscheme: industry
- GUI [gvim/vim-gtk3]
- font: Liberation Mono
- colorscheme: hybrid_material [light]
if [[ ! -z "${questions}" ]]; then
echo "Keep reading ;)"
else
echo "Have fun and goodbye :*"
exit 0
fi
for questions in ${mind}
do
echo ${questions}
doneLet me explain a little bit :)
I have all of my configurations in separate files. One file for keybindings, another for statusline configs and so on. In each file, I have some kind of settings.
This is the init file which vim reads settings from this.
And I source all my config files in it.
Also there is a section, just an if statement to say:
if vim opened in a tty, set this colorscheme and do this
if vim opened inside of a Terminal, do these and use this colorscheme
and if vim opened in a GUI mode [gvim typically] use this font, and this colorscheme
This file contains some of basic settings like
- Line numbering
- No Vi compatibilities
- set clipboard
- show status line
- etc...
This is the fun part. I have three functions in this file.
All these three functions do is
mapping some ascii characters like •, →, ⇒
to some common symbols like ., ->, =>
and let us to toggle [for enable and disable these maps]
between two functions.
One function to activate, one for deactivate, and one for toggle between those two functions.
The keybinding for toggling is <space><space>c in normal mode.
I keep most of my key mappings in this file. Thinks like:
<leader>ffto execute:20Lexplore<CR><C-w>w<leader>ssto execute:setlocal spell!<CR><leader>seto execute:set spelllang=en_us<CR><C-p>to execute:set paste!- etc...
I'm used to have \ as leader key.
You can set mapleader to something else like ,.
See keybinds.vim file, line 8.
"" <Leader> key section
let mapleader='\' " change the <Leader> KeyIf you want to set the leader key [or anything] to ,
note that I have , set to read some template files located in
$HOME/.vim/templates/ directory to the current file.
Take a look at skels.vim file, line 8, g:skelkey variable,
for changing the g:skelkey which I it set to , by default.
"" add ready-to-use text by .ext
let g:skelkey=','This file, as you guess from it's name, have some extra settings and features enabled. Things like:
- Auto fill
{ } [ ] ( )- Has a keybinding to enable/disable
- Fills markdown's
* *and_ _- This will be only enabled on markdown files, and cannot be turned off [Didn't set that :)]
- some
omnifuncconfigurations- like
set omnifunc=htmlcomplete#CompleteTagsforhtml/xhtmlfiletype
- like
- don't expand tab in
makefiletype [makefiles] - enable
filetype pluginandfiletype indent - also it has the
plugins
Plugins:
vim-plug is the plugin manager of my choice.
Active plugins [requires :PlugInstall to install]:
- 'Jorengarenar/miniSnip'
- 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
- 'vimwiki/vimwiki'
- 'lifepillar/vim-mucomplete'
- also some plugins which are commented out ;)
This file is for compile/execute programs/scripts.
That's all you need to know but, if want to, you can take a look ;)
Syntax is like:
autocmd FileType <File_type> nnoremap <Key_binding> :!<Command><CR>This file[s] is just status line.
I do not use a plugin for this. It's all just vim's built-in status line.
Plugin configs:
- latex-live-preview.vim
- minisnip.vim
- mucomplete.vim
- omnifunc.vim
latex-live-preview.vim- set
zathuraas viewer - set
xelatexas latex engine
- set
minisnip.vim<Ctrl-s><Ctrl-s>to apply snippet
vi.vim- It is a very very lightweight config file
- It is not using any plugins
- The most external tool it use is
netrw - I did not included it in
vimrcfile - Give it a try:
vim -u $PWD/vi.vim ~/.bashrc
There is another file called Note.vim,
this file is to use with two scripts NoteMarkdown.sh and NoteBuild.sh
for taking notes and building pdf[s] from that notes.
[I am thinking about a way to do it differently, but for now, it's all I got :)]
There is also some directories in the $HOME/.vim dir, right?
Wanna know what are those?!
case $1 in
[yY]|[yY][eE][sS])
echo "Keep reading ;)"
;;
*)
echo "Have a nice life, take care :*"
exit 0
;;
esacThe vim-plug plugin manager live in this directory :)
It is obvious right? It contains colorschemes :)))
Oh this one! I wrote a very small syntax highlighter
[about 5 line of code in total XD] for files with .sent extension.
In this directory, basically I told vim
Hey!
*.sentfiles are a kind! they aresent
And in sent.vim file, I defined the color scheme [just has 3 or 4 lines, nothing serious]
Custom snippets written by me to use it with minisnip plugin
All the plugins will be stored [installed] here.
If you install a new dictionary [which vim needs to download it] guess now :)) it will keep the dictionary files here.
This is where is keep my skeleton/template files, call them whatever you like I don't care XD
Available colors:
- 256_noir
- ayu
- codedark
- dalton
- deus
- fogbell
- genericdc-light
- gruvbox
- hybrid
- materialbox
- material
- minimalist
- molokai
- monokai_pro
- nord
- onehalf
- phoenix
- simple-dark
- solarized8
- sunbather
- xcode
I like and use hybrid colorscheme.
c
c [gvim]
lua
Shout out to all people who I learnt from <3


