Compare commits
32 Commits
custom_col
...
a09a34997c
| Author | SHA1 | Date | |
|---|---|---|---|
|
a09a34997c
|
|||
|
127047caeb
|
|||
|
60acbede4d
|
|||
|
9f36693f90
|
|||
|
8fdf9bd08c
|
|||
|
e3c064d3a9
|
|||
|
8754d5b79d
|
|||
|
ba6b926cc4
|
|||
|
201161972e
|
|||
|
2b10f5cb32
|
|||
|
c055bd2a2f
|
|||
|
f042e08ecd
|
|||
|
13bed01615
|
|||
|
3f9559992a
|
|||
|
9332c56c01
|
|||
|
a9bc0c8a7a
|
|||
|
5bba266c6e
|
|||
|
dce3a89665
|
|||
|
b660608fb3
|
|||
| 9652f4cb75 | |||
| df0441425f | |||
| 6347d51dc2 | |||
| 3c95acb92e | |||
| a81f0a2041 | |||
| 8555092095 | |||
| b9f6e59d12 | |||
| 871a8b4a8c | |||
| d26fa59d72 | |||
| 2544f1130f | |||
| 44eaabc43c | |||
| aa745901c6 | |||
| 6ebd6e83c6 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
result
|
||||
1
.nixd.json
Normal file
1
.nixd.json
Normal file
@@ -0,0 +1 @@
|
||||
{"formatting":{"command":"alejandra"}}
|
||||
12
flake.lock
generated
12
flake.lock
generated
@@ -2,16 +2,16 @@
|
||||
"nodes": {
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1688646010,
|
||||
"narHash": "sha256-kCeza5eKI2NEi8k0EoeZfv3lN1r1Vwx+L/VA6I8tmG4=",
|
||||
"owner": "NixOS",
|
||||
"lastModified": 1733120037,
|
||||
"narHash": "sha256-En+gSoVJ3iQKPDU1FHrR6zIxSLXKjzKY+pnh9tt+Yts=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "5daaa32204e9c46b05cd709218b7ba733d07e80c",
|
||||
"rev": "f9f0d5c5380be0a599b1fb54641fa99af8281539",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "NixOS",
|
||||
"ref": "nixpkgs-unstable",
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-24.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
||||
82
flake.nix
82
flake.nix
@@ -2,31 +2,75 @@
|
||||
description = "A very basic flake";
|
||||
|
||||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
|
||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||
};
|
||||
|
||||
outputs = {
|
||||
self,
|
||||
nixpkgs,
|
||||
}: let
|
||||
pkgs = nixpkgs.legacyPackages.x86_64-linux.pkgs;
|
||||
supportedSystems = ["x86_64-linux" "aarch64-linux"];
|
||||
forAllSystems = nixpkgs.lib.genAttrs supportedSystems;
|
||||
nixpkgsFor = forAllSystems (system: import nixpkgs {inherit system;});
|
||||
in {
|
||||
nvim = pkgs.mkShell {
|
||||
nativeBuildInputs = [
|
||||
pkgs.alejandra
|
||||
pkgs.ccls
|
||||
pkgs.luaformatter
|
||||
pkgs.nixd
|
||||
pkgs.pyright
|
||||
pkgs.rust-analyzer
|
||||
pkgs.sumneko-lua-language-server
|
||||
pkgs.svls
|
||||
pkgs.texlab
|
||||
pkgs.tree-sitter
|
||||
pkgs.verible
|
||||
pkgs.zls
|
||||
(import ./nvim-lsp.nix {inherit pkgs;})
|
||||
];
|
||||
};
|
||||
packages = forAllSystems (system: let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
neovim = import ./nvim-lsp.nix {inherit pkgs;};
|
||||
in {
|
||||
nvim = pkgs.symlinkJoin {
|
||||
name = "nvim";
|
||||
paths = with pkgs;
|
||||
[
|
||||
alejandra
|
||||
ccls
|
||||
gopls
|
||||
luaformatter
|
||||
nixd
|
||||
pyright
|
||||
rust-analyzer
|
||||
sumneko-lua-language-server
|
||||
svls
|
||||
texlab
|
||||
tree-sitter
|
||||
typst-lsp
|
||||
verible
|
||||
yaml-language-server
|
||||
zls
|
||||
]
|
||||
++ [neovim];
|
||||
};
|
||||
});
|
||||
|
||||
devShells = forAllSystems (system: let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
in {
|
||||
default = pkgs.mkShell {
|
||||
nativeBuildInputs = [
|
||||
pkgs.alejandra
|
||||
pkgs.ccls
|
||||
pkgs.gopls
|
||||
pkgs.luaformatter
|
||||
pkgs.nixd
|
||||
pkgs.pyright
|
||||
pkgs.rust-analyzer
|
||||
pkgs.sumneko-lua-language-server
|
||||
pkgs.svls
|
||||
pkgs.texlab
|
||||
pkgs.tree-sitter
|
||||
pkgs.verible
|
||||
pkgs.zls
|
||||
(import ./nvim-lsp.nix {inherit pkgs;})
|
||||
];
|
||||
};
|
||||
});
|
||||
|
||||
overlays = forAllSystems (system: let
|
||||
pkgs = nixpkgsFor.${system};
|
||||
in {
|
||||
overlay = final: prev: {
|
||||
nvim = self.packages.${system}.nvim;
|
||||
};
|
||||
});
|
||||
defaultPackage = forAllSystems (system: self.packages.${system}.nvim);
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{pkgs ? import <nixpkgs> {}}: let
|
||||
{pkgs}: let
|
||||
neovim = pkgs.neovim.override {
|
||||
configure = {
|
||||
customRC = ''
|
||||
@@ -11,6 +11,7 @@
|
||||
(nvim-treesitter.withPlugins (parsers: [
|
||||
parsers.c
|
||||
parsers.cpp
|
||||
parsers.go
|
||||
parsers.json
|
||||
parsers.latex
|
||||
parsers.lua
|
||||
@@ -28,12 +29,13 @@
|
||||
cmp-nvim-ultisnips
|
||||
cmp-path
|
||||
colorizer
|
||||
editorconfig-nvim
|
||||
fugitive
|
||||
fzf-lua
|
||||
gruvbox
|
||||
nvim-cmp
|
||||
nvim-lspconfig
|
||||
nvim-ts-rainbow
|
||||
rainbow-delimiters-nvim
|
||||
repeat
|
||||
targets-vim
|
||||
UltiSnips
|
||||
|
||||
83
vimrc.lua
83
vimrc.lua
@@ -1,22 +1,30 @@
|
||||
-- Basic settings
|
||||
vim.g.loaded_matchparen = true
|
||||
vim.g.netrw_liststyle = 3
|
||||
vim.go.background = 'dark'
|
||||
vim.go.belloff = 'all'
|
||||
vim.go.breakindent = true
|
||||
vim.go.hlsearch = false
|
||||
vim.go.laststatus = 0
|
||||
vim.go.lazyredraw = true
|
||||
vim.go.showcmd = true
|
||||
vim.go.synmaxcol = 800
|
||||
vim.go.syntax = 'on'
|
||||
vim.go.termguicolors = true
|
||||
vim.go.titleold = vim.fn.getcwd()
|
||||
vim.go.title = true
|
||||
vim.go.wildmenu = true
|
||||
vim.go.wrap = true
|
||||
vim.wo.number = true
|
||||
|
||||
local glob_opts = {
|
||||
background = 'dark',
|
||||
belloff = 'all',
|
||||
breakindent = true,
|
||||
hlsearch = false,
|
||||
laststatus = 0,
|
||||
lazyredraw = true,
|
||||
showcmd = true,
|
||||
synmaxcol = 800,
|
||||
syntax = 'on',
|
||||
termguicolors = true,
|
||||
titleold = vim.fn.getcwd(),
|
||||
title = true,
|
||||
wildmenu = true,
|
||||
wrap = true,
|
||||
}
|
||||
|
||||
for option, value in pairs(glob_opts) do
|
||||
vim.go[option] = value
|
||||
end
|
||||
|
||||
|
||||
vim.cmd([[colorscheme gruvbox]])
|
||||
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
@@ -24,11 +32,9 @@ require 'nvim-treesitter.configs'.setup {
|
||||
indent = { enable = false, disable = {} },
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Highlight also non-parentheses delimiters, boolean or table: lang -> boolean
|
||||
max_file_lines = 1000, -- Do not enable for files with more than 1000 lines, int
|
||||
colors = {
|
||||
'#ff0000', '#ffa500', '#ffff00', '#008000', '#0051a0', '#8003f2'
|
||||
} -- table of hex strings
|
||||
extended_mode = true,
|
||||
max_file_lines = 1000,
|
||||
colors = { '#ff0000', '#0051a0' ,'#ffa500', '#ffff00', '#008000', '#8003f2' }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -99,6 +105,19 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
||||
end
|
||||
})
|
||||
|
||||
vim.diagnostic.config({ virtual_text = false }) -- Turn off inline diagnostics
|
||||
|
||||
-- Show all diagnostics on current line in floating window
|
||||
vim.api.nvim_set_keymap('n', '<Leader>d', ':lua vim.diagnostic.open_float()<CR>', opts)
|
||||
|
||||
-- Go to next diagnostic (if there are multiple on the same line, only shows
|
||||
-- one at a time in the floating window)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>n', ':lua vim.diagnostic.goto_next()<CR>', opts)
|
||||
|
||||
-- Go to prev diagnostic (if there are multiple on the same line, only shows
|
||||
-- one at a time in the floating window)
|
||||
vim.api.nvim_set_keymap('n', '<Leader>p', ':lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||
|
||||
-- Use a loop to conveniently call 'setup' on multiple servers and
|
||||
-- map buffer local keybindings when the language server attaches
|
||||
local cmp = require 'cmp'
|
||||
@@ -163,7 +182,7 @@ cmp.setup({
|
||||
}
|
||||
})
|
||||
|
||||
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'lua_ls', 'nixd', 'texlab', 'verible' }
|
||||
local servers = { 'pyright', 'rust_analyzer', 'ccls', 'nixd', 'texlab', 'zls', 'gopls', 'yamlls', 'typst_lsp' }
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
for _, lsp in pairs(servers) do
|
||||
require('lspconfig')[lsp].setup {
|
||||
@@ -172,11 +191,33 @@ for _, lsp in pairs(servers) do
|
||||
end
|
||||
|
||||
require('lspconfig').lua_ls.setup({
|
||||
capabilities = capabilities,
|
||||
single_file_support = true,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' },
|
||||
},
|
||||
runtime = {
|
||||
version = 'LuaJIT',
|
||||
path = vim.split(package.path, ';'),
|
||||
},
|
||||
workspace = {
|
||||
library = {
|
||||
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
|
||||
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
|
||||
},
|
||||
},
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require('lspconfig').verible.setup({
|
||||
root_dir = function() return vim.loop.cwd() end
|
||||
capabilities = capabilities,
|
||||
root_dir = function() return vim.fn.getcwd() end
|
||||
})
|
||||
|
||||
if vim.fn.exists('+undofile') ~= 0 then
|
||||
|
||||
Reference in New Issue
Block a user