Compare commits
4 Commits
main
...
f23c3d413b
| Author | SHA1 | Date | |
|---|---|---|---|
| f23c3d413b | |||
| 85c6ae78fb | |||
| 6d106b954d | |||
| d2763cfa8b |
@ -13,8 +13,7 @@
|
|||||||
nil
|
nil
|
||||||
# neovim
|
# neovim
|
||||||
|
|
||||||
# (pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; })
|
(pkgs.nerdfonts.override { fonts = [ "FiraCode" ]; })
|
||||||
pkgs.nerd-fonts.fira-code
|
|
||||||
|
|
||||||
# (pkgs.writeShellScriptBin "my-hello" ''
|
# (pkgs.writeShellScriptBin "my-hello" ''
|
||||||
# echo "Hello, ${config.home.username}!"
|
# echo "Hello, ${config.home.username}!"
|
||||||
@ -49,8 +48,7 @@
|
|||||||
# EDITOR = "nvim";
|
# EDITOR = "nvim";
|
||||||
#};
|
#};
|
||||||
|
|
||||||
#home.shellAliases = {
|
# home.shellAliases = {
|
||||||
# "ll" = "ls -la";
|
|
||||||
# "t" = "tmuxp";
|
# "t" = "tmuxp";
|
||||||
# "tl" = "tmuxp load";
|
# "tl" = "tmuxp load";
|
||||||
# };
|
# };
|
||||||
|
|||||||
33
nix/flake.lock
generated
33
nix/flake.lock
generated
@ -7,11 +7,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750275572,
|
"lastModified": 1723986931,
|
||||||
"narHash": "sha256-upC/GIlsIgtdtWRGd1obzdXWYQptNkfzZeyAFWgsgf0=",
|
"narHash": "sha256-Fy+KEvDQ+Hc8lJAV3t6leXhZJ2ncU5/esxkgt3b8DEY=",
|
||||||
"owner": "nix-community",
|
"owner": "nix-community",
|
||||||
"repo": "home-manager",
|
"repo": "home-manager",
|
||||||
"rev": "0f355844e54e4c70906b1ef5cc35a0047d666c04",
|
"rev": "2598861031b78aadb4da7269df7ca9ddfc3e1671",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -20,33 +20,13 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"nix-darwin": {
|
|
||||||
"inputs": {
|
|
||||||
"nixpkgs": [
|
|
||||||
"nixpkgs"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"locked": {
|
|
||||||
"lastModified": 1749873626,
|
|
||||||
"narHash": "sha256-1Mc/D/1RwwmDKY59f4IpDBgcQttxffm+4o0m67lQ8hc=",
|
|
||||||
"owner": "LnL7",
|
|
||||||
"repo": "nix-darwin",
|
|
||||||
"rev": "2f140d6ac8840c6089163fb43ba95220c230f22b",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
"original": {
|
|
||||||
"owner": "LnL7",
|
|
||||||
"repo": "nix-darwin",
|
|
||||||
"type": "github"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1750134718,
|
"lastModified": 1724224976,
|
||||||
"narHash": "sha256-v263g4GbxXv87hMXMCpjkIxd/viIF7p3JpJrwgKdNiI=",
|
"narHash": "sha256-Z/ELQhrSd7bMzTO8r7NZgi9g5emh+aRKoCdaAv5fiO0=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "9e83b64f727c88a7711a2c463a7b16eedb69a84c",
|
"rev": "c374d94f1536013ca8e92341b540eba4c22f9c62",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@ -59,7 +39,6 @@
|
|||||||
"root": {
|
"root": {
|
||||||
"inputs": {
|
"inputs": {
|
||||||
"home-manager": "home-manager",
|
"home-manager": "home-manager",
|
||||||
"nix-darwin": "nix-darwin",
|
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,53 +3,18 @@
|
|||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
|
||||||
nix-darwin.url = "github:LnL7/nix-darwin";
|
|
||||||
nix-darwin.inputs.nixpkgs.follows = "nixpkgs";
|
|
||||||
home-manager = {
|
home-manager = {
|
||||||
url = "github:nix-community/home-manager";
|
url = "github:nix-community/home-manager";
|
||||||
inputs.nixpkgs.follows = "nixpkgs";
|
inputs.nixpkgs.follows = "nixpkgs";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, nix-darwin, nixpkgs, home-manager, ... }:
|
outputs = { nixpkgs, home-manager, ... }:
|
||||||
let
|
let
|
||||||
system = "x86_64-darwin";
|
#system = "x86_64-darwin";
|
||||||
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages.${system};
|
pkgs = nixpkgs.legacyPackages.${system};
|
||||||
|
|
||||||
configuration = { pkgs, ... }: {
|
|
||||||
environment.systemPackages =
|
|
||||||
[
|
|
||||||
pkgs.vim
|
|
||||||
];
|
|
||||||
|
|
||||||
# Auto upgrade nix package and the daemon service.
|
|
||||||
services.nix-daemon.enable = true;
|
|
||||||
# nix.package = pkgs.nix;
|
|
||||||
|
|
||||||
nix.settings.experimental-features = "nix-command flakes";
|
|
||||||
|
|
||||||
programs.zsh.enable = true; # default shell on catalina
|
|
||||||
|
|
||||||
# Set Git commit hash for darwin-version.
|
|
||||||
system.configurationRevision = self.rev or self.dirtyRev or null;
|
|
||||||
|
|
||||||
# Used for backwards compatibility, please read the changelog before changing.
|
|
||||||
# $ darwin-rebuild changelog
|
|
||||||
system.stateVersion = 4;
|
|
||||||
|
|
||||||
# The platform the configuration will be used on.
|
|
||||||
nixpkgs.hostPlatform = system;
|
|
||||||
};
|
|
||||||
in {
|
in {
|
||||||
# Build darwin flake using:
|
|
||||||
# $ darwin-rebuild build --flake .#Martins-MacBook-Pro
|
|
||||||
darwinConfigurations."Martins-MacBook-Pro" = nix-darwin.lib.darwinSystem {
|
|
||||||
modules = [ configuration ];
|
|
||||||
};
|
|
||||||
|
|
||||||
# Expose the package set, including overlays, for convenience.
|
|
||||||
darwinPackages = self.darwinConfigurations."Martins-MacBook-Pro".pkgs;
|
|
||||||
|
|
||||||
homeConfigurations = {
|
homeConfigurations = {
|
||||||
"moustachioed" = home-manager.lib.homeManagerConfiguration {
|
"moustachioed" = home-manager.lib.homeManagerConfiguration {
|
||||||
inherit pkgs;
|
inherit pkgs;
|
||||||
@ -57,16 +22,7 @@
|
|||||||
modules = [
|
modules = [
|
||||||
./user/profiles/moustachioedBook.nix
|
./user/profiles/moustachioedBook.nix
|
||||||
./common.nix
|
./common.nix
|
||||||
./user/task_home.nix
|
./user/task.nix
|
||||||
];
|
|
||||||
};
|
|
||||||
"martin" = home-manager.lib.homeManagerConfiguration {
|
|
||||||
inherit pkgs;
|
|
||||||
|
|
||||||
modules = [
|
|
||||||
./user/profiles/martin.nix
|
|
||||||
./common.nix
|
|
||||||
./user/task_home.nix
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
"pan" = home-manager.lib.homeManagerConfiguration {
|
"pan" = home-manager.lib.homeManagerConfiguration {
|
||||||
|
|||||||
@ -7,7 +7,5 @@
|
|||||||
nix-direnv.enable = true;
|
nix-direnv.enable = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
programs.ripgrep.enable = true;
|
||||||
visidata
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,49 +11,19 @@
|
|||||||
br = "branch";
|
br = "branch";
|
||||||
pl = "pull";
|
pl = "pull";
|
||||||
ps = "push";
|
ps = "push";
|
||||||
sw = "switch";
|
|
||||||
mno =" merge --no-ff";
|
mno =" merge --no-ff";
|
||||||
lg = "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%C(bold blue)<%an>%Creset' --abbrev-commit";
|
lg = "log --color --graph --pretty=format:'%cred%h%creset -%c(yellow)%d%creset %s %cgreen(%cr)%c(bold blue)<%an>%creset' --abbrev-commit";
|
||||||
cleanup = "!git fetch --prune && git branch -vv | grep ': gone]' | awk '{print $1}' | xargs git branch -D";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
difftastic.enable = true;
|
difftastic.enable = true;
|
||||||
|
|
||||||
extraConfig = {
|
extraConfig = {
|
||||||
column.ui = "auto";
|
core = {
|
||||||
branch.sort = "-committerdate";
|
editor = "nvim";
|
||||||
tag.sort = "version:refname";
|
|
||||||
diff = {
|
|
||||||
algorithm = "histogram";
|
|
||||||
colorMoved = "plain";
|
|
||||||
mnemonicPrefix = "true";
|
|
||||||
renames = "true";
|
|
||||||
};
|
};
|
||||||
pull.rebase = "true";
|
push.default = "matching";
|
||||||
push = {
|
|
||||||
default = "simple";
|
|
||||||
autoSetupRemote = "true";
|
|
||||||
followTags = "true";
|
|
||||||
};
|
|
||||||
fetch = {
|
|
||||||
prune = "true";
|
|
||||||
pruneTags = "true";
|
|
||||||
all = "true";
|
|
||||||
};
|
|
||||||
help.autocorrect = "prompt";
|
|
||||||
commit.verbose = "true";
|
|
||||||
rerere = {
|
|
||||||
enabled = "true";
|
|
||||||
autoupdate = "true";
|
|
||||||
};
|
|
||||||
rebase = {
|
|
||||||
autoSquas = "true";
|
|
||||||
autoStash = "true";
|
|
||||||
updateRefs = "true";
|
|
||||||
};
|
|
||||||
merge.conflictstyle = "zdiff3";
|
|
||||||
core.editor = "nvim";
|
|
||||||
init.defaultBranch = "main";
|
init.defaultBranch = "main";
|
||||||
|
merge.conflicstyle = "zdiff3";
|
||||||
};
|
};
|
||||||
|
|
||||||
ignores = [
|
ignores = [
|
||||||
@ -61,19 +31,4 @@
|
|||||||
".envrc"
|
".envrc"
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.lazygit = {
|
|
||||||
enable = true;
|
|
||||||
settings = {
|
|
||||||
theme.lightTheme = "true";
|
|
||||||
git = {
|
|
||||||
log = {
|
|
||||||
format = "%C(yellow)%h%Creset %C(bold blue)<%an>%Creset %s %Cgreen(%cr)%Creset";
|
|
||||||
graph = "true";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
programs.jujutsu.enable = true;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,66 +8,33 @@
|
|||||||
vimAlias = true;
|
vimAlias = true;
|
||||||
|
|
||||||
plugins = with pkgs.vimPlugins; [
|
plugins = with pkgs.vimPlugins; [
|
||||||
|
vim-commentary
|
||||||
vim-repeat
|
vim-repeat
|
||||||
vim-surround
|
vim-surround
|
||||||
ts-comments-nvim
|
|
||||||
vim-fugitive
|
|
||||||
gitsigns-nvim
|
|
||||||
nvim-tree-lua
|
|
||||||
targets-vim
|
targets-vim
|
||||||
mini-pairs
|
delimitMate
|
||||||
mini-align
|
vim-startify
|
||||||
mini-bracketed
|
|
||||||
mini-splitjoin
|
|
||||||
mini-move
|
|
||||||
mini-ai
|
|
||||||
mini-icons
|
|
||||||
flash-nvim
|
|
||||||
trouble-nvim
|
|
||||||
conform-nvim
|
|
||||||
nvim-lint
|
|
||||||
promise-async
|
|
||||||
nvim-ufo
|
|
||||||
vim-windowswap
|
vim-windowswap
|
||||||
|
vim-nix
|
||||||
plenary-nvim
|
plenary-nvim
|
||||||
telescope-nvim
|
telescope-nvim
|
||||||
telescope-fzf-native-nvim
|
telescope-fzf-native-nvim
|
||||||
telescope-ui-select-nvim
|
|
||||||
yanky-nvim
|
yanky-nvim
|
||||||
lualine-nvim
|
lualine-nvim
|
||||||
undotree
|
undotree
|
||||||
luasnip
|
vim-vsnip
|
||||||
nvim-cmp
|
nvim-cmp
|
||||||
cmp_luasnip
|
cmp-vsnip
|
||||||
cmp-buffer
|
cmp-buffer
|
||||||
cmp-path
|
cmp-path
|
||||||
cmp-cmdline
|
cmp-cmdline
|
||||||
cmp-nvim-lsp
|
cmp-nvim-lsp
|
||||||
cmp-nvim-lsp-signature-help
|
|
||||||
cmp_yanky
|
cmp_yanky
|
||||||
cmp-git
|
cmp-git
|
||||||
nvim-lspconfig
|
nvim-lspconfig
|
||||||
lspkind-nvim
|
lspkind-nvim
|
||||||
copilot-lua
|
copilot-lua
|
||||||
copilot-cmp
|
copilot-cmp
|
||||||
CopilotChat-nvim
|
|
||||||
bullets-vim
|
|
||||||
nvim-dap
|
|
||||||
nvim-nio
|
|
||||||
nvim-dap-ui
|
|
||||||
nvim-dap-virtual-text
|
|
||||||
nvim-dap-go
|
|
||||||
nvim-dap-python
|
|
||||||
nvim-dap-lldb
|
|
||||||
todo-comments-nvim
|
|
||||||
vim-markdown
|
|
||||||
zen-mode-nvim
|
|
||||||
plantuml-syntax
|
|
||||||
obsidian-nvim
|
|
||||||
render-markdown-nvim
|
|
||||||
image-nvim
|
|
||||||
img-clip-nvim
|
|
||||||
vim-nix
|
|
||||||
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
|
(nvim-treesitter.withPlugins (p: [ p.awk p.bash p.c p.c_sharp p.cpp p.css p.diff p.dockerfile p.doxygen p.git_config p.gitcommit p.go p.gomod p.gosum p.gotmpl p.helm p.haskell p.html p.http p.java p.javascript p.json p.latex p.lua p.markdown p.markdown_inline p.matlab p.nix p.printf p.python p.regex p.rust p.sql p.strace p.supercollider p.svelte p.swift p.terraform p.tmux p.toml p.typescript p.vim p.xml p.yaml p.zig ]))
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -79,13 +46,11 @@
|
|||||||
(lib.strings.fileContents ../../nvim/base.lua)
|
(lib.strings.fileContents ../../nvim/base.lua)
|
||||||
(lib.strings.fileContents ../../nvim/keymaps.lua)
|
(lib.strings.fileContents ../../nvim/keymaps.lua)
|
||||||
(lib.strings.fileContents ../../nvim/plugins.lua)
|
(lib.strings.fileContents ../../nvim/plugins.lua)
|
||||||
(lib.strings.fileContents ../../nvim/filetype.lua)
|
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
nodejs-slim
|
nodejs-slim
|
||||||
marksman
|
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,13 +0,0 @@
|
|||||||
{ config, pkgs, ... }:
|
|
||||||
|
|
||||||
{
|
|
||||||
home.username = "martin";
|
|
||||||
home.homeDirectory = "/Users/martin";
|
|
||||||
|
|
||||||
home.stateVersion = "24.05"; # Please read the comment before changing.
|
|
||||||
|
|
||||||
programs.git = {
|
|
||||||
userName = "Martin";
|
|
||||||
userEmail = "git@pander-on.de";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -46,21 +46,10 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
initContent = ''
|
initExtra = ''
|
||||||
HISTCONTROL='erasedups:ignoreboth'
|
HISTCONTROL='erasedups:ignoreboth'
|
||||||
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
|
HISTIGNORE='&:[ ]*:exit:ls:bg:fg:history:clear'
|
||||||
unsetopt beep
|
unsetopt beep
|
||||||
|
|
||||||
if [[ "$(uname -s)" == "Darwin" ]]; then
|
|
||||||
export RUSTUP_HOME="$HOME/.rustup"
|
|
||||||
export CARGO_HOME="$HOME/.cargo"
|
|
||||||
[ -f "$CARGO_HOME/env" ] && . "$CARGO_HOME/env"
|
|
||||||
fi;
|
|
||||||
if [[ "$(uname -r)" == *Microsoft* ]]; then
|
|
||||||
if command -v tmuxp &> /dev/null && [ -z "$TMUX" ]; then
|
|
||||||
tmuxp load --yes misc
|
|
||||||
fi
|
|
||||||
fi;
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -71,7 +60,7 @@
|
|||||||
|
|
||||||
programs.lsd = {
|
programs.lsd = {
|
||||||
enable = true;
|
enable = true;
|
||||||
enableZshIntegration = true;
|
enableAliases = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
programs.zoxide = {
|
programs.zoxide = {
|
||||||
@ -84,17 +73,11 @@
|
|||||||
|
|
||||||
programs.bat.enable = true;
|
programs.bat.enable = true;
|
||||||
programs.ripgrep.enable = true;
|
programs.ripgrep.enable = true;
|
||||||
programs.btop.enable = true;
|
|
||||||
programs.ranger.enable = true;
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
home.packages = with pkgs; [
|
||||||
fd
|
fd
|
||||||
du-dust
|
du-dust
|
||||||
glow
|
glow
|
||||||
ripgrep-all
|
|
||||||
viddy
|
|
||||||
duf
|
|
||||||
(python3.withPackages(ps: [ ps.llm ps.llm-gemini ]))
|
|
||||||
#nerdfonts
|
#nerdfonts
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -102,16 +85,4 @@
|
|||||||
BAT_THEME = "Coldark-Cold";
|
BAT_THEME = "Coldark-Cold";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
home.shellAliases = lib.mkMerge [
|
|
||||||
{
|
|
||||||
lst = "lsd --tree";
|
|
||||||
}
|
|
||||||
|
|
||||||
# This is the correct way to use lib.mkIf within lib.mkMerge
|
|
||||||
# (lib.mkIf pkgs.stdenv.targetPlatform.isWindows {
|
|
||||||
(lib.mkIf (lib.strings.hasSuffix "windows" pkgs.system) {
|
|
||||||
open = "explorer.exe .";
|
|
||||||
})
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,13 +39,6 @@
|
|||||||
report.low.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
|
report.low.labels="ID,Active,Age,Deps,P,E,Project,Tag,Recur,S,Due,Until,Description,Urg";
|
||||||
report.low.sort="energy+,urgency-";
|
report.low.sort="energy+,urgency-";
|
||||||
|
|
||||||
context.deferred.read = "+deferred";
|
|
||||||
context.deferred.write = "+deferred";
|
|
||||||
context.customer.read = "+cust";
|
|
||||||
context.customer.write = "+cust";
|
|
||||||
context.low_energy.read = "+low";
|
|
||||||
context.low_energy.write = "+low";
|
|
||||||
|
|
||||||
uda.taskwarrior-tui.task-report.show-info = false;
|
uda.taskwarrior-tui.task-report.show-info = false;
|
||||||
uda.taskwarrior-tui.selection.reverse = "yes";
|
uda.taskwarrior-tui.selection.reverse = "yes";
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,37 +0,0 @@
|
|||||||
{config, pkgs, lib, ...}:
|
|
||||||
|
|
||||||
{
|
|
||||||
programs.taskwarrior = {
|
|
||||||
enable = true;
|
|
||||||
colorTheme = "light-256";
|
|
||||||
package = pkgs.taskwarrior3;
|
|
||||||
config = {
|
|
||||||
weekstart = "monday";
|
|
||||||
|
|
||||||
uda.priority.values = "H,M,,L";
|
|
||||||
urgency.uda.priority.L.coefficient = -0.5;
|
|
||||||
urgency.user.tag.deferred.coefficient = -15.0;
|
|
||||||
urgency.user.tag.cust.coefficient = 5.0;
|
|
||||||
|
|
||||||
context.today.read = "-deferred and (prio:H or +next)";
|
|
||||||
context.today.write = "prio:H or +next";
|
|
||||||
context.deferred.read = "+deferred";
|
|
||||||
context.deferred.write = "+deferred";
|
|
||||||
context.low_energy.read = "+low";
|
|
||||||
context.low_energy.write = "+low";
|
|
||||||
|
|
||||||
uda.taskwarrior-tui.task-report.show-info = false;
|
|
||||||
uda.taskwarrior-tui.selection.reverse = "yes";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
home.packages = with pkgs; [
|
|
||||||
taskwarrior-tui
|
|
||||||
];
|
|
||||||
|
|
||||||
home.shellAliases = lib.mkMerge [ {
|
|
||||||
t = "task";
|
|
||||||
tt = "taskwarrior-tui";
|
|
||||||
}
|
|
||||||
];
|
|
||||||
}
|
|
||||||
@ -25,12 +25,6 @@
|
|||||||
bind % split-window -h -c "#{pane_current_path}"
|
bind % split-window -h -c "#{pane_current_path}"
|
||||||
bind c new-window -a -c "#{pane_current_path}"
|
bind c new-window -a -c "#{pane_current_path}"
|
||||||
|
|
||||||
bind C-s display-popup -E "zsh ~/bin/tmuxp_selector.sh"
|
|
||||||
bind C-g display-popup -E -d "#{pane_current_path}" -xC -yC -w 95% -h 95% "lazygit"
|
|
||||||
bind C-t display-popup -E -xC -yC -w 95% -h 95% "tasksquire"
|
|
||||||
bind C-n display-popup -E -xC -yC -w 95% -h 95% "vim /mnt/c/Users/marti/Documents/notes/Work/quick_notes.md"
|
|
||||||
bind C-m display-popup -E -xC -yC -w 95% -h 95% "vim /mnt/c/Users/marti/Documents/notes/Work/mbpr.md"
|
|
||||||
|
|
||||||
#######################################
|
#######################################
|
||||||
# status line
|
# status line
|
||||||
#######################################
|
#######################################
|
||||||
|
|||||||
104
nvim/base.lua
104
nvim/base.lua
@ -1,14 +1,11 @@
|
|||||||
vim.g.loaded_netrw = 1
|
|
||||||
vim.g.loaded_netrwPlugin = 1
|
|
||||||
|
|
||||||
-------------------------
|
-------------------------
|
||||||
-------- OPTIONS --------
|
-------- OPTIONS --------
|
||||||
-------------------------
|
-------------------------
|
||||||
vim.opt.mouse = 'a'
|
vim.opt.mouse = 'a'
|
||||||
vim.opt.history = 1000
|
vim.opt.history = 1000
|
||||||
vim.opt.ruler = true
|
vim.opt.ruler = true
|
||||||
|
vim.opt.ruler = true
|
||||||
vim.opt.number = true
|
vim.opt.number = true
|
||||||
vim.opt.relativenumber = true
|
|
||||||
vim.opt.showcmd = true
|
vim.opt.showcmd = true
|
||||||
vim.opt.ttimeoutlen = 100
|
vim.opt.ttimeoutlen = 100
|
||||||
vim.opt.backspace = 'indent,eol,start'
|
vim.opt.backspace = 'indent,eol,start'
|
||||||
@ -26,8 +23,7 @@ vim.opt.smartcase = true
|
|||||||
vim.opt.hidden = true
|
vim.opt.hidden = true
|
||||||
vim.opt.splitright = true
|
vim.opt.splitright = true
|
||||||
vim.opt.splitbelow = true
|
vim.opt.splitbelow = true
|
||||||
vim.opt.swapfile = true
|
vim.opt.swapfile = false
|
||||||
vim.opt.directory= '~/.cache/nvim/swap//,$TEMP//,/tmp//'
|
|
||||||
vim.opt.wildmode = 'longest,list'
|
vim.opt.wildmode = 'longest,list'
|
||||||
vim.opt.wildignore = vim.opt.wildignore + 'main,*.o,*.d,*.aux,*.bbl,*.lof,*.loa,*.blg,*.fdb_latexmk,*.fls,*.tdo,*.pdf,*.pyc'
|
vim.opt.wildignore = vim.opt.wildignore + 'main,*.o,*.d,*.aux,*.bbl,*.lof,*.loa,*.blg,*.fdb_latexmk,*.fls,*.tdo,*.pdf,*.pyc'
|
||||||
vim.opt.spell = false
|
vim.opt.spell = false
|
||||||
@ -38,7 +34,7 @@ vim.opt.lazyredraw = true
|
|||||||
vim.opt.listchars = 'eol:¬,tab:▸ ,trail:·'
|
vim.opt.listchars = 'eol:¬,tab:▸ ,trail:·'
|
||||||
vim.opt.fillchars = 'vert:|,fold: '
|
vim.opt.fillchars = 'vert:|,fold: '
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
vim.opt.laststatus = 3
|
vim.opt.laststatus = 2
|
||||||
vim.opt.scrolloff = 8
|
vim.opt.scrolloff = 8
|
||||||
vim.opt.background = 'light'
|
vim.opt.background = 'light'
|
||||||
vim.opt.wrap = true
|
vim.opt.wrap = true
|
||||||
@ -50,8 +46,6 @@ vim.opt.autoread = true
|
|||||||
vim.opt.syntax = 'on'
|
vim.opt.syntax = 'on'
|
||||||
vim.opt.encoding = 'utf-8'
|
vim.opt.encoding = 'utf-8'
|
||||||
vim.opt.completeopt = 'menu,menuone,noselect'
|
vim.opt.completeopt = 'menu,menuone,noselect'
|
||||||
vim.opt.termguicolors = true
|
|
||||||
vim.opt.conceallevel = 1
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------
|
----------------------------
|
||||||
@ -84,47 +78,13 @@ vim.api.nvim_create_autocmd({'FocusGained', 'BufEnter', 'CursorMoved', 'CursorMo
|
|||||||
command = 'silent! checktime'
|
command = 'silent! checktime'
|
||||||
})
|
})
|
||||||
|
|
||||||
-- vim.api.nvim_create_autocmd('BufEnter', {
|
vim.api.nvim_create_autocmd('BufEnter', {
|
||||||
-- group = 'VimIntern',
|
group = 'VimIntern',
|
||||||
-- pattern = '*',
|
pattern = '*',
|
||||||
-- command = 'silent! lcd %:p:h'
|
command = 'silent! lcd %:p:h'
|
||||||
-- })
|
|
||||||
|
|
||||||
-- Open nvim-tree when starting Neovim in a specific directory or any of its subdirectories
|
|
||||||
vim.api.nvim_create_autocmd("VimEnter", {
|
|
||||||
callback = function()
|
|
||||||
local args = vim.fn.argv()
|
|
||||||
|
|
||||||
if #args > 0 then
|
|
||||||
local current_dir = vim.fn.fnamemodify(args[1], ":p:h")
|
|
||||||
local dir_name = vim.fn.fnamemodify(current_dir, ":t")
|
|
||||||
|
|
||||||
-- Check if in a "notes" directory or its subdirectory
|
|
||||||
local in_notes = dir_name == "notes"
|
|
||||||
if not in_notes then
|
|
||||||
-- Check if any parent directory is named "notes"
|
|
||||||
local path_parts = vim.split(current_dir, "/", {plain = true})
|
|
||||||
for i, part in ipairs(path_parts) do
|
|
||||||
if part == "notes" then
|
|
||||||
in_notes = true
|
|
||||||
break
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
-- If in a notes directory or subdirectory, open the tree
|
|
||||||
if in_notes then
|
|
||||||
require("nvim-tree.api").tree.open()
|
|
||||||
vim.defer_fn(function()
|
|
||||||
require("nvim-tree.api").tree.expand_all()
|
|
||||||
-- After expanding, return focus to the main window/buffer
|
|
||||||
vim.cmd("wincmd p")
|
|
||||||
end, 100) -- Small delay to ensure tree is fully loaded before expanding
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
---------------------------
|
---------------------------
|
||||||
-------- FUNCTIONS --------
|
-------- FUNCTIONS --------
|
||||||
---------------------------
|
---------------------------
|
||||||
@ -132,51 +92,3 @@ vim.api.nvim_create_autocmd("VimEnter", {
|
|||||||
vim.api.nvim_create_user_command('TrimWhiteSpace', function()
|
vim.api.nvim_create_user_command('TrimWhiteSpace', function()
|
||||||
vim.cmd('%s/\\s\\+$//e')
|
vim.cmd('%s/\\s\\+$//e')
|
||||||
end, {})
|
end, {})
|
||||||
|
|
||||||
local function ToggleDiagnostics()
|
|
||||||
vim.diagnostic.enable(not vim.diagnostic.is_enabled())
|
|
||||||
if vim.diagnostic.is_enabled() then
|
|
||||||
print("Diagnostics enabled")
|
|
||||||
else
|
|
||||||
print("Diagnostics disabled")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
---------------------------
|
|
||||||
------- DIAGNOSTICS -------
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
vim.diagnostic.config({
|
|
||||||
update_in_insert = true,
|
|
||||||
signs = true,
|
|
||||||
virtual_text = {
|
|
||||||
prefix = '● ',
|
|
||||||
current_line = false,
|
|
||||||
severity = {
|
|
||||||
-- min = vim.diagnostic.severity.INFO,
|
|
||||||
max = vim.diagnostic.severity.INFO,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
virtual_lines = {
|
|
||||||
current_line = false,
|
|
||||||
severity = {
|
|
||||||
min = vim.diagnostic.severity.WARN,
|
|
||||||
-- max = vim.diagnostic.severity.WARN,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
float = {
|
|
||||||
prefix = '',
|
|
||||||
focusable = false,
|
|
||||||
style = "minimal",
|
|
||||||
border = "rounded",
|
|
||||||
source = "always",
|
|
||||||
header = "",
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.cmd([[highlight DiagnosticUnderlineError gui=undercurl guifg=Red]])
|
|
||||||
vim.cmd([[highlight DiagnosticUnderlineWarn gui=undercurl guifg=Yellow]])
|
|
||||||
vim.cmd([[highlight DiagnosticUnderlineInfo gui=undercurl guifg=Blue]])
|
|
||||||
vim.cmd([[highlight DiagnosticUnderlineHint gui=undercurl guifg=Cyan]])
|
|
||||||
|
|
||||||
|
|||||||
@ -1,153 +0,0 @@
|
|||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
|
|
||||||
vim.api.nvim_create_augroup('FileTypeConfigs', { clear = true })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
group = 'FileTypeConfigs',
|
|
||||||
pattern = 'python',
|
|
||||||
callback = function()
|
|
||||||
require('dap-python').setup()
|
|
||||||
-- lspconfig.pyright.setup({ capabilities = capabilities })
|
|
||||||
-- require("conform").setup({
|
|
||||||
-- python = {"black"},
|
|
||||||
-- })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = 'go',
|
|
||||||
-- callback = function()
|
|
||||||
-- require('dap-python').setup()
|
|
||||||
-- require('dap-go').setup()
|
|
||||||
|
|
||||||
lspconfig.ruff.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.gopls.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.marksman.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.rust_analyzer.setup({
|
|
||||||
capabilities = capabilities,
|
|
||||||
settings = {
|
|
||||||
["rust-analyzer"] = {
|
|
||||||
checkOnSave = {
|
|
||||||
command = "clippy",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
lspconfig.dockerls.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.clangd.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.sqls.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.zls.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.omnisharp.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.yamlls.setup({ capabilities = capabilities })
|
|
||||||
|
|
||||||
require("conform").setup({
|
|
||||||
go = {"gofmt"},
|
|
||||||
python = {"black"},
|
|
||||||
rust = {"rustfmt"},
|
|
||||||
})
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = 'rust',
|
|
||||||
-- callback = function()
|
|
||||||
-- require('dap-python').setup()
|
|
||||||
--
|
|
||||||
-- lspconfig.rust_analyzer.setup({
|
|
||||||
-- capabilities = capabilities,
|
|
||||||
-- settings = {
|
|
||||||
-- ["rust-analyzer"] = {
|
|
||||||
-- checkOnSave = {
|
|
||||||
-- command = "clippy",
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- },
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- require("conform").setup({
|
|
||||||
-- rust = {"rustfmt"},
|
|
||||||
-- })
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = 'markdown',
|
|
||||||
-- callback = function()
|
|
||||||
-- lspconfig.marksman.setup({ capabilities = capabilities })
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = 'dockerfile',
|
|
||||||
-- callback = function()
|
|
||||||
-- lspconfig.dockerls.setup({ capabilities = capabilities })
|
|
||||||
-- lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = 'cs',
|
|
||||||
-- callback = function()
|
|
||||||
-- lspconfig.omnisharp.setup({ capabilities = capabilities })
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = 'yaml',
|
|
||||||
-- callback = function()
|
|
||||||
-- lspconfig.yamlls.setup({ capabilities = capabilities })
|
|
||||||
-- lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = {'c', 'cpp', 'objc', 'objcpp'},
|
|
||||||
-- callback = function()
|
|
||||||
-- lspconfig.clangd.setup({ capabilities = capabilities })
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = 'sql',
|
|
||||||
-- callback = function()
|
|
||||||
-- lspconfig.sqls.setup({ capabilities = capabilities })
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
-- vim.api.nvim_create_autocmd('FileType', {
|
|
||||||
-- group = 'FileTypeConfigs',
|
|
||||||
-- pattern = 'zig',
|
|
||||||
-- callback = function()
|
|
||||||
-- lspconfig.zls.setup({ capabilities = capabilities })
|
|
||||||
-- end,
|
|
||||||
-- })
|
|
||||||
--
|
|
||||||
local get_datetime = function()
|
|
||||||
return os.date("%Y-%m-%d %H:%M")
|
|
||||||
end
|
|
||||||
|
|
||||||
local ls = require('luasnip')
|
|
||||||
ls.add_snippets("markdown", {
|
|
||||||
ls.snippet("mindful", {
|
|
||||||
-- Inserts the output of the get_datetime function as static text
|
|
||||||
ls.function_node(get_datetime, {}),
|
|
||||||
ls.text_node(" -- "),
|
|
||||||
ls.insert_node(1, "project"),
|
|
||||||
ls.text_node(" -- "),
|
|
||||||
ls.insert_node(2, "mode"),
|
|
||||||
ls.text_node(" -- "),
|
|
||||||
ls.insert_node(3, "description"),
|
|
||||||
}, {
|
|
||||||
descr = "Mindful of distractions",
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
111
nvim/keymaps.lua
111
nvim/keymaps.lua
@ -1,32 +1,21 @@
|
|||||||
vim.g.mapleader = " "
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
-- Navigation
|
-- Navigation
|
||||||
vim.keymap.set({'n', 'v'}, 'j', 'gj', {})
|
vim.keymap.set('n', 'j', 'gj', {})
|
||||||
vim.keymap.set({'n', 'v'}, 'k', 'gk', {})
|
vim.keymap.set('n', 'k', 'gk', {})
|
||||||
|
vim.keymap.set('v', 'j', 'gj', {})
|
||||||
|
vim.keymap.set('v', 'k', 'gk', {})
|
||||||
|
|
||||||
vim.keymap.set('n', '<C-M-h>', '<C-w>h', {})
|
vim.keymap.set('n', '<C-h>', '<C-w>h', {})
|
||||||
vim.keymap.set('n', '<C-M-j>', '<C-w>j', {})
|
vim.keymap.set('n', '<C-j>', '<C-w>j', {})
|
||||||
vim.keymap.set('n', '<C-M-k>', '<C-w>k', {})
|
vim.keymap.set('n', '<C-k>', '<C-w>k', {})
|
||||||
vim.keymap.set('n', '<C-M-l>', '<C-w>l', {})
|
vim.keymap.set('n', '<C-l>', '<C-w>l', {})
|
||||||
vim.keymap.set('t', '<C-M-h>', '<C-\\><C-n><C-w>h', {})
|
|
||||||
vim.keymap.set('t', '<C-M-j>', '<C-\\><C-n><C-w>j', {})
|
|
||||||
vim.keymap.set('t', '<C-M-k>', '<C-\\><C-n><C-w>k', {})
|
|
||||||
vim.keymap.set('t', '<C-M-l>', '<C-\\><C-n><C-w>l', {})
|
|
||||||
vim.keymap.set('n', '<leader>zm', '<C-W>_<C-W>|', { noremap = true, silent = true })
|
|
||||||
vim.keymap.set('n', '<C-M-Y>', '<C-w>5<', {})
|
|
||||||
vim.keymap.set('n', '<C-M-U>', '<C-w>5+', {})
|
|
||||||
vim.keymap.set('n', '<C-M-I>', '<C-w>5-', {})
|
|
||||||
vim.keymap.set('n', '<C-M-O>', '<C-w>5>', {})
|
|
||||||
vim.keymap.set('t', '<C-M-Y>', '<C-\\><C-n><C-w>5<', {})
|
|
||||||
vim.keymap.set('t', '<C-M-U>', '<C-\\><C-n><C-w>5+', {})
|
|
||||||
vim.keymap.set('t', '<C-M-I>', '<C-\\><C-n><C-w>5-', {})
|
|
||||||
vim.keymap.set('t', '<C-M-O>', '<C-\\><C-n><C-w>5>', {})
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>s', ':call WindowSwap#EasyWindowSwap()<CR>', {})
|
vim.keymap.set('n', '<leader>s', ':call WindowSwap#EasyWindowSwap()<CR>', {})
|
||||||
|
|
||||||
-- Convenience
|
-- Convenience
|
||||||
vim.keymap.set('n', '<leader>w', ':w<CR>', { silent = true })
|
vim.keymap.set('n', '<leader>w', ':w<CR>', { silent = true })
|
||||||
vim.keymap.set('n', '<leader>F', ':NvimTreeToggle<CR>', { noremap = true, silent = true })
|
vim.keymap.set('n', '<leader>F', ':e.<CR>', {})
|
||||||
vim.keymap.set('n', 'Y', 'y$', {})
|
vim.keymap.set('n', 'Y', 'y$', {})
|
||||||
|
|
||||||
-- Telescope
|
-- Telescope
|
||||||
@ -37,62 +26,6 @@ vim.keymap.set('n', '<leader>fs', telebuiltin.grep_string, { silent = true })
|
|||||||
vim.keymap.set('n', '<leader>o', telebuiltin.buffers, { silent = true })
|
vim.keymap.set('n', '<leader>o', telebuiltin.buffers, { silent = true })
|
||||||
vim.keymap.set('n', '<leader>fh', telebuiltin.help_tags, { silent = true })
|
vim.keymap.set('n', '<leader>fh', telebuiltin.help_tags, { silent = true })
|
||||||
|
|
||||||
-- Code
|
|
||||||
vim.keymap.set('n', '<leader>cs', '<cmd>Trouble symbols toggle focus=true win.position=right<cr>')
|
|
||||||
vim.keymap.set('n', '<leader>cl', '<cmd>Trouble lsp toggle focus=true win.position=right<cr>')
|
|
||||||
vim.keymap.set('n', '<leader>cd', '<cmd>Trouble diagnostics toggle focus=true win.position=bottom<cr>')
|
|
||||||
vim.keymap.set('n', '<leader>cq', '<cmd>Trouble quickfix toggle focus=true win.position=bottom<cr>')
|
|
||||||
vim.keymap.set('n', '<leader>cr', vim.lsp.buf.rename, { desc = 'LSP Rename' })
|
|
||||||
vim.keymap.set('n', '<leader>ct', vim.lsp.buf.type_definition, { desc = 'LSP Type Definition' })
|
|
||||||
vim.keymap.set('n', '<leader>cF', require("conform").format, { desc = 'LSP Format' })
|
|
||||||
vim.keymap.set('n', '<leader>cgi', vim.lsp.buf.implementation, { desc = 'LSP Implementation' })
|
|
||||||
vim.keymap.set('n', '<leader>cgd', vim.lsp.buf.definition, { desc = 'LSP Definition' })
|
|
||||||
vim.keymap.set('n', '<leader>cgD', vim.lsp.buf.declaration, { desc = 'LSP Declaration' })
|
|
||||||
vim.keymap.set('n', '<leader>cwa', vim.lsp.buf.add_workspace_folder, { desc = 'LSP Add Workspace Folder' })
|
|
||||||
vim.keymap.set('n', '<leader>cwl', vim.lsp.buf.list_workspace_folders, { desc = 'LSP List Workspace Folders' })
|
|
||||||
vim.keymap.set('n', '<leader>cwr', vim.lsp.buf.remove_workspace_folder, { desc = 'LSP Remove Workspace Folder' })
|
|
||||||
vim.keymap.set('n', '<leader>cws', vim.lsp.buf.workspace_symbol, { desc = 'LSP Workspace Symbol' })
|
|
||||||
vim.keymap.set('n', '<leader>ch', vim.lsp.buf.hover, { desc = 'LSP Hover' })
|
|
||||||
vim.keymap.set('n', '<leader>cH', vim.lsp.buf.signature_help, { desc = 'LSP Signature Help' })
|
|
||||||
vim.keymap.set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, { desc = 'LSP Code Action' })
|
|
||||||
vim.keymap.set('n', '<leader>cde', ToggleDiagnostics, { desc = 'Toggle Diagnostics' })
|
|
||||||
vim.keymap.set('n', '<leader>cf',
|
|
||||||
function()
|
|
||||||
local word = vim.fn.expand("<cword>")
|
|
||||||
require('telescope.builtin').live_grep({
|
|
||||||
default_text = word,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
)
|
|
||||||
vim.keymap.set('v', '<leader>cf',
|
|
||||||
function()
|
|
||||||
require('telescope.builtin').grep_string()
|
|
||||||
end
|
|
||||||
)
|
|
||||||
|
|
||||||
-- Copilot
|
|
||||||
local cop = require('copilot.panel')
|
|
||||||
local cos = require('copilot.suggestion')
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>ap', cop.toggle)
|
|
||||||
vim.keymap.set('n', '<leader>apn', cop.jump_next)
|
|
||||||
vim.keymap.set('n', '<leader>app', cop.jump_prev)
|
|
||||||
vim.keymap.set('n', '<leader>apr', cop.refresh)
|
|
||||||
|
|
||||||
-- vim.keymap.set('n', '<leader>as', cos.accept)
|
|
||||||
-- vim.keymap.set('n', '<leader>ast', cos.toggle_auto_trigger)
|
|
||||||
-- vim.keymap.set('n', '<leader>asl', cos.accept_word)
|
|
||||||
-- vim.keymap.set('n', '<leader>asw', cos.accept_line)
|
|
||||||
-- vim.keymap.set('n', '<leader>asn', cos.next)
|
|
||||||
-- vim.keymap.set('n', '<leader>asp', cos.prev)
|
|
||||||
-- vim.keymap.set('n', '<leader>asd', cos.dismiss)
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>ac', '<cmd>CopilotChatToggle<cr>')
|
|
||||||
vim.keymap.set('n', '<leader>acs', '<cmd>CopilotChatStop<cr>')
|
|
||||||
vim.keymap.set('n', '<leader>acr', '<cmd>CopilotChatReset<cr>')
|
|
||||||
vim.keymap.set('n', '<leader>acm', '<cmd>CopilotChatModels<cr>')
|
|
||||||
vim.keymap.set('n', '<leader>acp', '<cmd>CopilotChatPrompts<cr>')
|
|
||||||
|
|
||||||
-- Yanky
|
-- Yanky
|
||||||
vim.keymap.set({"n","x"}, "p", "<Plug>(YankyPutAfter)")
|
vim.keymap.set({"n","x"}, "p", "<Plug>(YankyPutAfter)")
|
||||||
vim.keymap.set({"n","x"}, "P", "<Plug>(YankyPutBefore)")
|
vim.keymap.set({"n","x"}, "P", "<Plug>(YankyPutBefore)")
|
||||||
@ -105,27 +38,5 @@ vim.keymap.set({"n","x"}, "y", "<Plug>(YankyYank)")
|
|||||||
-- Undotree
|
-- Undotree
|
||||||
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
|
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
|
||||||
|
|
||||||
-- DAP
|
-- nnoremap <silent> <leader>t :CtrlPBufTagAll<CR>
|
||||||
vim.keymap.set('n', "<Leader>db", function() require("dap").toggle_breakpoint() end)
|
-- nnoremap <silent> <leader>T :TagbarToggle<CR>
|
||||||
vim.keymap.set('n', "<leader>dB", function() require("dap").set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
|
|
||||||
vim.keymap.set('n', "<leader>dc", function() require("dap").continue() end)
|
|
||||||
vim.keymap.set('n', "<leader>da", function() require("dap").continue({ before = get_args }) end)
|
|
||||||
vim.keymap.set('n', "<leader>dC", function() require("dap").run_to_cursor() end)
|
|
||||||
vim.keymap.set('n', "<leader>dg", function() require("dap").goto_() end)
|
|
||||||
vim.keymap.set('n', "<leader>di", function() require("dap").step_into() end)
|
|
||||||
vim.keymap.set('n', "<leader>dj", function() require("dap").down() end)
|
|
||||||
vim.keymap.set('n', "<leader>dk", function() require("dap").up() end)
|
|
||||||
vim.keymap.set('n', "<leader>dl", function() require("dap").run_last() end)
|
|
||||||
vim.keymap.set('n', "<leader>do", function() require("dap").step_over() end)
|
|
||||||
vim.keymap.set('n', "<leader>dO", function() require("dap").step_out() end)
|
|
||||||
vim.keymap.set('n', "<leader>dP", function() require("dap").pause() end)
|
|
||||||
vim.keymap.set('n', "<leader>dr", function() require("dap").repl.toggle() end)
|
|
||||||
vim.keymap.set('n', "<leader>ds", function() require("dap").session() end)
|
|
||||||
vim.keymap.set('n', "<leader>dt", function() require("dap").terminate() end)
|
|
||||||
vim.keymap.set('n', "<leader>dw", function() require("dap.ui.widgets").hover() end)
|
|
||||||
|
|
||||||
vim.keymap.set('n', "<F5>", function() require("dap").continue() end)
|
|
||||||
vim.keymap.set('n', "<F11>", function() require("dap").step_into() end)
|
|
||||||
vim.keymap.set('n', "<F10>", function() require("dap").step_over() end)
|
|
||||||
vim.keymap.set('n', "<F12>", function() require("dap").step_out() end)
|
|
||||||
|
|
||||||
|
|||||||
331
nvim/plugins.lua
331
nvim/plugins.lua
@ -1,18 +1,5 @@
|
|||||||
-- vim.g.delimitMate_expand_space=1
|
vim.g.delimitMate_expand_space=1
|
||||||
-- vim.g.delimitMate_expand_cr = 1
|
vim.g.delimitMate_expand_cr = 1
|
||||||
|
|
||||||
require('mini.pairs').setup()
|
|
||||||
require('mini.align').setup()
|
|
||||||
require('mini.bracketed').setup()
|
|
||||||
require('mini.splitjoin').setup()
|
|
||||||
require('mini.move').setup()
|
|
||||||
require('mini.move').setup()
|
|
||||||
require('flash').setup()
|
|
||||||
require('ts-comments').setup()
|
|
||||||
|
|
||||||
local function is_wsl_env()
|
|
||||||
return os.getenv("WSL_DISTRO_NAME") ~= nil or os.getenv("WSL_INTEROP") ~= nil
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.g.tagbar_left=1
|
vim.g.tagbar_left=1
|
||||||
vim.g.tagbar_autoclose=1
|
vim.g.tagbar_autoclose=1
|
||||||
@ -22,12 +9,11 @@ vim.g.windowswap_map_keys=0
|
|||||||
|
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
local lspkind = require('lspkind')
|
local lspkind = require('lspkind')
|
||||||
local ls = require('luasnip')
|
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args)
|
expand = function(args)
|
||||||
ls.lsp_expand(args.body)
|
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -36,60 +22,23 @@ cmp.setup({
|
|||||||
documentation = cmp.config.window.bordered(),
|
documentation = cmp.config.window.bordered(),
|
||||||
},
|
},
|
||||||
|
|
||||||
-- mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
-- -- ['<Tab>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
-- }),
|
|
||||||
mapping = {
|
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
['<C-Space>'] = cmp.mapping.complete(),
|
||||||
['<C-e>'] = cmp.mapping.abort(),
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
['<CR>'] = cmp.mapping(function(fallback)
|
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||||
if cmp.visible() then
|
}),
|
||||||
if cmp.get_selected_entry() then
|
|
||||||
if ls.expandable() then
|
|
||||||
ls.expand()
|
|
||||||
else
|
|
||||||
cmp.confirm({
|
|
||||||
select = false,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end),
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif ls.locally_jumpable(1) then
|
|
||||||
ls.jump(1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif ls.locally_jumpable(-1) then
|
|
||||||
ls.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
},
|
|
||||||
|
|
||||||
sources = cmp.config.sources({
|
sources = cmp.config.sources({
|
||||||
{ name = 'nvim_lsp', priority = 1000 },
|
{ name = 'nvim_lsp' },
|
||||||
{ name = 'buffer', priority = 800, keyword_length = 2 },
|
{ name = 'vsnip' },
|
||||||
{ name = 'copilot', priority = 700 },
|
{ name = 'path' },
|
||||||
{ name = 'path', priority = 600 },
|
{ name = 'cmp_yanky' },
|
||||||
{ name = 'cmp_yanky', priority = 500 },
|
{ name = 'git' },
|
||||||
{ name = 'git', priority = 400 },
|
{ name = 'copilot' },
|
||||||
{ name = 'luasnip', priority = 300 },
|
-- }, {
|
||||||
{ name = 'nvim_lua', priority = 200 },
|
{ name = 'buffer', keyword_length = 2 },
|
||||||
}),
|
}),
|
||||||
|
|
||||||
formatting = {
|
formatting = {
|
||||||
@ -139,23 +88,19 @@ cmp.setup.cmdline(':', {
|
|||||||
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
local lspconfig = require("lspconfig")
|
local lspconfig = require("lspconfig")
|
||||||
-- lspconfig.svelte.setup({ capabilities = capabilities })
|
lspconfig.gopls.setup({ capabilities = capabilities })
|
||||||
-- lspconfig.flow.setup({ capabilities = capabilities })
|
lspconfig.svelte.setup({ capabilities = capabilities })
|
||||||
-- lspconfig.nil_ls.setup({ capabilities = capabilities })
|
lspconfig.pyright.setup({ capabilities = capabilities })
|
||||||
|
lspconfig.omnisharp.setup({ capabilities = capabilities })
|
||||||
capabilities.textDocument.foldingRange = {
|
lspconfig.clangd.setup({ capabilities = capabilities })
|
||||||
dynamicRegistration = false,
|
lspconfig.dockerls.setup({ capabilities = capabilities })
|
||||||
lineFoldingOnly = true
|
lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
|
||||||
}
|
lspconfig.flow.setup({ capabilities = capabilities })
|
||||||
|
lspconfig.marksman.setup({ capabilities = capabilities })
|
||||||
local language_servers = vim.lsp.get_clients() -- or list servers manually like {'gopls', 'clangd'}
|
lspconfig.als.setup({ capabilities = capabilities })
|
||||||
for _, ls in ipairs(language_servers) do
|
lspconfig.sqls.setup({ capabilities = capabilities })
|
||||||
require('lspconfig')[ls].setup({
|
lspconfig.yamlls.setup({ capabilities = capabilities })
|
||||||
capabilities = capabilities
|
lspconfig.nil_ls.setup({ capabilities = capabilities })
|
||||||
-- you can add other fields for setting up lsp server in this table
|
|
||||||
})
|
|
||||||
end
|
|
||||||
require('ufo').setup()
|
|
||||||
|
|
||||||
require("yanky").setup({
|
require("yanky").setup({
|
||||||
ring = {
|
ring = {
|
||||||
@ -172,15 +117,6 @@ require("yanky").setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
require("telescope").setup {
|
|
||||||
extensions = {
|
|
||||||
["ui-select"] = {
|
|
||||||
require("telescope.themes").get_dropdown {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
require("telescope").load_extension("ui-select")
|
|
||||||
require("telescope").load_extension("yank_history")
|
require("telescope").load_extension("yank_history")
|
||||||
|
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
@ -217,7 +153,7 @@ require('lualine').setup({
|
|||||||
},
|
},
|
||||||
ignore_focus = {},
|
ignore_focus = {},
|
||||||
always_divide_middle = true,
|
always_divide_middle = true,
|
||||||
globalstatus = true,
|
globalstatus = false,
|
||||||
refresh = {
|
refresh = {
|
||||||
statusline = 1000,
|
statusline = 1000,
|
||||||
tabline = 1000,
|
tabline = 1000,
|
||||||
@ -252,214 +188,3 @@ require("copilot").setup({
|
|||||||
panel = { enabled = false },
|
panel = { enabled = false },
|
||||||
})
|
})
|
||||||
require("copilot_cmp").setup()
|
require("copilot_cmp").setup()
|
||||||
require("CopilotChat").setup {
|
|
||||||
model = 'claude-3.7-sonnet',
|
|
||||||
}
|
|
||||||
|
|
||||||
vim.g.bullets_enabled_file_types = {
|
|
||||||
'markdown',
|
|
||||||
'text',
|
|
||||||
'gitcommit',
|
|
||||||
'scratch'
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
require("nvim-tree").setup({
|
|
||||||
sort = {
|
|
||||||
sorter = "case_sensitive",
|
|
||||||
},
|
|
||||||
view = {
|
|
||||||
width = 30,
|
|
||||||
},
|
|
||||||
renderer = {
|
|
||||||
group_empty = true,
|
|
||||||
},
|
|
||||||
-- filters = {
|
|
||||||
-- dotfiles = true,
|
|
||||||
-- },
|
|
||||||
})
|
|
||||||
|
|
||||||
require('gitsigns').setup {
|
|
||||||
signs = {
|
|
||||||
add = { text = '┃' },
|
|
||||||
change = { text = '┃' },
|
|
||||||
delete = { text = '_' },
|
|
||||||
topdelete = { text = '‾' },
|
|
||||||
changedelete = { text = '~' },
|
|
||||||
untracked = { text = '┆' },
|
|
||||||
},
|
|
||||||
signs_staged = {
|
|
||||||
add = { text = '┃' },
|
|
||||||
change = { text = '┃' },
|
|
||||||
delete = { text = '_' },
|
|
||||||
topdelete = { text = '‾' },
|
|
||||||
changedelete = { text = '~' },
|
|
||||||
untracked = { text = '┆' },
|
|
||||||
},
|
|
||||||
signs_staged_enable = true,
|
|
||||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
|
||||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
|
||||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
|
||||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
|
||||||
watch_gitdir = {
|
|
||||||
follow_files = true
|
|
||||||
},
|
|
||||||
auto_attach = true,
|
|
||||||
attach_to_untracked = false,
|
|
||||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
|
||||||
current_line_blame_opts = {
|
|
||||||
virt_text = true,
|
|
||||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
|
||||||
delay = 1000,
|
|
||||||
ignore_whitespace = false,
|
|
||||||
virt_text_priority = 100,
|
|
||||||
use_focus = true,
|
|
||||||
},
|
|
||||||
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
|
|
||||||
sign_priority = 6,
|
|
||||||
update_debounce = 100,
|
|
||||||
status_formatter = nil, -- Use default
|
|
||||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
|
||||||
preview_config = {
|
|
||||||
-- Options passed to nvim_open_win
|
|
||||||
style = 'minimal',
|
|
||||||
relative = 'cursor',
|
|
||||||
row = 0,
|
|
||||||
col = 1
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require("conform").setup({
|
|
||||||
formatters_by_ft = {
|
|
||||||
python = {"ruff_fix", "ruff_format", "ruff_organize_imports", lsp_format = "fallback"},
|
|
||||||
rust = {"rustfmt", lsp_format = "fallback"},
|
|
||||||
go = {"gofmt", "goimports", lsp_format = "fallback"},
|
|
||||||
lua = { "stylua", lsp_format = "fallback"},
|
|
||||||
},
|
|
||||||
})
|
|
||||||
require('lint').linters_by_ft = {
|
|
||||||
markdown = {'vale'},
|
|
||||||
}
|
|
||||||
require("trouble").setup()
|
|
||||||
require("todo-comments").setup()
|
|
||||||
|
|
||||||
require("dapui").setup()
|
|
||||||
require("nvim-dap-virtual-text").setup()
|
|
||||||
|
|
||||||
local dap, dapui = require("dap"), require("dapui")
|
|
||||||
dap.listeners.before.attach.dapui_config = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.launch.dapui_config = function()
|
|
||||||
dapui.open()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_terminated.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
dap.listeners.before.event_exited.dapui_config = function()
|
|
||||||
dapui.close()
|
|
||||||
end
|
|
||||||
|
|
||||||
dap.adapters.codelldb = {
|
|
||||||
type = 'server',
|
|
||||||
port = "${port}",
|
|
||||||
executable = {
|
|
||||||
command = "codelldb",
|
|
||||||
args = {"--port", "${port}"},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dap.configurations.zig = {
|
|
||||||
{
|
|
||||||
name = "Launch Zig Program",
|
|
||||||
type = "codelldb",
|
|
||||||
request = "launch",
|
|
||||||
program = function()
|
|
||||||
-- Prompts for the executable path when you start debugging
|
|
||||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/zig-out/bin/', 'file')
|
|
||||||
end,
|
|
||||||
cwd = "${workspaceFolder}",
|
|
||||||
stopOnEntry = false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
if vim.fn.has("mac") then
|
|
||||||
workspaces = {
|
|
||||||
{
|
|
||||||
name = "privat",
|
|
||||||
path = "~/Documents/notes/privat",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = "joplin",
|
|
||||||
path = "~/Documents/notes/fromjoplin",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
daily_notes = {
|
|
||||||
folder = "Journal",
|
|
||||||
date_format = "%Y-%m-%d",
|
|
||||||
default_tags = { "journal" },
|
|
||||||
template = "daily.md"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
if is_wsl_env() then
|
|
||||||
workspaces = {
|
|
||||||
{
|
|
||||||
name = "work",
|
|
||||||
path = "/mnt/c/Users/marti/Documents/notes/Work",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name = "privat",
|
|
||||||
path = "/mnt/c/Users/marti/Documents/notes/privat",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
daily_notes = {}
|
|
||||||
end
|
|
||||||
|
|
||||||
require("obsidian").setup({
|
|
||||||
workspaces = workspaces,
|
|
||||||
templates = {
|
|
||||||
folder = "_templates",
|
|
||||||
date_format = "%Y-%m-%d %a",
|
|
||||||
time_format = "%H:%M",
|
|
||||||
},
|
|
||||||
ui = {
|
|
||||||
checkboxes = {
|
|
||||||
[" "] = { char = "", hl_group = "ObsidianTodo" },
|
|
||||||
[">"] = { char = "", hl_group = "ObsidianRightArrow" },
|
|
||||||
["x"] = { char = "", hl_group = "ObsidianDone" },
|
|
||||||
["~"] = { char = "", hl_group = "ObsidianTilde" },
|
|
||||||
["!"] = { char = "", hl_group = "ObsidianImportant" },
|
|
||||||
["?"] = { char = "?", hl_group = "ObsidianImportant" }
|
|
||||||
},
|
|
||||||
},
|
|
||||||
disable_frontmatter = false,
|
|
||||||
note_frontmatter_func = function(note)
|
|
||||||
-- Add the title of the note as an alias.
|
|
||||||
if note.title then
|
|
||||||
note:add_alias(note.title)
|
|
||||||
end
|
|
||||||
|
|
||||||
local out = { id = note.id, tags = note.tags }
|
|
||||||
|
|
||||||
if note.metadata ~= nil and not vim.tbl_isempty(note.metadata) then
|
|
||||||
for k, v in pairs(note.metadata) do
|
|
||||||
out[k] = v
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
return out
|
|
||||||
end,
|
|
||||||
note_path_func = function(spec)
|
|
||||||
local path = spec.dir / spec.title
|
|
||||||
return path:with_suffix(".md")
|
|
||||||
end,
|
|
||||||
daily_notes = daily_notes,
|
|
||||||
})
|
|
||||||
|
|
||||||
require('render-markdown').setup({
|
|
||||||
enabled = true,
|
|
||||||
file_types = { 'markdown'},
|
|
||||||
completions = { lsp = { enabled = true } },
|
|
||||||
render_modes = { 'n', 'c', 't' },
|
|
||||||
})
|
|
||||||
|
|||||||
@ -1,338 +0,0 @@
|
|||||||
-------------------------
|
|
||||||
-------- OPTIONS --------
|
|
||||||
-------------------------
|
|
||||||
vim.opt.mouse = 'a'
|
|
||||||
vim.opt.history = 1000
|
|
||||||
-- vim.opt.ruler = true
|
|
||||||
-- vim.opt.ruler = true
|
|
||||||
-- vim.opt.number = true
|
|
||||||
vim.opt.showcmd = true
|
|
||||||
vim.opt.ttimeoutlen = 100
|
|
||||||
vim.opt.backspace = 'indent,eol,start'
|
|
||||||
vim.opt.tabstop = 2
|
|
||||||
vim.opt.expandtab = true
|
|
||||||
vim.opt.shiftwidth = 2
|
|
||||||
vim.opt.softtabstop = 2
|
|
||||||
vim.opt.autoindent = true
|
|
||||||
vim.opt.showmatch = true
|
|
||||||
vim.opt.incsearch = true
|
|
||||||
vim.opt.hlsearch = true
|
|
||||||
vim.opt.wrapscan = true
|
|
||||||
vim.opt.ignorecase = true
|
|
||||||
vim.opt.smartcase = true
|
|
||||||
vim.opt.hidden = true
|
|
||||||
vim.opt.splitright = true
|
|
||||||
vim.opt.splitbelow = true
|
|
||||||
vim.opt.swapfile = false
|
|
||||||
vim.opt.wildmode = 'longest,list'
|
|
||||||
vim.opt.wildignore = vim.opt.wildignore + 'main,*.o,*.d,*.aux,*.bbl,*.lof,*.loa,*.blg,*.fdb_latexmk,*.fls,*.tdo,*.pdf,*.pyc'
|
|
||||||
vim.opt.spell = false
|
|
||||||
vim.opt.foldmethod = 'syntax'
|
|
||||||
vim.opt.foldopen = vim.opt.foldopen - 'block'
|
|
||||||
vim.opt.foldlevel = 99
|
|
||||||
vim.opt.lazyredraw = true
|
|
||||||
vim.opt.listchars = 'eol:¬,tab:▸ ,trail:·'
|
|
||||||
vim.opt.fillchars = 'vert:|,fold: '
|
|
||||||
vim.opt.list = true
|
|
||||||
vim.opt.laststatus = 2
|
|
||||||
vim.opt.scrolloff = 8
|
|
||||||
vim.opt.background = 'light'
|
|
||||||
vim.opt.wrap = true
|
|
||||||
vim.opt.showbreak = '..'
|
|
||||||
vim.opt.errorbells = false
|
|
||||||
vim.opt.visualbell = false
|
|
||||||
vim.opt.title = true
|
|
||||||
vim.opt.autoread = true
|
|
||||||
vim.opt.syntax = 'on'
|
|
||||||
vim.opt.encoding = 'utf-8'
|
|
||||||
vim.opt.completeopt = 'menu,menuone,noselect'
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------
|
|
||||||
-------- CLIPBOARD ---------
|
|
||||||
----------------------------
|
|
||||||
-- if vim.fn.has("wsl") == 1 then
|
|
||||||
vim.opt.clipboard:append('unnamedplus')
|
|
||||||
-- end
|
|
||||||
|
|
||||||
|
|
||||||
----------------------------
|
|
||||||
-------- COMMANDS ----------
|
|
||||||
----------------------------
|
|
||||||
|
|
||||||
vim.cmd('filetype plugin indent on')
|
|
||||||
|
|
||||||
-- vim.cmd('colorscheme lucius')
|
|
||||||
-- vim.cmd('LuciusWhite')
|
|
||||||
|
|
||||||
|
|
||||||
------------------------------
|
|
||||||
---------- AUTOGROUPS --------
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
vim.api.nvim_create_augroup('VimIntern', { clear = true })
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd({'FocusGained', 'BufEnter', 'CursorMoved', 'CursorMovedI', 'CursorHold', 'CursorHoldI'}, {
|
|
||||||
group = 'VimIntern',
|
|
||||||
pattern = '*',
|
|
||||||
command = 'silent! checktime'
|
|
||||||
})
|
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('BufEnter', {
|
|
||||||
group = 'VimIntern',
|
|
||||||
pattern = '*',
|
|
||||||
command = 'silent! lcd %:p:h'
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
-----------------------------
|
|
||||||
---------- FUNCTIONS --------
|
|
||||||
-----------------------------
|
|
||||||
|
|
||||||
vim.api.nvim_create_user_command('TrimWhiteSpace', function()
|
|
||||||
vim.cmd('%s/\\s\\+$//e')
|
|
||||||
end, {})
|
|
||||||
vim.g.mapleader = " "
|
|
||||||
|
|
||||||
-- Navigation
|
|
||||||
vim.keymap.set('n', 'j', 'gj', {})
|
|
||||||
vim.keymap.set('n', 'k', 'gk', {})
|
|
||||||
vim.keymap.set('v', 'j', 'gj', {})
|
|
||||||
vim.keymap.set('v', 'k', 'gk', {})
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<C-h>', '<C-w>h', {})
|
|
||||||
vim.keymap.set('n', '<C-j>', '<C-w>j', {})
|
|
||||||
vim.keymap.set('n', '<C-k>', '<C-w>k', {})
|
|
||||||
vim.keymap.set('n', '<C-l>', '<C-w>l', {})
|
|
||||||
|
|
||||||
vim.keymap.set('n', '<leader>s', ':call WindowSwap#EasyWindowSwap()<CR>', {})
|
|
||||||
|
|
||||||
-- Convenience
|
|
||||||
vim.keymap.set('n', '<leader>w', ':w<CR>', { silent = true })
|
|
||||||
vim.keymap.set('n', '<leader>F', ':e.<CR>', {})
|
|
||||||
vim.keymap.set('n', 'Y', 'y$', {})
|
|
||||||
|
|
||||||
-- Telescope
|
|
||||||
local telebuiltin = require('telescope.builtin')
|
|
||||||
vim.keymap.set('n', '<leader>ff', telebuiltin.find_files, { silent = true })
|
|
||||||
vim.keymap.set('n', '<leader>fg', telebuiltin.live_grep, { silent = true })
|
|
||||||
vim.keymap.set('n', '<leader>fs', telebuiltin.grep_string, { silent = true })
|
|
||||||
vim.keymap.set('n', '<leader>o', telebuiltin.buffers, { silent = true })
|
|
||||||
vim.keymap.set('n', '<leader>fh', telebuiltin.help_tags, { silent = true })
|
|
||||||
|
|
||||||
---- Yanky
|
|
||||||
--vim.keymap.set({"n","x"}, "p", "<Plug>(YankyPutAfter)")
|
|
||||||
--vim.keymap.set({"n","x"}, "P", "<Plug>(YankyPutBefore)")
|
|
||||||
--vim.keymap.set({"n","x"}, "gp", "<Plug>(YankyGPutAfter)")
|
|
||||||
--vim.keymap.set({"n","x"}, "gP", "<Plug>(YankyGPutBefore)")
|
|
||||||
--vim.keymap.set("n", "<c-n>", "<Plug>(YankyCycleForward)")
|
|
||||||
--vim.keymap.set("n", "<c-p>", "<Plug>(YankyCycleBackward)")
|
|
||||||
--vim.keymap.set({"n","x"}, "y", "<Plug>(YankyYank)")
|
|
||||||
|
|
||||||
-- Undotree
|
|
||||||
vim.keymap.set('n', '<leader>u', vim.cmd.UndotreeToggle)
|
|
||||||
|
|
||||||
---- nnoremap <silent> <leader>t :CtrlPBufTagAll<CR>
|
|
||||||
---- nnoremap <silent> <leader>T :TagbarToggle<CR>
|
|
||||||
vim.g.delimitMate_expand_space=1
|
|
||||||
vim.g.delimitMate_expand_cr = 1
|
|
||||||
|
|
||||||
vim.g.tagbar_left=1
|
|
||||||
vim.g.tagbar_autoclose=1
|
|
||||||
vim.g.tagbar_autofocus=1
|
|
||||||
|
|
||||||
--vim.g.windowswap_map_keys=0
|
|
||||||
|
|
||||||
local cmp = require('cmp')
|
|
||||||
local lspkind = require('lspkind')
|
|
||||||
|
|
||||||
--cmp.setup({
|
|
||||||
-- snippet = {
|
|
||||||
-- expand = function(args)
|
|
||||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
|
||||||
-- end,
|
|
||||||
-- },
|
|
||||||
|
|
||||||
-- window = {
|
|
||||||
-- completion = cmp.config.window.bordered(),
|
|
||||||
-- documentation = cmp.config.window.bordered(),
|
|
||||||
-- },
|
|
||||||
|
|
||||||
-- mapping = cmp.mapping.preset.insert({
|
|
||||||
-- ['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
-- ['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
-- ['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
-- ['<C-e>'] = cmp.mapping.abort(),
|
|
||||||
-- ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
-- }),
|
|
||||||
|
|
||||||
-- sources = cmp.config.sources({
|
|
||||||
-- { name = 'nvim_lsp' },
|
|
||||||
-- { name = 'vsnip' },
|
|
||||||
-- { name = 'path' },
|
|
||||||
-- { name = 'cmp_yanky' },
|
|
||||||
-- { name = 'git' },
|
|
||||||
-- { name = 'copilot' },
|
|
||||||
-- -- }, {
|
|
||||||
-- { name = 'buffer', keyword_length = 2 },
|
|
||||||
-- }),
|
|
||||||
|
|
||||||
-- formatting = {
|
|
||||||
-- format = lspkind.cmp_format({
|
|
||||||
-- -- mode = "symbol_text",
|
|
||||||
-- mode = "symbol",
|
|
||||||
-- menu = ({
|
|
||||||
-- buffer = "[buf]",
|
|
||||||
-- nvim_lsp = "[lsp]",
|
|
||||||
-- vsnip = "[snip]",
|
|
||||||
-- nvim_lua = "[lua]",
|
|
||||||
-- latex_symbols = "[tex]",
|
|
||||||
-- path = "[path]",
|
|
||||||
-- cmp_yanky = "[yank]",
|
|
||||||
-- copilot = "[copilot]",
|
|
||||||
-- }),
|
|
||||||
-- symbol_map = { Copilot = "" }
|
|
||||||
-- }),
|
|
||||||
-- },
|
|
||||||
--})
|
|
||||||
|
|
||||||
---- -- Set configuration for specific filetype.
|
|
||||||
---- cmp.setup.filetype('gitcommit', {
|
|
||||||
---- sources = cmp.config.sources({
|
|
||||||
---- { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
|
|
||||||
---- }, {
|
|
||||||
---- { name = 'buffer' },
|
|
||||||
---- })
|
|
||||||
---- })
|
|
||||||
|
|
||||||
--cmp.setup.cmdline({ '/', '?' }, {
|
|
||||||
-- mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
-- sources = {
|
|
||||||
-- { name = 'buffer' }
|
|
||||||
-- }
|
|
||||||
--})
|
|
||||||
|
|
||||||
--cmp.setup.cmdline(':', {
|
|
||||||
-- mapping = cmp.mapping.preset.cmdline(),
|
|
||||||
-- sources = cmp.config.sources({
|
|
||||||
-- { name = 'path' }
|
|
||||||
-- }, {
|
|
||||||
-- { name = 'cmdline' }
|
|
||||||
-- }),
|
|
||||||
-- matching = { disallow_symbol_nonprefix_matching = false }
|
|
||||||
--})
|
|
||||||
|
|
||||||
--local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
local lspconfig = require("lspconfig")
|
|
||||||
--lspconfig.gopls.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.svelte.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.pyright.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.omnisharp.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.clangd.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.dockerls.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.docker_compose_language_service.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.flow.setup({ capabilities = capabilities })
|
|
||||||
lspconfig.marksman.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.als.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.sqls.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.yamlls.setup({ capabilities = capabilities })
|
|
||||||
--lspconfig.nil_ls.setup({ capabilities = capabilities })
|
|
||||||
|
|
||||||
require("yanky").setup({
|
|
||||||
ring = {
|
|
||||||
history_length = 100,
|
|
||||||
storage = "shada",
|
|
||||||
sync_with_numbered_registers = true,
|
|
||||||
cancel_event = "update",
|
|
||||||
},
|
|
||||||
system_clipboard = {
|
|
||||||
sync_with_ring = true,
|
|
||||||
},
|
|
||||||
preserve_cursor_position = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
|
|
||||||
require("telescope").load_extension("yank_history")
|
|
||||||
|
|
||||||
require'nvim-treesitter.configs'.setup {
|
|
||||||
-- ensure_installed = { "lua", "vim", "help" },
|
|
||||||
ensure_installed = {},
|
|
||||||
sync_install = false,
|
|
||||||
auto_install = false,
|
|
||||||
|
|
||||||
|
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
|
|
||||||
disable = function(lang, buf)
|
|
||||||
local max_filesize = 100 * 1024 -- 100 KB
|
|
||||||
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
|
|
||||||
if ok and stats and stats.size > max_filesize then
|
|
||||||
return true
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
|
|
||||||
additional_vim_regex_highlighting = false,
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
require('lualine').setup({
|
|
||||||
options = {
|
|
||||||
icons_enabled = true,
|
|
||||||
theme = 'Tomorrow',
|
|
||||||
component_separators = { left = '', right = ''},
|
|
||||||
section_separators = { left = '', right = ''},
|
|
||||||
disabled_filetypes = {
|
|
||||||
statusline = {},
|
|
||||||
winbar = {},
|
|
||||||
},
|
|
||||||
ignore_focus = {},
|
|
||||||
always_divide_middle = true,
|
|
||||||
globalstatus = false,
|
|
||||||
refresh = {
|
|
||||||
statusline = 1000,
|
|
||||||
tabline = 1000,
|
|
||||||
winbar = 1000,
|
|
||||||
}
|
|
||||||
},
|
|
||||||
sections = {
|
|
||||||
lualine_a = {'mode'},
|
|
||||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
|
||||||
lualine_c = {'filename'},
|
|
||||||
lualine_x = {'encoding', 'fileformat', 'filetype'},
|
|
||||||
lualine_y = {'progress'},
|
|
||||||
lualine_z = {'location'}
|
|
||||||
},
|
|
||||||
inactive_sections = {
|
|
||||||
lualine_a = {},
|
|
||||||
lualine_b = {},
|
|
||||||
lualine_c = {'filename'},
|
|
||||||
lualine_x = {'location'},
|
|
||||||
lualine_y = {},
|
|
||||||
lualine_z = {}
|
|
||||||
},
|
|
||||||
tabline = {},
|
|
||||||
winbar = {},
|
|
||||||
inactive_winbar = {},
|
|
||||||
extensions = {}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
--require("copilot").setup({
|
|
||||||
-- suggestion = { enabled = false },
|
|
||||||
-- panel = { enabled = false },
|
|
||||||
--})
|
|
||||||
--require("copilot_cmp").setup()
|
|
||||||
|
|
||||||
require("aerial").setup({
|
|
||||||
-- optionally use on_attach to set keymaps when aerial has attached to a buffer
|
|
||||||
on_attach = function(bufnr)
|
|
||||||
-- Jump forwards/backwards with '{' and '}'
|
|
||||||
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
|
|
||||||
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
-- You probably also want to set a keymap to toggle aerial
|
|
||||||
vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>")
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user