Skip to content

Instantly share code, notes, and snippets.

@RayZ0rr
RayZ0rr / lsp-config.lua
Created January 22, 2022 16:29
Nvim lsp settings
--##########################################################################################################
-- LSP Keybindings and completion---------------------------------------------------------------------------
--###################################################################################################################
local nvim_lsp = require('lspconfig')
vim.lsp.set_log_level 'debug'
-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
@RayZ0rr
RayZ0rr / min-vimrc.vim
Created January 13, 2022 21:29
Minimal neovim rc file to test 'syntax enable' bug
if has('vim_starting')
set encoding=utf-8
endif
scriptencoding utf-8
if &compatible
set nocompatible
endif
let s:plug_dir = expand('/tmp/plugged/vim-plug')
@RayZ0rr
RayZ0rr / mini-vimrc.lua
Created January 13, 2022 21:04
Minimal neovim rc file to show 'syntax enable' bug
local on_windows = vim.loop.os_uname().version:match 'Windows'
local function join_paths(...)
local path_sep = on_windows and '\\' or '/'
local result = table.concat({ ... }, path_sep)
return result
end
vim.cmd [[set runtimepath=$VIMRUNTIME]]
@RayZ0rr
RayZ0rr / array.sh
Created January 13, 2022 19:12
A test bash array
#!/usr/bin/env bash
# find "${1}" -maxdepth 1 -not -path "${1}" -type d -printf "%f\n"
# find "${1}" -maxdepth 1 -not -path "${1}" -type d -print0
readarray -d '' myArray1 < <(find "${1}" -maxdepth 1 -not -path "${1}" -type d -printf "%f\n")
readarray -d '' myArray2 < <(find "${1}" -maxdepth 1 -not -path "${1}" -type d -print0)
echo "myArray1\n"
for i in "${myArray1[@]}" ; do
echo "$i "
done
@RayZ0rr
RayZ0rr / minrc-treesitter.lua
Created January 13, 2022 18:10
Minimal vimrc based on Vim-plug for treesitter testing
local on_windows = vim.loop.os_uname().version:match 'Windows'
local function join_paths(...)
local path_sep = on_windows and '\\' or '/'
local result = table.concat({ ... }, path_sep)
return result
end
vim.cmd [[set runtimepath=$VIMRUNTIME]]
@RayZ0rr
RayZ0rr / minrc-treesitter.vim
Created January 13, 2022 17:10
Minimal vimrc based on Vim-plug for treesitter testing
if has('vim_starting')
set encoding=utf-8
endif
scriptencoding utf-8
if &compatible
set nocompatible
endif
let s:plug_dir = expand('/tmp/plugged/vim-plug')