update a bunch of nvim stuff

This commit is contained in:
LordMZTE 2022-11-02 20:10:32 +01:00
parent b6e49ded57
commit 70d7fa533a
Signed by: LordMZTE
GPG key ID: B64802DC33A64FF6
5 changed files with 34 additions and 1 deletions

View file

@ -11,5 +11,5 @@ export CXX=clang++
export EDITOR=nvim export EDITOR=nvim
# paths # paths
export PATH="$HOME/.cargo/bin:$HOME/.local/bin:$HOME/go/bin:$PATH" export PATH="$HOME/.mix/escripts:$HOME/.cargo/bin:$HOME/.local/bin:$HOME/go/bin:$PATH"
export LUA_CPATH="$HOME/.local/lib/lua/?.so;$HOME/.local/lib/lua/?.lua;;" export LUA_CPATH="$HOME/.local/lib/lua/?.so;$HOME/.local/lib/lua/?.lua;;"

View file

@ -4,3 +4,4 @@ require "plugins"
require "settings" require "settings"
require "maps" require "maps"
require "neovide" require "neovide"
require "pipe"

27
.config/nvim/lua/pipe.lua Normal file
View file

@ -0,0 +1,27 @@
-- https://gist.github.com/ii14/c5d6c39c1bc7b8553afe76db3350c043
-- :! replacement that supports char-wise selection
-- from visual mode :Pipe <command>
vim.api.nvim_create_user_command('Pipe', function(ctx)
local ms = vim.api.nvim_buf_get_mark(0, '<')
local me = vim.api.nvim_buf_get_mark(0, '>')
local mt = vim.fn.visualmode()
if mt == '\22' then
error 'blockwise selection not supported'
end
local lines = vim.api.nvim_buf_get_lines(0, ms[1] - 1, me[1], true)
local input = vim.deepcopy(lines)
if mt == 'v' then
input[#input] = input[#input]:sub(1, me[2] + 1)
input[1] = input[1]:sub(ms[2] + 1)
end
local output = vim.fn.systemlist(ctx.args, input)
if #output == 0 then
output = {''}
end
if mt == 'v' then
output[#output] = output[#output] .. lines[#lines]:sub(me[2] + 2)
output[1] = lines[#lines]:sub(1, ms[2]) .. output[1]
end
vim.api.nvim_buf_set_lines(0, ms[1] - 1, me[1], true, output)
end, { range = true, nargs = '+', complete = 'shellcmd' })

View file

@ -12,6 +12,10 @@ table.insert(lua_runtime_path, "lua/?/init.lua")
lspc.clangd.setup { capabilities = caps } lspc.clangd.setup { capabilities = caps }
lspc.cssls.setup { capabilities = caps } lspc.cssls.setup { capabilities = caps }
lspc.elixirls.setup {
capabilities = caps,
cmd = { "elixir-ls" },
}
lspc.eslint.setup { capabilities = caps } lspc.eslint.setup { capabilities = caps }
lspc.haxe_language_server.setup { capabilities = caps } lspc.haxe_language_server.setup { capabilities = caps }
lspc.html.setup { capabilities = caps } lspc.html.setup { capabilities = caps }

View file

@ -1,4 +1,5 @@
lsps := " lsps := "
elixir-ls-git
eslint eslint
lua-language-server lua-language-server
rust-analyzer rust-analyzer