Skip to content

Commit

Permalink
Add nix language server support
Browse files Browse the repository at this point in the history
  • Loading branch information
rake5k committed Nov 9, 2024
1 parent 7f17ee4 commit db80331
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions home/users/christian/vim/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ in
sessionVariables = {
EDITOR = "vim";
};

packages = with pkgs; [
nil
nixpkgs-fmt
];
};

xdg.dataFile = {
Expand All @@ -57,6 +62,37 @@ in

programs.neovim = {
enable = true;

coc = {
enable = true;
settings = {
coc.preferences = {
formatOnSave = true;
};
semanticTokens = {
filetypes = [ "nix" ];
};
suggest = {
noselect = true;
enablePreselect = false;
};
languageserver = {
nix = {
command = "nil";
filetypes = [ "nix" ];
rootPatterns = [ "flake.nix" ];
settings = {
nil = {
formatting = {
command = [ "nixpkgs-fmt" ];
};
};
};
};
};
};
};

extraConfig = ''
set clipboard=unnamedplus
set number relativenumber
Expand All @@ -78,13 +114,15 @@ in
set thesaurus+=~/.local/share/nvim/site/dict/openthesaurus.txt
set thesaurus+=~/.local/share/nvim/site/dict/mthesaur.txt
'';

plugins = with pkgs.vimPlugins; [
vim-nix

# Markdown
tabular
vim-markdown
];

viAlias = true;
vimAlias = true;
vimdiffAlias = true;
Expand Down

0 comments on commit db80331

Please sign in to comment.