diff --git a/nvim/.config/nvim/fnl/dotfiles/core.fnl b/nvim/.config/nvim/fnl/dotfiles/core.fnl index e04c5db..144871b 100644 --- a/nvim/.config/nvim/fnl/dotfiles/core.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/core.fnl @@ -1,8 +1,8 @@ -(module dotfiles.core {autoload {a aniseed.core} - require {anenv aniseed.env - nvim aniseed.nvim - nu aniseed.nvim.util - u dotfiles.util}}) +(module dotfiles.core + {autoload {a aniseed.core} + require {anenv aniseed.env nvim aniseed.nvim}}) + +(local u (require :dotfiles.util)) (nvim.ex.set :shortmess+=c) @@ -10,86 +10,90 @@ (nvim.ex.set :path+=**) (nvim.ex.set "wildignore+=*.o,*.obj,.git,*.rbc,*.class,.svn,vendor/gems/*") -(defn- safe-source [filename] - (let [glob (nvim.fn.glob filename)] - (if (not (a.empty? glob)) - (nvim.ex.source filename)))) +(defn- safe-source + [filename] + (let [glob (nvim.fn.glob filename)] + (if (not (a.empty? glob)) + (nvim.ex.source filename)))) ; (a.map safe-source ["~/.vimrc" "~/.vimrc.local"]) (def- backup-dir (.. (nvim.fn.glob :$HOME) :/.vim/backup)) (def- undo-dir (.. (nvim.fn.glob :$HOME) :/.vim/backup)) -(def- on-opts [:autoindent - :autoread - :expandtab - :exrc - ; allow project level (neo)vim files - :hlsearch - :ignorecase - :incsearch - :number - :ruler - :secure - :shiftround - ; When at 3 spaces and I hit >>, go to 4, not 5. - :showcmd - ; shows (parital) command in the status line - :showmatch - :smartcase - :splitbelow - :splitright - :termguicolors - :title - :undofile - :wildmenu]) +(def- on-opts + [:autoindent + :autoread + :expandtab + :exrc + ; allow project level (neo)vim files + :hlsearch + :ignorecase + :incsearch + :number + :ruler + :secure + :shiftround + ; When at 3 spaces and I hit >>, go to 4, not 5. + :showcmd + ; shows (parital) command in the status line + :showmatch + :smartcase + :splitbelow + :splitright + :termguicolors + :title + :undofile + :wildmenu]) -(def- val-based-opts {; :t_Co 256 - :laststatus 2 - :encoding :utf-8 - :history 500 - :redrawtime 5000 - :scrolloff 3 - :guifont :Hasklig - :guifontwide :Hasklig - :background :dark - :backupdir backup-dir - :directory backup-dir - ;Don't clutter my dirs up with swp and tmp files - :grepprg "ag --vimgrep" - ; Use Silver Searcher instead of grep - :tags :tags - :updatetime 300 - ; per coc.vim for diagnostic messages - :signcolumn "auto:1-3" - :colorcolumn [81 100] - :cmdheight 2 - ; Better display for messages - :undodir undo-dir - :undolevels 1000 - :undoreload 10000 - :foldmethod :expr - :foldexpr "nvim_treesitter#foldexpr()" - :foldlevelstart 100 - :foldlevel 99 - :tabstop 2 - :shiftwidth 2 - :softtabstop 2 - :mouse "" - :list true - :listchars "tab:➥\\ ,trail:·,nbsp:■" - :backspace "indent,eol,start" - ;allow backspacing over everything in insert mode - :wildmode "list:longest,list:full" - :wrap false}) +(def- val-based-opts + {; :t_Co 256 + :laststatus 2 + :encoding :utf-8 + :history 500 + :redrawtime 5000 + :scrolloff 3 + :guifont :Hasklig + :guifontwide :Hasklig + :background :dark + :backupdir backup-dir + :directory backup-dir + ;Don't clutter my dirs up with swp and tmp files + :grepprg "ag --vimgrep" + ; Use Silver Searcher instead of grep + :tags :tags + :updatetime 300 + ; per coc.vim for diagnostic messages + :signcolumn "auto:1-3" + :colorcolumn [81 100] + :cmdheight 2 + ; Better display for messages + :undodir undo-dir + :undolevels 1000 + :undoreload 10000 + :foldmethod :expr + :foldexpr "nvim_treesitter#foldexpr()" + :foldlevelstart 100 + :foldlevel 99 + :tabstop 2 + :shiftwidth 2 + :softtabstop 2 + :mouse "" + :list true + :listchars "tab:➥\\ ,trail:·,nbsp:■" + :backspace "indent,eol,start" + ;allow backspacing over everything in insert mode + :wildmode "list:longest,list:full" + :wrap false}) (def- append-val-opts {:diffopt "algorithm:patience"}) (defn- set-opt [[opt val]] (tset vim.opt (a.str opt) val)) -(defn- set-opt+ [[opt val]] - (let [existing-opt-val (a.get nvim.o opt)] - (tset vim.opt (a.str opt) (a.str existing-opt-val "," val)))) +(defn- set-opt+ + [[opt val]] + (let [existing-opt-val (a.get nvim.o opt)] + (tset vim.opt (a.str opt) (a.str existing-opt-val "," val)))) (defn- set-opt-on [opt] (set-opt [opt true])) @@ -109,15 +113,14 @@ ; ; (nvim.fn.glob "~/.vimrc.local") -(defn make-fennel-scratch [] - (nvim.command "new | setlocal bt=nofile bh=wipe nobl noswapfile nu filetype=fennel")) +(fn make-fennel-scratch [] + (vim.cmd "new | setlocal bt=nofile bh=wipe nobl noswapfile nu filetype=fennel")) -(nu.fn-bridge :FennelScratchBuffer :dotfiles.core :make-fennel-scratch - {:return false}) +(vim.api.nvim_create_user_command :FennelScratchBuffer make-fennel-scratch {}) (u.nnoremap :fsb ":call FennelScratchBuffer ()") -(defn compile-fnl [] (print :recompiling) - (anenv.init {:force true :init :dotfiles.init})) +(fn compile-fnl [] (print :recompiling) + (anenv.init {:force true :init :dotfiles.init})) -(nu.fn-bridge :AniseedCompile :dotfiles.core :compile-fnl {:return false}) +(vim.api.nvim_create_user_command :AniseedCompile compile-fnl {}) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl index 9c406a2..f5525b1 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/lspconfig.fnl @@ -4,7 +4,6 @@ nvim aniseed.nvim lsp vim.lsp lspconfig lspconfig - nu aniseed.nvim.util mason dotfiles.plugin.mason cmp_nvim_lsp cmp_nvim_lsp}}) @@ -14,139 +13,138 @@ (defn xbufmap [from to] (bufmap :x from to)) -(vim.diagnostic.config - {:signs {:text {vim.diagnostic.severity.ERROR "☢️" - vim.diagnostic.severity.WARN "⚠️" - vim.diagnostic.severity.INFO "ℹ️" - vim.diagnostic.severity.HINT "🔎"} - :linehl {vim.diagnostic.severity.ERROR :ErrorMsg} - :numhl {vim.diagnostic.severity.WARN :WarningMsg}}}) +(vim.diagnostic.config {:signs {:text {vim.diagnostic.severity.ERROR "☢️" + vim.diagnostic.severity.WARN "⚠️" + vim.diagnostic.severity.INFO "ℹ️" + vim.diagnostic.severity.HINT "🔎"} + ;; :linehl {vim.diagnostic.severity.ERROR :ErrorMsg} + ;; :numhl {vim.diagnostic.severity.WARN :WarningMsg} + }}) (def core-nmappings - {:gd "lua vim.lsp.buf.definition()" - :gD "lua vim.lsp.buf.declaration()" - :gi "lua vim.lsp.buf.implementation()" - :gr "lua vim.lsp.buf.references()" - :K "lua vim.lsp.buf.hover()" - "[g" "lua vim.diagnostic.goto_prev()" - "]g" "lua vim.diagnostic.goto_next()" - ;: "lua vim.lsp.buf.signature_help()" - :ca "lua vim.lsp.buf.code_action()" - :cl "lua vim.lsp.codelens.run()" - :ic "lua vim.lsp.buf.incoming_calls()" - ;; TODO: think of new mapping; conficts with org mode - ;; :oc "lua vim.lsp.buf.outgoing_calls()" - :sld "lua vim.diagnostic.open_float(nil, {source = 'always'})" - :rn "lua vim.lsp.buf.rename()" - :fa "lua vim.lsp.buf.format()"}) + {:gd "lua vim.lsp.buf.definition()" + :gD "lua vim.lsp.buf.declaration()" + :gi "lua vim.lsp.buf.implementation()" + :gr "lua vim.lsp.buf.references()" + :K "lua vim.lsp.buf.hover()" + "[g" "lua vim.diagnostic.goto_prev()" + "]g" "lua vim.diagnostic.goto_next()" + ;: "lua vim.lsp.buf.signature_help()" + :ca "lua vim.lsp.buf.code_action()" + :cl "lua vim.lsp.codelens.run()" + :ic "lua vim.lsp.buf.incoming_calls()" + ;; TODO: think of new mapping; conficts with org mode + ;; :oc "lua vim.lsp.buf.outgoing_calls()" + :sld "lua vim.diagnostic.open_float(nil, {source = 'always'})" + :rn "lua vim.lsp.buf.rename()" + :fa "lua vim.lsp.buf.format()"}) (def client-nmappings - {:clojure_lsp {:cn "call LspExecuteCommand('clean-ns')" - :ref "call LspExecuteCommand('extract-function', input('Function name: '))" - :id "call LspExecuteCommand('inline-symbol')" - :il "call LspExecuteCommand('introduce-let', input('Binding name: '))" - :m2l "call LspExecuteCommand('move-to-let', input('Binding name: '))"}}) + {:clojure_lsp {:cn "call LspExecuteCommand('clean-ns')" + :ref "call LspExecuteCommand('extract-function', input('Function name: '))" + :id "call LspExecuteCommand('inline-symbol')" + :il "call LspExecuteCommand('introduce-let', input('Binding name: '))" + :m2l "call LspExecuteCommand('move-to-let', input('Binding name: '))"}}) (def client-command-lnmappings - {:clojure_lsp {:ai [:add-import-to-namespace - ["input('Namespace name: ')"]] - :am [:add-missing-libspec []] - :as [:add-require-suggestion - ["input('Namespace name: ')" - "input('Namespace as: ')" - "input('Namespace name: ')"]] - :cc [:cycle-coll []] - :cn [:clean-ns []] - :cp [:cycle-privacy []] - :ct [:create-test []] - :df [:drag-forward []] - :db [:drag-backward []] - :df [:drag-forward []] - :dk [:destructure-keys []] - :ed [:extract-to-def ["input('Definition name: ')"]] - :ef [:extract-function ["input('Function name: ')"]] - :el [:expand-let []] - :fe [:create-function []] - :il [:introduce-let ["input('Binding name: ')"]] - :is [:inline-symbol []] - :ma [:resolve-macro-as []] - :mf [:move-form ["input('File name: ')"]] - :ml [:move-to-let ["input('Binding name: ')"]] - :pf [:promote-fn ["input('Function name: ')"]] - :sc [:change-collection ["input('Collection type: ')"]] - :sm [:sort-map []] - :tf [:thread-first-all []] - :tF [:thread-first []] - :tl [:thread-last-all []] - :tL [:thread-last []] - :ua [:unwind-all []] - :uw [:unwind-thread []]}}) + {:clojure_lsp {:ai [:add-import-to-namespace ["input('Namespace name: ')"]] + :am [:add-missing-libspec []] + :as [:add-require-suggestion + ["input('Namespace name: ')" + "input('Namespace as: ')" + "input('Namespace name: ')"]] + :cc [:cycle-coll []] + :cn [:clean-ns []] + :cp [:cycle-privacy []] + :ct [:create-test []] + :df [:drag-forward []] + :db [:drag-backward []] + :df [:drag-forward []] + :dk [:destructure-keys []] + :ed [:extract-to-def ["input('Definition name: ')"]] + :ef [:extract-function ["input('Function name: ')"]] + :el [:expand-let []] + :fe [:create-function []] + :il [:introduce-let ["input('Binding name: ')"]] + :is [:inline-symbol []] + :ma [:resolve-macro-as []] + :mf [:move-form ["input('File name: ')"]] + :ml [:move-to-let ["input('Binding name: ')"]] + :pf [:promote-fn ["input('Function name: ')"]] + :sc [:change-collection ["input('Collection type: ')"]] + :sm [:sort-map []] + :tf [:thread-first-all []] + :tF [:thread-first []] + :tl [:thread-last-all []] + :tL [:thread-last []] + :ua [:unwind-all []] + :uw [:unwind-thread []]}}) (def server-specific-opts {}) -(defn bind-client-mappings [client] - (let [client-name (a.get client :name) - mappings (a.get client-nmappings client-name) - command-lnmappings (a.get client-command-lnmappings client-name)] - (when mappings - (each [mapping cmd (pairs mappings)] - (nbufmap mapping cmd))) - (when command-lnmappings - (each [lnmapping command-mapping (pairs command-lnmappings)] - (let [lsp-cmd (a.first command-mapping) - opts-str (accumulate [s "" i opt (ipairs (a.second command-mapping))] - (.. s ", " opt)) - mapping (.. : lnmapping) - cmd (.. "call LspExecuteCommand('" lsp-cmd "'" opts-str ")")] - (nbufmap mapping cmd)))))) +(defn bind-client-mappings + [client] + (let [client-name (a.get client :name) + mappings (a.get client-nmappings client-name) + command-lnmappings (a.get client-command-lnmappings client-name)] + (when mappings + (each [mapping cmd (pairs mappings)] + (nbufmap mapping cmd))) + (when command-lnmappings + (each [lnmapping command-mapping (pairs command-lnmappings)] + (let [lsp-cmd (a.first command-mapping) + opts-str (accumulate [s "" i opt (ipairs (a.second command-mapping))] + (.. s ", " opt)) + mapping (.. : lnmapping) + cmd (.. "call LspExecuteCommand('" lsp-cmd "'" opts-str ")")] + (nbufmap mapping cmd)))))) -(defn on_attach [client bufnr] - (each [mapping cmd (pairs core-nmappings)] - (nbufmap mapping cmd)) ; x mode mappings - (xbufmap :fa "lua vim.lsp.buf.format()") - ; -- buf_set_keymap('n', 'gs', 'lua vim.lsp.buf.document_symbol()', opts) - ; -- buf_set_keymap('n', 'gS', 'lua vim.lsp.buf.workspace_symbol()', opts) - ; -- buf_set_keymap('n', 'gt', 'lua vim.lsp.buf.type_definition()', opts) - ; -- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) - ; -- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) - ; -- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) - ; -- buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) - ; -- buf_set_keymap('n', 'ic', "lua vim.lsp.buf.incoming_calls()", opts) - ; -- buf_set_keymap('x', 'ic', "lua vim.lsp.buf.incoming_calls()", opts) - (nvim.buf_set_option 0 :omnifunc "v:lua.vim.lsp.omnifunc") - (bind-client-mappings client) - (if client.server_capabilities.documentFormattingProvider - (nvim.ex.autocmd :BufWritePre : ":lua vim.lsp.buf.format()")) - ; (nvim.ex.autocmd "BufEnter,CursorHold,InsertLeave" : :lua "vim.lsp.codelens.refresh()") - ; client autocmds - ; -- vim.api.nvim_command[[autocmd BufWritePre lua vim.lsp.buf_request_sync(vim.api.nvim_get_current_buf(), 'workspace/executeCommand', {command = 'clean-ns', arguments = {vim.uri_from_bufnr(1), vim.api.nvim_win_get_cursor(0)[1], vim.api.nvim_win_get_cursor(0)[2]}, title = 'Clean Namespace'})]] - (print "LSP Client Attached.")) +(defn on_attach + [client bufnr] + (each [mapping cmd (pairs core-nmappings)] + (nbufmap mapping cmd)) ; x mode mappings + (xbufmap :fa "lua vim.lsp.buf.format()") ; -- buf_set_keymap('n', 'gs', 'lua vim.lsp.buf.document_symbol()', opts) + ; -- buf_set_keymap('n', 'gS', 'lua vim.lsp.buf.workspace_symbol()', opts) + ; -- buf_set_keymap('n', 'gt', 'lua vim.lsp.buf.type_definition()', opts) + ; -- buf_set_keymap('n', 'wa', 'lua vim.lsp.buf.add_workspace_folder()', opts) + ; -- buf_set_keymap('n', 'wr', 'lua vim.lsp.buf.remove_workspace_folder()', opts) + ; -- buf_set_keymap('n', 'wl', 'lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))', opts) + ; -- buf_set_keymap('n', 'q', 'lua vim.lsp.diagnostic.set_loclist()', opts) + ; -- buf_set_keymap('n', 'ic', "lua vim.lsp.buf.incoming_calls()", opts) + ; -- buf_set_keymap('x', 'ic', "lua vim.lsp.buf.incoming_calls()", opts) + (nvim.buf_set_option 0 :omnifunc "v:lua.vim.lsp.omnifunc") + (bind-client-mappings client) + (if client.server_capabilities.documentFormattingProvider + (nvim.ex.autocmd :BufWritePre : ":lua vim.lsp.buf.format()")) ; (nvim.ex.autocmd "BufEnter,CursorHold,InsertLeave" : :lua "vim.lsp.codelens.refresh()") + ; client autocmds ; -- vim.api.nvim_command[[autocmd BufWritePre lua vim.lsp.buf_request_sync(vim.api.nvim_get_current_buf(), 'workspace/executeCommand', {command = 'clean-ns', arguments = {vim.uri_from_bufnr(1), vim.api.nvim_win_get_cursor(0)[1], vim.api.nvim_win_get_cursor(0)[2]}, title = 'Clean Namespace'})]] + (print "LSP Client Attached.")) (def base-server-opts - (let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))] - {: on_attach : capabilities :flags {:debounce_text_changes 150}})) + (let [capabilities (cmp_nvim_lsp.default_capabilities (lsp.protocol.make_client_capabilities))] + {: on_attach : capabilities :flags {:debounce_text_changes 150}})) -(defn default-server-handler [server-name] - (let [specific-opts (a.get server-specific-opts server-name {}) - server (a.get lspconfig server-name) - server-opts (a.merge base-server-opts server-opts)] - (server.setup server-opts))) +(defn default-server-handler + [server-name] + (let [specific-opts (a.get server-specific-opts server-name {}) + server (a.get lspconfig server-name) + server-opts (a.merge base-server-opts server-opts)] + (server.setup server-opts))) -(defn lsp-execute-command [cmd ...] - (let [buf-uri (vim.uri_from_bufnr 0) - cursor (vim.api.nvim_win_get_cursor 0) - r (- (a.first cursor) 1) - c (a.second cursor) - opts [buf-uri r c] - args (a.concat opts [...])] - (vim.lsp.buf.execute_command {:command cmd :arguments args}))) +(defn lsp-execute-command + [cmd ...] + (let [buf-uri (vim.uri_from_bufnr 0) + cursor (vim.api.nvim_win_get_cursor 0) + r (- (a.first cursor) 1) + c (a.second cursor) + opts [buf-uri r c] + args (a.concat opts [...])] + (vim.lsp.buf.execute_command {:command cmd :arguments args}))) (mason.setup) -(when-let [mason-lspconfig (require :mason-lspconfig)] - (mason-lspconfig.setup) - (mason-lspconfig.setup_handlers {1 default-server-handler})) +(when-let [mason-lspconfig (require :mason-lspconfig)] (mason-lspconfig.setup) + (mason-lspconfig.setup_handlers {1 default-server-handler})) (u.nnoremap :li :LspInfo) -(nu.fn-bridge :LspExecuteCommand :dotfiles.plugin.lspconfig - :lsp-execute-command {:return false}) + +(vim.api.nvim_create_user_command :LspExecuteCommand lsp-execute-command {}) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl index 380773e..2855e03 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/toggleterm.fnl @@ -1,30 +1,27 @@ -(module dotfiles.toggleterm - {autoload {a aniseed.core} - require {nvim aniseed.nvim - nu aniseed.nvim.util - toggleterm toggleterm}}) +(local toggleterm (require :toggleterm)) -(toggleterm.setup { - :open_mapping : - :start_in_insert true - :insert_mappings true ;; whether or not the open mapping applies in insert mode - :terminal_mappings true ;; whether or not the open mapping applies in the opened terminals - :persist_size true - :persist_mode true ;; if set to true (default) the previous terminal mode will be remembered - :autochdir true - }) +(toggleterm.setup {:open_mapping "" + :start_in_insert true + :insert_mappings true + ;; whether or not the open mapping applies in insert mode + :terminal_mappings true + ;; whether or not the open mapping applies in the opened terminals + :persist_size true + :persist_mode true + ;; if set to true (default) the previous terminal mode will be remembered + :autochdir true}) - -(defn set_terminal_keymaps [] - (vim.keymap.set :t : :) - (vim.keymap.set :t :jk :) +(fn set-terminal-keymaps [] + (vim.keymap.set :t : "") + (vim.keymap.set :t :jk "") (vim.keymap.set :t : "wincmd h") (vim.keymap.set :t : "wincmd j") (vim.keymap.set :t : "wincmd k") (vim.keymap.set :t : "wincmd l") - (vim.keymap.set :t : :)) + (vim.keymap.set :t : "")) +(vim.api.nvim_create_user_command :SetTerminalKeymaps set-terminal-keymaps {}) -(nu.fn-bridge :SetTerminalKeymaps :dotfiles.toggleterm :set_terminal_keymaps {:return false}) - -(nvim.ex.autocmd :TermOpen "term://*" :call "SetTerminalKeymaps()") +(vim.api.nvim_create_autocmd [:TermOpen] + {:pattern "term://*" + :callback set-terminal-keymaps}) diff --git a/nvim/.config/nvim/fnl/dotfiles/plugin/treesitter.fnl b/nvim/.config/nvim/fnl/dotfiles/plugin/treesitter.fnl index b5f288b..cf85efd 100644 --- a/nvim/.config/nvim/fnl/dotfiles/plugin/treesitter.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/plugin/treesitter.fnl @@ -1,29 +1,31 @@ -(module dotfiles.plugin.treesitter - {autoload {treesitter nvim-treesitter - ts_utils nvim-treesitter.ts_utils - treesitter-configs nvim-treesitter.configs}}) +(local treesitter-configs (require :nvim-treesitter.configs)) -(treesitter-configs.setup - {:highlight {:enable true - ;; :additional_vim_regex_highlighting false - :additional_vim_regex_highlighting [:org] - } - - :ensure_installed :all ; [:org] - - :rainbow {:enable true - :extended_mode true ; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean - :max_file_lines 10000 ; Do not enable for files with more than 1000 lines, int - :colors [ - :#dc322f ; red - :#b58900 ; yellow - :#d33682 ; magenta - :#859900 ; green - :#2aa198 ; cyan - :#268bd2 ; blue - :#6c71c4 ; violet / brmagenta - ] ; table of hex strings - } - }) +(treesitter-configs.setup {:highlight {:enable true + ;; :additional_vim_regex_highlighting false + :additional_vim_regex_highlighting [:org]} + :ensure_installed :all + ; [:org] + :rainbow {:enable true + :extended_mode true + ; Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean + :max_file_lines 10000 + ; Do not enable for files with more than 1000 lines, int + :colors ["#dc322f" + ; red + "#b58900" + ; yellow + "#d33682" + ; magenta + "#859900" + ; green + "#2aa198" + ; cyan + "#268bd2" + ; blue + "#6c71c4" + ; violet / brmagenta + ] + ; table of hex strings + }}) ; lua print(require('nvim-treesitter.parsers').get_parser():language_for_range({ require('nvim-treesitter.ts_utils').get_node_at_cursor():range() }):lang()) diff --git a/nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl b/nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl index 66675aa..fed6bd5 100644 --- a/nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/terraform-helpers.fnl @@ -1,22 +1,18 @@ (module dotfiles.terraform-helpers {autoload {a aniseed.core} - require {anenv aniseed.env - nvim aniseed.nvim - nu aniseed.nvim.util - u dotfiles.util}}) + require {anenv aniseed.env nvim aniseed.nvim u dotfiles.util}}) -(defn append-to-buf [bufno lines] - (when lines - (nvim.buf_set_lines buffno -1 -1 false lines))) +(fn append-to-buf [bufno lines] + (when lines + (nvim.buf_set_lines buffno -1 -1 false lines))) (var tf-log-bufno nil) -(defn tf-log-buffer []) -(defn terraform-import [] - (vim.fn.jobstart [:terraform :import :-no-color address id] - {:stdout_buffered true - :on_stdout (fn [_ data] - (append-to-buf bufno data))})) +(fn terraform-import [] + (vim.fn.jobstart [:terraform :import :-no-color address id] + {:stdout_buffered true + :on_stdout (fn [_ data] + (append-to-buf bufno data))})) ; (nu.fn-bridge :ZoomToggle :dotfiles.zoom-toggle :zoom-toggle {:return false}) ; (u.nnoremap :z ":call ZoomToggle()") diff --git a/nvim/.config/nvim/fnl/dotfiles/zoom-toggle.fnl b/nvim/.config/nvim/fnl/dotfiles/zoom-toggle.fnl index a51df5b..3454a99 100644 --- a/nvim/.config/nvim/fnl/dotfiles/zoom-toggle.fnl +++ b/nvim/.config/nvim/fnl/dotfiles/zoom-toggle.fnl @@ -1,21 +1,18 @@ -(module dotfiles.zoom-toggle - {autoload {a aniseed.core} - require {anenv aniseed.env - nvim aniseed.nvim - nu aniseed.nvim.util - u dotfiles.util}}) +(local u (require :dotfiles.util)) (var unzoom! nil) -(defn zoom-toggle [] (if unzoom! - (do - (nvim.command unzoom!) - (set unzoom! nil)) - (do - (set unzoom! (nvim.fn.winrestcmd)) - (nvim.ex.resize) - (nvim.ex.vertical :resize)))) +(fn zoom-toggle [] + (if unzoom! + (do + (vim.cmd unzoom!) + (set unzoom! nil)) + (do + (set unzoom! (vim.fn.winrestcmd)) + (vim.fn.resize) + (vim.fn.vertical :resize)))) + +(vim.api.nvim_create_user_command :ZoomToggle zoom-toggle {}) -(nu.fn-bridge :ZoomToggle :dotfiles.zoom-toggle :zoom-toggle {:return false}) (u.nnoremap : ":call ZoomToggle()") (u.tnoremap : ":call ZoomToggle()")