Skip to content

Commit

Permalink
Random vim updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sandhose committed Jun 10, 2024
1 parent fd9be4c commit 1cc4bec
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 14 deletions.
8 changes: 6 additions & 2 deletions profiles/common/packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ with pkgs; [
python3Full
# python37Packages.ansible
redis
# rustup
rye
rustup
# socat
sqlite-interactive
sshpass
Expand All @@ -74,6 +75,10 @@ with pkgs; [
# clang-tools # broken on darwin
zig

haproxy
python3Packages.supervisor
prometheus

(hiPrio corepack_20)
(hiPrio fenix.rust-analyzer)

Expand Down Expand Up @@ -142,7 +147,6 @@ with pkgs; [
bat
ripgrep

rustup
#(fenix.complete.withComponents [ "rustc" "rustfmt" ])
#(hiPrio
# (fenix.combine [
Expand Down
4 changes: 2 additions & 2 deletions profiles/darwin/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ with inputs; {

environment = {
systemPackages = with pkgs; [
postgresql_14
postgresql_14.lib
postgresql_16
postgresql_16.lib
openssl.out
pinentry_mac
reattach-to-user-namespace
Expand Down
19 changes: 13 additions & 6 deletions profiles/home-manager/vim/config/lua/my/completion.lua
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
local cmp = require'cmp'
local lspkind = require'lspkind'

require'copilot'.setup({
suggestion = { enabled = false },
panel = { enabled = false },
})
require'copilot_cmp'.setup({})
require'supermaven-nvim'.setup{
disable_inline_completion = true,
disable_keymaps = true,
}

local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
Expand All @@ -16,6 +15,14 @@ local feedkey = function(key, mode)
vim.api.nvim_feedkeys(vim.api.nvim_replace_termcodes(key, true, true, true), mode, true)
end

lspkind.init({
symbol_map = {
Supermaven = "",
},
})

vim.api.nvim_set_hl(0, "CmpItemKindSupermaven", {fg ="#6CC644"})

cmp.setup {
snippet = {
expand = function(args)
Expand Down Expand Up @@ -65,7 +72,7 @@ cmp.setup {

sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'copilot' },
{ name = 'supermaven' },
--{ name = 'vsnip' },
{ name = 'path' },
{ name = 'crates' },
Expand Down
7 changes: 7 additions & 0 deletions profiles/home-manager/vim/config/lua/my/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@ require'nvim-tree'.setup {
},
}

require'treesitter-context'.setup {
enable = true,
max_lines = 10,
multiline_threshold = 2,
mode = 'topline',
}

local dap, dapui = require'dap', require'dapui'
dapui.setup()
dap.listeners.before.attach.dapui_config = function()
Expand Down
19 changes: 15 additions & 4 deletions profiles/home-manager/vim/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ config, pkgs, ... }:
{ config, pkgs, lib, ... }:

let
nvimHome = "${config.xdg.configHome}/nvim";
Expand All @@ -21,6 +21,18 @@ let
url = "http://ftp.vim.org/vim/runtime/spell/fr.latin1.sug";
sha256 = "5cb2c97901b9ca81bf765532099c0329e2223c139baa764058822debd2e0d22a";
};

supermaven-nvim = pkgs.vimUtils.buildVimPlugin {
pname = "supermaven-nvim";
version = "2010-10-18";
src = pkgs.fetchFromGitHub {
owner = "supermaven-inc";
repo = "supermaven-nvim";
rev = "4621e779e69c2b09807a3c545ed43697d826ef83";
sha256 = "0ajh64bkvfkcyb7lvjd9hs184yg83p72d9x0g5phqnzihxdz7aqg";
};
meta.homepage = "https://github.com/supermaven-inc/supermaven-nvim";
};
in
{
programs = {
Expand All @@ -42,7 +54,7 @@ in
clang-tools # broken on darwin
nodePackages.vscode-langservers-extracted
nodePackages.dockerfile-language-server-nodejs
nodePackages.pyright
pyright
gopls
# python38Packages.python-lsp-server
# python38Packages.python-lsp-black
Expand Down Expand Up @@ -131,8 +143,7 @@ in
fidget-nvim
nvim-treesitter-context

copilot-lua
copilot-cmp
supermaven-nvim

cmp-nvim-lsp
cmp-buffer
Expand Down

0 comments on commit 1cc4bec

Please sign in to comment.