Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Shevchenko ur4ltz

View GitHub Profile
@VonHeikemen
VonHeikemen / map_utils.lua
Last active Mar 27, 2022
Allows you to use lua functions with `vim.api.nvim_set_keymap` (for neovim 0.6.1 or lower)
View map_utils.lua
local M = {}
local module_name = 'map_utils'
local fn_store = {}
local function register_fn(fn)
table.insert(fn_store, fn)
return #fn_store
end
function M.apply_function(id)
@VonHeikemen
VonHeikemen / prompt-backspace.lua
Last active Jan 10, 2022
Neovim: Use backspace when `buftype=prompt`
View prompt-backspace.lua
-- Taken from here:
-- https://github.com/neovim/neovim/issues/14116#issuecomment-977555102
function PromptBackspace()
-- Have to know the length of the prompt
local prompt = 2
local cursor = vim.api.nvim_win_get_cursor(0)
local line = cursor[1]
local col = cursor[2]
if col ~= prompt then
@VonHeikemen
VonHeikemen / completion.lua
Created Nov 16, 2021
Sublime-like autocompletion for neovim, using nvim-cmp and luasnip
View completion.lua
--[[
Dependencies:
Completion:
https://github.com/hrsh7th/nvim-cmp
https://github.com/hrsh7th/cmp-buffer
https://github.com/hrsh7th/cmp-path
https://github.com/saadparwaiz1/cmp_luasnip
Snippets:
@numToStr
numToStr / au.lua
Last active Aug 1, 2022
Neovim autocmd in lua
View au.lua
--
-- Move this file to your neovim lua runtime path ie. ~/.config/nvim/lua/au.lua
--
local cmd = vim.api.nvim_command
local function autocmd(this, event, spec)
local is_table = type(spec) == 'table'
local pattern = is_table and spec[1] or '*'
local action = is_table and spec[2] or spec
if type(action) == 'function' then
@folke
folke / lua-lsp.lua
Last active Jun 22, 2022
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")
@pianocomposer321
pianocomposer321 / colors.lua
Last active Jun 8, 2022
Feline.nvim config
View colors.lua
-- ~/.config/nvim/lua/plugins/feline/colors.lua
-- One-dark colors
local _M = {
bg = '#2c323c',
fg = none,
yellow = '#e5c07b',
cyan = '#8abeb7',
darkblue = '#528bff',
green = '#98c379',
@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
@TheCedarPrince
TheCedarPrince / init.vim
Last active Jul 22, 2022
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
@nezuo
nezuo / testez-selene.md
Last active Jun 10, 2022
TestEZ standard library for selene
View testez-selene.md

Instructions

  1. Copy the file below into one called testez.yml
  2. In selene.toml, replace std = "roblox" with std = "roblox+testez"