Compare commits
9 Commits
90f9fdd8e2
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9423b98d5f | |||
| 2b3b2c5996 | |||
| 21bb788396 | |||
| 1a5d9f1e4b | |||
| 22c5b1fc58 | |||
| c78d5756b9 | |||
| 35a331f827 | |||
| 792cd2f051 | |||
| 0f06ba63fb |
@@ -6,6 +6,10 @@ It uses Lazy.nvim as the plugin manager, lspconfig for the language server confi
|
|||||||
## Linter configs
|
## Linter configs
|
||||||
You may find the linter configs and setup-scripts for some linters that require some extra setup [here](https://git.janishutz.com/janishutz/dotfiles/)
|
You may find the linter configs and setup-scripts for some linters that require some extra setup [here](https://git.janishutz.com/janishutz/dotfiles/)
|
||||||
|
|
||||||
|
# Lua notes
|
||||||
|
To get your luarocks packages to be picked up by the language server, it is currently configured to only look at the `cwd` that nvim is open in.
|
||||||
|
I may expand that in the future to do a proper search for all open buffers, but that would require a language server restart to apply on every buffer add
|
||||||
|
|
||||||
# Issues with jdtls
|
# Issues with jdtls
|
||||||
Ensure you have jdk21-opnejdk or newer installed. On Arch (and derivatives) you can switch the preferred java version using `archlinux-java set <version name>`
|
Ensure you have jdk21-opnejdk or newer installed. On Arch (and derivatives) you can switch the preferred java version using `archlinux-java set <version name>`
|
||||||
|
|
||||||
|
|||||||
@@ -71,13 +71,13 @@ keymap.set("n", "<leader><leader>x", ":!chmod +x %:p<CR>", opts("make current fi
|
|||||||
keymap.set(
|
keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<leader>#",
|
"<leader>#",
|
||||||
":w<CR>:!chmod +x %:p<CR>ggi#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>",
|
":w<CR>:!chmod +x %:p<CR>ggO#!/bin/sh<CR><CR><Esc>:setfiletype bash<CR>",
|
||||||
opts("setup sh script")
|
opts("setup sh script")
|
||||||
)
|
)
|
||||||
keymap.set(
|
keymap.set(
|
||||||
"n",
|
"n",
|
||||||
"<leader><leader>#",
|
"<leader><leader>#",
|
||||||
":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>:LspStart pyright<CR>i#!/usr/bin/env python3<CR><CR>",
|
":set syntax=python<CR>:w<CR>:!chmod +x %:p<CR>ggO#!/usr/bin/env python3<CR><CR>",
|
||||||
opts("setup python script")
|
opts("setup python script")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -20,12 +20,13 @@ lsp.config("lua_ls", {
|
|||||||
library = {
|
library = {
|
||||||
vim.fn.expand("$VIMRUNTIME/lua"),
|
vim.fn.expand("$VIMRUNTIME/lua"),
|
||||||
vim.fn.stdpath("config") .. "/lua",
|
vim.fn.stdpath("config") .. "/lua",
|
||||||
vim.fn.expand("~/.luarocks/share/lua/5.3"),
|
vim.fn.expand("~/.luarocks/share/lua/5.4"),
|
||||||
-- To use LÖVR, follow https://lovr.org/docs/dev/VS_Code_Setup#manual-installation
|
-- To use LÖVR, follow https://lovr.org/docs/dev/VS_Code_Setup#manual-installation
|
||||||
-- TL;DR run lovr api cats in the lovr-docs repo and update the path below
|
-- TL;DR run lovr api cats in the lovr-docs repo and update the path below
|
||||||
-- Then update the blow path (if you have not used the script in this repo)
|
-- Then update the blow path (if you have not used the script in this repo)
|
||||||
vim.fn.expand("~/.local/share/lovr-docs/api/cats"),
|
vim.fn.expand("~/.local/share/lovr-docs/api/cats"),
|
||||||
"/usr/share/lua/5.3",
|
vim.fn.expand(vim.fn.getcwd() .. "/lua_modules/share/lua/5.4"),
|
||||||
|
"/usr/share/lua/5.4",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
-- ┌ ┐
|
||||||
|
-- │ GitHub Actions │
|
||||||
|
-- └ ┘
|
||||||
|
local lsp = vim.lsp
|
||||||
|
|
||||||
|
local capabilities = require("lsp-options").capabilities
|
||||||
|
local on_attach = require("lsp-options").on_attach
|
||||||
|
|
||||||
|
lsp.config("yamlls", {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = on_attach,
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
-- ── Enable configs ───────────────────────────────────────────────
|
||||||
|
local enable = vim.lsp.enable
|
||||||
|
enable("yamlls")
|
||||||
@@ -38,6 +38,7 @@ return {
|
|||||||
require("plugins.lsp.ls.sql")
|
require("plugins.lsp.ls.sql")
|
||||||
require("plugins.lsp.ls.text")
|
require("plugins.lsp.ls.text")
|
||||||
require("plugins.lsp.ls.web")
|
require("plugins.lsp.ls.web")
|
||||||
|
require("plugins.lsp.ls.yaml")
|
||||||
-- ───────────────────────────────────────────────────────────────────
|
-- ───────────────────────────────────────────────────────────────────
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ return {
|
|||||||
"verible",
|
"verible",
|
||||||
"vtsls",
|
"vtsls",
|
||||||
"vue_ls",
|
"vue_ls",
|
||||||
|
"yamlls"
|
||||||
},
|
},
|
||||||
-- auto-install configured servers (with lspconfig)
|
-- auto-install configured servers (with lspconfig)
|
||||||
automatic_enable = false,
|
automatic_enable = false,
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
return {
|
||||||
|
-- Treesitter parser support
|
||||||
|
"arborist-ts/arborist.nvim",
|
||||||
|
config = function()
|
||||||
|
require("arborist").setup({
|
||||||
|
update_cadence = "weekly",
|
||||||
|
prefer_wasm = false,
|
||||||
|
install_popular = false,
|
||||||
|
ensure_installed = {
|
||||||
|
"asm",
|
||||||
|
"bash",
|
||||||
|
"c",
|
||||||
|
"cpp",
|
||||||
|
"css",
|
||||||
|
"gotmpl",
|
||||||
|
"haskell",
|
||||||
|
"helm",
|
||||||
|
"html",
|
||||||
|
"hyprlang",
|
||||||
|
"java",
|
||||||
|
"javadoc",
|
||||||
|
"javascript",
|
||||||
|
"jsdoc",
|
||||||
|
"json",
|
||||||
|
"latex",
|
||||||
|
"lua",
|
||||||
|
"markdown",
|
||||||
|
"python",
|
||||||
|
"scss",
|
||||||
|
"toml",
|
||||||
|
"typescript",
|
||||||
|
"tsx",
|
||||||
|
"xml",
|
||||||
|
"yaml",
|
||||||
|
},
|
||||||
|
ignore = {
|
||||||
|
"tex",
|
||||||
|
"latex",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
}
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
return {
|
|
||||||
-- syntax highlighting
|
|
||||||
"nvim-treesitter/nvim-treesitter",
|
|
||||||
branch = "master",
|
|
||||||
event = { "BufRead", "BufNewFile" },
|
|
||||||
build = ":TSUpdate",
|
|
||||||
config = function()
|
|
||||||
require("nvim-treesitter.configs").setup({
|
|
||||||
ensure_installed = {
|
|
||||||
"asm",
|
|
||||||
"bash",
|
|
||||||
"c",
|
|
||||||
"cpp",
|
|
||||||
"css",
|
|
||||||
"gotmpl",
|
|
||||||
"haskell",
|
|
||||||
"helm",
|
|
||||||
"html",
|
|
||||||
"hyprlang",
|
|
||||||
"java",
|
|
||||||
"javadoc",
|
|
||||||
"javascript",
|
|
||||||
"jsdoc",
|
|
||||||
"json",
|
|
||||||
"jsonc",
|
|
||||||
-- "latex",
|
|
||||||
"lua",
|
|
||||||
"markdown",
|
|
||||||
"meson",
|
|
||||||
"nginx",
|
|
||||||
"php",
|
|
||||||
"python",
|
|
||||||
"rasi",
|
|
||||||
"requirements",
|
|
||||||
"robots",
|
|
||||||
"ruby",
|
|
||||||
"rust",
|
|
||||||
"scss",
|
|
||||||
"sql",
|
|
||||||
"svelte",
|
|
||||||
"swift",
|
|
||||||
"toml",
|
|
||||||
"typescript",
|
|
||||||
"tsx",
|
|
||||||
"verilog",
|
|
||||||
"vue",
|
|
||||||
"xml",
|
|
||||||
"yaml",
|
|
||||||
"zathurarc",
|
|
||||||
},
|
|
||||||
sync_install = false,
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
disable = { "tex" },
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@@ -332,6 +332,12 @@
|
|||||||
"\\langle $1 \\rangle"
|
"\\langle $1 \\rangle"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"dblbrackets": {
|
||||||
|
"prefix": "dblbrackets",
|
||||||
|
"body": [
|
||||||
|
"\\llbracket $1 \\rrbracket"
|
||||||
|
]
|
||||||
|
},
|
||||||
"fill-width": {
|
"fill-width": {
|
||||||
"prefix": "#fill",
|
"prefix": "#fill",
|
||||||
"body": [
|
"body": [
|
||||||
|
|||||||
@@ -1,43 +1,28 @@
|
|||||||
{
|
{
|
||||||
"JS-Class": {
|
|
||||||
"prefix": "jsSetupClass",
|
|
||||||
"body": "class $1 { \n\tconstructor () {} \n\n \t$2 () {\n\t$3\n\t}\n}",
|
|
||||||
"description": "Setup the basic structure of a class in JS"
|
|
||||||
},
|
|
||||||
"ExpressJS": {
|
"ExpressJS": {
|
||||||
"prefix": "jsExpressSetup",
|
"prefix": "setupExpressApp",
|
||||||
"body": [
|
"body": [
|
||||||
"const express = require( 'express' );",
|
"import express from 'express';",
|
||||||
"let app = express();",
|
"import path from 'path';",
|
||||||
"const path = require( 'path' );",
|
"import expressSession from 'express-session';",
|
||||||
"const expressSession = require( 'express-session' );",
|
"import fs from 'fs';\n",
|
||||||
"const fs = require( 'fs' );",
|
"let app = express();",
|
||||||
"const bodyParser = require( 'body-parser' );",
|
"\napp.use( expressSession ( {\n\tsecret: $1,\n\tresave: true,\n\tsaveUninitialized: false\n} ) );",
|
||||||
"const cookieParser = require( 'cookie-parser' )",
|
"\n\napp.get( '/', ( request: express.Request, response: express.Response ) => {\n$4\n} );",
|
||||||
"const favicon = require( 'serve-favicon' );",
|
"app.use( ( _request: express.Request, response: express.Response ) => {",
|
||||||
"\napp.use( expressSession ( {\n\tsecret: $1,\n\tresave: true,\n\tsaveUninitialized: true\n} ) );",
|
"\tresponse.sendFile( path.join( __dirname, '$3' ) ) \n} );",
|
||||||
"app.use( bodyParser.urlencoded( { extended: false } ) );",
|
|
||||||
"app.use( bodyParser.json() );",
|
|
||||||
"app.use( cookieParser() );",
|
|
||||||
"app.use( favicon( path.join( __dirname + '$2' ) ) );\n",
|
|
||||||
"app.use( ( request, response, next ) => {\n\tresponse.sendFile( path.join( __dirname + '$3' ) ) \n} );",
|
|
||||||
"\n\napp.get( '/', ( request, response ) => {\n$4\n} );",
|
|
||||||
"\n\nconst PORT = process.env.PORT || 8080;",
|
"\n\nconst PORT = process.env.PORT || 8080;",
|
||||||
"http.createServer( app ).listen( PORT );"
|
"app.listen( PORT );"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ExpressJS-Route": {
|
"ExpressJS-Route": {
|
||||||
"prefix": "jsEjsRoute",
|
"prefix": "expressRoute",
|
||||||
"body": "\n\napp.get( '$1', ( request: express.Request, response: express.Response ) => {\n$4\n} );"
|
"body": "\n\napp.get( '$1', ( request: express.Request, response: express.Response ) => {\n$4\n} );"
|
||||||
},
|
},
|
||||||
"JSAsync": {
|
"JSAsync": {
|
||||||
"prefix": "jsAsync",
|
"prefix": "async-sync",
|
||||||
"body": "(async () => {\n$1\n} ) ();"
|
"body": "(async () => {\n$1\n} ) ();"
|
||||||
},
|
},
|
||||||
"JSpromiseReturnFunc": {
|
|
||||||
"prefix": "jsPromise",
|
|
||||||
"body": "function $1 () {\n\treturn new Promise( ( resolve, reject ) => {\n\t$2\n\t} );\n}"
|
|
||||||
},
|
|
||||||
"fetch from other url": {
|
"fetch from other url": {
|
||||||
"prefix": "remoteURL",
|
"prefix": "remoteURL",
|
||||||
"body": [
|
"body": [
|
||||||
|
|||||||
@@ -9,13 +9,9 @@
|
|||||||
"description": "Setup the basic structure of a class in JS"
|
"description": "Setup the basic structure of a class in JS"
|
||||||
},
|
},
|
||||||
"JSAsync": {
|
"JSAsync": {
|
||||||
"prefix": "jsAsync",
|
"prefix": "async-sync",
|
||||||
"body": "(async () => {\n$1\n} ) ();"
|
"body": "(async () => {\n$1\n} ) ();"
|
||||||
},
|
},
|
||||||
"JSpromiseReturnFunc": {
|
|
||||||
"prefix": "jsPromise",
|
|
||||||
"body": "function $1 () {\n\treturn new Promise( ( resolve, reject ) => {\n\t$2\n\t} );\n}"
|
|
||||||
},
|
|
||||||
"fetch from other url": {
|
"fetch from other url": {
|
||||||
"prefix": "remoteURL",
|
"prefix": "remoteURL",
|
||||||
"body": [
|
"body": [
|
||||||
|
|||||||
Reference in New Issue
Block a user