Fixed NeoVim, updated fastfetch, now using ghostty

This commit is contained in:
2025-01-01 16:32:23 -08:00
parent b0d87cc4e2
commit a01c3ccfb3
11 changed files with 628 additions and 635 deletions
+1
View File
@@ -157,6 +157,7 @@
moonlight-qt
qFlipper
android-tools
remmina
];
fonts.packages = with pkgs; [
Generated
+294 -10
View File
@@ -1,5 +1,26 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1728330715,
"narHash": "sha256-xRJ2nPOXb//u1jaBnDP56M7v5ldavjbtR6lfGqSvcKg=",
"owner": "numtide",
"repo": "devshell",
"rev": "dd6b80932022cea34a019e2bb32f6fa9e494dfef",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-compat": {
"flake": false,
"locked": {
@@ -16,6 +37,41 @@
"type": "github"
}
},
"flake-compat_2": {
"locked": {
"lastModified": 1696426674,
"narHash": "sha256-kvjfFW7WAETZlt09AgDn1MrtKzP7t90Vf7vypd3OL1U=",
"rev": "0f9255e01c2351cc7d116c072cb317785dd33b33",
"revCount": 57,
"type": "tarball",
"url": "https://api.flakehub.com/f/pinned/edolstra/flake-compat/1.0.1/018afb31-abd1-7bff-a5e4-cff7e18efb7a/source.tar.gz"
},
"original": {
"type": "tarball",
"url": "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"
}
},
"flake-parts": {
"inputs": {
"nixpkgs-lib": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733312601,
"narHash": "sha256-4pDvzqnegAfRkPwO3wmwBhVi/Sye1mzps0zHWYnP88c=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "205b12d8b7cd4802fbcb8e8ef6a0f1408781a4f9",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "flake-parts",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems"
@@ -34,6 +90,24 @@
"type": "github"
}
},
"flake-utils_2": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1731533236,
"narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "11707dc2f618dd54ca8739b309ec4fc024de578b",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"ghostty": {
"inputs": {
"flake-compat": "flake-compat",
@@ -42,11 +116,11 @@
"zig": "zig"
},
"locked": {
"lastModified": 1735597925,
"narHash": "sha256-znyKiXlrkPL+2xQwAR6G4/DKCgsutyIPo+d1dGeh2W4=",
"lastModified": 1735765328,
"narHash": "sha256-f4LI34cXP8nOTi4Va6GPUFaJYf0qGbabk+OeUddsfuk=",
"owner": "ghostty-org",
"repo": "ghostty",
"rev": "478fe3917c2882a1c321f9d1eec808b71698974d",
"rev": "94599102e9fb8247af08cbbbcb7ee25e3d31e1bd",
"type": "github"
},
"original": {
@@ -55,6 +129,58 @@
"type": "github"
}
},
"git-hooks": {
"inputs": {
"flake-compat": [
"nixvim",
"flake-compat"
],
"gitignore": "gitignore",
"nixpkgs": [
"nixvim",
"nixpkgs"
],
"nixpkgs-stable": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1734797603,
"narHash": "sha256-ulZN7ps8nBV31SE+dwkDvKIzvN6hroRY8sYOT0w+E28=",
"owner": "cachix",
"repo": "git-hooks.nix",
"rev": "f0f0dc4920a903c3e08f5bdb9246bb572fcae498",
"type": "github"
},
"original": {
"owner": "cachix",
"repo": "git-hooks.nix",
"type": "github"
}
},
"gitignore": {
"inputs": {
"nixpkgs": [
"nixvim",
"git-hooks",
"nixpkgs"
]
},
"locked": {
"lastModified": 1709087332,
"narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=",
"owner": "hercules-ci",
"repo": "gitignore.nix",
"rev": "637db329424fd7e46cf4185293b9cc8c88c95394",
"type": "github"
},
"original": {
"owner": "hercules-ci",
"repo": "gitignore.nix",
"type": "github"
}
},
"home-manager": {
"inputs": {
"nixpkgs": [
@@ -62,11 +188,11 @@
]
},
"locked": {
"lastModified": 1731880681,
"narHash": "sha256-FmYTkIyPBUxSWgA7DPIVTsCCMvSSbs56yOtHpLNSnKg=",
"lastModified": 1735344290,
"narHash": "sha256-oJDtWPH1oJT34RJK1FSWjwX4qcGOBRkcNQPD0EbSfNM=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "aecd341dfead1c3ef7a3c15468ecd71e8343b7c6",
"rev": "613691f285dad87694c2ba1c9e6298d04736292d",
"type": "github"
},
"original": {
@@ -76,13 +202,83 @@
"type": "github"
}
},
"home-manager_2": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1735381016,
"narHash": "sha256-CyCZFhMUkuYbSD6bxB/r43EdmDE7hYeZZPTCv0GudO4=",
"owner": "nix-community",
"repo": "home-manager",
"rev": "10e99c43cdf4a0713b4e81d90691d22c6a58bdf2",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "home-manager",
"type": "github"
}
},
"ixx": {
"inputs": {
"flake-utils": [
"nixvim",
"nuschtosSearch",
"flake-utils"
],
"nixpkgs": [
"nixvim",
"nuschtosSearch",
"nixpkgs"
]
},
"locked": {
"lastModified": 1729958008,
"narHash": "sha256-EiOq8jF4Z/zQe0QYVc3+qSKxRK//CFHMB84aYrYGwEs=",
"owner": "NuschtOS",
"repo": "ixx",
"rev": "9fd01aad037f345350eab2cd45e1946cc66da4eb",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"ref": "v0.0.6",
"repo": "ixx",
"type": "github"
}
},
"nix-darwin": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1735478292,
"narHash": "sha256-Ys9pSP9ch0SthhpbjnkCSJ9ZLfaNKnt/dcy7swjmS1A=",
"owner": "lnl7",
"repo": "nix-darwin",
"rev": "71a3a075e3229a7518d76636bb762aef2bcb73ac",
"type": "github"
},
"original": {
"owner": "lnl7",
"repo": "nix-darwin",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1731755305,
"narHash": "sha256-v5P3dk5JdiT+4x69ZaB18B8+Rcu3TIOrcdG4uEX7WZ8=",
"lastModified": 1735669367,
"narHash": "sha256-tfYRbFhMOnYaM4ippqqid3BaLOXoFNdImrfBfCp4zn0=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "057f63b6dc1a2c67301286152eb5af20747a9cb4",
"rev": "edf04b75c13c2ac0e54df5ec5c543e300f76f1c9",
"type": "github"
},
"original": {
@@ -124,11 +320,63 @@
"type": "github"
}
},
"nixvim": {
"inputs": {
"devshell": "devshell",
"flake-compat": "flake-compat_2",
"flake-parts": "flake-parts",
"git-hooks": "git-hooks",
"home-manager": "home-manager_2",
"nix-darwin": "nix-darwin",
"nixpkgs": [
"nixpkgs"
],
"nuschtosSearch": "nuschtosSearch",
"treefmt-nix": "treefmt-nix"
},
"locked": {
"lastModified": 1735734686,
"narHash": "sha256-VQ/fyItyoffCXR81TXMWzmRDxaeQsSNtg+sp5WsQf+o=",
"owner": "nix-community",
"repo": "nixvim",
"rev": "3399ebfedd741456f45de6148fc36e7fcc74fcfa",
"type": "github"
},
"original": {
"owner": "nix-community",
"repo": "nixvim",
"type": "github"
}
},
"nuschtosSearch": {
"inputs": {
"flake-utils": "flake-utils_2",
"ixx": "ixx",
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1733773348,
"narHash": "sha256-Y47y+LesOCkJaLvj+dI/Oa6FAKj/T9sKVKDXLNsViPw=",
"owner": "NuschtOS",
"repo": "search",
"rev": "3051be7f403bff1d1d380e4612f0c70675b44fc9",
"type": "github"
},
"original": {
"owner": "NuschtOS",
"repo": "search",
"type": "github"
}
},
"root": {
"inputs": {
"ghostty": "ghostty",
"home-manager": "home-manager",
"nixpkgs": "nixpkgs"
"nixpkgs": "nixpkgs",
"nixvim": "nixvim"
}
},
"systems": {
@@ -146,6 +394,42 @@
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"treefmt-nix": {
"inputs": {
"nixpkgs": [
"nixvim",
"nixpkgs"
]
},
"locked": {
"lastModified": 1735135567,
"narHash": "sha256-8T3K5amndEavxnludPyfj3Z1IkcFdRpR23q+T0BVeZE=",
"owner": "numtide",
"repo": "treefmt-nix",
"rev": "9e09d30a644c57257715902efbb3adc56c79cf28",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "treefmt-nix",
"type": "github"
}
},
"zig": {
"inputs": {
"flake-compat": [
+6 -1
View File
@@ -9,12 +9,17 @@
inputs.nixpkgs.follows = "nixpkgs";
};
nixvim = {
url = "github:nix-community/nixvim";
inputs.nixpkgs.follows = "nixpkgs";
};
ghostty = {
url = "github:ghostty-org/ghostty";
};
};
outputs = { self, nixpkgs, home-manager, ghostty, ... }@inputs: {
outputs = { self, nixpkgs, home-manager, nixvim, ghostty, ... }@inputs: {
nixosConfigurations = {
default = nixpkgs.lib.nixosSystem {
specialArgs = {inherit inputs;};
-96
View File
@@ -1,96 +0,0 @@
{
programs = {
fastfetch = {
enable = true;
settings = {
logo = {
source = "/etc/nixos/home-manager/commands/fastfetch/assets/image.png";
type = "kitty";
height = 20;
padding = {
top = 2;
left= 3;
};
};
display = {
separator = "";
key = {
width = 15;
};
};
modules = [
{
key = ;
"type": "custom"
},
{
// draw borders first to make colors of left and right border consistant
"key": " \u001b[11D\u001b[31m user",
"type": "title",
"format": "{1}"
},
{
"key": " \u001b[11D\u001b[32m󰇅 hname",
"type": "title",
"format": "{2}"
},
{
"key": " \u001b[11D\u001b[33m󰅐 uptime",
"type": "uptime"
},
{
"key": " \u001b[11D\u001b[34m󰟾 distro",
"type": "os"
},
{
"key": " \u001b[11D\u001b[35m kernel",
"type": "kernel"
},
{
"key": " \u001b[11D\u001b[36m󰇄 desktop",
"type": "de"
},
{
"key": " \u001b[11D\u001b[31m term",
"type": "terminal"
},
{
"key": " \u001b[11D\u001b[32m shell",
"type": "shell"
},
{
"key": " \u001b[11D\u001b[33m󰍛 battery",
"type": "battery"
},
{
"key": " \u001b[11D\u001b[34m󰉉 disk",
"type": "disk",
"folders": "/"
},
{
"key": " \u001b[11D\u001b[35m memory",
"type": "memory"
},
{
"key": " \u001b[11D\u001b[36m󰩟 network",
"type": "localip",
"format": "{1} ({4})"
},
{
"key": "",
"type": "custom"
},
{
"key": " \u001b[11D\u001b[m colors",
"type": "colors",
"symbol": "circle"
},
{
"key": "",
"type": "custom"
}
];
};
};
};
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

@@ -4,7 +4,7 @@
enable = true;
settings = {
logo = {
source = "/etc/nixos/home-manager/commands/fastfetch/assets/image.png";
source = "/etc/nixos/home-manager/fastfetch/assets/evangelion-mecha-neon-genesis-desktop-wallpaper-cover.jpg";
type = "kitty";
height = 20;
padding = {
+4 -3
View File
@@ -1,11 +1,12 @@
{ config, pkgs, ... }:
{ config, pkgs, inputs, ... }:
{
imports = [
./cli-tools.nix
./fastfetch.nix
./fastfetch/fastfetch.nix
./direnv.nix
./neovim-nvim
./nixvim/nixvim.nix
inputs.nixvim.homeManagerModules.nixvim
];
# Home Manager needs a bit of information about you and the paths it should
-83
View File
@@ -1,83 +0,0 @@
{ config, pkgs, ...}:
let
link = config.lib.file.mkOutOfStoreSymlink;
ccryptor-nvim = pkgs.vimUtils.buildVimPlugin {
name = "ccryptor.nvim";
src = pkgs.fetchFromGitHub {
owner = "kurotych";
repo = "ccryptor.nvim";
rev = "4b2cd7fbf54eb8385d023b7411be4a46ab0eded8";
hash = "sha256-CUjM8cr+SbgSd+NFbHysxogbq0QPJ/pXdSGo4p5AuHo=";
};
};
telescope-ag = pkgs.vimUtils.buildVimPlugin {
name = "telescope-ag";
src = pkgs.fetchFromGitHub {
owner = "kelly-lin";
repo = "telescope-ag";
rev = "7d25064da3c7689461bcfa89ad1f08548415193d";
hash = "sha256-xOgiiTElHLgx7Gwp6aR0Ipfanq6ZTTgiQv9Zs3LTb1g=";
};
};
in
{
programs.ripgrep.enable = true;
programs.fd.enable = true; # find replacement; depends on ripgrep and for telescope
programs.fzf.enable = true;
programs.neovim = {
enable = true;
viAlias = true;
vimAlias = true;
vimdiffAlias = true;
# colorschemes.everforest = {
# enable = true;
# settings = {
# background = "soft";
# transparent_background = 1;
# };
# };
plugins = with pkgs.vimPlugins; [
#gruvbox # theme
#tokyonight-nvim
sonokai
vim-nix # nix language
vim-lsp # lsp
telescope-nvim # fuzzy finder
telescope-fzf-native-nvim
# copilot-vim # copilot, no more copilot, bad ai go google 240809
oil-nvim # OIL file manager, view link for help https://github.com/stevearc/oil.nvim?tab=readme-ov-file
lazygit-nvim # git support
markdown-preview-nvim # markdown preview ... seems to be ok but can't use unless running X11 server
# tmux navigator, depends on tmux plugin in config
vim-tmux-navigator
vim-commentary # comment out lines
vim-windowswap ## <leader>ww to swap windows
git-blame-nvim # git blame
limelight-vim # used for highlighting the current line
leap-nvim # fast, two char nav
# adding a gitlinker that lets me grab URLS
gitlinker-nvim
fzf-lua
# DIY Plugins
# telescope-ag
ccryptor-nvim
# conflict marker vim
conflict-marker-vim
toggleterm-nvim
];
};
home.file.".config/nvim/init.lua" = {
enable = true;
source = link ./nvim.lua;
};
}
-441
View File
@@ -1,441 +0,0 @@
local function get_current_user()
local user = os.getenv("USER") or os.getenv("USERNAME")
return user or "Unknown"
end
local current_user = get_current_user()
require("ccryptor").setup({
dir_path = '/home/' .. current_user .. '/gitprojects/personal/personal_notes/journal/',
})
--------------------------------------------------------------------------------
-- oil setup
require("oil").setup({
cleanup_delay_ms = 1000,
view_options = {
show_hidden = true
}
})
vim.keymap.set("n", "-", "<CMD>Oil --float<CR>", { desc = "Open parent directory" })
--------------------------------------------------------------------------------
-- glow setup: https://github.com/ellisonleao/glow.nvim?tab=readme-ov-file#setup
--require('glow').setup({
-- width = 80,
-- height = 100,
-- width_ratio = 1, -- maximum width of the Glow window compared to the nvim window size (overrides `width`)
-- height_ratio = 1,
--})
--------------------------------------------------------------------------------
-- TELESCOPE FUNCTIONS
-- part of the config
-- Set your fixed file path here
local actions = require('telescope.actions')
local action_state = require('telescope.actions.state')
-- Set your fixed file path here
local fixed_path = "~/gitprojects/personal/"
function recent_files()
require('telescope.builtin').find_files({
prompt_title = "Recent Files",
cwd = fixed_path,
find_command = { "sh", "-c", "find " .. fixed_path .. " -type f -not -path '*/\\.git/*' -printf '%T@ %p\n' | sort -n -r | cut -d' ' -f2-" },
})
end
local custom_actions = {}
custom_actions.insert_path = function(prompt_bufnr)
local entry = action_state.get_selected_entry()
actions.close(prompt_bufnr)
vim.api.nvim_put({ entry.value }, '', false, true)
end
-- telescope config
require('telescope').setup({
defaults = {
scroll_strategy = 'limit',
layout_strategy = 'vertical',
layout_config = {
mirror = true,
prompt_position = 'bottom',
preview_height = 0.65,
width = 0.75,
height = 0.95,
},
mappings = {
i = {
-- Map Ctrl-i to insert_path in insert mode
["<M-i>"] = custom_actions.insert_path
},
n = {
-- Map i to insert_path in normal mode
["<M-i>"] = custom_actions.insert_path
},
},
}
})
require('telescope').load_extension('fzf')
------------------------------------------------------------------------------
-- fzf-vim config
local actions = require "fzf-lua.actions"
require'fzf-lua'.setup {
winopts = {
height = 0.95,
preview = {
layout = 'vertical',
},
},
}
------------------------------------------------------------------------------
-- leap
require('leap').create_default_mappings()
------------------------------------------------------------------------------
-- vim keybindings below
vim.cmd [[
set splitbelow
set splitright
let mapleader = "\<Space>"
colorscheme sonokai
set noswapfile
" turning mouse off so that I can click in and it won't move my cursor
set mouse=
" set clipboard=unnamedplus
set number relativenumber
set scrolloff=5
set nowrap
nnoremap <Leader>z :set wrap!<CR>
" toggle side numbers
nnoremap <Leader>n :call ToggleSidenums()<CR>
function! ToggleSidenums()
if &relativenumber
set norelativenumber
else
set relativenumber " number " used to use number when I was hiding these
endif
endfunction
" toggle listchars
nnoremap <Leader>N :call ToggleListchars()<CR>
function! ToggleListchars()
if &list
set listchars= nolist
else
set list listchars=tab:>␣,trail:~,extends:>,precedes:<,space:·
endif
endfunction
" rebind J and K to be { and } for jumping whitespace
vnoremap J }
vnoremap K {
nnoremap J }
nnoremap K {
" copy , pasting is handling by going to insert and hitting "ctrl + shift + v"
vnoremap c "*y
vnoremap <Leader>c "*y
nnoremap <Leader>c "*y
vnoremap y "*y
" pasting just in case
vnoremap <Leader>v "*p
nnoremap <Leader>v "*p
" cutting
vnoremap <Leader>x "*d
nnoremap <Leader>x "*d
" saving file
nnoremap <Leader>w :wa<CR>
nnoremap <Leader>s :wa<CR>
" closing
nnoremap <Leader>C :close<CR>
nnoremap <Leader>q :wq<CR>
nnoremap <Leader>Q :q!<CR>
" copilot
let g:copilot_filetypes = {
\ '*': v:true,
\ }
" tabs and buffers
" tab switching using ctrl + tab
nnoremap <Leader>k :tabprevious<CR>
nnoremap <Leader>j :tabnext<CR>
" tab with just hold
nnoremap <M-<> :tabprevious<CR>
nnoremap <>->> :tabnext<CR>
" vim-windowswap
let g:windowswap_map_keys = 0
nnoremap <silent> <leader>WW :call WindowSwap#EasyWindowSwap()<CR>
" vim markdown renderer
" let g:vim_markdown_folding_disabled = 1
" let g:vim_markdown_toc_autofit = 1
" let g:vim_markdown_follow_anchor = 1
" let g:vim_markdown_no_extensions_in_markdown = 1
" let g:vim_markdown_strikethrough = 1
" let g:vim_markdown_autowrite = 1
" markdown-renderer
" use a custom port to start server or empty for random
let g:mkdp_open_to_the_world = 1
let g:mkdp_port = '3010'
let g:mkdp_open_ip = $MARKDOWN_IP
let g:mkdp_echo_preview_url = 1
let g:mkdp_browser = 'none'
nnoremap <Leader>m :MarkdownPreviewToggle<CR>
nnoremap <Leader>, :tabprevious<CR>
nnoremap <Leader>. :tabnext<CR>
" rebind :bprev and :bnext
nnoremap <Leader>J :bprev<CR>
nnoremap <Leader>K :bnext<CR>
" copilot remap autocomplete to ctrl + l when in insert mode
imap <silent><script><expr> <C-l> copilot#Accept("\<CR>")
let g:copilot_no_tab_map = v:true
" Telescope searching
" clear the highlighting from search
nnoremap <Leader><Enter> :nohlsearch<CR> " telescope
" map <Leader>F to search for the current word under the cursor
nnoremap <Leader>W viw"0y<space>:Telescope grep_string<CR><Esc>
"nnoremap <Leader>F :Telescope grep_string<CR><Esc>
nnoremap <Leader>F :FzfLua grep_visual<CR>
nnoremap <Leader>f :Telescope live_grep<CR>
nnoremap <Leader>p :Telescope find_files<CR>
inoremap <M-i> <Esc>:Telescope find_files hidden=true<CR>
noremap <M-i> <Esc>:Telescope find_files hidden=true<CR>
nnoremap <Leader>o :Telescope oldfiles<CR><Esc>
nnoremap <Leader>C :Telescope current_buffer_fuzzy_find<CR>
" reload configuration
nnoremap <Leader>R :source ~/.config/nvim/init.lua<CR>
" Function to scroll approximately 1/3 of the page down
function! ScrollThirdDown()
let l:height = winheight(0)
let l:scroll_amount = l:height / 3
execute "normal! " . l:scroll_amount . "\<C-E>"
endfunction
" Function to scroll approximately 1/3 of the page up
function! ScrollThirdUp()
let l:height = winheight(0)
let l:scroll_amount = l:height / 3
execute "normal! " . l:scroll_amount . "\<C-Y>"
endfunction
" Map <C-D> to scroll down 1/3 of the page
nnoremap <C-D> :call ScrollThirdDown()<CR>
" Map <C-U> to scroll up 1/3 of the page
nnoremap <C-U> :call ScrollThirdUp()<CR>
" lazygit
map <leader>G :LazyGit<CR>
" buffer switching like Vimium
nnoremap <Leader>b :Telescope buffers<CR><Esc>
"nnoremap T :Telescope buffers<CR>
nnoremap <Leader>T :Telescope buffers<CR>
nnoremap <Leader>t :Telescope buffers<CR>
" toggle term key bind | toggleterm
"nnoremap <Leader>t :ToggleTerm<CR>i
" binding to open terminal in current dir
" Set a mapping for Normal, Insert, and Terminal mode
nnoremap <C-\> :ToggleTerm dir=%:p:h<CR>i
inoremap <C-\> <Esc>:ToggleTerm dir=%:p:h<CR>i
tnoremap <C-\> <C-\><C-n>:ToggleTerm dir=%:p:h<CR>i
" set a keybind to insert todo list items
inoremap <C-t> - [ ]<Space>
" Insert the text in normal mode when pressing Ctrl + t
nnoremap <C-t> i- [ ] <Esc>a
set ignorecase
set smartcase
" set incsearch, this should remain off
set noincsearch
tnoremap <Esc> <C-\><C-n>
" On pressing tab, insert 2 spaces
set expandtab
" show existing tab with 2 spaces width
set tabstop=2
set softtabstop=2
"when indenting with '>', use 2 spaces width
set shiftwidth=2
" expirimental tmux navigator
let g:tmux_navigator_no_mappings = 1
" let g:tmux_navigator_no_wrap = 1
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
noremap <silent> <C-h> :<C-U>TmuxNavigateLeft<cr>
noremap <silent> <C-j> :<C-U>TmuxNavigateDown<cr>
noremap <silent> <C-k> :<C-U>TmuxNavigateUp<cr>
noremap <silent> <C-l> :<C-U>TmuxNavigateRight<cr>
noremap <silent> <C-/> :<C-U>TmuxNavigatePrevious<cr>
" mapping with meta
nnoremap <M-Left> <C-w>h
nnoremap <M-Down> <C-w>j
nnoremap <M-Up> <C-w>k
nnoremap <M-Right> <C-w>l
noremap <silent> <M-Left> :<C-U>TmuxNavigateLeft<cr>
noremap <silent> <M-Down> :<C-U>TmuxNavigateDown<cr>
noremap <silent> <M-Up> :<C-U>TmuxNavigateUp<cr>
noremap <silent> <M-Right> :<C-U>TmuxNavigateRight<cr>
" limelight colorscheme help https://github.com/junegunn/limelight.vim?tab=readme-ov-file#options
" Color name (:help cterm-colors) or ANSI code
let g:limelight_conceal_ctermfg = 'gray'
let g:limelight_conceal_ctermfg = 240
" Function to toggle Limelight
function! ToggleLimelight()
if exists("g:limelight_active") && g:limelight_active
Limelight!
let g:limelight_active = 0
else
Limelight
let g:limelight_active = 1
endif
endfunction
" Map <Leader>L to toggle Limelight
nnoremap <Leader>L :call ToggleLimelight()<CR>
" also for goyo
" let g:goyo_height='80%'
" let g:goyo_width='80%'
" bind ctrl + shift + d to insert (date +'%y%m%d - %H:%M %p')
" nnoremap <C-D> i<C-R>=strftime("%y%m%d")<CR>
" do the same but from insert mode
inoremap <C-D> <C-R>=strftime("%y%m%d")<CR>
nnoremap <Leader>U :lcd %:p:h<CR>
]]
--------------------------------------------------------------------------------
-- these keybinds need to come after the vim bindinds otherwise they don't load until reloading the configuration
vim.api.nvim_set_keymap('n', '<leader>h', ':lua recent_files()<CR>', { noremap = true, silent = true })
require"gitlinker".setup({
opts ={
add_current_line_on_normal_mode = false,
action_callback = require"gitlinker.actions".copy_to_clipboard,
print_url = true,
},
callbacks = {
["github.com"] = require"gitlinker.hosts".get_github_type_url,
["gitlab.com"] = require"gitlinker.hosts".get_gitlab_type_url,
["gitlab.pololu.work"] = require"gitlinker.hosts".get_gitlab_type_url,
[".pololu.work"] = require"gitlinker.hosts".get_gitlab_type_url,
},
mappings = "<leader>gy"
})
--------------------------------------------------------------------------------
local Terminal = require('toggleterm.terminal').Terminal
-- Define the on_close function
local function on_terminal_close(term)
-- Send the 'exit' command to the terminal
term:send("exit\n")
end
require("toggleterm").setup({
-- open_mapping = [[<c-\>]],
direction = 'float',
autochdir = false,
--on_close = on_terminal_close, -- run the on_close function when the terminal closes
start_in_insert = false,
})
--------------------------------------------------------------------------------
-- TODO FOR NEOVIM | NVIM TODO
-- todo for neovim | neovim todo
--
--
--
-- vim-markdown
-- table of contents on demmand for a markdown file
-- add something to fold lines
-- make vim highlight the links like https:// etc in markdown docs
--
-- make a way to get my home-manager/vim config onto servers easily without cloning the whole repo
--
-- look for a vim extension for doing media wiki text and see if I can get better closing tags?
-- also make something to hold and then go to the next tab, like ctrl + ta make something to quickly open the new tab
-- mayeb like alt + > or < ?
--
-- find something to insert the name of a file in the current buffer: (oh for linking files to each other)
-- but I want to search for something in telescope or smething like that
-- or maybe just a way to copy the file name to the clipboard:
-- SOLUTION-: Almost what you're asking for, and it might do: in INSERT mode, Ctrl+R % pulls the current filename into where you are (command prompt, edit buffer, ...). See this Vim Tip for more.
--
--
--
-- VIM centered focus mode?
-- also make a keybinding or keymap for my dz60 that's going to allow me to use jk or kj to chord escape
--
-- show the most recently edited files in a dir
--
-- find another markdown renderer or something for easy viewing, maybe something in the broswer would be best?
-- make something for turning on copilot (leave it off by default) i'm thinking <leader>A
--
--
-- add a keybinding for git for vim that copies the git url to the system clipboard?
-- make a plugin that lets me first highlight some text block and then fuzzy search for things inside of just that highligted block
--
-- redo the keybind for ctrld to just be the date and then ctrlD to be the date + day like "240719 Friday"
+322
View File
@@ -0,0 +1,322 @@
{
programs = {
nixvim = {
enable = true;
defaultEditor = true;
viAlias = true;
vimAlias = true;
colorschemes.everforest = {
enable = true;
settings = {
background = "soft";
transparent_background = 1;
};
};
opts = {
number = true;
relativenumber = true;
expandtab = true;
shiftwidth = 2;
tabstop = 2;
};
diagnostics = {
virtual_text = true;
update_in_insert = true;
severity_sort = true;
};
globals = {
mapleader = " ";
maplocalleader = " ";
};
keymaps = [
{
action = ":q<CR>";
key = "<leader>q";
options = {
silent = true;
noremap = true;
desc = "Quit";
};
}
{
action = ":w<CR>";
key = "<leader>w";
options = {
silent = true;
noremap = true;
desc = "Save";
};
}
{
action = ":wq<CR>";
key = "<leader>wq";
options = {
silent = true;
noremap = true;
desc = "Save and quit";
};
}
{
action = "<C-\\><C-n>:ToggleTerm direction=float<CR>";
key = "<leader>t";
mode = [ "n" "v" "t" ];
options = {
silent = true;
noremap = true;
desc = "Toggle floating terminal";
};
}
{
action = ":Telescope live_grep<CR>";
key = "<leader>lg";
options = {
silent = true;
noremap = true;
desc = "Live grep";
};
}
{
action = ":Telescope find_files<CR>";
key = "<leader>ff";
options = {
silent = true;
noremap = true;
desc = "Find file";
};
}
{
action = ":Telescope oldfiles<CR>";
key = "<leader>of";
options = {
silent = true;
noremap = true;
desc = "Browse recent files";
};
}
{
action = ":Telescope file_browser<CR>";
key = "<leader>fb";
options = {
silent = true;
noremap = true;
desc = "Directory-based file browser";
};
}
{
action = ":Neotree toggle reveal<CR>";
key = "<leader>nt";
options = {
silent = true;
noremap = true;
desc = "Toggle file tree";
};
}
];
plugins = {
lualine.enable = true;
lsp-format.enable = true;
treesitter.enable = true;
nvim-colorizer.enable = true;
neo-tree.enable = true;
gitsigns.enable = true;
web-devicons.enable = true;
toggleterm.enable = true;
nvim-autopairs.enable = true;
direnv.enable = true;
intellitab.enable = true;
lastplace.enable = true;
luasnip.enable = true;
multicursors.enable = true;
refactoring.enable = true;
neoscroll.enable = true;
lspsaga.enable = true;
comment.enable = true;
telescope = {
enable = true;
extensions.file-browser.enable = true;
};
lint = {
enable = true;
autoCmd = {
event = [ "InsertLeave" "TextChanged" ];
};
};
illuminate = {
enable = true;
delay = 100;
minCountToHighlight = 1;
modesAllowlist = ["n" "i" "v"];
};
which-key = {
enable = true;
settings = {
preset = "modern";
delay = 500;
expand = 1;
notify = false;
win = {
border = "single";
padding = [1 1];
wo.winblend = 10;
};
replace = {
desc = [
[
"<space>"
"SPACE"
]
[
"<leader>"
"SPACE"
]
[
"<[cC][rR]>"
"RETURN"
]
[
"<[tT][aA][bB]>"
"TAB"
]
[
"<[bB][sS]>"
"BACKSPACE"
]
];
};
};
};
scrollview = {
enable = true;
settings = {
signs_on_startup = [
"all"
];
};
};
startup = {
enable = true;
parts = [ "header" "body" ];
sections = {
header = {
align = "center";
content = {
__raw = "require('startup.headers').hydra_header";
};
defaultColor = "";
foldSection = false;
highlight = "Statement";
margin = 5;
oldfilesAmount = 0;
title = "Header";
type = "text";
};
body = {
align = "center";
content = [
[
" Find File"
"Telescope find_files"
"<leader>ff"
]
[
"󰍉 Find Word"
"Telescope live_grep"
"<leader>lg"
]
[
" Recent Files"
"Telescope oldfiles"
"<leader>of"
]
[
" File Browser"
"Telescope file_browser"
"<leader>fb"
]
[
" New File"
"lua require'startup'.new_file()"
"<leader>nf"
]
];
defaultColor = "";
foldSection = false;
highlight = "String";
margin = 5;
oldfilesAmount = 0;
title = "Basic Commands";
type = "mapping";
};
};
};
indent-blankline = {
enable = true;
settings = {
scope = {
show_end = true;
show_exact_scope = true;
show_start = true;
};
};
};
cmp = {
enable = true;
autoEnableSources = true;
settings = {
sources = [
{name = "nvim_lsp";}
{name = "path";}
{name = "buffer";}
{name = "luasnip";}
];
mapping = {
"<C-Space>" = "cmp.mapping.complete()";
"<C-d>" = "cmp.mapping.scroll_docs(-4)";
"<C-e>" = "cmp.mapping.close()";
"<C-f>" = "cmp.mapping.scroll_docs(4)";
"<CR>" = "cmp.mapping.confirm({ select = true })";
"<S-Tab>" = "cmp.mapping(cmp.mapping.select_prev_item(), {'i', 's'})";
"<Tab>" = "cmp.mapping(cmp.mapping.select_next_item(), {'i', 's'})";
};
};
};
lsp = {
enable = true;
servers = {
nixd = {
enable = true;
extraOptions = {
offset_encoding = "utf-8";
};
};
ts_ls.enable = true;
gopls.enable = true;
golangci_lint_ls.enable = true;
rust_analyzer = {
enable = true;
installCargo = true;
installRustc = true;
};
};
};
};
};
};
}