Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Shevchenko ur4ltz

View GitHub Profile
@folke
folke / lua-lsp.lua
Last active Jun 15, 2021
Correct sumneko lua lsp setup for init.lua and plugin development
View lua-lsp.lua
-- put this file somewhere in your nvim config, like: ~/.config/nvim/lua/config/lua-lsp.lua
-- usage: require'lspconfig'.sumneko_lua.setup(require("config.lua-lsp"))
local library = {}
local path = vim.split(package.path, ";")
-- this is the ONLY correct way to setup your path
table.insert(path, "lua/?.lua")
table.insert(path, "lua/?/init.lua")
@windwp
windwp / livereload.lua
Created Apr 18, 2021
livereload for plugin development on lua
View livereload.lua
#Neovim Trick
Live Reload on plugin development and init.lua
# Demo
# How
* [ ] code
@pkkm
pkkm / git-ml.el
Created Feb 26, 2021
Asynchronous git modeline (rough prototype)
View git-ml.el
;;; Asynchronous detailed git modeline.
;; git-ml is free software: you can redistribute it and/or modify it under the
;; terms of the GNU General Public License as published by the Free Software
;; Foundation, either version 3 of the License, or (at your option) any later
;; version.
;; This is a rough sketch. Things to do before publishing it as a package:
;;
;; * Consider doing the checks per git directory instead of per buffer, then
View mpv-btfs.lua
--[[
script to make mpv play torrents/magnets directly using btfs
requires:
- linux
- btfs
- xterm (optional)
usage:
@TheCedarPrince
TheCedarPrince / init.vim
Last active May 31, 2021
My (neo)Vim Configuration File
View init.vim
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" VIM SETTINGS
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" TURNS LINE NUMBERING ON
set nu
" trigger `autoread` when files changes on disk
set autoread
autocmd FocusGained,BufEnter,CursorHold,CursorHoldI * if mode() != 'c' | checktime | endif
@rougier
rougier / nano.el
Created Oct 2, 2020
A very minimal emacs configuration
View nano.el
;; nano.el -- A very minimal emacs
;; Usage: emacs -q -l nano.el
;;
;; Copyright (C) 2020 Nicolas .P Rougier
;;
;; Author: Nicolas P. Rougier <nicolas.rougier@inria.fr>
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
@mg979
mg979 / import.vim
Last active May 4, 2021
Import Ultisnips snippets in vim-vsnip
View import.vim
" ========================================================================///
" Description: import UltiSnips snippets as VsCode snippets for vim-vsnip
" File: import.vim
" Author: Gianmaria Bajo <mg1979@git.gmail.com>
" License: MIT
" Created: dom 09 agosto 2020 13:14:35
" Modified: dom 09 agosto 2020 15:33:32
" ========================================================================///
function! import#snippets(ask_confirm) abort
@windwp
windwp / i3-swallow.py
Last active Feb 10, 2021
i3-swallow used to swallow a terminal window in i3
View i3-swallow.py
#!/usr/bin/env python3
#-----------------------------------------------
# used to swallow a terminal window in i3
#
# INSTALL
# Install python 3 and install i3ipc libary
# pip3 install i3ipc
# download this scrript and put it to your i3 config folder and run
@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,