Compare commits
No commits in common. "3902f3e598b821032db73aecc9f6e7e00521a567" and "88d1681f4dd48843197f52c11486e75ef9392e14" have entirely different histories.
3902f3e598
...
88d1681f4d
@ -3,48 +3,14 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
local conform = require("conform")
|
local conform = require("conform")
|
||||||
|
|
||||||
local function file_exists(name)
|
|
||||||
local f = io.open(name, "r")
|
|
||||||
if f ~= nil then
|
|
||||||
io.close(f)
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function decide_js_formatter()
|
|
||||||
local cwd = vim.fn.getcwd()
|
|
||||||
if file_exists(cwd .. "/biome.json") then
|
|
||||||
return "biome"
|
|
||||||
else
|
|
||||||
return "prettier"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function decide_json_formatter()
|
|
||||||
local cwd = vim.fn.getcwd()
|
|
||||||
if file_exists(cwd .. "/biome.json") then
|
|
||||||
return "biome"
|
|
||||||
elseif file_exists(cwd .. "/.prettierrc") then
|
|
||||||
return "prettier"
|
|
||||||
else
|
|
||||||
return "jq"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
conform.setup({
|
conform.setup({
|
||||||
formatters_by_ft = {
|
formatters_by_ft = {
|
||||||
javascript = { decide_js_formatter() },
|
|
||||||
javascriptreact = { decide_js_formatter() },
|
|
||||||
json = { decide_json_formatter() },
|
|
||||||
lua = { "stylua" },
|
lua = { "stylua" },
|
||||||
markdown = { "mdformat" },
|
|
||||||
nginx = { "nginxfmt" },
|
nginx = { "nginxfmt" },
|
||||||
python = { "isort", "black" },
|
python = { "black", "flake8" },
|
||||||
sh = { "shfmt" },
|
|
||||||
typescript = { decide_js_formatter() },
|
|
||||||
typescriptreact = { decide_js_formatter() },
|
|
||||||
yaml = { "yamlfix" },
|
yaml = { "yamlfix" },
|
||||||
["*"] = { "codespell" },
|
-- Use the "*" filetype to run formatters on all filetypes.
|
||||||
|
-- ["*"] = { "codespell" },
|
||||||
},
|
},
|
||||||
|
|
||||||
default_format_opts = {
|
default_format_opts = {
|
||||||
|
|||||||
@ -1,48 +0,0 @@
|
|||||||
return {
|
|
||||||
"mfussenegger/nvim-lint",
|
|
||||||
config = function()
|
|
||||||
local function file_exists(name)
|
|
||||||
local f = io.open(name, "r")
|
|
||||||
if f ~= nil then
|
|
||||||
io.close(f)
|
|
||||||
return true
|
|
||||||
else
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
end
|
|
||||||
local function decide_linter()
|
|
||||||
local cwd = vim.fn.getcwd()
|
|
||||||
if file_exists(cwd .. "/biome.json") then
|
|
||||||
return "biome"
|
|
||||||
else
|
|
||||||
return "eslint_d"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
local lint = require("lint")
|
|
||||||
|
|
||||||
lint.linters_by_ft = {
|
|
||||||
javascript = { "eslint_d" },
|
|
||||||
javascriptreact = { "eslint_d" },
|
|
||||||
markdown = { "markdownlint" },
|
|
||||||
python = { "flake8" },
|
|
||||||
sh = { "shellcheck" },
|
|
||||||
typescript = { "eslint_d" },
|
|
||||||
typescriptreact = { "eslint_d" },
|
|
||||||
yaml = { "yamllint" },
|
|
||||||
}
|
|
||||||
|
|
||||||
local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({ "BufEnter", "BufWritePost", "InsertLeave" }, {
|
|
||||||
group = lint_augroup,
|
|
||||||
callback = function()
|
|
||||||
lint.try_lint()
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>l", function()
|
|
||||||
lint.try_lint()
|
|
||||||
end, { desc = "Trigger linting for current file" })
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
@ -18,11 +18,9 @@ return {
|
|||||||
|
|
||||||
require("mason-lspconfig").setup({
|
require("mason-lspconfig").setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"bashls",
|
|
||||||
"cssls",
|
"cssls",
|
||||||
"dockerls",
|
"dockerls",
|
||||||
"emmet_ls",
|
"emmet_ls",
|
||||||
"eslint",
|
|
||||||
"html",
|
"html",
|
||||||
"jdtls",
|
"jdtls",
|
||||||
"jsonls",
|
"jsonls",
|
||||||
@ -45,15 +43,10 @@ return {
|
|||||||
"eslint_d",
|
"eslint_d",
|
||||||
"firefox-debug-adapter",
|
"firefox-debug-adapter",
|
||||||
"flake8",
|
"flake8",
|
||||||
"isort",
|
|
||||||
"java-debug-adapter",
|
"java-debug-adapter",
|
||||||
"jq",
|
"jq",
|
||||||
"markdownlint",
|
|
||||||
"mdformat",
|
|
||||||
"nginx-config-formatter",
|
"nginx-config-formatter",
|
||||||
"prettier",
|
"prettierd",
|
||||||
"shellcheck",
|
|
||||||
"shfmt",
|
|
||||||
"stylua",
|
"stylua",
|
||||||
"yamlfix",
|
"yamlfix",
|
||||||
"yamllint",
|
"yamllint",
|
||||||
|
|||||||
@ -134,17 +134,6 @@ return {
|
|||||||
root_markers = { "tsconfig.json", "jsconfig.json", "package.json" },
|
root_markers = { "tsconfig.json", "jsconfig.json", "package.json" },
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config("jsonls", {
|
|
||||||
on_attach = function(client)
|
|
||||||
-- Disable formatting capability for tsserver
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
end,
|
|
||||||
filetypes = {
|
|
||||||
"json",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.lsp.config("pylsp", {
|
vim.lsp.config("pylsp", {
|
||||||
on_attach = function(client)
|
on_attach = function(client)
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
client.server_capabilities.documentFormattingProvider = false
|
||||||
@ -155,15 +144,5 @@ return {
|
|||||||
},
|
},
|
||||||
root_markers = { "requirements.txt" },
|
root_markers = { "requirements.txt" },
|
||||||
})
|
})
|
||||||
|
|
||||||
vim.lsp.config("bashls", {
|
|
||||||
on_attach = function(client)
|
|
||||||
client.server_capabilities.documentFormattingProvider = false
|
|
||||||
client.server_capabilities.documentRangeFormattingProvider = false
|
|
||||||
end,
|
|
||||||
filetypes = {
|
|
||||||
"sh",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@ -6,10 +6,12 @@
|
|||||||
|
|
||||||
!.config/neofetch/*
|
!.config/neofetch/*
|
||||||
|
|
||||||
!.config/nvim/*
|
!.config/nvim/init.lua
|
||||||
|
!.config/nvim/lua/**
|
||||||
|
|
||||||
!.config/tmux/tmux.conf
|
!.config/tmux/tmux.conf
|
||||||
!.config/tmux/catppuccin.conf
|
!.config/tmux/catppuccin.conf
|
||||||
|
.config/tmux/local.tmux.config
|
||||||
|
|
||||||
!.config/waybar/*
|
!.config/waybar/*
|
||||||
|
|
||||||
@ -18,4 +20,3 @@
|
|||||||
!.zinit.zsh
|
!.zinit.zsh
|
||||||
!.zshrc
|
!.zshrc
|
||||||
!.zstyle.zsh
|
!.zstyle.zsh
|
||||||
!.wslrc.zsh
|
|
||||||
|
|||||||
15
.wslrc.zsh
15
.wslrc.zsh
@ -1,15 +0,0 @@
|
|||||||
# Fix HOME, END, and DEL keys for zsh
|
|
||||||
bindkey "^[[H" beginning-of-line
|
|
||||||
bindkey "^[[F" end-of-line
|
|
||||||
bindkey "^[[3~" delete-char
|
|
||||||
|
|
||||||
# Fix HOME and END for tmux
|
|
||||||
bindkey "\E[1~" beginning-of-line
|
|
||||||
bindkey "\E[4~" end-of-line
|
|
||||||
|
|
||||||
# Set vals for C-Right, C-S-Right, C-Left, C-S-Left
|
|
||||||
# To move through words
|
|
||||||
bindkey "^[[1;6D" vi-backward-word
|
|
||||||
bindkey "^[[1;5D" backward-word
|
|
||||||
bindkey "^[[1;6C" vi-forward-word
|
|
||||||
bindkey "^[[1;5C" emacs-forward-word
|
|
||||||
4
.zshrc
4
.zshrc
@ -49,8 +49,4 @@ alias vim="nvim"
|
|||||||
alias vi="nvim"
|
alias vi="nvim"
|
||||||
alias python="python3"
|
alias python="python3"
|
||||||
|
|
||||||
# If wsl.conf exists we're probably in WSL and need some changes for terminal commands to work correctly
|
|
||||||
[[ ! -f /etc/wsl.conf ]] || source ~/.wslrc.zsh
|
|
||||||
|
|
||||||
[[ ! -f ~/.localrc.zsh ]] || source ~/.localrc.zsh
|
[[ ! -f ~/.localrc.zsh ]] || source ~/.localrc.zsh
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user