arthurealike / vimconfig

My personal .vimrc file with many useful plugins.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

😎 vimconfig

My personal .vimrc file with many useful plugins.

  • I'm using macOS its version : Catalina 10.15.5
  • I uploaded it to backup my config. Do not ever use my .vimrc file, it is chaotic 🤯

Check these out to get better results :

https://github.com/amix/vimrc, https://devhints.io/vimscript
Make your own or try to get it from the link above.

Alt text

Color Cheatsheet (Xterm)

List of 256 colors

Plugins

Key Mappings

Leader key is comma (",")

Toggle NERDTree:

map <F2> :NERDTreeToggle <CR>

Run .py files:

map <buffer> <F9> :w<CR>:exec '!python3' shellescape(@%, 1) <CR>

Delete all buffers except current one:

nmap <buffer> <leader>bb :BufOnly <CR>

Open .vimrc in a new tab:

nmap <silent> <leader>vr :tabnew $MYVIMRC<CR>

Go to definiton Ycm:

map <leader>g  :YcmCompleter GoToDefinitionElseDeclaration <CR>

Love2d (Löve) & Lua support

Biggest advantage is my config is that to run lua scripts and launch love in vim with a single keystroke, and every time you run script, command window will be cleared. It works well. There is a plugin with 105 LOC and it is probably better solution but i didn't get the code well (i am newbie) and tried to make my own and it took only 2 lines of code.

Do not forget to set $PATH variable for love2d.

Press to launch love
Let's say, your buffer's path is ~/Desktop/game/main.lua and it will run love ~/Desktop/game/ that's it.

Key Mappings

au Filetype lua nmap <buffer> <F5> :call RunLove() <CR>
au Filetype lua nmap <buffer> <F10> :call LuaExecCurrent() <CR>


RunLove function does the job for love and LuaExecCurrent will run any lua script.
Both execute ClearCmdWin() function which clears current terminal's window.

Functions

function RunLove()
     call ClearCmdwin()
     lcd %:p:h
     !love  `pwd` 
endfunction
function ClearCmdwin()
    silent !clear
    redraw!
endfunction
function! LuaExecCurrent()
    call ClearCmdwin() 
    w expand("%")
    execute ":!lua" exists("g:mainfile") ? g:mainfile : expand("%")
endfunction


Lua scripts remember love functions by the dictionary, click below to download.

Dictionary Link
Put dictionary file under the .vim/love-dictionary/ directory.

ScreenShots

There are screenshots of environments with different colorschemes. I've installed same vim plugins on macOS and ubuntu.

Here is the results of my .vimrc configuration on two different OS.


Color Schemes

  • Onedark
  • Gruvbox
  • Koehler
  • Zenburn
  • Dracula

macOS

Gruvbox

Alt text

Alt text

Onedark

Alt text

Koehler

Alt text

Zenburn

Alt text

Ubuntu

Gruvbox

Alt text

Koehler

Alt text

Zenburn

Alt text

Onedark

Alt text

Dracula

Alt text

STRONGLY recommended plugin

Create a file with .todo extension, leave the rest to plugin.

I added those lines to .vimrc to insert date automatically when a task is created:
let g:VimTodoListsDatesEnabled = 1
let g:VimTodoListsDatesFormat = "%a %d, %Y"

Alt text

Baddest text editor on the planet!

About

My personal .vimrc file with many useful plugins.