null ls removed

This commit is contained in:
Henrik Bakken
2023-08-14 20:22:52 +02:00
parent c3d90ae859
commit 02a696cf24
2 changed files with 121 additions and 113 deletions
+24 -18
View File
@@ -4,67 +4,73 @@ set -e
# general
sudo systemctl enable --now sshd.service
sudo systemctl enable --now fstrim.timer
yay plymouth tldextract go nodejs unzip exa
yay -S plymouth tldextract go nodejs unzip exa
# nvidia
yay cuda nvidia-settings nvidia-docker
yay -S cuda nvidia-settings nvidia-docker
# python
yay python-pip pyenv ipython
yay -S python-pip pyenv ipython
# sound
yay manjaro-pipewire pavucontrol
yay -S manjaro-pipewire pavucontrol
# terminal and shell
yay kitty fish
yay -S kitty fish
chsh -s /usr/bin/fish
# code
yay neovim tig stylua tmux diff-so-fancy ripgrep prettier jq git-lfs git-secret shfmt yq glow nvimpager git-delta
yay -S neovim tmux tig diff-so-fancy ripgrep nvimpager
git clone https://github.com/tmux-plugins/tpm ~/.config/tmux/plugins/tpm
# git
yay -S git-secret git-delta git-lfs
# formatters
yay -S python-black python-blackdoc python-pyment python-isort \
eslint_d eslint jq yamlfmt shfmt prettierd
# file sync
yay syncthings rclone
yay -S syncthings rclone glusterfs
sudo systemctl enable --now syncthing@hjalmarlucius.service
systemctl --user daemon-reload
systemctl --user enable --now rclone-gdrive.service
sudo systemctl enable --now glusterd
# docker incl non-root daemon
yay docker docker-compose dry-bin nvidia-docker docker-buildx
yay -S docker docker-compose dry-bin nvidia-docker docker-buildx
sudo groupadd docker && sudo usermod -aG docker $USER
sudo systemctl enable --now containerd.service
sudo systemctl enable --now docker.service
# printer
yay manajaro-printer samsung-unified-driver-printer
yay -S manajaro-printer samsung-unified-driver-printer
# monitors
yay iftop bpytop nvtop
yay -S iftop bpytop nvtop
# pdf
yay zathura zathura-pdf-mupdf zathura-djvu zathura-ps
yay -S zathura zathura-pdf-mupdf zathura-djvu zathura-ps
# fonts
yay noto-fonts-emoji ttf-hack
yay -S noto-fonts-emoji ttf-hack
# browser
# zerotier
yay zerotier-one
yay -S zerotier-one
sudo systemctl enable --now zerotier-one.service
sudo zerotier-cli join d5e5fb653797795b
# coolercontrol
yay coolercontrol
yay -S coolercontrol
sudo systemctl enable --now coolercontrold.service
sudo systemctl edit coolercontrold.service # set log level to WARN
sudo systemctl edit coolercontrold.service # set log level to WARN
# video streaming
yay vlc protobuf
yay castnow
yay -S vlc protobuf
yay -S castnow
# div applications
yay i3status \
yay -S i3status \
rofi \
mutt \
redshift \
+97 -95
View File
@@ -149,11 +149,6 @@ require("lazy").setup({
vim.g.mkdp_echo_preview_url = 1
end,
},
{
"ellisonleao/glow.nvim",
config = true,
cmd = "Glow",
},
{
-- better asterisk search
"haya14busa/vim-asterisk",
@@ -513,58 +508,85 @@ require("lazy").setup({
end,
},
{
"williamboman/mason-lspconfig.nvim",
dependencies = { "williamboman/mason.nvim" },
},
{
-- autoinstalls stuff specified in null-ls
"jay-babu/mason-null-ls.nvim",
event = { "BufReadPre", "BufNewFile" },
dependencies = {
"williamboman/mason.nvim",
"jose-elias-alvarez/null-ls.nvim",
},
config = function()
require("mason-null-ls").setup({
ensure_installed = nil,
automatic_setup = false,
automatic_installation = false,
})
end,
},
{
"jose-elias-alvarez/null-ls.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
-- local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
local null_ls = require("null-ls")
null_ls.setup({
sources = {
-- null_ls.builtins.diagnostics.mypy,
null_ls.builtins.diagnostics.eslint_d,
null_ls.builtins.formatting.black.with({ extra_args = { "--preview" } }),
null_ls.builtins.formatting.eslint_d,
null_ls.builtins.formatting.isort,
null_ls.builtins.formatting.jq,
null_ls.builtins.formatting.prettierd,
null_ls.builtins.formatting.shfmt.with({ extra_args = { "--indent", "4" } }),
null_ls.builtins.formatting.stylua.with({ extra_args = { "--indent-type", "Spaces" } }),
null_ls.builtins.formatting.yamlfmt,
},
-- on_attach = function(client, bufnr)
-- if client.supports_method("textDocument/formatting") then
-- vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
-- vim.api.nvim_create_autocmd("BufWritePre", {
-- group = augroup,
-- buffer = bufnr,
-- callback = function()
-- vim.lsp.buf.format({ bufnr = bufnr })
-- end,
-- })
-- end
-- end,
})
end,
"mhartington/formatter.nvim",
-- Utilities for creating configurations
config = function ()
local util = require("formatter.util")
local map = vim.keymap.set
local opts = { silent = true, noremap = true }
map("n", "<leader>f", ":Format<cr>", opts)
map("n", "<leader>F", ":FormatWrite<cr>", opts)
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
require("formatter").setup({
logging = true,
log_level = vim.log.levels.WARN,
filetype = {
python = {
require("formatter.filetypes.python").black,
-- require("formatter.filetypes.python").pyment,
function ()
return {
exe = "isort",
args = { "--quiet", "--profile black", "--force-single-line-import", "-" },
stdin = true,
}
end,
function ()
return {
exe = "black",
args = { "--quiet", "--preview", "-" },
stdin = true,
}
end,
function ()
return {
exe = "blackdoc",
args = { "-q", "-t py311", },
stdin = false,
}
end,
},
lua = {
function ()
return {
exe = "stylua",
args = {
"--search-parent-directories",
"--indent-type Spaces",
"--stdin-filepath",
util.escape_path(util.get_current_buffer_file_path()),
"--",
"-",
},
stdin = true,
}
end,
},
yaml = {
function ()
return {
exe = "yamlfmt",
args = { "-formatter indentless_arrays=true,retain_line_breaks=true,line_ending=lf,max_line_length=100,pad_line_comments=2", "-in" },
stdin = true,
}
end,
},
sh = { require("formatter.filetypes.sh").shfmt, },
typescript = { require("formatter.filetypes.typescript").eslint_d, },
javascript = { require("formatter.filetypes.javascript").eslint_d, },
html = { require("formatter.filetypes.html").prettierd, },
css = {
require("formatter.filetypes.css").prettierd,
require("formatter.filetypes.css").eslint_d,
},
markdown = { require("formatter.filetypes.markdown").prettierd, },
json = {require("formatter.filetypes.json").jq, },
["*"] = { require("formatter.filetypes.any").remove_trailing_whitespace },
}
})
end
},
{
"neovim/nvim-lspconfig",
@@ -609,22 +631,9 @@ require("lazy").setup({
bmap("n", "K", vim.lsp.buf.hover)
bmap("n", "<M-r>", vim.lsp.buf.rename)
bmap("n", "<leader>ca", vim.lsp.buf.code_action)
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
vim.lsp.buf.format({ timeout_ms = 5000 })
end, { desc = "Format current buffer with LSP" })
bmap("n", "<leader>f", "<cmd>Format<cr>")
if
client.server_capabilities.documentFormattingProvider
or client.server_capabilities.documentRangeFormattingProvider
then
vim.api.nvim_command([[augroup Format]])
vim.api.nvim_command([[autocmd! * <buffer>]])
vim.api.nvim_command([[autocmd BufWritePre * lua vim.lsp.buf.format({ timeout_ms = 5000 })]])
vim.api.nvim_command([[augroup END]])
end
end
local servers = {
local server_configs = {
pyright = {
python = {
analysis = {
@@ -645,21 +654,12 @@ require("lazy").setup({
},
telemetry = { enable = false },
diagnostics = {
-- Get the language server to recognize the `vim` global
-- Get the language server to recognize the `vim` global in init.lua
globals = { "vim" },
},
format = { -- disable formatting, stylua handles it
enable = false,
},
format = {enable = false},
},
},
marksman = {},
yamlls = {},
tsserver = {},
html = {},
eslint = {},
cssls = {},
bashls = {},
}
require("neodev").setup()
@@ -668,14 +668,25 @@ require("lazy").setup({
local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup({
ensure_installed = vim.tbl_keys(servers),
ensure_installed = {
"bashls", -- bash
"cssls", -- css
"eslint", -- javascript
"html", -- html
"jsonls", -- json
"lua_ls", -- lua
"marksman", -- markdown
"pyright", -- python
"tsserver", -- typescript
"yamlls", -- yaml
},
})
mason_lspconfig.setup_handlers({
function(server_name)
require("lspconfig")[server_name].setup({
capabilities = capabilities,
on_attach = on_attach,
settings = servers[server_name],
settings = server_configs[server_name],
})
end,
})
@@ -771,16 +782,11 @@ vim.o.foldenable = false
vim.o.foldmethod = "expr"
vim.o.completeopt = "menu,menuone,noinsert"
vim.opt.formatoptions = vim.opt.formatoptions - {"c", "r", "o"}
-- ----------------------------------------
-- AUTOCOMMANDS
-- ----------------------------------------
local cmd = vim.cmd
-- press enter in quickfix list to goto
vim.api.nvim_command([[augroup MYAU]])
vim.api.nvim_command([[autocmd!]])
vim.api.nvim_command([[autocmd BufWritePre * %s/\s\+$//e]])
vim.api.nvim_command([[autocmd FileType python setlocal indentkeys-=<:>]])
vim.api.nvim_command([[autocmd BufReadPost quickfix nmap <buffer> <cr> <cr>]])
vim.api.nvim_command([[augroup END]])
@@ -837,14 +843,10 @@ map("n", "<C-n>", "<cmd>cn<cr>", { noremap = true })
map("n", "<F1>", "<cmd>Lazy<cr>", { noremap = true })
map("n", "<F2>", "<cmd>Mason<cr>", { noremap = true })
map("n", "<F3>", "<cmd>LspInfo<cr>", { noremap = true })
map("n", "<F4>", "<cmd>NullLsInfo<cr>", { noremap = true })
map("n", "<F5>", "<cmd>checkt<cr>", { noremap = true })
map("n", "<F6>", "<cmd>TodoQuickFix<cr>", { noremap = true })
map("n", "<F9>", '<cmd>lua require("telescope.builtin").colorscheme({enable_preview=1})<cr>', { noremap = true })
-- shit HACK
map("n", "<leader>b", "<cmd>!blackdoc %<cr>", { noremap = true })
-- cursor color
-- https://codeyarns.com/tech/2011-07-29-vim-chart-of-color-names.html