2025-02-01 14:53:45 -08:00
-- [nfnl] Compiled from ./init.fnl by https://github.com/Olical/nfnl, do not edit.
if ( os.getenv ( " TERM " ) == " xterm-kitty " ) then
2024-12-30 14:42:29 -08:00
require ( " scripts.chameleon " ) . setup ( )
require ( " scripts.kitty-padding " ) . setup ( )
2025-02-01 14:53:45 -08:00
else
2024-12-30 14:42:29 -08:00
end
2024-10-10 00:21:39 -07:00
require ( " keymaps " )
2024-10-09 17:13:16 -07:00
require ( " plugins " )
2024-12-28 23:55:45 -08:00
require ( " scripts.obsidian-sync " )
2024-10-11 21:08:07 -07:00
require ( " scripts.autoroot " ) . setup ( )
2024-10-09 17:13:16 -07:00
vim.opt . relativenumber = true
vim.opt . number = true
vim.opt . laststatus = 3
vim.opt . undofile = true
vim.opt . tabstop = 4
vim.opt . shiftwidth = 2
vim.treesitter . indent = true
vim.opt . foldexpr = " nvim_treesitter#foldexpr() "
vim.opt . foldmethod = " expr "
vim.opt . foldenable = false
2024-10-10 17:54:49 -07:00
vim.opt . signcolumn = " yes "
vim.opt . updatetime = 250
vim.opt . list = true
2025-02-01 14:53:45 -08:00
vim.opt . listchars = { nbsp = " \226 \144 \163 " , tab = " \194 \187 " , trail = " \194 \183 " }
2024-10-10 17:54:49 -07:00
vim.opt . scrolloff = 10
2024-12-29 16:33:01 -08:00
vim.cmd . colorscheme ( " oxocarbon " )
2025-01-11 01:05:35 -08:00
vim.g . node_host_prog = nixCats ( " bin.neovim-node-host " )
vim.g . loaded_node_provider = nil
2025-02-01 14:53:45 -08:00
local function _2_ ( _ , buf )
local max_filesize = ( 100 * 1024 )
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
else
return nil
end
end
require ( " nvim-treesitter.configs " ) . setup ( { disable = _2_ , ensure_installed = { } , highlight = { enable = true } , ignore_install = { } , incremental_selection = { enable = true , keymaps = { init_selection = " <CR> " , node_decremental = " <C-j> " , node_incremental = " <C-k> " , scope_incremental = " <BS> " } } , modules = { " highlight " , " incremental_selection " , " indent " } , additional_vim_regex_highlighting = false , auto_install = false , sync_install = false } )
local function _4_ ( )
return vim.cmd ( " setlocal nonumber norelativenumber " )
end
vim.api . nvim_create_autocmd ( { " TermOpen " } , { callback = _4_ , group = vim.api . nvim_create_augroup ( " terminal " , { } ) } )
local function _5_ ( )
return vim.highlight . on_yank ( { higroup = " Visual " , timeout = 300 } )
end
vim.api . nvim_create_autocmd ( " TextYankPost " , { callback = _5_ } )
vim.lsp . handlers [ " textDocument/hover " ] = vim.lsp . with ( vim.lsp . handlers.hover , { silent = true } )
local function _6_ ( )
local current_tab = vim.api . nvim_get_current_tabpage ( )
vim.cmd ( " tabdo wincmd = " )
return vim.api . nvim_set_current_tabpage ( current_tab )
end
return vim.api . nvim_create_autocmd ( { " VimResized " } , { callback = _6_ , desc = " Resize splits with terminal window " , group = vim.api . nvim_create_augroup ( " EqualizeSplits " , { } ) } )