Disabled a bunch of nvim stuff, will re-enable later once I sort things out

This commit is contained in:
2024-11-19 00:58:09 +02:00
parent 39b82ef71b
commit 92010ca06c
10 changed files with 217 additions and 214 deletions

View File

@@ -1,130 +1,130 @@
-- NOTE: a table or true to enable, false to disable
return {
lua_ls = {
settings = {
diagnostics = { globals = { 'vim' } },
telemetry = { enabled = false },
hint = { enable = true },
workspace = {
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
[vim.fn.stdpath('config') .. '/lua'] = true,
},
},
},
}, -- lua
clangd = {
cmd = {
'clangd',
'--background-index',
'--clang-tidy',
'--header-insertion=iwyu',
'--completion-style=detailed',
'--function-arg-placeholders',
'--fallback-style=llvm',
},
root_dir = function(filename)
return require('lspconfig/util').root_pattern(
'.clang-tidy',
'.clang-format',
'compile_commands.json',
'.git'
)(filename) or vim.fn.getcwd()
end,
init_options = {
usePlaceholders = true,
completeUnimported = true,
clangdFileStatus = true,
},
}, -- c/cpp
neocmake = {
root_dir = function(filename)
return require('lspconfig/util').root_pattern(
'CMakePresets.json',
'CTestConfig.cmake',
'build',
'cmake',
'.git' -- NOTE: git is last due to monorepos (so it tries to use build/cmake first)
)(filename) or vim.fn.getcwd()
end,
},
pyright = {
settings = {
python = {
pythonPath = '~/python/venv/bin/python',
},
},
}, -- python
bashls = true, -- bash
taplo = true, -- toml
lemminx = true, -- xml
yamlls = true, -- yaml
jsonls = true, -- json
html = true, -- html
cssls = true, -- css
ts_ls = true, -- javascript/typescript
astro = true, -- astro framework
mdx_analyzer = true, -- markdown with JS I think
-- marksman = true, -- Markdown LSP
markdown_oxide = true, -- Markdown LSP but better
gopls = {
cmd = { 'gopls' },
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
root_dir = function(filename)
return require('lspconfig/util').root_pattern('go.work', 'go.mod', '.git')(filename)
end,
settings = {
gopls = {
gofumpt = true,
codelenses = {
gc_details = false,
generate = true,
regenerate_cgo = true,
run_govulncheck = true,
test = true,
tidy = true,
upgrade_dependency = true,
vendor = true,
},
hints = {
assignVariableTypes = false,
compositeLiteralFields = false,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = false,
parameterNames = false,
rangeVariableTypes = true,
},
analyses = {
fieldalignment = true,
nilness = true,
unusedparams = true,
unusedwrite = true,
useany = true,
},
usePlaceholders = false,
completeUnimported = true,
staticcheck = true,
directoryFilters = { '-.git', '-.vscode', '-.idea', '-.vscode-test', '-node_modules' },
semanticTokens = true,
},
},
}, -- Go LSP
jdtls = true, -- java
-- sqlls = true,
-- sqls = {
-- on_attach = function(client, bufnr)
-- require('sqls').on_attach(client, bufnr)
-- end,
-- lua_ls = {
-- settings = {
-- sqls = {
-- connections = {
-- {
-- driver = 'sqlite3',
-- dataSourceName = '/home/kyren/projects/eko/server.db',
-- },
-- diagnostics = { globals = { 'vim' } },
-- telemetry = { enabled = false },
-- hint = { enable = true },
-- workspace = {
-- library = {
-- [vim.fn.expand('$VIMRUNTIME/lua')] = true,
-- [vim.fn.stdpath('config') .. '/lua'] = true,
-- },
-- },
-- },
-- }, -- lua
-- clangd = {
-- cmd = {
-- 'clangd',
-- '--background-index',
-- '--clang-tidy',
-- '--header-insertion=iwyu',
-- '--completion-style=detailed',
-- '--function-arg-placeholders',
-- '--fallback-style=llvm',
-- },
-- root_dir = function(filename)
-- return require('lspconfig/util').root_pattern(
-- '.clang-tidy',
-- '.clang-format',
-- 'compile_commands.json',
-- '.git'
-- )(filename) or vim.fn.getcwd()
-- end,
-- init_options = {
-- usePlaceholders = true,
-- completeUnimported = true,
-- clangdFileStatus = true,
-- },
-- }, -- c/cpp
-- neocmake = {
-- root_dir = function(filename)
-- return require('lspconfig/util').root_pattern(
-- 'CMakePresets.json',
-- 'CTestConfig.cmake',
-- 'build',
-- 'cmake',
-- '.git' -- NOTE: git is last due to monorepos (so it tries to use build/cmake first)
-- )(filename) or vim.fn.getcwd()
-- end,
-- },
-- pyright = {
-- settings = {
-- python = {
-- pythonPath = '~/python/venv/bin/python',
-- },
-- },
-- }, -- python
-- bashls = true, -- bash
-- taplo = true, -- toml
-- lemminx = true, -- xml
-- yamlls = true, -- yaml
-- jsonls = true, -- json
-- html = true, -- html
-- cssls = true, -- css
-- ts_ls = true, -- javascript/typescript
-- astro = true, -- astro framework
-- mdx_analyzer = true, -- markdown with JS I think
-- -- marksman = true, -- Markdown LSP
-- markdown_oxide = true, -- Markdown LSP but better
-- gopls = {
-- cmd = { 'gopls' },
-- filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
-- root_dir = function(filename)
-- return require('lspconfig/util').root_pattern('go.work', 'go.mod', '.git')(filename)
-- end,
-- settings = {
-- gopls = {
-- gofumpt = true,
-- codelenses = {
-- gc_details = false,
-- generate = true,
-- regenerate_cgo = true,
-- run_govulncheck = true,
-- test = true,
-- tidy = true,
-- upgrade_dependency = true,
-- vendor = true,
-- },
-- hints = {
-- assignVariableTypes = false,
-- compositeLiteralFields = false,
-- compositeLiteralTypes = true,
-- constantValues = true,
-- functionTypeParameters = false,
-- parameterNames = false,
-- rangeVariableTypes = true,
-- },
-- analyses = {
-- fieldalignment = true,
-- nilness = true,
-- unusedparams = true,
-- unusedwrite = true,
-- useany = true,
-- },
-- usePlaceholders = false,
-- completeUnimported = true,
-- staticcheck = true,
-- directoryFilters = { '-.git', '-.vscode', '-.idea', '-.vscode-test', '-node_modules' },
-- semanticTokens = true,
-- },
-- },
-- }, -- Go LSP
-- jdtls = true, -- java
-- -- sqlls = true,
-- -- sqls = {
-- -- on_attach = function(client, bufnr)
-- -- require('sqls').on_attach(client, bufnr)
-- -- end,
-- -- settings = {
-- -- sqls = {
-- -- connections = {
-- -- {
-- -- driver = 'sqlite3',
-- -- dataSourceName = '/home/kyren/projects/eko/server.db',
-- -- },
-- -- },
-- -- },
-- -- },
-- -- },
}

View File

@@ -18,8 +18,8 @@ telescope.setup({
},
})
pcall(telescope.load_extension('ui-select'))
pcall(telescope.load_extension('fzf'))
-- pcall(telescope.load_extension('ui-select'))
-- pcall(telescope.load_extension('fzf'))
local builtin = require('telescope.builtin')
local function find_all()

View File

@@ -1,33 +1,33 @@
return {
'okuuva/auto-save.nvim',
cmd = 'ASToggle',
event = { 'InsertLeave', 'TextChanged' },
opts = function()
-- Disable autoformat between automatic saves
vim.api.nvim_create_autocmd('User', {
pattern = 'AutoSaveWritePre',
group = vim.api.nvim_create_augroup('autosave-pre', { clear = true }),
callback = function(opts)
local bufnr = opts.data.saved_buffer
vim.b[bufnr].disable_autoformat = true
end,
})
vim.api.nvim_create_autocmd('User', {
pattern = 'AutoSaveWritePost',
group = vim.api.nvim_create_augroup('autosave-post', { clear = true }),
callback = function(opts)
local bufnr = opts.data.saved_buffer
vim.b[bufnr].disable_autoformat = false
end,
})
return {
-- execution_message = { enabled = false }, removed
condition = function(buf)
-- Save only if the buffer is not a "special buffer"
return vim.fn.getbufvar(buf, '&buftype') == ''
end,
}
end,
-- 'okuuva/auto-save.nvim',
-- cmd = 'ASToggle',
-- event = { 'InsertLeave', 'TextChanged' },
-- opts = function()
-- -- Disable autoformat between automatic saves
-- vim.api.nvim_create_autocmd('User', {
-- pattern = 'AutoSaveWritePre',
-- group = vim.api.nvim_create_augroup('autosave-pre', { clear = true }),
-- callback = function(opts)
-- local bufnr = opts.data.saved_buffer
-- vim.b[bufnr].disable_autoformat = true
-- end,
-- })
--
-- vim.api.nvim_create_autocmd('User', {
-- pattern = 'AutoSaveWritePost',
-- group = vim.api.nvim_create_augroup('autosave-post', { clear = true }),
-- callback = function(opts)
-- local bufnr = opts.data.saved_buffer
-- vim.b[bufnr].disable_autoformat = false
-- end,
-- })
--
-- return {
-- -- execution_message = { enabled = false }, removed
-- condition = function(buf)
-- -- Save only if the buffer is not a "special buffer"
-- return vim.fn.getbufvar(buf, '&buftype') == ''
-- end,
-- }
-- end,
}

View File

@@ -1,29 +1,29 @@
return {
'rmagatti/auto-session',
lazy = false,
config = function()
vim.opt.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions'
require('auto-session').setup({
log_level = 'error',
auto_session_suppress_dirs = { '~/', '/' },
session_lens = { load_on_setup = false },
no_restore_cmds = {
function()
if vim.fn.argc() == 0 then
vim.cmd('Alpha')
end
end,
},
})
local session_lens_setup_done = false
local function search_session()
if not session_lens_setup_done then
require('auto-session').setup_session_lens()
session_lens_setup_done = true
end
require('auto-session.session-lens').search_session()
end
vim.keymap.set('n', '<C-s>', search_session, { desc = '[S]ession Manager' })
end,
-- 'rmagatti/auto-session',
-- lazy = false,
-- config = function()
-- vim.opt.sessionoptions = 'blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions'
-- require('auto-session').setup({
-- log_level = 'error',
-- auto_session_suppress_dirs = { '~/', '/' },
-- session_lens = { load_on_setup = false },
-- no_restore_cmds = {
-- function()
-- if vim.fn.argc() == 0 then
-- vim.cmd('Alpha')
-- end
-- end,
-- },
-- })
--
-- local session_lens_setup_done = false
-- local function search_session()
-- if not session_lens_setup_done then
-- require('auto-session').setup_session_lens()
-- session_lens_setup_done = true
-- end
-- require('auto-session.session-lens').search_session()
-- end
-- vim.keymap.set('n', '<C-s>', search_session, { desc = '[S]ession Manager' })
-- end,
}

View File

@@ -10,5 +10,5 @@ return {
vim.cmd.colorscheme('carbonight')
end,
},
{ dir = '~/projects/carbonight' },
{ dir = '~/projects/carbonight.nvim' },
}

View File

@@ -12,18 +12,18 @@ return {
---@type conform.setupOpts
opts = {
formatters_by_ft = {
['lua'] = { 'stylua' },
['c'] = { 'clang-format' },
['python'] = { 'isort', 'black' },
['rust'] = { 'rustfmt' },
['go'] = { 'gofumpt', 'goimports-reviser' },
['markdown'] = { 'prettierd', 'prettier', stop_after_first = true },
['yaml'] = { 'prettierd' },
['json'] = { 'jq' },
['html'] = { 'prettierd', 'prettier', stop_after_first = true },
['css'] = { 'prettierd', 'prettier', stop_after_first = true },
['javascript'] = { 'prettierd', 'prettier', stop_after_first = true },
['typescript'] = { 'prettierd', 'prettier', stop_after_first = true },
-- ['lua'] = { 'stylua' },
-- ['c'] = { 'clang-format' },
-- ['python'] = { 'isort', 'black' },
-- ['rust'] = { 'rustfmt' },
-- ['go'] = { 'gofumpt', 'goimports-reviser' },
-- ['markdown'] = { 'prettierd', 'prettier', stop_after_first = true },
-- ['yaml'] = { 'prettierd' },
-- ['json'] = { 'jq' },
-- ['html'] = { 'prettierd', 'prettier', stop_after_first = true },
-- ['css'] = { 'prettierd', 'prettier', stop_after_first = true },
-- ['javascript'] = { 'prettierd', 'prettier', stop_after_first = true },
-- ['typescript'] = { 'prettierd', 'prettier', stop_after_first = true },
},
format_on_save = function(bufnr)
-- Disable with a global or buffer local variable

View File

@@ -17,21 +17,21 @@ return {
lazy = false,
opts = {
ensure_installed = {
'stylua', -- lua formatting
'clang-format', -- C/C++ formatter
'codelldb', -- C/C++ debugger
'cpplint', -- C/C++ linter
'black', -- python formatter
'isort', -- python formatter for imports
'flake8', -- python linter
'gofumpt', -- go formatter
-- 'golangci-lint', -- go linter
'prettierd', -- multi-lang formatter
'prettier', -- prettierd but slower, used as a fallback
'jq', -- json formatter
'jsonlint', -- json linter
'shellcheck', -- bash linter
'beautysh', -- shell formatter
-- 'stylua', -- lua formatting
-- 'clang-format', -- C/C++ formatter
-- 'codelldb', -- C/C++ debugger
-- 'cpplint', -- C/C++ linter
-- 'black', -- python formatter
-- 'isort', -- python formatter for imports
-- 'flake8', -- python linter
-- 'gofumpt', -- go formatter
-- -- 'golangci-lint', -- go linter
-- 'prettierd', -- multi-lang formatter
-- 'prettier', -- prettierd but slower, used as a fallback
-- 'jq', -- json formatter
-- 'jsonlint', -- json linter
-- 'shellcheck', -- bash linter
-- 'beautysh', -- shell formatter
},
},
},

View File

@@ -3,8 +3,8 @@ return {
tag = '0.1.5',
dependencies = {
'nvim-lua/plenary.nvim',
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
'nvim-telescope/telescope-ui-select.nvim',
-- { 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
-- 'nvim-telescope/telescope-ui-select.nvim',
},
cmd = 'Telescope',
config = function()

View File

@@ -12,7 +12,7 @@
rebase = true
[core]
editor = nvim
pager = delta --syntax-theme='Monokai Extended'
pager = nvim -R
[interactive]
diffFilter = delta --color-only
[delta]
@@ -21,3 +21,5 @@
gpgSign = true
[gpg]
format = ssh
[color]
pager = no

3
.zshrc
View File

@@ -63,7 +63,8 @@ alias vim='nvim'
alias gs='git status'
export EDITOR=nvim
# export PAGER=nvimpager
export PAGER='nvim -R'
export MANPAGER='nvim +Man!'
export FZF_DEFAULT_OPTS=" \
--color=bg+:#313244,bg:#1e1e2e,spinner:#f5e0dc,hl:#f38ba8 \
--color=fg:#cdd6f4,header:#f38ba8,info:#cba6f7,pointer:#f5e0dc \