Skip to content

Commit

Permalink
More lsps
Browse files Browse the repository at this point in the history
  • Loading branch information
JafarAbdi committed Jan 28, 2025
1 parent 9a8cdc3 commit 47f3966
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 5 deletions.
60 changes: 57 additions & 3 deletions neovim/.config/nvim/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ local root_dirs = {
zig = function(startpath)
return vim.fs.root(startpath, { "build.zig" })
end,
dockerfile = function(startpath)
return vim.fs.root(startpath, { "Dockerfile" })
end,
}
root_dirs.c = root_dirs.cpp
root_dirs.cuda = root_dirs.cpp
Expand Down Expand Up @@ -717,6 +720,44 @@ end, {
-----------------

local servers = {
ts_ls = {
name = "typescript-language-server",
cmd = { "bunx", "typescript-language-server", "--stdio" },
filetypes = {
"javascript",
"javascriptreact",
"javascript.jsx",
"typescript",
"typescriptreact",
"typescript.tsx",
},
},
yamlls = {
name = "yamlls",
cmd = { "bunx", "yaml-language-server", "--stdio" },
filetypes = { "yaml" },
settings = {
yaml = {
schemas = {
["https://json.schemastore.org/pre-commit-config.json"] = {
".pre-commit-config.yml",
".pre-commit-config.yaml",
},
["https://json.schemastore.org/github-action.json"] = {
"action.yml",
"action.yaml",
},
["https://json.schemastore.org/github-workflow.json"] = {
".github/workflows/**.yml",
".github/workflows/**.yaml",
},
["https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json"] = {
"docker-compose.yml",
},
},
},
},
},
{
name = "taplo",
filetypes = { "toml" },
Expand Down Expand Up @@ -1055,13 +1096,19 @@ local servers = {
"envs",
"python-lsp",
"bin",
"jedi-language-server"
"jedi-language-server",
"-vv",
"--log-file",
"/tmp/logging.txt"
),
}, -- "-vv", "--log-file", "/tmp/logging.txt"
},
init_options = function(file)
local options = {
workspace = {
extraPaths = { vim.env.HOME .. "/.cache/python-stubs" },
extraPaths = {
vim.env.HOME .. "/.cache/python-stubs",
vim.env.HOME .. "/.cache/python-stubs/stubs",
},
environmentPath = "/usr/bin/python3",
},
}
Expand Down Expand Up @@ -1092,6 +1139,13 @@ local servers = {
filetypes = { "xml" },
cmd = { "lemminx" },
},
{
name = "docker-ls",
cmd = { "bunx", "dockerfile-language-server-nodejs", "--stdio" },
filetypes = {
"dockerfile",
},
},
}

for _, server in pairs(servers) do
Expand Down
9 changes: 7 additions & 2 deletions scripts/.local/bin/gr
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,18 @@
# 2. Interactively narrow down the list using fzf
# 3. Open the file in Vim
extra_args=""
while getopts ":hn" opt; do
fzf_extra_args=""
while getopts ":hne" opt; do
case ${opt} in
h )
extra_args="$extra_args --hidden"
;;
n )
extra_args="$extra_args --no-ignore"
;;
e )
fzf_extra_args="--exact"
;;
\? )
echo "Invalid option: -$OPTARG" 1>&2
exit 1
Expand All @@ -34,6 +38,7 @@ IFS=: read -ra selected < <(
--delimiter : \
--preview 'bat --color=always {1} --highlight-line {2}' \
--bind='f3:become(nvim {1}:{2} < /dev/tty > /dev/tty 2>&1)' \
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3'
--preview-window 'up,60%,border-bottom,+{2}+3/3,~3' \
${fzf_extra_args:-}
)
[ -n "${selected[0]}" ] && nvim "${selected[0]}" "+${selected[1]}"

0 comments on commit 47f3966

Please sign in to comment.