Skip to content

Commit 765fcb4

Browse files
committed
feat: update some configs and stuff
1 parent 9609236 commit 765fcb4

File tree

7 files changed

+122
-30
lines changed

7 files changed

+122
-30
lines changed

init.lua

Lines changed: 50 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,14 @@ vim.api.nvim_create_autocmd('TextYankPost', {
138138
end,
139139
})
140140

141+
-- eslint_d is slow so using an autocmd to automatically apply ESlint's suggestions
142+
-- See https://github.com/stevearc/conform.nvim/issues/364#issuecomment-2308959873
143+
vim.api.nvim_create_autocmd('BufWritePre', {
144+
group = vim.api.nvim_create_augroup('EslintFixAll', { clear = true }),
145+
pattern = { '*.tsx', '*.ts', '*.jsx', '*.js' },
146+
command = 'silent! LspEslintFixAll',
147+
})
148+
141149
-- [[ Install `lazy.nvim` plugin manager ]]
142150
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
143151
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
@@ -167,6 +175,7 @@ rtp:prepend(lazypath)
167175
require('lazy').setup({
168176
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
169177
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
178+
'tpope/vim-fugitive',
170179

171180
-- NOTE: Plugins can also be added by using a table,
172181
-- with the first argument being the link and the following
@@ -355,6 +364,7 @@ require('lazy').setup({
355364
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
356365
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
357366
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
367+
vim.keymap.set('n', '<leader>so', builtin.lsp_document_symbols, { desc = '[S]earch d[O]cument symbols' })
358368

359369
-- Slightly advanced example of overriding default behavior and theme
360370
vim.keymap.set('n', '<leader>/', function()
@@ -591,16 +601,26 @@ require('lazy').setup({
591601
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
592602
local servers = {
593603
-- clangd = {},
594-
gopls = {},
595-
-- pyright = {},
596-
-- rust_analyzer = {},
604+
gopls = {
605+
settings = {
606+
gopls = { buildFlags = { '-tags=integration' } },
607+
},
608+
},
609+
pyright = {},
610+
rust_analyzer = {},
597611
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
598612
--
599613
-- Some languages (like typescript) have entire language plugins that can be useful:
600614
-- https://github.com/pmizio/typescript-tools.nvim
601615
--
616+
-- FRONTEND SETUP
602617
-- But for many setups, the LSP (`ts_ls`) will work just fine
603-
-- ts_ls = {},
618+
vtsls = {},
619+
tailwindcss = {},
620+
eslint = {},
621+
html = {},
622+
cssls = {},
623+
jsonls = {},
604624
--
605625

606626
lua_ls = {
@@ -680,7 +700,7 @@ require('lazy').setup({
680700
return nil
681701
else
682702
return {
683-
timeout_ms = 500,
703+
timeout_ms = 1000,
684704
lsp_format = 'fallback',
685705
}
686706
end
@@ -691,12 +711,18 @@ require('lazy').setup({
691711
-- python = { "isort", "black" },
692712
--
693713
-- You can use 'stop_after_first' to run the first available formatter from the list
694-
-- javascript = { "prettierd", "prettier", stop_after_first = true },
714+
javascript = { 'prettierd', stop_after_first = false },
715+
typescript = { 'prettierd' },
716+
javascriptreact = { 'prettierd' },
717+
typescriptreact = { 'prettierd' },
718+
css = { 'prettierd' },
719+
html = { 'prettierd' },
720+
markdown = { 'prettierd' },
721+
json = { 'prettierd', 'prettier', stop_after_first = true },
695722
go = { 'gofumpt' },
696723
},
697724
},
698725
},
699-
700726
{ -- Autocompletion
701727
'saghen/blink.cmp',
702728
event = 'VimEnter',
@@ -797,7 +823,22 @@ require('lazy').setup({
797823
},
798824
-- import everything under custom/plugins
799825
{ import = 'custom.plugins' },
800-
826+
{
827+
'windwp/nvim-ts-autotag',
828+
ft = { 'html', 'javascript', 'typescript', 'javascriptreact', 'typescriptreact' },
829+
config = true,
830+
},
831+
{
832+
'laytan/tailwind-sorter.nvim',
833+
dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-lua/plenary.nvim' },
834+
build = 'cd formatter && npm i && npm run build',
835+
config = true,
836+
},
837+
{
838+
'chrisgrieser/nvim-early-retirement',
839+
config = true,
840+
event = 'VeryLazy',
841+
},
801842
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
802843
-- init.lua. If you want these files, they are in the repository, so you can just download them and
803844
-- place them in the correct locations.
@@ -845,6 +886,5 @@ require('lazy').setup({
845886
},
846887
},
847888
})
848-
849889
-- The line beneath this is called `modeline`. See `:help modeline`
850-
-- vim: ts=2 sts=2 sw=2 et
890+
-- vim: ts=2 sts=2 sw=2 e

lazy-lock.json

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,32 @@
11
{
22
"LuaSnip": { "branch": "master", "commit": "458560534a73f7f8d7a11a146c801db00b081df0" },
3-
"blink.cmp": { "branch": "main", "commit": "022521a8910a5543b0251b21c9e1a1e989745796" },
4-
"catppuccin": { "branch": "main", "commit": "fa42eb5e26819ef58884257d5ae95dd0552b9a66" },
5-
"conform.nvim": { "branch": "master", "commit": "0e93e0d12d2f7ebdea9e3e444dfaff0050cefbe6" },
6-
"fidget.nvim": { "branch": "main", "commit": "d9ba6b7bfe29b3119a610892af67602641da778e" },
7-
"gitsigns.nvim": { "branch": "main", "commit": "d0f90ef51d4be86b824b012ec52ed715b5622e51" },
8-
"go.nvim": { "branch": "master", "commit": "a3455f48cff718a86275115523dcc735535a13aa" },
3+
"blink.cmp": { "branch": "main", "commit": "327fff91fe6af358e990be7be1ec8b78037d2138" },
4+
"catppuccin": { "branch": "main", "commit": "30fa4d122d9b22ad8b2e0ab1b533c8c26c4dde86" },
5+
"conform.nvim": { "branch": "master", "commit": "b4aab989db276993ea5dcb78872be494ce546521" },
6+
"fidget.nvim": { "branch": "main", "commit": "4d5858bd4c471c895060e1b9f3575f1551184dc5" },
7+
"gitsigns.nvim": { "branch": "main", "commit": "f780609807eca1f783a36a8a31c30a48fbe150c5" },
98
"guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
10-
"guihua.lua": { "branch": "master", "commit": "87bea7b98429405caf2a0ce4d029b027bb017c70" },
119
"lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" },
12-
"lazydev.nvim": { "branch": "main", "commit": "2367a6c0a01eb9edb0464731cc0fb61ed9ab9d2c" },
13-
"mason-lspconfig.nvim": { "branch": "main", "commit": "bef29b653ba71d442816bf56286c2a686210be04" },
14-
"mason-tool-installer.nvim": { "branch": "main", "commit": "93a9ff9b34c91c0cb0f7de8d5f7e4abce51d8903" },
15-
"mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" },
16-
"mini.icons": { "branch": "main", "commit": "397ed3807e96b59709ef3292f0a3e253d5c1dc0a" },
17-
"mini.nvim": { "branch": "main", "commit": "35e1767f4cd7dde51256eabae7349a5283a43cba" },
18-
"nvim-autopairs": { "branch": "master", "commit": "4d74e75913832866aa7de35e4202463ddf6efd1b" },
19-
"nvim-lspconfig": { "branch": "master", "commit": "a182334ba933e58240c2c45e6ae2d9c7ae313e00" },
10+
"lazydev.nvim": { "branch": "main", "commit": "0c5e67881ddb9c64e04ca5a4cc57b3e4b76c8feb" },
11+
"mason-lspconfig.nvim": { "branch": "main", "commit": "7f9a39fcd2ac6e979001f857727d606888f5909c" },
12+
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
13+
"mason.nvim": { "branch": "main", "commit": "7dc4facca9702f95353d5a1f87daf23d78e31c2a" },
14+
"mini.icons": { "branch": "main", "commit": "f9a177c11daa7829389b7b6eaaec8b8a5c47052d" },
15+
"mini.nvim": { "branch": "main", "commit": "cf515dd765665d51086e418e587a4f7ebc650ba1" },
16+
"nvim-autopairs": { "branch": "master", "commit": "23320e75953ac82e559c610bec5a90d9c6dfa743" },
17+
"nvim-early-retirement": { "branch": "main", "commit": "14aba23ce4168e6d6acbf78ab1d33739c3894f68" },
18+
"nvim-lspconfig": { "branch": "master", "commit": "d9879110d0422a566fa01d732556f4d5515e1738" },
2019
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
21-
"oil.nvim": { "branch": "master", "commit": "08c2bce8b00fd780fb7999dbffdf7cd174e896fb" },
22-
"plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" },
20+
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
21+
"nvim-web-devicons": { "branch": "master", "commit": "6e51ca170563330e063720449c21f43e27ca0bc1" },
22+
"oil.nvim": { "branch": "master", "commit": "07f80ad645895af849a597d1cac897059d89b686" },
23+
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
24+
"supermaven-nvim": { "branch": "main", "commit": "07d20fce48a5629686aefb0a7cd4b25e33947d50" },
25+
"tailwind-sorter.nvim": { "branch": "main", "commit": "717e5c9761ed8334dadbb9357df7d826aae97b92" },
2326
"telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" },
2427
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
2528
"telescope.nvim": { "branch": "master", "commit": "b4da76be54691e854d3e0e02c36b0245f945c2c7" },
2629
"todo-comments.nvim": { "branch": "main", "commit": "304a8d204ee787d2544d8bc23cd38d2f929e7cc5" },
30+
"vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" },
2731
"which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" }
2832
}

lua/custom/plugins/colorscheme.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ return {
77
config = function()
88
require('catppuccin').setup {
99
flavour = 'mocha',
10+
float = {
11+
transparent = true,
12+
solid = false,
13+
},
1014
highlight_overrides = {
1115
mocha = function(mocha)
1216
return {

lua/custom/plugins/floating-terminal.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,7 @@ end
5050

5151
vim.api.nvim_create_user_command('Floaterminal', toggle_terminal, {})
5252

53-
vim.keymap.set({ 'n', 't' }, '<leader>tt', '<cmd>Floaterminal<CR>', { desc = '[T]oggle floating [T]erminal' })
53+
vim.keymap.set('n', '<leader>tt', '<cmd>Floaterminal<CR>', { desc = '[T]oggle floating [T]erminal' })
54+
vim.keymap.set('t', '<C-q>', '<cmd>Floaterminal<CR>', { desc = 'Close floating terminal' })
55+
56+
return {}

lua/custom/plugins/nvim-treesitter.lua

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@ return {
55
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
66
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
77
opts = {
8-
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
8+
ensure_installed = {
9+
'bash',
10+
'c',
11+
'diff',
12+
'lua',
13+
'luadoc',
14+
'markdown',
15+
'markdown_inline',
16+
'query',
17+
'vim',
18+
'vimdoc',
19+
-- Frontend
20+
'typescript',
21+
'tsx',
22+
'javascript',
23+
'html',
24+
'css',
25+
'json',
26+
},
927
-- Autoinstall languages that are not installed
1028
auto_install = true,
1129
highlight = {

lua/custom/plugins/oil.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,15 @@ return {
55
'stevearc/oil.nvim',
66
---@module 'oil'
77
---@type oil.SetupOpts
8-
opts = {},
8+
opts = {
9+
skip_confirm_for_simple_edits = true,
10+
view_options = {
11+
show_hidden = true,
12+
is_always_hidden = function(name, _)
13+
return name == 'node_modules' or name == '.git'
14+
end,
15+
},
16+
},
917
-- Optional dependencies
1018
dependencies = { { 'echasnovski/mini.icons', opts = {} } },
1119
-- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons

lua/custom/plugins/super-maven.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
vim.keymap.set('n', '<leader>tc', '<cmd>SupermavenToggle<CR>', { desc = '[T]oggle AI [C]ompletion' })
2+
3+
return {
4+
{
5+
'supermaven-inc/supermaven-nvim',
6+
config = function()
7+
require('supermaven-nvim').setup {
8+
keymaps = {
9+
accept_suggestion = '<C-[>',
10+
clear_suggestion = '<C-]>',
11+
},
12+
}
13+
end,
14+
},
15+
}

0 commit comments

Comments
 (0)