-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
neovim: Use treesitter from nix and migrate from lazy to vim-plug
I didn't have time to split these commits.
- Loading branch information
1 parent
c252a2f
commit 13c4b4f
Showing
6 changed files
with
116 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,6 @@ | |
vivaldi | ||
|
||
# coding | ||
neovim-unwrapped | ||
(callPackage ./packages/nvim.nix {}) | ||
vim | ||
vscode | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,33 @@ | ||
{ writeShellApplication, wrapNeovim, neovim-unwrapped }: | ||
{ writeShellApplication, wrapNeovim, neovim-unwrapped, vimPlugins, symlinkJoin }: | ||
|
||
let | ||
# Link together all treesitter grammars into single derivation | ||
treesitterPath = symlinkJoin { | ||
name = "nvim-nix-treesitter-parsers"; | ||
paths = vimPlugins.nvim-treesitter.withAllGrammars.dependencies; | ||
}; | ||
|
||
# wrap neovim | ||
wrapped = wrapNeovim neovim-unwrapped { | ||
configure = { | ||
customRC = /* vim */ '' | ||
" Setting variables here is a clever way to set variables that are | ||
" different in NixOS and MacOS | ||
" let g:treesitter_path = "${treesitterPath}" | ||
" Add nvim-treesitter to runtimepath | ||
set rtp^=${vimPlugins.nvim-treesitter} | ||
" Add grammars to runtimepath | ||
set rtp^=${treesitterPath} | ||
" Load configuration from default location | ||
source $HOME/.config/nvim/init.lua | ||
''; | ||
}; | ||
}; | ||
in | ||
writeShellApplication { | ||
name = "nvim-test"; | ||
name = "nvim"; | ||
text = ''${wrapped}/bin/nvim "$@"''; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,116 +1,92 @@ | ||
return { | ||
-- LSP | ||
{ | ||
'neovim/nvim-lspconfig', | ||
dependencies = { | ||
-- Status updates for LSP | ||
{ 'j-hui/fidget.nvim' }, | ||
}, | ||
}, | ||
|
||
-- Completion | ||
{ | ||
"hrsh7th/nvim-cmp", | ||
dependencies = { | ||
"hrsh7th/cmp-nvim-lsp", | ||
"dcampos/nvim-snippy", | ||
"dcampos/cmp-snippy", | ||
} | ||
}, | ||
|
||
-- Snippets | ||
{ "honza/vim-snippets" }, | ||
|
||
-- keymap documentation | ||
{ "folke/which-key.nvim", config = true }, | ||
|
||
-- Treesitter | ||
{ | ||
'nvim-treesitter/nvim-treesitter', | ||
build = ":TSUpdate", | ||
}, | ||
|
||
-- fuzzy finder | ||
{ | ||
"nvim-telescope/telescope.nvim", | ||
dependencies = { | ||
"nvim-lua/plenary.nvim", | ||
}, | ||
}, | ||
|
||
-- linter | ||
-- disabling ale for now to avoid conflicts with LSP | ||
-- "dense-analysis/ale", | ||
|
||
-- Adds git releated signs to the gutter, as well as utilities for managing changes | ||
'lewis6991/gitsigns.nvim', | ||
|
||
-- Commenting | ||
{ 'numToStr/Comment.nvim', config = true }, | ||
|
||
-- file system tree | ||
{ | ||
"juanibiapina/vim-lighttree", | ||
}, | ||
|
||
-- text objects | ||
'wellle/targets.vim', | ||
|
||
-- migrated from Plug | ||
|
||
-- Navigation | ||
{ "mileszs/ack.vim", event = 'VimEnter' }, | ||
"tpope/vim-unimpaired", | ||
|
||
-- Utilities | ||
"tpope/vim-surround", | ||
"editorconfig/editorconfig-vim", | ||
"tpope/vim-repeat", | ||
"godlygeek/tabular", | ||
"tpope/vim-eunuch", | ||
"tpope/vim-abolish", | ||
-- Detect tabstop and shiftwidth automatically | ||
"tpope/vim-sleuth", | ||
"tpope/vim-rhubarb", | ||
"tpope/vim-capslock", | ||
"tpope/vim-dispatch", | ||
"radenling/vim-dispatch-neovim", | ||
"AndrewRadev/splitjoin.vim", | ||
"kopischke/vim-fetch", | ||
"ntpeters/vim-better-whitespace", | ||
"AndrewRadev/sideways.vim", | ||
"moll/vim-bbye", | ||
"sunaku/vim-shortcut", | ||
"tpope/vim-projectionist", | ||
"tpope/vim-sensible", | ||
"kassio/neoterm", | ||
|
||
-- Colors | ||
"lifepillar/vim-solarized8", | ||
|
||
-- Github CoPilot | ||
"github/copilot.vim", | ||
|
||
-- Diff | ||
"lambdalisue/vim-improve-diff", | ||
"lambdalisue/vim-unified-diff", | ||
|
||
-- Git | ||
"tpope/vim-git", | ||
"tpope/vim-fugitive", | ||
|
||
-- Quickfix | ||
"itchyny/vim-qfedit", | ||
|
||
-- Rails | ||
"tpope/vim-rails", | ||
|
||
-- Ruby | ||
"vim-ruby/vim-ruby", | ||
"ngmy/vim-rubocop", | ||
"tpope/vim-bundler", | ||
"keith/rspec.vim", | ||
|
||
-- Testing | ||
"juanibiapina/vim-runner", | ||
} | ||
local vim = vim -- just to prevent errors for the linter | ||
|
||
local Plug = vim.fn['plug#'] | ||
vim.call('plug#begin') | ||
|
||
-- LSP | ||
Plug('neovim/nvim-lspconfig') | ||
Plug('j-hui/fidget.nvim') -- Status updates for LSP | ||
|
||
-- Completion | ||
Plug("hrsh7th/nvim-cmp") | ||
Plug("hrsh7th/cmp-nvim-lsp") | ||
Plug("dcampos/nvim-snippy") | ||
Plug("dcampos/cmp-snippy") | ||
|
||
-- Fuzzy finder | ||
Plug("nvim-telescope/telescope.nvim") | ||
Plug("nvim-lua/plenary.nvim") | ||
|
||
-- Colors | ||
Plug("lifepillar/vim-solarized8") | ||
|
||
-- Keymap documentation | ||
Plug("folke/which-key.nvim") | ||
|
||
-- Snippets | ||
Plug("honza/vim-snippets") | ||
|
||
-- Git signs | ||
Plug("lewis6991/gitsigns.nvim") | ||
|
||
-- file system tree | ||
Plug("juanibiapina/vim-lighttree") | ||
|
||
-- text objects | ||
Plug("wellle/targets.vim") | ||
|
||
-- Grep | ||
Plug("mileszs/ack.vim") | ||
|
||
-- Github CoPilot | ||
Plug("github/copilot.vim") | ||
|
||
-- Diff | ||
Plug("lambdalisue/vim-improve-diff") | ||
Plug("lambdalisue/vim-unified-diff") | ||
|
||
-- Git | ||
Plug("tpope/vim-git") | ||
Plug("tpope/vim-fugitive") | ||
|
||
-- Quickfix | ||
Plug("itchyny/vim-qfedit") | ||
|
||
-- Rails | ||
Plug("tpope/vim-rails") | ||
|
||
-- Ruby | ||
Plug("vim-ruby/vim-ruby") | ||
Plug("ngmy/vim-rubocop") | ||
Plug("tpope/vim-bundler") | ||
Plug("keith/rspec.vim") | ||
|
||
-- Testing | ||
Plug("juanibiapina/vim-runner") | ||
|
||
-- Not organized yet | ||
Plug("AndrewRadev/sideways.vim") | ||
Plug("AndrewRadev/splitjoin.vim") | ||
Plug("editorconfig/editorconfig-vim") | ||
Plug("godlygeek/tabular") | ||
Plug("kassio/neoterm") | ||
Plug("kopischke/vim-fetch") | ||
Plug("moll/vim-bbye") | ||
Plug("ntpeters/vim-better-whitespace") | ||
Plug("radenling/vim-dispatch-neovim") | ||
Plug("sunaku/vim-shortcut") | ||
|
||
-- Tpope | ||
Plug("tpope/vim-abolish") | ||
Plug("tpope/vim-capslock") | ||
Plug("tpope/vim-dispatch") | ||
Plug("tpope/vim-eunuch") | ||
Plug("tpope/vim-projectionist") | ||
Plug("tpope/vim-repeat") | ||
Plug("tpope/vim-rhubarb") | ||
Plug("tpope/vim-sensible") | ||
Plug("tpope/vim-sleuth") | ||
Plug("tpope/vim-surround") | ||
Plug("tpope/vim-unimpaired") | ||
|
||
vim.call("plug#end") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,3 @@ | ||
-- bootstrap lazy | ||
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) | ||
|
||
-- set leader to space | ||
-- this needs to happen before lazy is setup | ||
vim.g.mapleader = " " | ||
vim.g.maplocalleader = " " |