Skip to content

Instantly share code, notes, and snippets.


Andy Shevchenko ur4ltz

View GitHub Profile
phelipetls / lsp.lua
Last active May 31, 2021
Neovim built-in LSP diagnostics into location list
View lsp.lua
local severity_map = { "E", "W", "I", "H" }
local parse_diagnostics = function(diagnostics)
if not diagnostics then return end
local items = {}
for _, diagnostic in ipairs(diagnostics) do
local fname = vim.fn.bufname()
local position = diagnostic.range.start
local severity = diagnostic.severity
table.insert(items, {
romainl /
Last active May 27, 2021
Off the beaten path

Off the beaten path

What is &path used for?

Vim uses :help 'path' to define the root directories from where to search non-recursively for files.

It is used for:

  • gf, gF, <C-w>f, <C-w>F, <C-w>gf, <C-w>gF,
  • :find, :sfind, :tabfind,
Daivasmara / .vimrc
Last active Feb 21, 2021
NVIM v0.4.4
View .vimrc
call plug#begin('~/.vim/plugged')
Plug 'challenger-deep-theme/vim', { 'as': 'challenger-deep' }
Plug 'morhetz/gruvbox'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
Plug 'junegunn/fzf.vim'
Plug 'stsewd/fzf-checkout.vim'
Plug 'sheerun/vim-polyglot'
Plug 'vim-airline/vim-airline'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
yegappan / VimScriptForPythonDevelopers.MD
Last active Sep 18, 2021
Vim script for Python Developers
View VimScriptForPythonDevelopers.MD

Vim Script for Python Developers

A guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.

For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way

For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter

This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, key-mapping,

View clink-powerline-prompt.lua
jfcherng /
Last active Sep 5, 2021
Sublime Text 4 changelog just because it's not on the official website yet.
wbthomason / help.vim
Last active May 25, 2021
Neovim: Open help in a floating window
View help.vim
scriptencoding utf-8
" This function originates from; it isn't mine
function! CreateCenteredFloatingWindow() abort
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
View floating window
function! CreateCenteredFloatingWindow()
let width = min([&columns - 4, max([80, &columns - 20])])
let height = min([&lines - 4, max([20, &lines - 10])])
let top = ((&lines - height) / 2) - 1
let left = (&columns - width) / 2
let opts = {'relative': 'editor', 'row': top, 'col': left, 'width': width, 'height': height, 'style': 'minimal'}
let top = "╭" . repeat("─", width - 2) . "╮"
let mid = "│" . repeat(" ", width - 2) . "│"
acrisci /
Last active Aug 3, 2020
A helper script to set a default media player in Linux
#!/usr/bin/env bash
help_string=$(cat <<EOF
Usage: $0 [-h|-l] APPLICATION
Set a video player as the default.
# List candidate desktop files for media players.
View theme.vim
hi VertSplit ctermbg=NONE guibg=NONE guifg=#455354
hi CursorLine term=NONE cterm=NONE gui=NONE
hi SpellCap guibg=#383900 cterm=NONE gui=NONE
hi SpellBad guibg=#661400 cterm=NONE gui=NONE
hi Pmenu guibg=#2d3135 guifg=#a0d1d9
hi PmenuSel guibg=#818890
hi PmenuSbar guibg=#121315
hi PmenuThumb guibg=#b1bfcc guifg=#66d9ef
hi NeomakeWarningSign guifg=#969900 guibg=#232526 cterm=NONE gui=NONE
hi NeomakeErrorSign guifg=#991f00 guibg=#232526 cterm=NONE gui=NONE