added some more configurations
This commit is contained in:
		
							parent
							
								
									41d6f87f64
								
							
						
					
					
						commit
						9ea714a879
					
				
							
								
								
									
										48
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										48
									
								
								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', '<Esc>', '<cmd>nohlsearch<CR>')
 | 
			
		||||
 | 
			
		||||
-- Open Vertical Terminal in Neovim
 | 
			
		||||
vim.keymap.set('n', '<leader>vt', '<cmd>vnew<CR><cmd>terminal<CR>a', { desc = 'Open neovim Terminal' })
 | 
			
		||||
 | 
			
		||||
-- Diagnostic keymaps
 | 
			
		||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
 | 
			
		||||
vim.keymap.set('n', '<leader>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`
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,13 @@
 | 
			
		|||
return {
 | 
			
		||||
  'mistricky/codesnap.nvim',
 | 
			
		||||
  build = 'make build_generator',
 | 
			
		||||
  keys = {
 | 
			
		||||
    { '<leader>cc', '<cmd>CodeSnap<cr>', mode = 'x', desc = 'Save selected code snapshot into clipboard' },
 | 
			
		||||
    { '<leader>cs', '<cmd>CodeSnapSave<cr>', mode = 'x', desc = 'Save selected code snapshot in ~/Screenshots' },
 | 
			
		||||
  },
 | 
			
		||||
  opts = {
 | 
			
		||||
    save_path = '~/Pictures/Screenshots/',
 | 
			
		||||
    -- has_breadcrumbs = true,
 | 
			
		||||
    bg_theme = 'bamboo',
 | 
			
		||||
  },
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -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,
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -0,0 +1,2 @@
 | 
			
		|||
-- return { 'github/copilot.vim' }
 | 
			
		||||
return {}
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {}
 | 
			
		||||
| 
						 | 
				
			
			@ -3,7 +3,7 @@ return {
 | 
			
		|||
  dependencies = {
 | 
			
		||||
    'preservim/vimux',
 | 
			
		||||
  },
 | 
			
		||||
  vim.keymap.set('n', '<leader>t', ':TestNearest<CR>'),
 | 
			
		||||
  vim.keymap.set('n', '<leader>tt', ':TestNearest<CR>', { desc = 'Test Nearest' }),
 | 
			
		||||
  vim.keymap.set('n', '<leader>T', ':TestFile<CR>'),
 | 
			
		||||
  vim.keymap.set('n', '<leader>m', ':TestSuite<CR>'),
 | 
			
		||||
  vim.keymap.set('n', '<leader>l', ':TestLast<CR>'),
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,3 @@
 | 
			
		|||
-- autopairs
 | 
			
		||||
-- https://github.com/windwp/nvim-autopairs
 | 
			
		||||
 | 
			
		||||
return {
 | 
			
		||||
  'windwp/nvim-autopairs',
 | 
			
		||||
  event = 'InsertEnter',
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue