-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(neovim): separate config in another repository
This caused issues when using lua_ls where the symlinks created by home-manager were not followed correctly. And this is, more generally, more stable and easily maintanable.
- Loading branch information
Showing
55 changed files
with
36 additions
and
3,504 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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[submodule "applications/neovim/config"] | ||
path = applications/neovim/config | ||
url = [email protected]:d4ilyrun/nvim-config.git |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
column_width = 120 | ||
line_endings = "Unix" | ||
indent_type = "Spaces" | ||
indent_width = 2 | ||
quote_style = "AutoPreferSingle" | ||
call_parentheses = "Always" |
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,142 +1,22 @@ | ||
{ config, lib, pkgs, ... }: | ||
{ pkgs, ... }: | ||
|
||
let | ||
vim_folder = "${config.dotfiles.folders.applications}/neovim"; | ||
vim_plugins = "${vim_folder}/plugins"; | ||
vim_lua = "${vim_folder}/lua"; | ||
vim_themes = "${vim_folder}/themes"; | ||
|
||
# installs a vim plugin from git with a given tag / branch | ||
pluginGit = ref: repo: pkgs.vimUtils.buildVimPluginFrom2Nix { | ||
pname = "${lib.strings.sanitizeDerivationName repo}"; | ||
version = ref; | ||
src = builtins.fetchGit { | ||
url = "https://github.com/${repo}.git"; | ||
ref = ref; | ||
}; | ||
}; | ||
|
||
# always installs latest version | ||
plugin = pluginGit "HEAD"; | ||
|
||
pluginWithName = name: repo: pkgs.vimUtils.buildVimPluginFrom2Nix { | ||
pname = name; | ||
version = "HEAD"; | ||
src = builtins.fetchGit { | ||
url = "https://github.com/${repo}.git"; | ||
ref = "HEAD"; | ||
}; | ||
}; | ||
|
||
in | ||
{ | ||
# Packages needed for neovim to work | ||
home.packages = with pkgs; [ | ||
nodePackages.npm | ||
nodePackages.pyright | ||
nodePackages.typescript-language-server | ||
sumneko-lua-language-server | ||
ripgrep | ||
glow | ||
nil | ||
]; | ||
|
||
programs.neovim = { | ||
enable = true; | ||
vimAlias = true; | ||
viAlias = true; | ||
vimdiffAlias = true; | ||
withNodeJs = true; | ||
|
||
extraConfig = '' | ||
lua home = "${config.dotfiles.homeDirectory}" | ||
lua path = "${vim_lua}" | ||
let g:vim_plugins_path="${vim_plugins}" | ||
" You might have to force true color when using regular vim inside tmux as the | ||
" colorscheme can appear to be grayscale with "termguicolors" option enabled. | ||
if !has('gui_running') && &term =~ '^\%(screen\|tmux\)' | ||
let &t_8f = "\<Esc>[38;2;%lu;%lu;%lum" | ||
let &t_8b = "\<Esc>[48;2;%lu;%lu;%lum" | ||
endif | ||
set termguicolors | ||
source ${vim_themes}/${config.dotfiles.theme.name}.vim | ||
source ${vim_folder}/init.vim | ||
source ${vim_plugins}/plugins.vim | ||
lua dofile("${vim_lua}/init.lua") | ||
''; | ||
|
||
plugins = with pkgs.vimPlugins; [ | ||
# Navigation | ||
(plugin "max397574/which-key.nvim") | ||
(plugin "airblade/vim-rooter") | ||
(plugin "startup-nvim/startup.nvim") | ||
(plugin "nvim-telescope/telescope.nvim") | ||
(plugin "kyazdani42/nvim-tree.lua") | ||
(plugin "akinsho/bufferline.nvim") | ||
(plugin "moll/vim-bbye") | ||
(plugin "folke/trouble.nvim") | ||
(plugin "folke/todo-comments.nvim") | ||
(plugin "BurntSushi/ripgrep") | ||
|
||
# Eyecandy | ||
nvim-treesitter | ||
nvim-web-devicons | ||
# (plugin "glepnir/galaxyline.nvim") | ||
(plugin "nvim-lualine/lualine.nvim") | ||
(plugin "glepnir/galaxyline.nvim") | ||
(plugin "norcalli/nvim-colorizer.lua") # color-previewer | ||
(plugin "lukas-reineke/indent-blankline.nvim") | ||
(plugin "smithbm2316/centerpad.nvim") | ||
(plugin "rcarriga/nvim-notify") | ||
(plugin "j-hui/fidget.nvim") | ||
|
||
# LSP | ||
(plugin "neovim/nvim-lspconfig") | ||
(plugin "williamboman/nvim-lsp-installer") | ||
(plugin "williamboman/mason-lspconfig.nvim") | ||
(plugin "williamboman/mason.nvim") | ||
(plugin "ojroques/nvim-lspfuzzy") | ||
|
||
# CMP | ||
(plugin "hrsh7th/nvim-cmp") | ||
(plugin "hrsh7th/cmp-nvim-lsp") | ||
(plugin "hrsh7th/cmp-cmdline") | ||
(plugin "hrsh7th/cmp-buffer") | ||
(plugin "hrsh7th/cmp-path") | ||
(plugin "hrsh7th/cmp-nvim-lsp-signature-help") | ||
|
||
# Snippets | ||
(plugin "L3MON4D3/LuaSnip") | ||
(plugin "saadparwaiz1/cmp_luasnip") | ||
(plugin "tami5/lspsaga.nvim") | ||
(plugin "mortepau/codicons.nvim") | ||
(plugin "onsails/lspkind-nvim") | ||
|
||
# Dev | ||
(plugin "nvim-lua/plenary.nvim") | ||
(plugin "jose-elias-alvarez/null-ls.nvim") | ||
(plugin "mfussenegger/nvim-dap") | ||
(plugin "rcarriga/nvim-dap-ui") | ||
(plugin "nvim-telescope/telescope-dap.nvim") | ||
(plugin "Shatur/neovim-cmake") | ||
# (plugin "danymat/neogen") | ||
(plugin "lewis6991/gitsigns.nvim") | ||
(plugin "nvim-neotest/neotest") | ||
(plugin "alfaix/neotest-gtest") | ||
(plugin "antoinemadec/FixCursorHold.nvim") | ||
(plugin "GnikDroy/projections.nvim") | ||
(plugin "sindrets/diffview.nvim") | ||
|
||
# Media files | ||
(plugin "marioortizmanero/adoc-pdf-live.nvim") # PDF viewer | ||
glow-nvim | ||
|
||
# Themes | ||
(pluginWithName "catpuccin" "catppuccin/nvim") | ||
(plugin "joshdick/onedark.vim") | ||
(plugin "tiagovla/tokyodark.nvim") | ||
extraPackages = with pkgs; [ | ||
ripgrep # for telescope/fzf | ||
]; | ||
}; | ||
|
||
# LSP | ||
home.packages = with pkgs; [ | ||
nil | ||
sumneko-lua-language-server | ||
nodePackages.pyright | ||
]; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.