Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Shevchenko ur4ltz

View GitHub Profile
@phelipetls
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
romainl / path.md
Last active May 27, 2021
Off the beaten path
View path.md

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
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
yegappan / VimScriptForPythonDevelopers.MD
Last active Jul 21, 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
jfcherng / st4-changelog.md
Last active Jul 23, 2021
Sublime Text 4 changelog just because it's not on the official website yet.
View st4-changelog.md
@wbthomason
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 https://www.reddit.com/r/neovim/comments/eq1xpt/how_open_help_in_floating_windows/; 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
acrisci / default-media-player.sh
Last active Aug 3, 2020
A helper script to set a default media player in Linux
View default-media-player.sh
#!/usr/bin/env bash
help_string=$(cat <<EOF
Usage: $0 [-h|-l] APPLICATION
Set a video player as the default.
Example:
# 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