From 2e2189bb2ade03a07aae039f5b954e5831459a08 Mon Sep 17 00:00:00 2001 From: DarkWiiPlayer Date: Tue, 19 Nov 2024 09:22:14 +0100 Subject: [PATCH] Add rtags helper to find ranger tags --- bin/rtags | 9 +++++++++ vim/plugin/lsp.lua | 16 ++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) create mode 100755 bin/rtags diff --git a/bin/rtags b/bin/rtags new file mode 100755 index 0000000..131ff93 --- /dev/null +++ b/bin/rtags @@ -0,0 +1,9 @@ +#!/bin/sh + +if [ -n "$1" ] +then mask="^$1:" +else mask='^\/' +fi + +pwd=$(pwd | sed -e 's/\//\\\//g') +cat $HOME/.config/ranger/tagged | sed -e "/$mask/!d" -e "s/$mask//" -e "/^$pwd/!d" diff --git a/vim/plugin/lsp.lua b/vim/plugin/lsp.lua index 30200c4..166506d 100644 --- a/vim/plugin/lsp.lua +++ b/vim/plugin/lsp.lua @@ -1,4 +1,5 @@ local config = require 'lspconfig' +local util = require 'lspconfig.util' local ensure_capabilities xpcall(function() @@ -23,6 +24,15 @@ end}) -- init_options -> during server initialization -- settings -> sent as config change event right after initialization local configs = setmetatable({ + ruby_lsp = default { + init_options = { + formatter = "standard"; + linters = { "standard" }; + } + }, + standardrb = default { + root_dir = util.root_pattern("Gemfile", ".git", ".standard.yml"); + }, yamlls = default { settings = { yaml = { @@ -30,12 +40,6 @@ local configs = setmetatable({ } } }, - ruby_lsp = default { - init_options = { - formatter = "standard"; - linters = { "standard" }; - } - }, }, {__index = function() return default end}) for _, language in ipairs {