Compare commits
42
Commits
783be7767e
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f051082a3 | ||
|
|
c2bd4d9468 | ||
|
|
467450029d | ||
|
|
64888f9b6a | ||
|
|
5e6a665265 | ||
|
|
a430080725 | ||
|
|
0f52c02146 | ||
|
|
2d659409b0 | ||
|
|
44e87facfa | ||
|
|
445110f8ba | ||
|
|
8d1ae01c30 | ||
|
|
407e1e40d7 | ||
|
|
82e363e2db | ||
|
|
65228858bf | ||
|
|
17e4e8974e | ||
|
|
5c83cea036 | ||
|
|
b973d61038 | ||
|
|
f76918b675 | ||
|
|
55903f7a18 | ||
|
|
192dc306e0 | ||
|
|
d73edb9f42 | ||
|
|
fd81db8289 | ||
|
|
08f2df497d | ||
|
|
4cd196435d | ||
|
|
9f071ec04f | ||
|
|
9511de0647 | ||
|
|
0c6b316734 | ||
|
|
2c9e2e1e10 | ||
|
|
0de1b49c58 | ||
|
|
afaad61c44 | ||
|
|
00ca16dad2 | ||
|
|
b2e5e97f84 | ||
|
|
bd8ef4ba75 | ||
|
|
1b73fe06fd | ||
|
|
b7810da99e | ||
|
|
936a035616 | ||
|
|
c752fa44e0 | ||
|
|
de1fc323ca | ||
|
|
8348794af9 | ||
|
|
a0dbffdfe6 | ||
|
|
29bc106b2c | ||
|
|
2f37b95989 |
@@ -6,14 +6,15 @@ stow:
|
|||||||
unstow:
|
unstow:
|
||||||
stow -D nvim ghostty emacs
|
stow -D nvim ghostty emacs
|
||||||
|
|
||||||
|
# if stow is not available, symlink configs instead
|
||||||
|
# TODO: this is currently outdated
|
||||||
|
|
||||||
LN := ln -svf
|
LN := ln -svf
|
||||||
LNDIR := ln -sv
|
LNDIR := ln -sv
|
||||||
|
|
||||||
DOTFILES_DIR := $(shell pwd)
|
DOTFILES_DIR := $(shell pwd)
|
||||||
TARGET_DIR := $(HOME)
|
TARGET_DIR := $(HOME)
|
||||||
|
|
||||||
# if stow is not available, symlink configs instead
|
|
||||||
# this is currently outdated
|
|
||||||
.PHONY: link unlink
|
.PHONY: link unlink
|
||||||
link: nvim
|
link: nvim
|
||||||
|
|
||||||
|
|||||||
@@ -4,4 +4,10 @@
|
|||||||
|
|
||||||
# Usage
|
# Usage
|
||||||
|
|
||||||
Run `make stow`
|
Run `make stow`.
|
||||||
|
|
||||||
|
Add the `./scripts` contents to the path for ez codin
|
||||||
|
|
||||||
|
```sh
|
||||||
|
export PATH="$PATH:$HOME/dotfiles/scripts"
|
||||||
|
```
|
||||||
|
|||||||
@@ -1,27 +0,0 @@
|
|||||||
cc-clean(){
|
|
||||||
rm -rf ./**/*.out 2>/dev/null
|
|
||||||
}
|
|
||||||
|
|
||||||
# compile and run a single C program. Useful for prototyping.
|
|
||||||
cc-run(){
|
|
||||||
local file
|
|
||||||
if [ -z "$1" ]; then
|
|
||||||
echo "Usage: cc-run <file> [args...]" >&2
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
file="$1"
|
|
||||||
shift
|
|
||||||
|
|
||||||
gcc "${file}" -o "${file}.out" -Wall -Wextra -Werror -g3 -fsanitize=address $@ && \
|
|
||||||
"./${file}.out"
|
|
||||||
|
|
||||||
rm "${file}.out"
|
|
||||||
}
|
|
||||||
|
|
||||||
# https://pypi.org/project/c-formatter-42/
|
|
||||||
# install via
|
|
||||||
# pip3 install --user c-formatter-42
|
|
||||||
norm(){
|
|
||||||
c_formatter_42 *.c *.h
|
|
||||||
}
|
|
||||||
+34
-3
@@ -1,3 +1,13 @@
|
|||||||
|
;; Use correct shell
|
||||||
|
(setenv "SHELL" "/bin/bash")
|
||||||
|
(setq shell-file-name "/bin/bash"
|
||||||
|
explicit-shell-file-name "/bin/bash"
|
||||||
|
shell-command-switch "-c")
|
||||||
|
|
||||||
|
;; Start the compile prompt with an empty command.
|
||||||
|
(setq-default compile-command "")
|
||||||
|
|
||||||
|
|
||||||
;; Disable auto-save files (#file#).
|
;; Disable auto-save files (#file#).
|
||||||
(setq auto-save-default nil)
|
(setq auto-save-default nil)
|
||||||
|
|
||||||
@@ -7,8 +17,26 @@
|
|||||||
;; Disable lockfiles (.#file)
|
;; Disable lockfiles (.#file)
|
||||||
(setq create-lockfiles nil)
|
(setq create-lockfiles nil)
|
||||||
|
|
||||||
|
;; Disable startup splash screen
|
||||||
|
(setq inhibit-startup-message t)
|
||||||
|
;; (setq initial-scratch-message nil)
|
||||||
|
|
||||||
|
;; Remove noisy UI
|
||||||
|
(menu-bar-mode 0)
|
||||||
|
(tool-bar-mode 0)
|
||||||
|
(scroll-bar-mode 0)
|
||||||
|
|
||||||
|
;; Line numbers
|
||||||
|
(global-display-line-numbers-mode 1)
|
||||||
|
(setq display-line-numbers 'relative)
|
||||||
|
|
||||||
|
(fido-mode 1)
|
||||||
|
|
||||||
;; Initialize the built-in package manager.
|
;; Initialize the built-in package manager.
|
||||||
|
;; Add nongnu just in case
|
||||||
(require 'package)
|
(require 'package)
|
||||||
|
(add-to-list 'package-archives
|
||||||
|
'("nongnu" . "https://elpa.nongnu.org/nongnu/") t)
|
||||||
(package-initialize)
|
(package-initialize)
|
||||||
|
|
||||||
;; Download Gruber Darker if it is not installed yet.
|
;; Download Gruber Darker if it is not installed yet.
|
||||||
@@ -19,6 +47,9 @@
|
|||||||
;; Enable the theme without a confirmation prompt.
|
;; Enable the theme without a confirmation prompt.
|
||||||
(load-theme 'gruber-darker t)
|
(load-theme 'gruber-darker t)
|
||||||
|
|
||||||
;; Display a greeting after startup.
|
;; Python
|
||||||
(add-hook 'emacs-startup-hook
|
|
||||||
(lambda () (message "Hello world")))
|
(defun pycheck ()
|
||||||
|
"Run flake8 and mypy in the current directory."
|
||||||
|
(interactive)
|
||||||
|
(compile "flake8 --color=never . && echo 'Success: flake8' && mypy --strict ."))
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
# Emacs config
|
# Emacs config
|
||||||
|
|
||||||
- [Inspiration](https://github.com/rexim/dotfiles)
|
- [Inspiration](https://github.com/rexim/dotfiles)
|
||||||
|
|
||||||
|
# Usage learning
|
||||||
|
|
||||||
|
- [Ido modes and stuff](https://karthinks.com/software/more-batteries-included-with-emacs/)
|
||||||
|
|||||||
@@ -1,15 +1,23 @@
|
|||||||
|
# No confusing symbols
|
||||||
font-feature = -calt, -liga, -dlig
|
font-feature = -calt, -liga, -dlig
|
||||||
|
|
||||||
# Allow terminal applications to read the clipboard without confirmation
|
# Disable clipboard annoyances
|
||||||
clipboard-read = allow
|
clipboard-read = allow
|
||||||
|
clipboard-paste-protection = false
|
||||||
|
|
||||||
# Use Alt for multi-teriminal management
|
# fbnp supremacy
|
||||||
keybind = ctrl+shift+t=unbind
|
keybind = up=ignore
|
||||||
keybind = alt+t=new_tab
|
keybind = down=ignore
|
||||||
keybind = ctrl+shift+w=unbind
|
keybind = left=ignore
|
||||||
keybind = alt+w=close_tab:this
|
keybind = right=ignore
|
||||||
keybind = ctrl+enter=unbind
|
keybind = ctrl+up=ignore
|
||||||
keybind = alt+enter=toggle_fullscreen
|
keybind = ctrl+down=ignore
|
||||||
|
keybind = ctrl+left=ignore
|
||||||
|
keybind = ctrl+right=ignore
|
||||||
|
keybind = alt+up=ignore
|
||||||
|
keybind = alt+down=ignore
|
||||||
|
keybind = alt+left=ignore
|
||||||
|
keybind = alt+right=ignore
|
||||||
|
|
||||||
# Disable touchpad horizontal-swipe tab switching.
|
# Disable touchpad horizontal-swipe tab switching.
|
||||||
# Will come in next version
|
# Will come in next version
|
||||||
|
|||||||
Executable
+29
@@ -0,0 +1,29 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# Builds emacs from source.
|
||||||
|
# However, its better to use system package managers.
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
version="31.1"
|
||||||
|
archive="emacs-${version}.tar.gz"
|
||||||
|
prefix="/opt/emacs-${version}"
|
||||||
|
workdir=$(mktemp -d)
|
||||||
|
|
||||||
|
trap 'rm -rf "$workdir"' EXIT
|
||||||
|
|
||||||
|
sudo apt-get install build-essential libxpm-dev libjpeg-dev libgif-dev \
|
||||||
|
libtiff-dev libgnutls28-dev
|
||||||
|
|
||||||
|
curl -fL -o "$workdir/$archive" "https://ftp.gnu.org/gnu/emacs/$archive"
|
||||||
|
tar -xzf "$workdir/$archive" -C "$workdir"
|
||||||
|
|
||||||
|
cd "$workdir/emacs-$version"
|
||||||
|
./configure --prefix="$prefix"
|
||||||
|
make -j 4
|
||||||
|
sudo make install
|
||||||
|
|
||||||
|
cat <<EOF
|
||||||
|
Add this to your shell config (~/.bashrc, ~/.zshrc, ...):
|
||||||
|
|
||||||
|
export PATH="$prefix/bin:\$PATH"
|
||||||
|
EOF
|
||||||
@@ -58,10 +58,9 @@ Git shortcuts:
|
|||||||
- `[h`, `]h`, `[H`, `]H` jump to hunks
|
- `[h`, `]h`, `[H`, `]H` jump to hunks
|
||||||
- `<leader>th` — toggle the expanded hunk view
|
- `<leader>th` — toggle the expanded hunk view
|
||||||
|
|
||||||
Oil usage:
|
Oil shortcuts:
|
||||||
|
|
||||||
- `-`, `<BS>` goes to the parent directory
|
- `gp` opens preview panel
|
||||||
- `<C-p>` previews the selected entry
|
|
||||||
|
|
||||||
Toggle shortcuts:
|
Toggle shortcuts:
|
||||||
|
|
||||||
@@ -70,6 +69,7 @@ Toggle shortcuts:
|
|||||||
- `<leader>ti` toggle inline diagnostics
|
- `<leader>ti` toggle inline diagnostics
|
||||||
- `<leader>tv` toggle virtual diagnostics
|
- `<leader>tv` toggle virtual diagnostics
|
||||||
- `<leader>th` — toggle the expanded hunk view
|
- `<leader>th` — toggle the expanded hunk view
|
||||||
|
- `<leader>tf` — toggle auto formatting on save
|
||||||
|
|
||||||
## Terminal
|
## Terminal
|
||||||
|
|
||||||
@@ -93,6 +93,7 @@ Useful Mason commands:
|
|||||||
|
|
||||||
Useful LSP commands:
|
Useful LSP commands:
|
||||||
|
|
||||||
|
- `lsp restart` restart LSP clients attached to the current buffer
|
||||||
- `K` show the type and documentation for the symbol under the cursor
|
- `K` show the type and documentation for the symbol under the cursor
|
||||||
- `gd` go to definition
|
- `gd` go to definition
|
||||||
- `gD` go to declaration
|
- `gD` go to declaration
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
local o = vim.opt_local
|
local o = vim.opt_local
|
||||||
|
|
||||||
o.expandtab = false
|
o.textwidth = 79
|
||||||
|
o.expandtab = true
|
||||||
|
|||||||
@@ -17,6 +17,14 @@ uc("NormFormat", "!c_formatter_42 *.c *.h", { desc = "comply with the norm in C"
|
|||||||
|
|
||||||
vim.cmd("cnoreabbrev wn noautocmd write")
|
vim.cmd("cnoreabbrev wn noautocmd write")
|
||||||
|
|
||||||
|
uc("GitBackup", function(opts)
|
||||||
|
vim.fn.system({ "git", "stash", "push", "-m", opts.args })
|
||||||
|
vim.fn.system({ "git", "stash", "apply", "--index", "stash@{0}" })
|
||||||
|
end, {
|
||||||
|
nargs = 1,
|
||||||
|
desc = "Stash changes without affecting the status",
|
||||||
|
})
|
||||||
|
|
||||||
-- ac("LspAttach", {
|
-- ac("LspAttach", {
|
||||||
-- desc = "Notify user about attached LSP clients",
|
-- desc = "Notify user about attached LSP clients",
|
||||||
-- group = aug("LSPOnAttach", { clear = true }),
|
-- group = aug("LSPOnAttach", { clear = true }),
|
||||||
|
|||||||
@@ -1,10 +1,28 @@
|
|||||||
local M = {}
|
local M = {}
|
||||||
|
|
||||||
-- This function returns project local dart, or fallsback to global
|
function M.root(path)
|
||||||
function M.executable(path)
|
local root = vim.fs.root(path, { "pubspec.yaml" })
|
||||||
local directory = vim.fn.isdirectory(path) == 1 and path or vim.fs.dirname(path)
|
if not root then return nil end
|
||||||
local root = vim.fs.root(directory, { "pubspec.yaml" })
|
|
||||||
|
|
||||||
|
local pubspec = table.concat(vim.fn.readfile(root .. "/pubspec.yaml"), "\n")
|
||||||
|
if pubspec:match("\nresolution:%s*workspace%s*[^\n]*") or pubspec:match("^resolution:%s*workspace%s*[^\n]*") then
|
||||||
|
local parent = vim.fs.dirname(root)
|
||||||
|
while parent do
|
||||||
|
local candidate = vim.fs.root(parent, { "pubspec.yaml" })
|
||||||
|
if not candidate then break end
|
||||||
|
local contents = table.concat(vim.fn.readfile(candidate .. "/pubspec.yaml"), "\n")
|
||||||
|
if contents:match("\nworkspace:%s*[^\n]*") or contents:match("^workspace:%s*[^\n]*") then
|
||||||
|
return candidate
|
||||||
|
end
|
||||||
|
local next_parent = vim.fs.dirname(candidate)
|
||||||
|
if next_parent == candidate then break end
|
||||||
|
parent = next_parent
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return root
|
||||||
|
end
|
||||||
|
|
||||||
|
function M.executable(root)
|
||||||
if root then
|
if root then
|
||||||
local fvm_dart = root .. "/.fvm/flutter_sdk/bin/dart"
|
local fvm_dart = root .. "/.fvm/flutter_sdk/bin/dart"
|
||||||
if vim.fn.executable(fvm_dart) == 1 then
|
if vim.fn.executable(fvm_dart) == 1 then
|
||||||
|
|||||||
@@ -124,10 +124,10 @@ local function checker_for(path)
|
|||||||
end
|
end
|
||||||
local root = vim.fs.dirname(found)
|
local root = vim.fs.dirname(found)
|
||||||
if kind == "dart" then
|
if kind == "dart" then
|
||||||
local has_fvm = vim.fs.find({ ".fvmrc", ".fvm" }, { path = root, upward = true })[1]
|
local dart = require("romanzy.custom.dart")
|
||||||
local executable = has_fvm and "fvm" or "dart"
|
root = dart.root(path)
|
||||||
local command = has_fvm and { "fvm", "dart", "analyze" } or { "dart", "analyze" }
|
local executable = dart.executable(root)
|
||||||
return kind, root, executable, command
|
return kind, root, executable, { executable, "analyze" }
|
||||||
end
|
end
|
||||||
local config = table.concat(vim.fn.readfile(found), "\n")
|
local config = table.concat(vim.fn.readfile(found), "\n")
|
||||||
if config:find('"references"%s*:') then
|
if config:find('"references"%s*:') then
|
||||||
@@ -168,7 +168,7 @@ function M.run()
|
|||||||
vim.notify("Project diagnostics failed:\n" .. vim.trim(output), vim.log.levels.ERROR)
|
vim.notify("Project diagnostics failed:\n" .. vim.trim(output), vim.log.levels.ERROR)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
add_lsp_diagnostics(items, root)
|
if kind ~= "dart" then add_lsp_diagnostics(items, root) end
|
||||||
vim.fn.setqflist({}, "r", { title = "Project diagnostics: " .. root, items = items })
|
vim.fn.setqflist({}, "r", { title = "Project diagnostics: " .. root, items = items })
|
||||||
if #items == 0 then
|
if #items == 0 then
|
||||||
require("trouble").close({ mode = "qflist" })
|
require("trouble").close({ mode = "qflist" })
|
||||||
|
|||||||
@@ -33,6 +33,9 @@ map("n", "<leader>ts", require("romanzy.custom.spell").toggle, { desc = "toggle
|
|||||||
map("n", "<leader>th", function()
|
map("n", "<leader>th", function()
|
||||||
MiniDiff.toggle_overlay()
|
MiniDiff.toggle_overlay()
|
||||||
end, { desc = "toggle hunk view" })
|
end, { desc = "toggle hunk view" })
|
||||||
|
map("n", "<leader>tf", function()
|
||||||
|
require("romanzy.plugins.conform").toggle_autoformat()
|
||||||
|
end, { desc = "toggle autoformatting" })
|
||||||
|
|
||||||
map("n", "<leader>sv", "<Cmd>vs<CR>", { desc = "split vertical" })
|
map("n", "<leader>sv", "<Cmd>vs<CR>", { desc = "split vertical" })
|
||||||
map("n", "<leader>sh", "<Cmd>sp<CR>", { desc = "split horizontal" })
|
map("n", "<leader>sh", "<Cmd>sp<CR>", { desc = "split horizontal" })
|
||||||
@@ -77,7 +80,7 @@ vim.api.nvim_create_autocmd("FileType", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- hjkl supremacy
|
-- hjkl supremacy
|
||||||
map({ "n", "v", "i" }, { "<left>", "<right>", "<up>", "<down>" }, function()
|
map({ "n", "v", "i", "t" }, { "<left>", "<right>", "<up>", "<down>" }, function()
|
||||||
vim.notify('hjkl supremacy', vim.log.levels.ERROR)
|
vim.notify('hjkl supremacy', vim.log.levels.ERROR)
|
||||||
end, { desc = "hjkl supremacy" })
|
end, { desc = "hjkl supremacy" })
|
||||||
|
|
||||||
|
|||||||
@@ -18,15 +18,6 @@ require("codamheader").setup({
|
|||||||
" #+# #+# ",
|
" #+# #+# ",
|
||||||
" ### ########## ",
|
" ### ########## ",
|
||||||
},
|
},
|
||||||
{
|
|
||||||
" ",
|
|
||||||
" ⠊⢉⠆ ",
|
|
||||||
" ⠴⠥⠄ ",
|
|
||||||
" en ",
|
|
||||||
" ⡠⢺⠀⡎⠉⡆ ",
|
|
||||||
" ⠉⠹⠁⠣⠤⠃ ",
|
|
||||||
" ",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
" ::: ###",
|
" ::: ###",
|
||||||
":::++++++ ###",
|
":::++++++ ###",
|
||||||
@@ -50,6 +41,15 @@ require("codamheader").setup({
|
|||||||
" +++### ",
|
" +++### ",
|
||||||
" +++ ",
|
" +++ ",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
" ",
|
||||||
|
" ⠊⢉⠆ ",
|
||||||
|
" ⠴⠥⠄ ",
|
||||||
|
" en ",
|
||||||
|
" ⡠⢺⠀⡎⠉⡆ ",
|
||||||
|
" ⠉⠹⠁⠣⠤⠃ ",
|
||||||
|
" ",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ vim.pack.add({
|
|||||||
})
|
})
|
||||||
|
|
||||||
local dart = require("romanzy.custom.dart")
|
local dart = require("romanzy.custom.dart")
|
||||||
|
local autoformat_enabled = true
|
||||||
|
|
||||||
require("conform").setup({
|
require("conform").setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
@@ -34,8 +35,21 @@ require("conform").setup({
|
|||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
format_on_save = {
|
format_on_save = function()
|
||||||
lsp_format = "fallback",
|
if not autoformat_enabled then
|
||||||
timeout_ms = 2000,
|
return
|
||||||
},
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
lsp_format = "fallback",
|
||||||
|
timeout_ms = 2000,
|
||||||
|
}
|
||||||
|
end,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return {
|
||||||
|
toggle_autoformat = function()
|
||||||
|
autoformat_enabled = not autoformat_enabled
|
||||||
|
vim.notify("Autoformatting " .. (autoformat_enabled and "enabled" or "disabled"))
|
||||||
|
end,
|
||||||
|
}
|
||||||
|
|||||||
@@ -34,7 +34,9 @@ configure_diagnostics()
|
|||||||
local capabilities = require("mini.completion").get_lsp_capabilities()
|
local capabilities = require("mini.completion").get_lsp_capabilities()
|
||||||
local dart = require("romanzy.custom.dart")
|
local dart = require("romanzy.custom.dart")
|
||||||
local managed_servers = {
|
local managed_servers = {
|
||||||
|
"astro",
|
||||||
"bashls",
|
"bashls",
|
||||||
|
"basedpyright",
|
||||||
"clangd",
|
"clangd",
|
||||||
"gopls",
|
"gopls",
|
||||||
"jsonls",
|
"jsonls",
|
||||||
@@ -46,18 +48,23 @@ local managed_servers = {
|
|||||||
"tailwindcss",
|
"tailwindcss",
|
||||||
"eslint",
|
"eslint",
|
||||||
"tinymist",
|
"tinymist",
|
||||||
|
"ruff",
|
||||||
}
|
}
|
||||||
local managed_tools = {
|
local managed_tools = {
|
||||||
"prettier",
|
"prettier",
|
||||||
}
|
}
|
||||||
local servers = {
|
local servers = {
|
||||||
|
-- General
|
||||||
bashls = {},
|
bashls = {},
|
||||||
clangd = {},
|
|
||||||
gopls = {},
|
|
||||||
jsonls = {},
|
|
||||||
marksman = {},
|
marksman = {},
|
||||||
taplo = {},
|
|
||||||
yamlls = {},
|
yamlls = {},
|
||||||
|
jsonls = {},
|
||||||
|
taplo = {},
|
||||||
|
-- C
|
||||||
|
clangd = {},
|
||||||
|
-- Go
|
||||||
|
gopls = {},
|
||||||
|
-- Lua
|
||||||
lua_ls = {
|
lua_ls = {
|
||||||
settings = {
|
settings = {
|
||||||
Lua = {
|
Lua = {
|
||||||
@@ -74,11 +81,19 @@ local servers = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
-- Web dev
|
||||||
ts_ls = {},
|
ts_ls = {},
|
||||||
tailwindcss = {},
|
tailwindcss = {},
|
||||||
eslint = {},
|
eslint = {},
|
||||||
|
astro = {},
|
||||||
|
-- Typst
|
||||||
tinymist = {},
|
tinymist = {},
|
||||||
|
-- Dart
|
||||||
dartls = {
|
dartls = {
|
||||||
|
root_dir = function(bufnr, on_dir)
|
||||||
|
local root = dart.root(vim.api.nvim_buf_get_name(bufnr))
|
||||||
|
if root then on_dir(root) end
|
||||||
|
end,
|
||||||
cmd = function(dispatchers, config)
|
cmd = function(dispatchers, config)
|
||||||
return vim.lsp.rpc.start({
|
return vim.lsp.rpc.start({
|
||||||
dart.executable(config.root_dir),
|
dart.executable(config.root_dir),
|
||||||
@@ -90,6 +105,34 @@ local servers = {
|
|||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
-- Python
|
||||||
|
basedpyright = {
|
||||||
|
settings = {
|
||||||
|
basedpyright = {
|
||||||
|
analysis = {
|
||||||
|
typeCheckingMode = "strict",
|
||||||
|
diagnosticSeverityOverrides = {
|
||||||
|
reportUnannotatedClassAttribute = "none",
|
||||||
|
reportAny = "none",
|
||||||
|
reportExplicitAny = "none",
|
||||||
|
reportUnknownVariableType = "none",
|
||||||
|
reportImplicitStringConcatenation = "none",
|
||||||
|
reportUnusedCallResult = "none"
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
ruff = {
|
||||||
|
init_options = {
|
||||||
|
settings = {
|
||||||
|
lineLength = 79,
|
||||||
|
lint = {
|
||||||
|
extendSelect = { "ANN2" }, -- Missing return annotations.
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for server_name, config in pairs(servers) do
|
for server_name, config in pairs(servers) do
|
||||||
|
|||||||
@@ -30,7 +30,8 @@ require("oil").setup({
|
|||||||
["gR"] = "actions.refresh", -- replaces default <C-l> behavior
|
["gR"] = "actions.refresh", -- replaces default <C-l> behavior
|
||||||
["<F5>"] = "actions.refresh",
|
["<F5>"] = "actions.refresh",
|
||||||
["<C-s>"] = false,
|
["<C-s>"] = false,
|
||||||
["<C-p>"] = { "actions.preview", opts = { vertical = true, split = "belowright" } },
|
["<C-p>"] = false,
|
||||||
|
["gp"] = { "actions.preview", opts = { vertical = true, split = "belowright" } },
|
||||||
["<BS>"] = { "actions.parent", mode = "n" },
|
["<BS>"] = { "actions.parent", mode = "n" },
|
||||||
},
|
},
|
||||||
view_options = {
|
view_options = {
|
||||||
|
|||||||
Executable
+25
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
script_name=$(basename "$0")
|
||||||
|
|
||||||
|
if [ "$#" -eq 0 ]; then
|
||||||
|
echo "Usage: $script_name command [args ...]" >&2
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! command -v inotifywait >/dev/null; then
|
||||||
|
echo "$script_name: inotifywait was not found. Install inotify-tools." >&2
|
||||||
|
exit 127
|
||||||
|
fi
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
if [ -t 1 ]; then
|
||||||
|
clear 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
( "$@" ) || echo "$script_name: command exited with status $?" >&2
|
||||||
|
inotifywait --quiet --recursive --event close_write,move,create,delete . >/dev/null
|
||||||
|
sleep 0.2
|
||||||
|
done
|
||||||
Executable
+9
@@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# https://pypi.org/project/c-formatter-42/
|
||||||
|
# install via
|
||||||
|
# pip3 install --user c-formatter-42
|
||||||
|
|
||||||
|
c_formatter_42 *.c *.h
|
||||||
Executable
+7
@@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
flake8 --color=never . && echo "Success: flake8"
|
||||||
|
|
||||||
|
mypy --strict .
|
||||||
Executable
+14
@@ -0,0 +1,14 @@
|
|||||||
|
# Run with `source pyvenv`
|
||||||
|
|
||||||
|
if [ -n "${VIRTUAL_ENV:-}" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f .venv/bin/activate ]; then
|
||||||
|
python3 -m venv .venv || return $?
|
||||||
|
if [ -f requirements.txt ]; then
|
||||||
|
.venv/bin/python -m pip install -r requirements.txt || return $?
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
. .venv/bin/activate
|
||||||
Reference in New Issue
Block a user