nvim

Neovim configuration
git clone git://git.laack.co/nvim.git
Log | Files | Refs | README

plugins.lua (7815B)


      1 local ensure_packer = function()
      2 	local fn = vim.fn
      3 	local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
      4 	if fn.empty(fn.glob(install_path)) > 0 then
      5 		fn.system({ "git", "clone", "--depth", "1", "https://github.com/wbthomason/packer.nvim", install_path })
      6 		vim.cmd([[packadd packer.nvim]])
      7 		return true
      8 	end
      9 	return false
     10 end
     11 
     12 local packer_bootstrap = ensure_packer()
     13 
     14 -- package manager
     15 return require("packer").startup(function(use)
     16 	use{
     17         "wbthomason/packer.nvim",
     18         commit = "ea0cc3c59f67c440c5ff0bbe4fb9420f4350b9a3"
     19     }
     20     -- Had to run this to get markdown preview working:
     21     -- cd ./.local/share/nvim/site/pack/packer/start/markdown-preview.nvim/
     22     -- Then:
     23     -- npm install
     24     -- See :messages after trying to run MarkdownPreview from nvim to see diagnostic messages.
     25 
     26 --    use({ "iamcco/markdown-preview.nvim", run = "cd app && npm install", setup = function() vim.g.mkdp_filetypes = { "markdown" } end, ft = { "markdown" }, })
     27 
     28 	use {
     29         'L3MON4D3/LuaSnip',
     30         commit = "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c"
     31     }
     32 	require("luasnip.loaders.from_lua").load({paths = "~/.config/nvim/LuaSnip/"})
     33 
     34 
     35 -- Somewhere in your Neovim startup, e.g. init.lua
     36 require("luasnip").config.set_config({ -- Setting LuaSnip config
     37 
     38   -- Enable autotriggered snippets
     39   enable_autosnippets = true,
     40 })
     41 	-- tex compile features
     42 	-- This is not really necessary though
     43 	-- because I use tmux + entr
     44 	
     45 	-- use("lervag/vimtex")
     46 
     47 	-- vim.g.vimtex_view_method = 'general'
     48 	-- vim.g.vimtex_view_general_viewer = 'zathura '
     49 
     50   -- use ('untitled-ai/jupyter_ascending.vim')
     51 
     52 	
     53 --	use({
     54 --		"kwkarlwang/bufjump.nvim",
     55 --		config = function()
     56 --			require("bufjump").setup({
     57 --				forward_key = "b",
     58 --				backward_key = "B",
     59 --				on_success = nil
     60 --			})
     61 --		end,
     62 --	})
     63 
     64 
     65 
     66     -- vim.g.wiki_root = '~/gitRepos/personal-notes/notes'
     67 	-- autopairs of {[()]}
     68 	use{
     69         "windwp/nvim-autopairs",
     70         commit = "59bce2eef357189c3305e25bc6dd2d138c1683f5"
     71     }
     72 	local npairs = require("nvim-autopairs")
     73 	npairs.setup({})
     74 
     75 	--use("OXY2DEV/markview.nvim")
     76 
     77 	-- lsp
     78 	use({
     79 		"VonHeikemen/lsp-zero.nvim",
     80 		commit = "77550f2f6cbf0959ef1583d845661af075f3442b",
     81 		requires = {
     82 			{ "neovim/nvim-lspconfig",
     83                 commit = "faa403f95fd82cc24ebd0cee6af41b0de2dae00c"
     84             },
     85 			{ "hrsh7th/nvim-cmp",
     86             commit = "da88697d7f45d16852c6b2769dc52387d1ddc45f"
     87             },
     88 			{ "hrsh7th/cmp-nvim-lsp",
     89             commit = "cbc7b02bb99fae35cb42f514762b89b5126651ef"
     90             },
     91 			{ "L3MON4D3/LuaSnip",
     92             commit = "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c"
     93         },
     94 
     95 		},
     96 	})
     97 	use{
     98 		"williamboman/mason.nvim",
     99         commit = "44d1e90e1f66e077268191e3ee9d2ac97cc18e65"
    100 	}
    101 	
    102     use {
    103         "williamboman/mason-lspconfig.nvim",
    104         commit = "a324581a3c83fdacdb9804b79de1cbe00ce18550"
    105     }
    106 
    107 	-- fuzzy finding
    108 	use({
    109 		"nvim-telescope/telescope.nvim",
    110 		commit = "5255aa27c422de944791318024167ad5d40aad20",
    111 		requires = { { "nvim-lua/plenary.nvim", commit = "b9fd5226c2f76c951fc8ed5923d85e4de065e509" } },
    112 	})
    113 
    114 
    115 	require('telescope').setup {
    116 	  defaults = {
    117 		mappings = {
    118 		  n = { ["<C-e>"] = require('telescope.actions').close },
    119 		  i = { ["<C-e>"] = require('telescope.actions').close },
    120 		},
    121     preview = {
    122       treesitter = false,
    123     },
    124 	  },
    125     pickers = {
    126 		find_files = {
    127 			-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
    128 			find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*", "-L" },
    129 		},
    130 	},
    131 
    132 	}
    133 
    134     use({
    135         'ggml-org/llama.vim',
    136         commit = '0e26efd52491bc83f81991c4f09252f688b9746e'
    137     })
    138 
    139     -- https://github.com/ggml-org/llama.vim/blob/master/autoload/llama.vim
    140     -- I cleared some of these shortcuts because it tried to use leader key... :(
    141 
    142     vim.g.llama_config = {
    143         endpoint_fim = 'http://mbp.local:8012/infill',
    144         api_key = os.getenv('LLAMA_API_KEY') or '',
    145       n_predict = 128,
    146       t_max_predict_ms = 5000,
    147         keymap_fim_trigger = "",
    148         keymap_fim_accept_full = "<C-a>", -- don't know if this is the correct keymap
    149         keymap_fim_accept_line = "<S-Tab>",
    150         keymap_fim_accept_word = "",
    151         keymap_inst_trigger = "",
    152         keymap_inst_rerun = "",
    153         keymap_inst_continue = "",
    154         keymap_inst_accept = "<Tab>",
    155         keymap_inst_cancel = "<Esc>",
    156         keymap_debug_toggle = "",
    157     }
    158 
    159 	-- needed for icons for telescope
    160 	-- use("nvim-tree/nvim-web-devicons")
    161 
    162 
    163 	-- Wiki plugin for creating files and stuff for note taking.
    164 	use{"lervag/wiki.vim", commit = "2acd05d2f1e5bb0fb094621a865879982c87a9cf"}
    165 
    166     -- oil for fs manipulation
    167     use{"stevearc/oil.nvim", commit = "0fcc83805ad11cf714a949c98c605ed717e0b83e"}
    168     require("oil").setup({
    169         skip_confirm_for_simple_edits = true
    170     })
    171 
    172     vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })
    173     
    174     use("/home/andrew/gitRepos/flashcards.nvim")
    175     
    176 
    177 
    178 	--use("scottmckendry/cyberdream.nvim")
    179 
    180     -- use('goerz/jupytext.nvim')
    181 
    182 
    183    --  opts = {
    184    --    jupytext = 'jupytext',
    185    --    format = "markdown",
    186    --    update = true,
    187    --    filetype = require("jupytext").get_filetype,
    188    --    new_template = require("jupytext").default_new_template(),
    189    --    sync_patterns = { '*.md', '*.py', '*.jl', '*.R', '*.Rmd', '*.qmd' },
    190    --    autosync = true,
    191    --    handle_url_schemes = true,
    192    --  }
    193 
    194     -- require("jupytext").setup(opts)
    195 
    196 
    197     --use('https://github.com/geg2102/nvim-jupyter-client')
    198     --require('nvim-jupyter-client').setup({})
    199 	use{'kwakzalver/duckytype.nvim', commit = "fa59fbd7cf8407337bfe07d01b361a3449f34743"}
    200 	require('duckytype').setup{}
    201 
    202 
    203 	-- use('https://github.com/ThePrimeagen/harpoon')
    204 	-- require("telescope").load_extension('harpoon')
    205 	
    206 	--require("cyberdream").setup({
    207 
    208 	--	borderless_picker = false,
    209 	--	extensions = {
    210 	--		telescope = false,
    211 	--	},
    212 
    213 	--})
    214     
    215 
    216 --    use('rlane/pounce.nvim')
    217 --    
    218 --    require'pounce'.setup{
    219 --       accept_keys = "TNSERIOADHFUYWPLMVXZCGBJKQ",
    220 --       accept_best_key = "<enter>",
    221 --       multi_window = true,
    222 --       debug = false,
    223 --    }
    224 
    225 --	-- Tree sitter (syntax highlighting)
    226        -- Tree sitter (syntax highlighting)
    227        use{"nvim-treesitter/nvim-treesitter", commit = "5cb05e1b0fa3c469958a2b26f36b3fe930af221c"}
    228 
    229        require'nvim-treesitter.config'.setup {
    230          ensure_installed = { "java", "lua", "python", "javascript", "html", "markdown" , "latex"},
    231 
    232          ignore_install = {"latex"},   -- Disables latex tree-sitter
    233 
    234                auto_install = true,
    235          highlight = {
    236                enable = true,              -- Enable highlighting
    237        additional_vim_regex_highlighting = { 'ruby', 'markdown' },
    238          },
    239          indent = {
    240                enable = true,              -- Enable indentation
    241          },
    242        }
    243 
    244 
    245 
    246 --	use({
    247 --		"kylechui/nvim-surround",
    248 --		tag = "*", -- Use for stability; omit to use `main` branch for the latest features
    249 --		config = function()
    250 --			require("nvim-surround").setup({})
    251 --		end,
    252 --	})
    253 
    254 	--vim.keymap.set("o", "s", function() require'pounce'.pounce { } end)
    255 
    256 	if packer_bootstrap then
    257 		require("packer").sync()
    258 	end
    259 
    260 -- nvim-cmp configuration for C-p and C-n
    261 local cmp = require('cmp')
    262 cmp.setup({
    263   snippet = {
    264     expand = function(args)
    265       require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
    266     end,
    267   },
    268 	mapping = {
    269 		['<C-p>'] = cmp.mapping.select_prev_item(), -- Move to previous suggestion
    270 		['<C-n>'] = cmp.mapping.select_next_item(), -- Move to next suggestion
    271 		['<C-y>'] = cmp.mapping.confirm({ select = true }), -- Confirm selection
    272 		['<C-Space>'] = cmp.mapping.complete(), -- Trigger completion menu
    273 	},
    274 	sources = cmp.config.sources({
    275 		{ name = 'luasnip' },
    276 		{ name = 'nvim_lsp' },
    277 	}),
    278 
    279 })
    280 end)