My own first version of kickstart.nvim
This commit is contained in:
		
							parent
							
								
									3668af39f4
								
							
						
					
					
						commit
						dc41cd1fc2
					
				| 
						 | 
					@ -1,4 +1,2 @@
 | 
				
			||||||
tags
 | 
					lazy-lock.json
 | 
				
			||||||
test.sh
 | 
					 | 
				
			||||||
.luarc.json
 | 
					 | 
				
			||||||
nvim
 | 
					nvim
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					vim.opt.breakindentopt = "shift:2"
 | 
				
			||||||
 | 
					vim.opt.shiftwidth = 4
 | 
				
			||||||
 | 
					vim.opt.textwidth = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vim.cmd([[
 | 
				
			||||||
 | 
					function! MyFormatExpr(start, end)
 | 
				
			||||||
 | 
					    silent execute a:start.','.a:end.'s/[.!?]\zs /\r/g'
 | 
				
			||||||
 | 
					endfunction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					set formatexpr=MyFormatExpr(v:lnum,v:lnum+v:count-1)
 | 
				
			||||||
 | 
					]])
 | 
				
			||||||
							
								
								
									
										174
									
								
								init.lua
								
								
								
								
							
							
						
						
									
										174
									
								
								init.lua
								
								
								
								
							| 
						 | 
					@ -1,51 +1,18 @@
 | 
				
			||||||
--[[
 | 
					-- DISABLED FOR NOW
 | 
				
			||||||
 | 
					-- @diagnostic disable: missing-fields -- disables annoying warnings
 | 
				
			||||||
 | 
					-- Lua guides:
 | 
				
			||||||
 | 
					-- - https://learnxinyminutes.com/docs/lua/
 | 
				
			||||||
 | 
					-- - `:help lua-guide`
 | 
				
			||||||
 | 
					-- - https://neovim.io/doc/user/lua-guide.html
 | 
				
			||||||
 | 
					
 | 
				
			||||||
=====================================================================
 | 
					 | 
				
			||||||
==================== READ THIS BEFORE CONTINUING ====================
 | 
					 | 
				
			||||||
=====================================================================
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Kickstart.nvim is *not* a distribution.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Kickstart.nvim is a template for your own configuration.
 | 
					 | 
				
			||||||
  The goal is that you can read every line of code, top-to-bottom, understand
 | 
					 | 
				
			||||||
  what your configuration is doing, and modify it to suit your needs.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  Once you've done that, you should start exploring, configuring and tinkering to
 | 
					 | 
				
			||||||
  explore Neovim!
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  If you don't know anything about Lua, I recommend taking some time to read through
 | 
					 | 
				
			||||||
  a guide. One possible example:
 | 
					 | 
				
			||||||
  - https://learnxinyminutes.com/docs/lua/
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  And then you can explore or search through `:help lua-guide`
 | 
					 | 
				
			||||||
  - https://neovim.io/doc/user/lua-guide.html
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
Kickstart Guide:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
I have left several `:help X` comments throughout the init.lua
 | 
					 | 
				
			||||||
You should run that command and read that help section for more information.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
In addition, I have some `NOTE:` items throughout the file.
 | 
					 | 
				
			||||||
These are for you, the reader to help understand what is happening. Feel free to delete
 | 
					 | 
				
			||||||
them once you know what you're doing, but they should serve as a guide for when you
 | 
					 | 
				
			||||||
are first encountering a few different constructs in your nvim config.
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
I hope you enjoy your Neovim journey,
 | 
					 | 
				
			||||||
- TJ
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
P.S. You can delete this when you're done too. It's your config now :)
 | 
					 | 
				
			||||||
--]]
 | 
					 | 
				
			||||||
-- Set <space> as the leader key
 | 
					 | 
				
			||||||
-- See `:help mapleader`
 | 
					 | 
				
			||||||
--  NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
 | 
					--  NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
 | 
				
			||||||
vim.g.mapleader = ' '
 | 
					vim.g.mapleader = ' '
 | 
				
			||||||
vim.g.maplocalleader = ' '
 | 
					vim.g.maplocalleader = ' '
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Install package manager
 | 
					
 | 
				
			||||||
--    https://github.com/folke/lazy.nvim
 | 
					
 | 
				
			||||||
--    `:help lazy.nvim.txt` for more info
 | 
					vim.g.have_nerd_font = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
 | 
					local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
 | 
				
			||||||
if not vim.loop.fs_stat(lazypath) then
 | 
					if not vim.loop.fs_stat(lazypath) then
 | 
				
			||||||
  vim.fn.system {
 | 
					  vim.fn.system {
 | 
				
			||||||
| 
						 | 
					@ -56,8 +23,8 @@ if not vim.loop.fs_stat(lazypath) then
 | 
				
			||||||
    '--branch=stable', -- latest stable release
 | 
					    '--branch=stable', -- latest stable release
 | 
				
			||||||
    lazypath,
 | 
					    lazypath,
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
end
 | 
					end -- ---@diagnostic disable-next-line: undefined-field
 | 
				
			||||||
vim.opt.rtp:prepend(lazypath)
 | 
					vim.opt.runtimepath:prepend(lazypath)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- NOTE: Here is where you install your plugins.
 | 
					-- NOTE: Here is where you install your plugins.
 | 
				
			||||||
--  You can configure plugins using the `config` key.
 | 
					--  You can configure plugins using the `config` key.
 | 
				
			||||||
| 
						 | 
					@ -65,8 +32,6 @@ vim.opt.rtp:prepend(lazypath)
 | 
				
			||||||
--  You can also configure plugins after the setup call,
 | 
					--  You can also configure plugins after the setup call,
 | 
				
			||||||
--    as they will be available in your neovim runtime.
 | 
					--    as they will be available in your neovim runtime.
 | 
				
			||||||
require('lazy').setup({
 | 
					require('lazy').setup({
 | 
				
			||||||
  -- NOTE: First, some plugins that don't require any configuration
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  -- Git related plugins
 | 
					  -- Git related plugins
 | 
				
			||||||
  'tpope/vim-fugitive',
 | 
					  'tpope/vim-fugitive',
 | 
				
			||||||
  'tpope/vim-rhubarb',
 | 
					  'tpope/vim-rhubarb',
 | 
				
			||||||
| 
						 | 
					@ -74,8 +39,6 @@ require('lazy').setup({
 | 
				
			||||||
  -- Detect tabstop and shiftwidth automatically
 | 
					  -- Detect tabstop and shiftwidth automatically
 | 
				
			||||||
  'tpope/vim-sleuth',
 | 
					  'tpope/vim-sleuth',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- NOTE: This is where your plugins related to LSP can be installed.
 | 
					 | 
				
			||||||
  --  The configuration is done below. Search for lspconfig to find it below.
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    -- LSP Configuration & Plugins
 | 
					    -- LSP Configuration & Plugins
 | 
				
			||||||
    'neovim/nvim-lspconfig',
 | 
					    'neovim/nvim-lspconfig',
 | 
				
			||||||
| 
						 | 
					@ -124,7 +87,8 @@ require('lazy').setup({
 | 
				
			||||||
        changedelete = { text = '~' },
 | 
					        changedelete = { text = '~' },
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      on_attach = function(bufnr)
 | 
					      on_attach = function(bufnr)
 | 
				
			||||||
        vim.keymap.set('n', '<leader>hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' })
 | 
					        vim.keymap.set('n', '<leader>hp', require('gitsigns').preview_hunk,
 | 
				
			||||||
 | 
					          { buffer = bufnr, desc = 'Preview git hunk' })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        -- don't override the built-in and fugitive keymaps
 | 
					        -- don't override the built-in and fugitive keymaps
 | 
				
			||||||
        local gs = package.loaded.gitsigns
 | 
					        local gs = package.loaded.gitsigns
 | 
				
			||||||
| 
						 | 
					@ -142,15 +106,6 @@ require('lazy').setup({
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  {
 | 
					 | 
				
			||||||
    -- Theme inspired by Atom
 | 
					 | 
				
			||||||
    'navarasu/onedark.nvim',
 | 
					 | 
				
			||||||
    priority = 1000,
 | 
					 | 
				
			||||||
    config = function()
 | 
					 | 
				
			||||||
      vim.cmd.colorscheme 'onedark'
 | 
					 | 
				
			||||||
    end,
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  {
 | 
					  {
 | 
				
			||||||
    -- Set lualine as statusline
 | 
					    -- Set lualine as statusline
 | 
				
			||||||
    'nvim-lualine/lualine.nvim',
 | 
					    'nvim-lualine/lualine.nvim',
 | 
				
			||||||
| 
						 | 
					@ -158,7 +113,7 @@ require('lazy').setup({
 | 
				
			||||||
    opts = {
 | 
					    opts = {
 | 
				
			||||||
      options = {
 | 
					      options = {
 | 
				
			||||||
        icons_enabled = false,
 | 
					        icons_enabled = false,
 | 
				
			||||||
        theme = 'onedark',
 | 
					        theme = 'catppuccin',
 | 
				
			||||||
        component_separators = '|',
 | 
					        component_separators = '|',
 | 
				
			||||||
        section_separators = '',
 | 
					        section_separators = '',
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
| 
						 | 
					@ -212,7 +167,7 @@ require('lazy').setup({
 | 
				
			||||||
  -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
 | 
					  -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
 | 
				
			||||||
  --       These are some example plugins that I've included in the kickstart repository.
 | 
					  --       These are some example plugins that I've included in the kickstart repository.
 | 
				
			||||||
  --       Uncomment any of the lines below to enable them.
 | 
					  --       Uncomment any of the lines below to enable them.
 | 
				
			||||||
  -- require 'kickstart.plugins.autoformat',
 | 
					  require 'kickstart.plugins.autoformat',
 | 
				
			||||||
  -- require 'kickstart.plugins.debug',
 | 
					  -- require 'kickstart.plugins.debug',
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
 | 
					  -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
 | 
				
			||||||
| 
						 | 
					@ -221,22 +176,30 @@ require('lazy').setup({
 | 
				
			||||||
  --    Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
 | 
					  --    Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
 | 
				
			||||||
  --
 | 
					  --
 | 
				
			||||||
  --    For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
 | 
					  --    For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
 | 
				
			||||||
  -- { import = 'custom.plugins' },
 | 
					  { import = 'custom.plugins' },
 | 
				
			||||||
}, {})
 | 
					}, {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- [[ Setting options ]]
 | 
					-- [[ Setting options ]]
 | 
				
			||||||
-- See `:help vim.o`
 | 
					-- See `:help vim.o`
 | 
				
			||||||
-- NOTE: You can change these options as you wish!
 | 
					-- NOTE: You can change these options as you wish!
 | 
				
			||||||
 | 
					-- See :help option-list
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Set highlight on search
 | 
					-- Set highlight on search
 | 
				
			||||||
vim.o.hlsearch = false
 | 
					vim.o.hlsearch = false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vim.g.have_nerd_font = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- colorcolumn
 | 
				
			||||||
 | 
					vim.o.colorcolumn = "80"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Make line numbers default
 | 
					-- Make line numbers default
 | 
				
			||||||
vim.wo.number = true
 | 
					vim.wo.number = true
 | 
				
			||||||
 | 
					vim.wo.relativenumber = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Enable mouse mode
 | 
					-- Enable mouse mode
 | 
				
			||||||
vim.o.mouse = 'a'
 | 
					vim.o.mouse = 'a'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					vim.opt.showmode = false
 | 
				
			||||||
-- Sync clipboard between OS and Neovim.
 | 
					-- Sync clipboard between OS and Neovim.
 | 
				
			||||||
--  Remove this option if you want your OS clipboard to remain independent.
 | 
					--  Remove this option if you want your OS clipboard to remain independent.
 | 
				
			||||||
--  See `:help 'clipboard'`
 | 
					--  See `:help 'clipboard'`
 | 
				
			||||||
| 
						 | 
					@ -274,6 +237,15 @@ vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
 | 
				
			||||||
-- Remap for dealing with word wrap
 | 
					-- Remap for dealing with word wrap
 | 
				
			||||||
vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
 | 
					vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })
 | 
				
			||||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
 | 
					vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", { expr = true, silent = true })
 | 
				
			||||||
 | 
					vim.keymap.set('n', 'gk', "v:count == 0 ? 'k' : 'k'", { expr = true, silent = true })
 | 
				
			||||||
 | 
					vim.keymap.set('n', 'gj', "v:count == 0 ? 'j' : 'j'", { expr = true, silent = true })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					-- wrap between words
 | 
				
			||||||
 | 
					vim.o.linebreak = true
 | 
				
			||||||
 | 
					vim.o.expandtab = true
 | 
				
			||||||
 | 
					vim.o.shiftwidth = 4
 | 
				
			||||||
 | 
					vim.o.tabstop = 8
 | 
				
			||||||
 | 
					vim.o.softtabstop = 4
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- [[ Highlight on yank ]]
 | 
					-- [[ Highlight on yank ]]
 | 
				
			||||||
-- See `:help vim.highlight.on_yank()`
 | 
					-- See `:help vim.highlight.on_yank()`
 | 
				
			||||||
| 
						 | 
					@ -314,18 +286,34 @@ vim.keymap.set('n', '<leader>/', function()
 | 
				
			||||||
end, { desc = '[/] Fuzzily search in current buffer' })
 | 
					end, { desc = '[/] Fuzzily search in current buffer' })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
 | 
					vim.keymap.set('n', '<leader>gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' })
 | 
				
			||||||
vim.keymap.set('n', '<leader>sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
 | 
					vim.keymap.set('n', '<leader>tf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' })
 | 
				
			||||||
vim.keymap.set('n', '<leader>sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
 | 
					vim.keymap.set('n', '<leader>th', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' })
 | 
				
			||||||
vim.keymap.set('n', '<leader>sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
 | 
					vim.keymap.set('n', '<leader>tw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' })
 | 
				
			||||||
vim.keymap.set('n', '<leader>sg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
 | 
					vim.keymap.set('n', '<leader>tg', require('telescope.builtin').live_grep, { desc = '[S]earch by [G]rep' })
 | 
				
			||||||
vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
 | 
					vim.keymap.set('n', '<leader>td', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' })
 | 
				
			||||||
vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
 | 
					vim.keymap.set('n', '<leader>tr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- [[ Configure Treesitter ]]
 | 
					-- [[ Configure Treesitter ]]
 | 
				
			||||||
-- See `:help nvim-treesitter`
 | 
					-- See `:help nvim-treesitter`
 | 
				
			||||||
require('nvim-treesitter.configs').setup {
 | 
					require('nvim-treesitter.configs').setup {
 | 
				
			||||||
  -- Add languages to be installed here that you want installed for treesitter
 | 
					  -- Add languages to be installed here that you want installed for treesitter
 | 
				
			||||||
  ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' },
 | 
					  ensure_installed = {
 | 
				
			||||||
 | 
					    'c',
 | 
				
			||||||
 | 
					    'cpp',
 | 
				
			||||||
 | 
					    'go',
 | 
				
			||||||
 | 
					    'lua',
 | 
				
			||||||
 | 
					    'python',
 | 
				
			||||||
 | 
					    'rust',
 | 
				
			||||||
 | 
					    'tsx',
 | 
				
			||||||
 | 
					    'javascript',
 | 
				
			||||||
 | 
					    'typescript',
 | 
				
			||||||
 | 
					    'vimdoc',
 | 
				
			||||||
 | 
					    'vim',
 | 
				
			||||||
 | 
					    'latex',
 | 
				
			||||||
 | 
					    'haskell',
 | 
				
			||||||
 | 
					    'norg',
 | 
				
			||||||
 | 
					    'markdown'
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
 | 
					  -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
 | 
				
			||||||
  auto_install = false,
 | 
					  auto_install = false,
 | 
				
			||||||
| 
						 | 
					@ -351,8 +339,9 @@ require('nvim-treesitter.configs').setup {
 | 
				
			||||||
        ['ia'] = '@parameter.inner',
 | 
					        ['ia'] = '@parameter.inner',
 | 
				
			||||||
        ['af'] = '@function.outer',
 | 
					        ['af'] = '@function.outer',
 | 
				
			||||||
        ['if'] = '@function.inner',
 | 
					        ['if'] = '@function.inner',
 | 
				
			||||||
        ['ac'] = '@class.outer',
 | 
					        -- FUCKS UP VIMTEX COMMANDS!
 | 
				
			||||||
        ['ic'] = '@class.inner',
 | 
					        -- ['ac'] = '@class.outer',
 | 
				
			||||||
 | 
					        -- ['ic'] = '@class.inner',
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    move = {
 | 
					    move = {
 | 
				
			||||||
| 
						 | 
					@ -460,6 +449,11 @@ local servers = {
 | 
				
			||||||
      telemetry = { enable = false },
 | 
					      telemetry = { enable = false },
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
 | 
					  -- ltex = {
 | 
				
			||||||
 | 
					  --   ["dictionary"] = {
 | 
				
			||||||
 | 
					  --     ["en-US"] = { "Surlykke" }
 | 
				
			||||||
 | 
					  --   }
 | 
				
			||||||
 | 
					  -- }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- Setup neovim lua configuration
 | 
					-- Setup neovim lua configuration
 | 
				
			||||||
| 
						 | 
					@ -491,8 +485,17 @@ mason_lspconfig.setup_handlers {
 | 
				
			||||||
-- See `:help cmp`
 | 
					-- See `:help cmp`
 | 
				
			||||||
local cmp = require 'cmp'
 | 
					local cmp = require 'cmp'
 | 
				
			||||||
local luasnip = require 'luasnip'
 | 
					local luasnip = require 'luasnip'
 | 
				
			||||||
require('luasnip.loaders.from_vscode').lazy_load()
 | 
					require('luasnip.loaders.from_vscode').lazy_load({
 | 
				
			||||||
luasnip.config.setup {}
 | 
					  exclude = { "tex" }
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					require('luasnip.loaders.from_snipmate').lazy_load({
 | 
				
			||||||
 | 
					  exclude = { "tex" }
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					luasnip.config.setup {
 | 
				
			||||||
 | 
					  enable_autosnippets = true,
 | 
				
			||||||
 | 
					  store_selection_keys = "<Tab>",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
cmp.setup {
 | 
					cmp.setup {
 | 
				
			||||||
  snippet = {
 | 
					  snippet = {
 | 
				
			||||||
| 
						 | 
					@ -503,16 +506,20 @@ cmp.setup {
 | 
				
			||||||
  mapping = cmp.mapping.preset.insert {
 | 
					  mapping = cmp.mapping.preset.insert {
 | 
				
			||||||
    ['<C-n>'] = cmp.mapping.select_next_item(),
 | 
					    ['<C-n>'] = cmp.mapping.select_next_item(),
 | 
				
			||||||
    ['<C-p>'] = cmp.mapping.select_prev_item(),
 | 
					    ['<C-p>'] = cmp.mapping.select_prev_item(),
 | 
				
			||||||
    ['<C-d>'] = cmp.mapping.scroll_docs(-4),
 | 
					    ['<C-u>'] = cmp.mapping.scroll_docs(-4),
 | 
				
			||||||
    ['<C-f>'] = cmp.mapping.scroll_docs(4),
 | 
					    ['<C-d>'] = cmp.mapping.scroll_docs(4),
 | 
				
			||||||
    ['<C-Space>'] = cmp.mapping.complete {},
 | 
					    ['<C-Space>'] = cmp.mapping.complete {},
 | 
				
			||||||
    ['<CR>'] = cmp.mapping.confirm {
 | 
					    -- ['<CR>'] = cmp.mapping.confirm {
 | 
				
			||||||
      behavior = cmp.ConfirmBehavior.Replace,
 | 
					    --   behavior = cmp.ConfirmBehavior.Replace,
 | 
				
			||||||
      select = true,
 | 
					    --   select = true,
 | 
				
			||||||
    },
 | 
					    -- },
 | 
				
			||||||
    ['<Tab>'] = cmp.mapping(function(fallback)
 | 
					    ['<Tab>'] = cmp.mapping(function(fallback)
 | 
				
			||||||
      if cmp.visible() then
 | 
					      if cmp.visible() then
 | 
				
			||||||
        cmp.select_next_item()
 | 
					        cmp.confirm {
 | 
				
			||||||
 | 
					          behavior = cmp.ConfirmBehavior.Replace,
 | 
				
			||||||
 | 
					          select = true,
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        -- cmp.select_next_item()
 | 
				
			||||||
      elseif luasnip.expand_or_locally_jumpable() then
 | 
					      elseif luasnip.expand_or_locally_jumpable() then
 | 
				
			||||||
        luasnip.expand_or_jump()
 | 
					        luasnip.expand_or_jump()
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
| 
						 | 
					@ -520,9 +527,9 @@ cmp.setup {
 | 
				
			||||||
      end
 | 
					      end
 | 
				
			||||||
    end, { 'i', 's' }),
 | 
					    end, { 'i', 's' }),
 | 
				
			||||||
    ['<S-Tab>'] = cmp.mapping(function(fallback)
 | 
					    ['<S-Tab>'] = cmp.mapping(function(fallback)
 | 
				
			||||||
      if cmp.visible() then
 | 
					      -- if cmp.visible() then
 | 
				
			||||||
        cmp.select_prev_item()
 | 
					      --   cmp.select_prev_item()
 | 
				
			||||||
      elseif luasnip.locally_jumpable(-1) then
 | 
					      if luasnip.locally_jumpable(-1) then
 | 
				
			||||||
        luasnip.jump(-1)
 | 
					        luasnip.jump(-1)
 | 
				
			||||||
      else
 | 
					      else
 | 
				
			||||||
        fallback()
 | 
					        fallback()
 | 
				
			||||||
| 
						 | 
					@ -532,6 +539,7 @@ cmp.setup {
 | 
				
			||||||
  sources = {
 | 
					  sources = {
 | 
				
			||||||
    { name = 'nvim_lsp' },
 | 
					    { name = 'nvim_lsp' },
 | 
				
			||||||
    { name = 'luasnip' },
 | 
					    { name = 'luasnip' },
 | 
				
			||||||
 | 
					    { name = "neorg" }
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,5 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  "windwp/nvim-autopairs",
 | 
				
			||||||
 | 
					  event = "InsertEnter",
 | 
				
			||||||
 | 
					  opts = {}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,20 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    -- Best colorscheme
 | 
				
			||||||
 | 
					    'catppuccin/nvim',
 | 
				
			||||||
 | 
					    name = 'catppuccin',
 | 
				
			||||||
 | 
					    priority = 1000,
 | 
				
			||||||
 | 
					    config = function()
 | 
				
			||||||
 | 
					      vim.cmd.colorscheme 'catppuccin'
 | 
				
			||||||
 | 
					    end,
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    -- Theme inspired by Atom
 | 
				
			||||||
 | 
					    'navarasu/onedark.nvim',
 | 
				
			||||||
 | 
					    priority = 1000,
 | 
				
			||||||
 | 
					    -- config = function()
 | 
				
			||||||
 | 
					    --   vim.cmd.colorscheme 'onedark'
 | 
				
			||||||
 | 
					    -- end,
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,5 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  'mrcjkb/haskell-tools.nvim',
 | 
				
			||||||
 | 
					  version = '^3', -- Recommended
 | 
				
			||||||
 | 
					  ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -2,4 +2,8 @@
 | 
				
			||||||
--  I promise not to create any merge conflicts in this directory :)
 | 
					--  I promise not to create any merge conflicts in this directory :)
 | 
				
			||||||
--
 | 
					--
 | 
				
			||||||
-- See the kickstart.nvim README for more information
 | 
					-- See the kickstart.nvim README for more information
 | 
				
			||||||
return {}
 | 
					--
 | 
				
			||||||
 | 
					-- FOR PLUGINS NOT REQUIRING CONFIGURATION:
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  "fladson/vim-kitty"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,29 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  "nvim-neorg/neorg",
 | 
				
			||||||
 | 
					  dependencies = { "nvim-lua/plenary.nvim" },
 | 
				
			||||||
 | 
					  build = ":Neorg sync-parsers",
 | 
				
			||||||
 | 
					  -- tag = "*",
 | 
				
			||||||
 | 
					  lazy = true,   -- enable lazy load
 | 
				
			||||||
 | 
					  ft = "norg",   -- lazy load on file type
 | 
				
			||||||
 | 
					  cmd = "Neorg", -- lazy load on command
 | 
				
			||||||
 | 
					  config = function()
 | 
				
			||||||
 | 
					    require("neorg").setup {
 | 
				
			||||||
 | 
					      load = {
 | 
				
			||||||
 | 
					        ["core.defaults"] = {},  -- Loads default behaviour
 | 
				
			||||||
 | 
					        ["core.concealer"] = {}, -- Adds pretty icons to your documents
 | 
				
			||||||
 | 
					        ["core.dirman"] = {      -- Manages Neorg workspaces
 | 
				
			||||||
 | 
					          config = {
 | 
				
			||||||
 | 
					            workspaces = {
 | 
				
			||||||
 | 
					              notes = "~/documents/notes",
 | 
				
			||||||
 | 
					            },
 | 
				
			||||||
 | 
					          },
 | 
				
			||||||
 | 
					        },
 | 
				
			||||||
 | 
					        ["core.completion"] = {
 | 
				
			||||||
 | 
					          config = {
 | 
				
			||||||
 | 
					            engine = "nvim-cmp",
 | 
				
			||||||
 | 
					          }
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,3 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  "Fymyte/rasi.vim"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,9 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  "AndrewRadev/sideways.vim",
 | 
				
			||||||
 | 
					  config = function()
 | 
				
			||||||
 | 
					    vim.keymap.set("n", "<leader>s<", ":SidewaysLeft<Cr>")
 | 
				
			||||||
 | 
					    vim.keymap.set("n", "<leader>s>", ":SidewaysRight<Cr>")
 | 
				
			||||||
 | 
					    vim.keymap.set("n", "<leader>sh", ":SidewaysJumpLeft<Cr>")
 | 
				
			||||||
 | 
					    vim.keymap.set("n", "<leader>sl", ":SidewaysJumpRight<Cr>")
 | 
				
			||||||
 | 
					  end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,26 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  'nvim-orgmode/orgmode',
 | 
				
			||||||
 | 
					  dependencies = {
 | 
				
			||||||
 | 
					    { 'nvim-treesitter/nvim-treesitter', lazy = true },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					  -- ADD THIS BACK LATER - SOMETHING WRONG, SO DOESNT START
 | 
				
			||||||
 | 
					  -- event = 'VeryLazy',
 | 
				
			||||||
 | 
					  config = function()
 | 
				
			||||||
 | 
					    -- Load treesitter grammar for org
 | 
				
			||||||
 | 
					    require('orgmode').setup_ts_grammar()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- Setup treesitter
 | 
				
			||||||
 | 
					    require('nvim-treesitter.configs').setup({
 | 
				
			||||||
 | 
					      highlight = {
 | 
				
			||||||
 | 
					        enable = true,
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      ensure_installed = { 'org' },
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    -- Setup orgmode
 | 
				
			||||||
 | 
					    require('orgmode').setup({
 | 
				
			||||||
 | 
					      org_agenda_files = '~/documents/orgfiles/**/*',
 | 
				
			||||||
 | 
					      org_default_notes_file = '~/documents/orgfiles/refile.org',
 | 
				
			||||||
 | 
					    })
 | 
				
			||||||
 | 
					  end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,14 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  "aperezdc/vim-template",
 | 
				
			||||||
 | 
					  -- Change init to config, and then tell when to load
 | 
				
			||||||
 | 
					  -- config only works for lua modules that are "required" by nvim.
 | 
				
			||||||
 | 
					  init = function()
 | 
				
			||||||
 | 
					      vim.g.templates_directory = "~/documents/latex-templates/"
 | 
				
			||||||
 | 
					      vim.g.templates_no_builtin_templates = true
 | 
				
			||||||
 | 
					      vim.g.templates_global_name_prefix = "template:"
 | 
				
			||||||
 | 
					      vim.g.templates_name_prefix = "template:"
 | 
				
			||||||
 | 
					      vim.g.templates_no_autocmd = true
 | 
				
			||||||
 | 
					    -- vim.cmd("let g:templates_no_autocmd=1")
 | 
				
			||||||
 | 
					  end,
 | 
				
			||||||
 | 
					  -- cmd = "Template",
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,6 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  "lervag/vimtex",
 | 
				
			||||||
 | 
					  config = function()
 | 
				
			||||||
 | 
					    vim.g.vimtex_view_method = 'zathura'
 | 
				
			||||||
 | 
					  end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,52 @@
 | 
				
			||||||
 | 
					--[[
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					-- This file is not required for your own configuration,
 | 
				
			||||||
 | 
					-- but helps people determine if their system is setup correctly.
 | 
				
			||||||
 | 
					--
 | 
				
			||||||
 | 
					--]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local check_version = function()
 | 
				
			||||||
 | 
					  local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch)
 | 
				
			||||||
 | 
					  if not vim.version.cmp then
 | 
				
			||||||
 | 
					    vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
 | 
				
			||||||
 | 
					    return
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
 | 
				
			||||||
 | 
					    vim.health.ok(string.format("Neovim version is: '%s'", verstr))
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					local check_external_reqs = function()
 | 
				
			||||||
 | 
					  -- Basic utils: `git`, `make`, `unzip`
 | 
				
			||||||
 | 
					  for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do
 | 
				
			||||||
 | 
					    local is_executable = vim.fn.executable(exe) == 1
 | 
				
			||||||
 | 
					    if is_executable then
 | 
				
			||||||
 | 
					      vim.health.ok(string.format("Found executable: '%s'", exe))
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      vim.health.warn(string.format("Could not find executable: '%s'", exe))
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  return true
 | 
				
			||||||
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  check = function()
 | 
				
			||||||
 | 
					    vim.health.start 'kickstart.nvim'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    vim.health.info [[NOTE: Not every warning is a 'must-fix' in `:checkhealth`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  Fix only warnings for plugins and languages you intend to use.
 | 
				
			||||||
 | 
					    Mason will give warnings for languages that are not installed.
 | 
				
			||||||
 | 
					    You do not need to install, unless you want to use those languages!]]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    local uv = vim.uv or vim.loop
 | 
				
			||||||
 | 
					    vim.health.info('System Information: ' .. vim.inspect(uv.os_uname()))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    check_version()
 | 
				
			||||||
 | 
					    check_external_reqs()
 | 
				
			||||||
 | 
					  end,
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,9 @@
 | 
				
			||||||
 | 
					return {
 | 
				
			||||||
 | 
					  { -- Add indentation guides even on blank lines
 | 
				
			||||||
 | 
					    'lukas-reineke/indent-blankline.nvim',
 | 
				
			||||||
 | 
					    -- Enable `lukas-reineke/indent-blankline.nvim`
 | 
				
			||||||
 | 
					    -- See `:help ibl`
 | 
				
			||||||
 | 
					    main = 'ibl',
 | 
				
			||||||
 | 
					    opts = {},
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,12 @@
 | 
				
			||||||
 | 
					snippet dmo "\DeclareMathOperator"
 | 
				
			||||||
 | 
					    \\DeclareMathOperator{${1}}{${2}}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					snippet $$ "$Math$"
 | 
				
			||||||
 | 
					    \$${1:VISUAL}\$
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					snippet em "\emph{...}"
 | 
				
			||||||
 | 
					    \emph{${1:VISUAL}}
 | 
				
			||||||
 | 
					snippet \ "\[ ... \]"
 | 
				
			||||||
 | 
					    \[
 | 
				
			||||||
 | 
					        ${1}
 | 
				
			||||||
 | 
					    \]
 | 
				
			||||||
		Loading…
	
		Reference in New Issue