mirror of
https://github.com/halfdan/dotfiles.git
synced 2025-09-10 19:56:24 +00:00
lazy.nvim
This commit is contained in:
@@ -6,7 +6,6 @@ local source_mapping = {
|
||||
nvim_lsp = "[LSP]",
|
||||
nvim_lua = "[Lua]",
|
||||
path = "[Path]",
|
||||
luasnip = "[Snippet]",
|
||||
jira = "[Jira]",
|
||||
}
|
||||
|
||||
@@ -21,8 +20,8 @@ cmp.setup({
|
||||
preselect = cmp.PreselectMode.None,
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require'luasnip'.lsp_expand(args.body)
|
||||
end,
|
||||
vim.snippet.expand(args.body)
|
||||
end
|
||||
},
|
||||
mapping = {
|
||||
['<C-p>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c' }),
|
||||
@@ -36,10 +35,10 @@ cmp.setup({
|
||||
select = false, -- only replace if explicitly selected
|
||||
},
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif require'luasnip'.expand_or_jumpable() then
|
||||
require'luasnip'.expand_or_jump()
|
||||
elseif vim.snippet.jumpable(1) then
|
||||
vim.snippet.jump(1)
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
@@ -50,8 +49,8 @@ cmp.setup({
|
||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif require'luasnip'.jumpable(-1) then
|
||||
require'luasnip'.jump(-1)
|
||||
elseif vim.snippet.jumpable(-1) then
|
||||
vim.snippet.jump(-1)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
|
@@ -1,5 +1,3 @@
|
||||
require("halfdan.packer")
|
||||
|
||||
require("halfdan.settings")
|
||||
|
||||
if vim.g.vscode then
|
||||
@@ -7,15 +5,14 @@ if vim.g.vscode then
|
||||
else
|
||||
-- ordinary Neovim
|
||||
vim.notify = require("notify")
|
||||
|
||||
require("impatient")
|
||||
require("halfdan.lazy")
|
||||
|
||||
require("halfdan.neogit")
|
||||
require("halfdan.neorg")
|
||||
-- require("halfdan.neorg")
|
||||
require('halfdan.globals')
|
||||
require('halfdan.keymap')
|
||||
require('halfdan.cmp')
|
||||
require('halfdan.luasnip')
|
||||
-- require('halfdan.luasnip')
|
||||
require('halfdan.colorscheme')
|
||||
require('halfdan.treesitter')
|
||||
require('halfdan.telescope')
|
||||
|
191
.config/nvim/lua/halfdan/lazy.lua
Normal file
191
.config/nvim/lua/halfdan/lazy.lua
Normal file
@@ -0,0 +1,191 @@
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup({
|
||||
{'TimUntersberger/neogit', dependencies = {'sindrets/diffview.nvim' } },
|
||||
{'airblade/vim-gitgutter'},
|
||||
|
||||
-- Load .editorconfig files
|
||||
{'editorconfig/editorconfig-vim'},
|
||||
|
||||
{'junegunn/vim-easy-align'},
|
||||
|
||||
-- Goodies
|
||||
{'tpope/vim-fugitive'},
|
||||
{'tpope/vim-surround'}, -- ✅
|
||||
{'tpope/vim-dispatch'},
|
||||
|
||||
-- Treesitter
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
},
|
||||
{ 'nvim-treesitter/playground', after = 'nvim-treesitter' },
|
||||
{ 'nvim-treesitter/nvim-treesitter-textobjects', after = 'nvim-treesitter' },
|
||||
|
||||
-- Testing
|
||||
{'vim-test/vim-test'},
|
||||
{
|
||||
"nvim-neotest/neotest",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
|
||||
"jfpedroza/neotest-elixir",
|
||||
"rouge8/neotest-rust",
|
||||
}
|
||||
},
|
||||
{"nvim-neotest/neotest-vim-test" },
|
||||
|
||||
|
||||
{'preservim/tagbar'},
|
||||
|
||||
-- Status Line and Bufferline
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {'kyazdani42/nvim-web-devicons'}
|
||||
},
|
||||
|
||||
{'rcarriga/nvim-notify'},
|
||||
|
||||
-- { "nvim-neorg/neorg" },
|
||||
-- {'nvim-neorg/neorg-telescope'},
|
||||
|
||||
{'justinmk/vim-sneak'},
|
||||
|
||||
{'machakann/vim-highlightedyank'},
|
||||
|
||||
-- LSP / Language Server Protocol
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
'williamboman/nvim-lsp-installer',
|
||||
},
|
||||
|
||||
{
|
||||
'nvimdev/lspsaga.nvim',
|
||||
config = function()
|
||||
require('lspsaga').setup({})
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter', -- optional
|
||||
'nvim-tree/nvim-web-devicons' -- optional
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
'hrsh7th/nvim-cmp',
|
||||
dependencies = {
|
||||
{ 'hrsh7th/cmp-buffer', after = 'nvim-cmp' },
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'onsails/lspkind.nvim',
|
||||
{ 'hrsh7th/cmp-path', after = 'nvim-cmp' },
|
||||
{ 'hrsh7th/cmp-nvim-lua', after = 'nvim-cmp' },
|
||||
{ 'hrsh7th/cmp-cmdline', after = 'nvim-cmp', event = 'CmdlineEnter' },
|
||||
{'petertriho/cmp-git', after = 'nvim-cmp'},
|
||||
}
|
||||
},
|
||||
|
||||
-- Used to display LSP status in Lualine
|
||||
{'nvim-lua/lsp-status.nvim'},
|
||||
|
||||
-- null-ls for a collection of LSP-like plugins
|
||||
{
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
config = function()
|
||||
require("null-ls").setup()
|
||||
end,
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
|
||||
{'simrat39/symbols-outline.nvim'},
|
||||
{
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end
|
||||
},
|
||||
|
||||
-- Telescope fuzzy find files/grep
|
||||
{'nvim-lua/popup.nvim'},
|
||||
{'nvim-lua/plenary.nvim'},
|
||||
{'nvim-telescope/telescope-fzf-native.nvim', build = 'make' },
|
||||
{'nvim-telescope/telescope.nvim'},
|
||||
{'nvim-telescope/telescope-dap.nvim'},
|
||||
{
|
||||
"danielfalk/smart-open.nvim",
|
||||
branch = "0.2.x",
|
||||
dependencies = {"kkharji/sqlite.lua"}
|
||||
},
|
||||
|
||||
{'numToStr/FTerm.nvim'},
|
||||
{'theprimeagen/git-worktree.nvim'},
|
||||
{'theprimeagen/harpoon'},
|
||||
|
||||
-- Debugging
|
||||
"mfussenegger/nvim-dap",
|
||||
"rcarriga/nvim-dap-ui",
|
||||
"theHamsta/nvim-dap-virtual-text",
|
||||
|
||||
-- => Language Support
|
||||
{'rust-lang/rust.vim'},
|
||||
{'simrat39/rust-tools.nvim'},
|
||||
{
|
||||
"elixir-tools/elixir-tools.nvim",
|
||||
version = "*",
|
||||
event = { "BufReadPre", "BufNewFile" },
|
||||
config = function()
|
||||
local elixir = require("elixir")
|
||||
local elixirls = require("elixir.elixirls")
|
||||
|
||||
elixir.setup {
|
||||
nextls = {enable = true},
|
||||
credo = {},
|
||||
elixirls = {
|
||||
enable = false,
|
||||
settings = elixirls.settings {
|
||||
dialyzerEnabled = false,
|
||||
enableTestLenses = false,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
vim.keymap.set("n", "<space>fp", ":ElixirFromPipe<cr>", { buffer = true, noremap = true })
|
||||
vim.keymap.set("n", "<space>tp", ":ElixirToPipe<cr>", { buffer = true, noremap = true })
|
||||
vim.keymap.set("v", "<space>em", ":ElixirExpandMacro<cr>", { buffer = true, noremap = true })
|
||||
end,
|
||||
}
|
||||
}
|
||||
end,
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
},
|
||||
{'tpope/vim-projectionist'},
|
||||
-- themes & colorschemes
|
||||
{'gruvbox-community/gruvbox'},
|
||||
{'luisiacc/gruvbox-baby'},
|
||||
{
|
||||
'https://gitlab.com/__tpb/monokai-pro.nvim',
|
||||
as = 'monokai-pro.nvim'
|
||||
},
|
||||
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
}
|
||||
}
|
||||
})
|
@@ -1,4 +1,4 @@
|
||||
local luasnip = require('luasnip')
|
||||
-- local luasnip = require('luasnip')
|
||||
luasnip.config.set_config {
|
||||
history = true,
|
||||
updateevents = "TextChanged,TextChangedI"
|
||||
|
@@ -1,193 +0,0 @@
|
||||
local execute = vim.api.nvim_command
|
||||
local fn = vim.fn
|
||||
|
||||
local install_path = fn.stdpath("data") .. "/site/pack/packer/start/packer.nvim"
|
||||
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
execute("!git clone https://github.com/wbthomason/packer.nvim " .. install_path)
|
||||
execute "packadd packer.nvim"
|
||||
end
|
||||
|
||||
--- Check if a file or directory exists in this path
|
||||
local function require_plugin(plugin)
|
||||
local plugin_prefix = fn.stdpath("data") .. "/site/pack/packer/opt/"
|
||||
|
||||
local plugin_path = plugin_prefix .. plugin .. "/"
|
||||
-- print('test '..plugin_path)
|
||||
local ok, err, code = os.rename(plugin_path, plugin_path)
|
||||
if not ok then
|
||||
if code == 13 then
|
||||
-- Permission denied, but it exists
|
||||
return true
|
||||
end
|
||||
end
|
||||
-- print(ok, err, code)
|
||||
if ok then
|
||||
vim.cmd("packadd " .. plugin)
|
||||
end
|
||||
return ok, err, code
|
||||
end
|
||||
|
||||
vim.cmd "autocmd BufWritePost plugins.lua PackerCompile" -- Auto compile when there are changes in plugins.lua
|
||||
|
||||
vim.opt.runtimepath:append("~/code/jira.nvim")
|
||||
return require("packer").startup({
|
||||
function(use)
|
||||
-- Packer can manage itself as an optional plugin
|
||||
use "wbthomason/packer.nvim"
|
||||
|
||||
use 'lewis6991/impatient.nvim'
|
||||
|
||||
use {'TimUntersberger/neogit', requires = {'sindrets/diffview.nvim' } }
|
||||
use {'airblade/vim-gitgutter'}
|
||||
-- use {'andymass/vim-matchup'}
|
||||
|
||||
-- Load .editorconfig files
|
||||
use {'editorconfig/editorconfig-vim'}
|
||||
|
||||
use {'junegunn/vim-easy-align'}
|
||||
|
||||
-- Goodies
|
||||
use {'tpope/vim-fugitive'}
|
||||
use {'tpope/vim-surround'} -- ✅
|
||||
use {'tpope/vim-dispatch'}
|
||||
|
||||
-- Treesitter
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
}
|
||||
use { 'nvim-treesitter/playground', after = 'nvim-treesitter' }
|
||||
use { 'nvim-treesitter/nvim-treesitter-textobjects', after = 'nvim-treesitter' }
|
||||
|
||||
-- Testing
|
||||
use {'vim-test/vim-test'}
|
||||
use {
|
||||
"nvim-neotest/neotest",
|
||||
requires = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
"antoinemadec/FixCursorHold.nvim",
|
||||
|
||||
"jfpedroza/neotest-elixir",
|
||||
"rouge8/neotest-rust",
|
||||
}
|
||||
}
|
||||
use {"nvim-neotest/neotest-vim-test" }
|
||||
|
||||
|
||||
use {'preservim/tagbar'}
|
||||
vim.g.tagbar_ctags_bin = '/usr/local/bin/ctags'
|
||||
|
||||
-- Status Line and Bufferline
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = {'kyazdani42/nvim-web-devicons'}
|
||||
}
|
||||
|
||||
use {'rcarriga/nvim-notify'}
|
||||
|
||||
use { "nvim-neorg/neorg" }
|
||||
use {'nvim-neorg/neorg-telescope'}
|
||||
use{ "mickael-menu/zk-nvim" }
|
||||
|
||||
use {'justinmk/vim-sneak'}
|
||||
|
||||
use {'machakann/vim-highlightedyank'}
|
||||
-- let g:highlightedyank_highlight_duration = 100
|
||||
|
||||
-- LSP / Language Server Protocol
|
||||
use {
|
||||
'neovim/nvim-lspconfig',
|
||||
'williamboman/nvim-lsp-installer',
|
||||
}
|
||||
|
||||
use {'L3MON4D3/LuaSnip'}
|
||||
use {"rafamadriz/friendly-snippets", after="LuaSnip"}
|
||||
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
{ 'hrsh7th/cmp-buffer', after = 'nvim-cmp' },
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'onsails/lspkind.nvim',
|
||||
{ 'hrsh7th/cmp-path', after = 'nvim-cmp' },
|
||||
{ 'hrsh7th/cmp-nvim-lua', after = 'nvim-cmp' },
|
||||
{ 'saadparwaiz1/cmp_luasnip', after = 'nvim-cmp' },
|
||||
{ 'hrsh7th/cmp-cmdline', after = 'nvim-cmp', event = 'CmdlineEnter' },
|
||||
{'tzachar/cmp-tabnine', run = './install.sh', after = 'nvim-cmp' },
|
||||
{'petertriho/cmp-git', after = 'nvim-cmp'},
|
||||
}
|
||||
}
|
||||
|
||||
use {'glepnir/lspsaga.nvim'}
|
||||
|
||||
-- Used to display LSP status in Lualine
|
||||
use {'nvim-lua/lsp-status.nvim'}
|
||||
|
||||
-- null-ls for a collection of LSP-like plugins
|
||||
use({
|
||||
"jose-elias-alvarez/null-ls.nvim",
|
||||
config = function()
|
||||
require("null-ls").setup()
|
||||
end,
|
||||
requires = { "nvim-lua/plenary.nvim" },
|
||||
})
|
||||
|
||||
use {'simrat39/symbols-outline.nvim'}
|
||||
use {
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end
|
||||
}
|
||||
use { 'numToStr/FTerm.nvim' }
|
||||
|
||||
-- Telescope fuzzy find files/grep
|
||||
use {'nvim-lua/popup.nvim'}
|
||||
use {'nvim-lua/plenary.nvim'}
|
||||
use {'nvim-telescope/telescope.nvim'}
|
||||
use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
||||
use {'nvim-telescope/telescope-dap.nvim'}
|
||||
|
||||
|
||||
use {
|
||||
"danielfalk/smart-open.nvim",
|
||||
branch = "0.1.x",
|
||||
requires = {"kkharji/sqlite.lua"}
|
||||
}
|
||||
|
||||
use {'theprimeagen/git-worktree.nvim'}
|
||||
use {'theprimeagen/harpoon'}
|
||||
|
||||
-- Debugging
|
||||
use("mfussenegger/nvim-dap")
|
||||
use("rcarriga/nvim-dap-ui")
|
||||
use("theHamsta/nvim-dap-virtual-text")
|
||||
|
||||
-- => Language Support
|
||||
use {'rust-lang/rust.vim'}
|
||||
use {'simrat39/rust-tools.nvim'}
|
||||
-- use({ "mhanberg/elixir.nvim", requires = { "neovim/nvim-lspconfig", "nvim-lua/plenary.nvim" }})
|
||||
use {"elixir-tools/elixir-tools.nvim", requires = { "nvim-lua/plenary.nvim" }}
|
||||
use {'tpope/vim-projectionist'}
|
||||
-- use {'JuliaEditorSupport/julia-vim', opt=true}
|
||||
-- vim.g.latex_to_unicode_auto = 1
|
||||
|
||||
-- themes & colorschemes
|
||||
use {'gruvbox-community/gruvbox'}
|
||||
use {'luisiacc/gruvbox-baby'}
|
||||
use {
|
||||
'https://gitlab.com/__tpb/monokai-pro.nvim',
|
||||
as = 'monokai-pro.nvim'
|
||||
}
|
||||
end,
|
||||
config = {
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require('packer.util').float({ border = 'single' })
|
||||
end
|
||||
}
|
||||
}
|
||||
})
|
||||
|
@@ -3,7 +3,7 @@ if vim.g.vscode then
|
||||
end
|
||||
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = { "python", "go", "elixir", "rust", "gomod", "json", "lua", "ruby", "yaml", "norg", "query" },
|
||||
ensure_installed = { "python", "go", "elixir", "heex", "rust", "gomod", "json", "lua", "yaml", "norg", "query", "markdown", "markdown_inline"},
|
||||
ignore_install = { "haskell" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
Reference in New Issue
Block a user