chore(all): change stuff in a lot of things

This commit is contained in:
Afonso Franco 2024-05-26 16:18:00 +01:00
parent ce796e3c6e
commit e189b6856a
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4
13 changed files with 171 additions and 185 deletions

View file

@ -1,4 +1,8 @@
{ {
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"runtime.version": "LuaJIT" "runtime.version": "LuaJIT",
"diagnostics.globals": [
"vim",
"numbers"
]
} }

View file

@ -2,4 +2,3 @@ require("core.variables")
require('core.package_manager') require('core.package_manager')
require('winbar') require('winbar')
require('core.theme') require('core.theme')
require('impatient')

View file

@ -1,6 +1,7 @@
require("conform").setup({ require("conform").setup({
formatters_by_ft = { formatters_by_ft = {
python = { "black" }, python = { "black" },
haskell = { "fourmolu" },
javascript = { "prettierd" }, javascript = { "prettierd" },
markdown = { "mdformat" }, markdown = { "mdformat" },
go = { "gofmt" }, go = { "gofmt" },

View file

@ -2,28 +2,27 @@ local lazy = require("lazy")
lazy.setup({ lazy.setup({
"lewis6991/impatient.nvim",
-------------------------------------------THEMES------------------------------------------ -------------------------------------------THEMES------------------------------------------
{ {
"catppuccin/nvim", "catppuccin/nvim",
name = "catppuccin", name = "catppuccin",
event = "VeryLazy",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
opts = {}, opts = {},
}, },
"sainnhe/gruvbox-material",
-------------------------------------------------------MFP---------------------------------
{ {
"susliko/tla.nvim", "sainnhe/gruvbox-material",
opts = {}, event = "VeryLazy",
priority = 1000,
}, },
-------------------------------------------------------QOL--------------------------------- -------------------------------------------------------QOL---------------------------------
{ {
"jbyuki/instant.nvim", "jbyuki/instant.nvim",
event = "VeryLazy",
config = function() config = function()
vim.g.instant_username = "afonso" vim.g.instant_username = "afonso"
end, end,
@ -31,6 +30,7 @@ lazy.setup({
{ {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
event = "VeryLazy",
cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" },
ft = { "markdown" }, ft = { "markdown" },
build = function() vim.fn["mkdp#util#install"]() end, build = function() vim.fn["mkdp#util#install"]() end,
@ -38,6 +38,7 @@ lazy.setup({
{ {
"ThePrimeagen/harpoon", "ThePrimeagen/harpoon",
event = "VeryLazy",
branch = "harpoon2", branch = "harpoon2",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
config = function() config = function()
@ -52,8 +53,17 @@ lazy.setup({
end end
}, },
{
"FabijanZulj/blame.nvim",
event = "VeryLazy",
config = function()
require("blame").setup()
end
},
{ {
"TobinPalmer/pastify.nvim", "TobinPalmer/pastify.nvim",
event = "VeryLazy",
cmd = { "Pastify" }, cmd = { "Pastify" },
opts = {}, opts = {},
}, },
@ -61,6 +71,7 @@ lazy.setup({
--Python notebooks --Python notebooks
{ {
"luk400/vim-jukit", "luk400/vim-jukit",
event = "VeryLazy",
config = function() config = function()
require("plugins.jukit") require("plugins.jukit")
end, end,
@ -68,7 +79,7 @@ lazy.setup({
}, },
--Nvim to browser --Nvim to browser
"subnut/nvim-ghost.nvim", --"subnut/nvim-ghost.nvim",
{ {
"declancm/cinnamon.nvim", "declancm/cinnamon.nvim",
@ -126,17 +137,19 @@ lazy.setup({
}, },
-- Rename variable pop up -- Rename variable pop up
"stevearc/dressing.nvim", {
"stevearc/dressing.nvim",
event = "VeryLazy",
},
{ {
"windwp/nvim-autopairs", "windwp/nvim-autopairs",
event = "VeryLazy",
config = function() config = function()
require("plugins.autopairs") require("plugins.autopairs")
end, end,
}, },
"nvim-tree/nvim-web-devicons",
{ {
"nvim-lualine/lualine.nvim", "nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons", opt = true }, dependencies = { "nvim-tree/nvim-web-devicons", opt = true },
@ -153,6 +166,7 @@ lazy.setup({
-------------------------------------------------------LSP---------------------------------------------- -------------------------------------------------------LSP----------------------------------------------
{ {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
event = "VeryLazy",
dependencies = { dependencies = {
"hrsh7th/cmp-nvim-lsp", -- lsp "hrsh7th/cmp-nvim-lsp", -- lsp
"hrsh7th/cmp-nvim-lua", -- Nvim API completions "hrsh7th/cmp-nvim-lua", -- Nvim API completions
@ -205,6 +219,7 @@ lazy.setup({
}, },
{ {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
event = "VeryLazy",
config = function() config = function()
require("plugins.dap") require("plugins.dap")
end, end,
@ -212,53 +227,52 @@ lazy.setup({
{ {
'leoluz/nvim-dap-go', 'leoluz/nvim-dap-go',
event = "VeryLazy",
opts = {} opts = {}
}, },
{
"williamboman/mason.nvim",
config = function()
require("plugins.mason")
end,
},
"williamboman/mason-lspconfig.nvim",
{ {
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
event = { "BufReadPost", "BufNewFile" },
dependencies = {
{
"williamboman/mason-lspconfig.nvim",
dependencies = {
{
"williamboman/mason.nvim",
config = function()
require("plugins.mason")
end,
},
},
config = function()
require("plugins.mason-lspconfig")
end
},
},
config = function() config = function()
require("plugins.lspconfig") require("plugins.lspconfig")
end, end,
}, },
--Better quick fix --Better quick fix
{ {
'kevinhwang91/nvim-bqf', 'kevinhwang91/nvim-bqf',
event = "VeryLazy",
ft = 'qf' ft = 'qf'
}, },
'junegunn/fzf',
{ {
"stevearc/conform.nvim", "stevearc/conform.nvim",
event = "VeryLazy",
config = function() config = function()
require("plugins.conform") require("plugins.conform")
end, end,
}, },
{
'dense-analysis/ale',
config = function()
vim.g.ale_linters_explicit = 1
vim.g.ale_echo_msg_error_str = 'E'
vim.g.ale_echo_msg_warning_str = 'W'
vim.g.ale_echo_msg_format = '[%linter%] %s [%severity%]'
--vim.g.ale_linters = {
-- go = { 'golangci-lint' },
--}
end
},
{ {
"lervag/vimtex", "lervag/vimtex",
event = "VeryLazy",
config = function() config = function()
require("plugins.vimtex") require("plugins.vimtex")
end, end,
@ -272,12 +286,16 @@ lazy.setup({
-- ft = { "rust" }, -- ft = { "rust" },
-- }, -- },
"barreiroleo/ltex-extra.nvim", {
"barreiroleo/ltex-extra.nvim",
event = "VeryLazy",
},
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
-- Syntax Highlighting -- Syntax Highlighting
{ {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
event = { "BufReadPost", "BufNewFile" },
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects' 'nvim-treesitter/nvim-treesitter-textobjects'
}, },
@ -295,34 +313,33 @@ lazy.setup({
end, end,
}, },
"runoshun/vim-alloy",
--does so much
{ {
"nvim-telescope/telescope.nvim", "ibhagwan/fzf-lua",
tag = "0.1.4", event = "VeryLazy",
-- or , branch = '0.1.x', dependencies = { "nvim-tree/nvim-web-devicons" },
dependencies = {
"nvim-lua/plenary.nvim",
'nvim-telescope/telescope-ui-select.nvim',
{ 'nvim-telescope/telescope-fzf-native.nvim', build = 'make' }
},
config = function() config = function()
require("plugins.telescope") require('plugins.fzf-lua')
end, end
}, },
--Discord Rich Presence --Discord Rich Presence
"andweeb/presence.nvim", "andweeb/presence.nvim",
--Vim be good --Vim be good
'ThePrimeagen/vim-be-good', {
'ThePrimeagen/vim-be-good',
event = "VeryLazy",
},
--JQ --JQ
'jrop/jq.nvim',
{ {
'BooleanCube/keylab.nvim', 'jrop/jq.nvim',
opts = {} event = "VeryLazy",
} },
-- {
-- 'BooleanCube/keylab.nvim',
-- opts = {}
-- }
}) })

View file

@ -1,10 +1,5 @@
local mason_lspconfig = require("mason-lspconfig")
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
mason_lspconfig.setup({
automatic_installation = false,
})
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd("LspAttach", { vim.api.nvim_create_autocmd("LspAttach", {
@ -14,33 +9,28 @@ vim.api.nvim_create_autocmd("LspAttach", {
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc"
vim.opt_local.signcolumn = numbers vim.opt_local.signcolumn = numbers
local telescope = require("telescope.builtin") local fzflua = require("fzf-lua")
local conform = require("conform") local conform = require("conform")
local client = vim.lsp.get_client_by_id(ev.data.client_id) local client = vim.lsp.get_client_by_id(ev.data.client_id)
client.server_capabilities.semanticTokensProvider = nil client.server_capabilities.semanticTokensProvider = nil
--Enable inlay hints
--vim.lsp.inlay_hint.enable(ev.buf,true)
-- Mappings. -- Mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions
local bufopts = { noremap = true, silent = true, buffer = ev.buf } local bufopts = { noremap = true, silent = true, buffer = ev.buf }
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, bufopts) vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, bufopts)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, bufopts) vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, bufopts)
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts) vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
vim.keymap.set("n", "gd", telescope.lsp_definitions, bufopts) vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
vim.keymap.set("n", "gr", telescope.lsp_references, bufopts) vim.keymap.set("n", "gr", fzflua.lsp_references, bufopts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
vim.keymap.set("n", "gi", telescope.lsp_implementations, bufopts) vim.keymap.set("n", "gi", fzflua.lsp_implementations, bufopts)
vim.keymap.set("n", "<space>k", vim.lsp.buf.signature_help, bufopts) vim.keymap.set("n", "<space>k", vim.lsp.buf.signature_help, bufopts)
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts) vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts) vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts) vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
vim.keymap.set("n", "<space>ge", function() vim.diagnostic.goto_next() end, bufopts) vim.keymap.set("n", "<space>ge", vim.diagnostic.goto_next, bufopts)
vim.keymap.set("n", "<space>gE", function() vim.diagnostic.goto_prev() end, bufopts) vim.keymap.set("n", "<space>gE", vim.diagnostic.goto_prev, bufopts)
vim.keymap.set("n", "<space>fo", function() conform.format({ lsp_fallback = true }) end, bufopts) vim.keymap.set("n", "<space>fo", function() conform.format({ lsp_fallback = true }) end, bufopts)
vim.keymap.set("n", "<space>n", "<cmd>!toke check<cr>")
end, end,
}) })
@ -49,101 +39,7 @@ local lsp_defaults = lspconfig.util.default_config
local capabilities = local capabilities =
vim.tbl_deep_extend("force", lsp_defaults.capabilities, require("cmp_nvim_lsp").default_capabilities()) vim.tbl_deep_extend("force", lsp_defaults.capabilities, require("cmp_nvim_lsp").default_capabilities())
mason_lspconfig.setup_handlers({
-- This is a default handler that will be called for each installed server (also for new servers that are installed during a session)
function(server_name)
lspconfig[server_name].setup({
capabilities = capabilities,
})
end,
["gopls"] = function()
lspconfig["gopls"].setup({
capabilities = capabilities,
settings = {
gopls = {
["ui.completion.usePlaceholders"] = true,
["ui.diagnostic.staticcheck"] = true,
["ui.inlayhint.hints"] = {
assignVariablesTypes = true,
compositeLiteralFields = true,
compositeLiteralTypes = true,
constantValues = true,
functionTypeParameters = true,
parameterNames = true,
rangeVariableTypes = true
},
}
}
})
end,
["lua_ls"] = function()
lspconfig["lua_ls"].setup({
capabilities = capabilities,
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = { "vim" },
},
workspace = {
-- Make the server aware of Neovim runtime files
library = vim.api.nvim_get_runtime_file("", true),
},
hint = { enable = true }
},
},
})
end,
["ltex"] = function()
lspconfig["ltex"].setup({
capabilities = capabilities,
--Local on attach
on_attach = function(_, _)
-- rest of your on_attach process.
require("ltex_extra").setup()
end,
settings = {
ltex = {
language = "en-US",
},
},
})
end,
["basedpyright"] = function()
lspconfig["basedpyright"].setup({
capabilities = capabilities,
settings = {
verboseOutput = true,
autoImportCompletion = true,
basedpyright = {
analysis = {
typeCheckingMode = "all",
autoSearchPaths = true,
useLibraryCodeForTypes = true,
diagnosticMode = "openFilesOnly",
indexing = true,
},
},
},
})
end,
})
lspconfig["hls"].setup({ lspconfig["hls"].setup({
capabilities = capabilities, capabilities = capabilities,
filetypes = { 'haskell', 'lhaskell', 'cabal' }, filetypes = { 'haskell', 'lhaskell', 'cabal' },
}) })
--vim.g.rustaceanvim = {
-- server = {
-- capabilities = capabilities,
-- },
--}

View file

@ -1,17 +1,13 @@
local present, mason = pcall(require, "mason") local mason = require("mason")
vim.api.nvim_create_augroup("_mason", { clear = true }) vim.api.nvim_create_augroup("_mason", { clear = true })
local options = { local options = {
PATH = "skip", PATH = "skip",
ui = { ui = {
icons = { icons = {
package_pending = "", package_pending = "",
package_installed = "󰄳 ", package_installed = "󰄳 ",
package_uninstalled = "", package_uninstalled = "",
}, },
keymaps = { keymaps = {
toggle_server_expand = "<CR>", toggle_server_expand = "<CR>",
install_server = "i", install_server = "i",
@ -23,9 +19,6 @@ local options = {
cancel_installation = "<C-c>", cancel_installation = "<C-c>",
}, },
}, },
max_concurrent_installers = 10, max_concurrent_installers = 10,
} }
mason.setup(options) mason.setup(options)

View file

@ -4,6 +4,7 @@ local actions = require("telescope.actions")
telescope.setup { telescope.setup {
defaults = { defaults = {
layout_strategy = "horizontal", layout_strategy = "horizontal",
path_display = { "filename_first" },
mappings = { mappings = {
i = { i = {
["<esc>"] = actions.close, ["<esc>"] = actions.close,
@ -32,10 +33,10 @@ telescope.setup {
} }
telescope.load_extension('fzf') telescope.load_extension('fzf')
telescope.load_extension("ui-select") telescope.load_extension("ui-select")
--local builtin = require('telescope.builtin')
local builtin = require('telescope.builtin') --vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>ff', builtin.find_files, {}) --vim.keymap.set('n', '<leader>fe', builtin.diagnostics, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {}) --vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {}) --vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fs', builtin.treesitter, {}) --vim.keymap.set('n', '<leader>fs', builtin.treesitter, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {}) --vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})

View file

@ -60,9 +60,10 @@ function M.render()
' ', ' ',
prefix, prefix,
table.concat( table.concat(
vim.iter.map(function(segment) vim.iter(vim.split(path, '/'))
:map(function(segment)
return string.format('%%#Winbar#%s', segment) return string.format('%%#Winbar#%s', segment)
end, vim.split(path, '/')), end):totable(),
separator separator
), ),
} }

View file

@ -8,8 +8,8 @@ cmd - return : yabai -m window --swap west
cmd - u : yabai --load-sa && yabai --restart # Assuming you have scripting additions installed cmd - u : yabai --load-sa && yabai --restart # Assuming you have scripting additions installed
# Window Management # Window Management
cmd - h : yabai -m window --resize right:-20:0 #cmd - h : yabai -m window --resize right:-20:0
cmd - l : yabai -m window --resize left:20:0 #cmd - l : yabai -m window --resize left:20:0
# Focus workspaces 1 through 6 # Focus workspaces 1 through 6

View file

@ -106,3 +106,38 @@ pure_prompt_colors() {
for color in $(pure_prompt_colors); do for color in $(pure_prompt_colors); do
zstyle ":prompt:pure:$color" color "$color" zstyle ":prompt:pure:$color" color "$color"
done done
# FZF
# # Scheme name: Gruvbox dark, hard
# Scheme system: base16
# Scheme author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
# Template author: Tinted Theming (https://github.com/tinted-theming)
_gen_fzf_default_opts() {
local color00='#1d2021'
local color01='#3c3836'
local color02='#504945'
local color03='#665c54'
local color04='#bdae93'
local color05='#d5c4a1'
local color06='#ebdbb2'
local color07='#fbf1c7'
local color08='#fb4934'
local color09='#fe8019'
local color0A='#fabd2f'
local color0B='#b8bb26'
local color0C='#8ec07c'
local color0D='#83a598'
local color0E='#d3869b'
local color0F='#d65d0e'
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS"\
" --color=bg+:$color01,bg:$color00,spinner:$color0C,hl:$color0D"\
" --color=fg:$color04,header:$color0D,info:$color0A,pointer:$color0C"\
" --color=marker:$color0C,fg+:$color06,prompt:$color0A,hl+:$color0D"
}
_gen_fzf_default_opts

View file

@ -102,3 +102,38 @@ pure_prompt_colors() {
for color in $(pure_prompt_colors); do for color in $(pure_prompt_colors); do
zstyle ":prompt:pure:$color" color "$color" zstyle ":prompt:pure:$color" color "$color"
done done
#FZF
# Scheme name: Gruvbox light, soft
# Scheme system: base16
# Scheme author: Dawid Kurek (dawikur@gmail.com), morhetz (https://github.com/morhetz/gruvbox)
# Template author: Tinted Theming (https://github.com/tinted-theming)
_gen_fzf_default_opts() {
local color00='#f2e5bc'
local color01='#ebdbb2'
local color02='#d5c4a1'
local color03='#bdae93'
local color04='#665c54'
local color05='#504945'
local color06='#3c3836'
local color07='#282828'
local color08='#9d0006'
local color09='#af3a03'
local color0A='#b57614'
local color0B='#79740e'
local color0C='#427b58'
local color0D='#076678'
local color0E='#8f3f71'
local color0F='#d65d0e'
export FZF_DEFAULT_OPTS="$FZF_DEFAULT_OPTS"\
" --color=bg+:$color01,bg:$color00,spinner:$color0C,hl:$color0D"\
" --color=fg:$color04,header:$color0D,info:$color0A,pointer:$color0C"\
" --color=marker:$color0C,fg+:$color06,prompt:$color0A,hl+:$color0D"
}
_gen_fzf_default_opts

View file

@ -32,3 +32,5 @@
rebase = false rebase = false
[init] [init]
defaultBranch = main defaultBranch = main
[alias]
count-lines = "! git log --author=\"$1\" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\\n\", add, subs, loc }' #"

2
.zshrc
View file

@ -9,6 +9,8 @@ export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.ghcup/bin:$PATH" export PATH="$HOME/.ghcup/bin:$PATH"
export PATH="$HOME/.miniforge3/bin:$PATH" export PATH="$HOME/.miniforge3/bin:$PATH"
export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH" export PATH="/opt/homebrew/opt/openjdk@17/bin:$PATH"
export PATH="/opt/homebrew/opt/texlive/bin:$PATH"
export PATH="$HOME/.cabal/bin:$PATH"
export GOPATH=$HOME/.go export GOPATH=$HOME/.go
export PATH=$PATH:$GOPATH/bin export PATH=$PATH:$GOPATH/bin