refactor: neovim config out of home-manager 🎨
This commit is contained in:
parent
da93ae365e
commit
7a34ccfc7f
2 changed files with 6 additions and 71 deletions
|
|
@ -31,7 +31,8 @@
|
|||
vscode-server.nixosModules.default
|
||||
./hosts/wsl.nix
|
||||
./tmux.nix
|
||||
./neovim.nix
|
||||
# TODO: handle all user-level programs via home-manager
|
||||
# ./neovim.nix # Now handled via home-manager
|
||||
./fish.nix
|
||||
# home-manager.nixosModules.default
|
||||
];
|
||||
|
|
@ -46,7 +47,8 @@
|
|||
./hosts/macbookair.nix
|
||||
./hardware-configuration.nix
|
||||
./tmux.nix
|
||||
./neovim.nix
|
||||
# TODO: handle all user-level programs via home-manager
|
||||
# ./neovim.nix # Now handled via home-manager
|
||||
./fish.nix
|
||||
# home-manager.nixosModules.default
|
||||
];
|
||||
|
|
|
|||
|
|
@ -6,75 +6,8 @@
|
|||
|
||||
programs.home-manager.enable = true;
|
||||
|
||||
# Neovim (user-level, works great on macOS)
|
||||
programs.neovim = {
|
||||
enable = true;
|
||||
defaultEditor = true;
|
||||
# extraLuaConfig is also available; we’ll keep your Vimscript as-is:
|
||||
extraConfig = ''
|
||||
set title
|
||||
set mouse=a
|
||||
set nohlsearch
|
||||
set number
|
||||
let mapleader=","
|
||||
|
||||
lua << EOF
|
||||
local config_file = os.getenv("HOME")..'/.local/share/nvim_color_scheme'
|
||||
local f = io.open(config_file, "r")
|
||||
if f ~= nil then
|
||||
local system_theme = f:read()
|
||||
io.close(f)
|
||||
if system_theme == 'dark' then
|
||||
vim.cmd("set bg=dark")
|
||||
elseif system_theme == 'light' then
|
||||
vim.cmd("set bg=light")
|
||||
else
|
||||
print('warning: expected value "light" or "dark"')
|
||||
print(' got:', system_theme)
|
||||
print(' expected path:', config_file)
|
||||
end
|
||||
else
|
||||
print('warning: nvim color scheme not found')
|
||||
print(' expected path:', config_file)
|
||||
end
|
||||
EOF
|
||||
|
||||
colorscheme catppuccin " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
|
||||
|
||||
" netrw (dir listing) settings
|
||||
let g:netrw_liststyle = 3
|
||||
let g:netrw_banner = 0
|
||||
let g:netrw_browse_split = 3
|
||||
let g:netrw_winsize = 25 " % of page
|
||||
|
||||
set listchars=tab:→\ ,space:·,nbsp:␣,trail:•,eol:¶,precedes:«,extends:»
|
||||
set clipboard+=unnamedplus
|
||||
|
||||
" Replace-all is aliased to S.
|
||||
nnoremap S :%s//g<Left><Left>
|
||||
|
||||
" save file with ,w
|
||||
map <leader>w :w<cr><Space>
|
||||
|
||||
" spellcheck
|
||||
set spell spelllang=en_us
|
||||
setlocal spell! spelllang=en_us
|
||||
'';
|
||||
|
||||
plugins = with pkgs.vimPlugins; [
|
||||
vim-surround
|
||||
vim-gitgutter
|
||||
vim-nix
|
||||
# vimtex - disabled due to build check issue with fzf-lua dependency
|
||||
# vimtex-fixed
|
||||
fzf-lua
|
||||
nerdtree
|
||||
rainbow
|
||||
catppuccin-nvim
|
||||
goyo-vim
|
||||
limelight-vim
|
||||
];
|
||||
};
|
||||
# Import neovim configuration
|
||||
imports = [ ../../neovim.nix ];
|
||||
|
||||
# tmux (user-level; same config on macOS and NixOS if you reuse this file)
|
||||
programs.tmux = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue