diff --git a/init.lua b/init.lua index fb52b008..ce1c0b92 100644 --- a/init.lua +++ b/init.lua @@ -5,8 +5,9 @@ vim.g.maplocalleader = ' ' vim.g.have_nerd_font = true vim.opt.undodir = os.getenv 'HOME' .. '/.vim/undodir' +vim.opt.encoding = 'utf-8' -vim.opt.wrap = false +vim.opt.wrap = true -- [[ Setting options ]] -- See `:help vim.opt` -- NOTE: You can change these options as you wish! @@ -30,6 +31,18 @@ vim.opt.showmode = false -- See `:help 'clipboard'` vim.schedule(function() vim.opt.clipboard = 'unnamedplus' + vim.g.clipboard = { + name = 'wl-clipboard', + copy = { + ['+'] = 'wl-copy', + ['*'] = 'wl-copy', + }, + paste = { + ['+'] = 'wl-paste --no-newline', + ['*'] = 'wl-paste --no-newline', + }, + cache_enabled = 0, + } end) -- Enable break indent @@ -59,20 +72,20 @@ vim.opt.splitbelow = true -- Sets how neovim will display certain whitespace characters in the editor. -- See `:help 'list'` -- and `:help 'listchars'` -vim.opt.list = true -vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } +-- vim.opt.list = true +-- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } -- Preview substitutions live, as you type! vim.opt.inccommand = 'split' -- Show which line your cursor is on -vim.opt.cursorline = true +vim.opt.cursorline = false -- Minimal number of screen lines to keep above and below the cursor. vim.opt.scrolloff = 10 vim.opt.termguicolors = true -vim.opt.tabstop = 4 +vim.opt.tabstop = 1 -- -- [[ Basic Keymaps ]] @@ -82,8 +95,12 @@ vim.opt.tabstop = 4 -- See `:help hlsearch` vim.keymap.set('n', '', 'nohlsearch') +-- Open Vertical Terminal in Neovim +vim.keymap.set('n', 'vt', 'vnewterminala', { desc = 'Open neovim Terminal' }) + -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open diagnostic of current line' }) -- Netrw keymaps @@ -499,7 +516,8 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`tsserver`) will work just fine - tsserver = {}, + tailwindcss = {}, + ts_ls = {}, cssls = { settings = { css = { @@ -547,6 +565,7 @@ require('lazy').setup({ require('mason-lspconfig').setup { handlers = { function(server_name) + server_name = server_name == 'tsserver' and 'ts_ls' or server_name local server = servers[server_name] or {} -- This handles overriding only values explicitly passed -- by the server configuration above. Useful when disabling @@ -591,8 +610,10 @@ require('lazy').setup({ -- python = { "isort", "black" }, -- -- You can use 'stop_after_first' to run the first available formatter from the list - javascript = { "prettierd", "prettier", stop_after_first = true }, - cpp = { { 'clang-format' } }, + typescript = { 'prettierd', 'prettier', stop_after_first = true }, + json = { 'prettierd' }, + javascript = { 'prettierd', 'prettier', stop_after_first = true }, + cpp = { 'clang-format' }, }, }, }, @@ -721,6 +742,11 @@ require('lazy').setup({ 'catppuccin/nvim', priority = 1000, -- Make sure to load this before all the other start plugins. name = 'catppuccin', + config = function(self, opts) + require('catppuccin').setup { + transparent_background = true, + } + end, init = function() -- Load the colorscheme here. -- Like many other themes, this one has different styles, and you could load @@ -776,7 +802,7 @@ require('lazy').setup({ 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', opts = { - ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, + ensure_installed = { 'bash', 'typescript', 'tsx', 'c', 'cpp', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, -- Autoinstall languages that are not installed auto_install = true, highlight = { @@ -788,6 +814,10 @@ require('lazy').setup({ }, indent = { enable = true, disable = { 'ruby' } }, }, + context_commentstring = { + enable = true, + enable_autocmd = false, + }, config = function(_, opts) -- [[ Configure Treesitter ]] See `:help nvim-treesitter` diff --git a/lua/custom/plugins/codecompanion.lua b/lua/custom/plugins/codecompanion.lua new file mode 100644 index 00000000..4a737a62 --- /dev/null +++ b/lua/custom/plugins/codecompanion.lua @@ -0,0 +1,11 @@ +return { + -- 'olimorris/codecompanion.nvim', + -- dependencies = { + -- 'nvim-lua/plenary.nvim', + -- 'nvim-treesitter/nvim-treesitter', + -- 'hrsh7th/nvim-cmp', -- Optional: For using slash commands and variables in the chat buffer + -- 'nvim-telescope/telescope.nvim', -- Optional: For using slash commands + -- { 'stevearc/dressing.nvim', opts = {} }, -- Optional: Improves the default Neovim UI + -- }, + -- config = true, +} diff --git a/lua/custom/plugins/codesnap.lua b/lua/custom/plugins/codesnap.lua new file mode 100644 index 00000000..17271651 --- /dev/null +++ b/lua/custom/plugins/codesnap.lua @@ -0,0 +1,13 @@ +return { + 'mistricky/codesnap.nvim', + build = 'make build_generator', + keys = { + { 'cc', 'CodeSnap', mode = 'x', desc = 'Save selected code snapshot into clipboard' }, + { 'cs', 'CodeSnapSave', mode = 'x', desc = 'Save selected code snapshot in ~/Screenshots' }, + }, + opts = { + save_path = '~/Pictures/Screenshots/', + -- has_breadcrumbs = true, + bg_theme = 'bamboo', + }, +} diff --git a/lua/custom/plugins/comment.lua b/lua/custom/plugins/comment.lua new file mode 100644 index 00000000..63536d8a --- /dev/null +++ b/lua/custom/plugins/comment.lua @@ -0,0 +1,17 @@ +return { + 'numToStr/Comment.nvim', + dependencies = { 'JoosepAlviste/nvim-ts-context-commentstring' }, + config = function() + require('Comment').setup { + pre_hook = require('ts_context_commentstring.integrations.comment_nvim').create_pre_hook(), + -- Ensure commentstring is set properly for TSX and JSX files + vim.api.nvim_create_autocmd('FileType', { + pattern = { 'javascriptreact', 'typescriptreact' }, + callback = function() + -- Use JSX-style comments in TSX/JSX files + vim.bo.commentstring = '{/* %s */}' + end, + }), + } + end, +} diff --git a/lua/custom/plugins/copilot.lua b/lua/custom/plugins/copilot.lua new file mode 100644 index 00000000..f28f4d98 --- /dev/null +++ b/lua/custom/plugins/copilot.lua @@ -0,0 +1,2 @@ +-- return { 'github/copilot.vim' } +return {} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua deleted file mode 100644 index be0eb9d8..00000000 --- a/lua/custom/plugins/init.lua +++ /dev/null @@ -1,5 +0,0 @@ --- You can add your own plugins here or in other files in this directory! --- I promise not to create any merge conflicts in this directory :) --- --- See the kickstart.nvim README for more information -return {} diff --git a/lua/custom/plugins/vim-test.lua b/lua/custom/plugins/vim-test.lua index 3ace7bf0..6fc37060 100644 --- a/lua/custom/plugins/vim-test.lua +++ b/lua/custom/plugins/vim-test.lua @@ -3,7 +3,7 @@ return { dependencies = { 'preservim/vimux', }, - vim.keymap.set('n', 't', ':TestNearest'), + vim.keymap.set('n', 'tt', ':TestNearest', { desc = 'Test Nearest' }), vim.keymap.set('n', 'T', ':TestFile'), vim.keymap.set('n', 'm', ':TestSuite'), vim.keymap.set('n', 'l', ':TestLast'), diff --git a/lua/kickstart/plugins/autopairs.lua b/lua/kickstart/plugins/autopairs.lua index 87a7e5ff..3807819d 100644 --- a/lua/kickstart/plugins/autopairs.lua +++ b/lua/kickstart/plugins/autopairs.lua @@ -1,6 +1,3 @@ --- autopairs --- https://github.com/windwp/nvim-autopairs - return { 'windwp/nvim-autopairs', event = 'InsertEnter', diff --git a/lua/kickstart/plugins/lint.lua b/lua/kickstart/plugins/lint.lua index ca9bc237..a27cd959 100644 --- a/lua/kickstart/plugins/lint.lua +++ b/lua/kickstart/plugins/lint.lua @@ -5,9 +5,9 @@ return { event = { 'BufReadPre', 'BufNewFile' }, config = function() local lint = require 'lint' - lint.linters_by_ft = { - markdown = { 'markdownlint' }, - } + -- lint.linters_by_ft = { + -- markdown = { 'markdownlint' }, + -- } -- To allow other plugins to add linters to require('lint').linters_by_ft, -- instead set linters_by_ft like this: