nvim: tested fnl install, working fterm

This commit is contained in:
Anish Lakhwara 2024-08-25 00:46:03 -07:00
parent 0f34a00a4e
commit d623b21234
10 changed files with 529 additions and 511 deletions

View file

@ -1,3 +0,0 @@
(local nvim (require :lib/nvim))
(nvim.g :tidal_target "terminal")

View file

@ -2,22 +2,22 @@
(nvim.g :mapleader " ") (nvim.g :mapleader " ")
(nvim.opt :runtimepath (.. vim.opt.runtimepath "/home/anish/.config/nvim/,")) ; (nvim.opt :runtimepath (.. vim.opt.runtimepath "/home/anish/.config/nvim/,"))
(nvim.opt :tabstop 2) (nvim.opt :tabstop 2)
(nvim.opt :showmatch) (nvim.opt :showmatch true)
(nvim.opt :shiftwidth 2) (nvim.opt :shiftwidth 2)
(nvim.opt :autoindent) (nvim.opt :autoindent true)
(nvim.opt :undofile) (nvim.opt :undofile true)
(nvim.opt :signcolumn "auto:4") (nvim.opt :signcolumn "auto:4")
(nvim.opt :title) (nvim.opt :title true)
(nvim.opt :number) (nvim.opt :number true)
(nvim.opt :nocompatible) ; (nvim.opt :nocompatible)
(nvim.opt :relativenumber) (nvim.opt :relativenumber true)
(nvim.opt :showtabline 2) (nvim.opt :showtabline 2)
(nvim.opt :expandtab) (nvim.opt :expandtab true)
(nvim.opt :autowriteall) (nvim.opt :autowriteall true)
(nvim.opt :lisp) ; include - in word to move better in snake-case) (nvim.opt :lisp true) ; include - in word to move better in snake-case)
(nvim.g :sexp_filetypes "clojure,scheme,lisp,janet,fennel,yuck") ; include the lisps I use (nvim.g :sexp_filetypes "clojure,scheme,lisp,janet,fennel,yuck") ; include the lisps I use
(nvim.opt :termguicolors) (nvim.opt :termguicolors)

View file

@ -1,9 +1,21 @@
(local nvim (require :lib/nvim)) (local nvim (require :lib/nvim))
(local wk (require :which-key)) (local wk (require :which-key))
;; Convenient way to indent stuff in visual mode
(nvim.keymap [:v] "<" "<gv" {:noremap true})
(nvim.keymap [:v] ">" ">gv" {:noremap true})
(nvim.keymap [:n] "<space>" "<NOP>" {:noremap true :silent true})
(vim.api.nvim_create_user_command "FTermToggle" (fn [_]
((-> (require :FTerm)
(. :toggle))))
{:bang true})
(nvim.keymap [:t] "<TAB>" "<cmd>:FTermToggle<CR>")
(nvim.keymap [:n] "<TAB>" "<cmd>:FTermToggle<CR>" {:nnoremap true})
(local (local
normal-map-leader normal-map-leader
{"t" ["" {"t" [":Neotree toggle<CR>"
"Toggle neo-tree"] "Toggle neo-tree"]
"w" ["<cmd>:w<cr>" "w" ["<cmd>:w<cr>"
"Write file"] "Write file"]
@ -12,7 +24,7 @@
"r" [":RainbowParenthesesToggleAll<CR>" "r" [":RainbowParenthesesToggleAll<CR>"
"Toggle Rainbow Parens"] "Toggle Rainbow Parens"]
; Telescope ; Telescope
"f" {:Name "Files" "f" {:name "Files"
:f ["<cmd>Telescope find_files<cr>" :f ["<cmd>Telescope find_files<cr>"
"Find Files (in Telescope)"] "Find Files (in Telescope)"]
:g ["<cmd>Telescope live_grep<cr>" :g ["<cmd>Telescope live_grep<cr>"
@ -26,16 +38,16 @@
:r ["<cmd>Telescope oldfiles<CR>" :r ["<cmd>Telescope oldfiles<CR>"
"Recent files"]} "Recent files"]}
; Git ; Git
"g" {:Name "Git" "g" {:name "Git"
"s" [":G<CR>" "s" [":G<CR>"
"Git Status"] "Git Status"]
"f" [":G fetch --all" "f" [":G fetch --all<cr>"
"Git Fetch"] "Git Fetch"]
"b" [":GBranches" "b" [":GBranches<cr>"
"Git Branch"] "Git Branch"]
"p" [":Git! push" "p" [":Git! push<cr>"
"Git Push"] "Git Push"]
"d" [":GDiff" "d" [":GDiff<cr>"
"Git Diff"] "Git Diff"]
"h" ["" "h" [""
"Commit Hunk under Cursor"]} "Commit Hunk under Cursor"]}
@ -43,7 +55,7 @@
; nmap <leader>gh :diffget //2<CR> ; nmap <leader>gh :diffget //2<CR>
; nnoremap <leader>gc :G commit -v -q %:p<CR> ; nnoremap <leader>gc :G commit -v -q %:p<CR>
; Buffers ; Buffers
"b" {:Name "Buffer" "b" {:name "Buffer"
:a ["" :a [""
"Buffer Add"] "Buffer Add"]
:q ["" :q [""
@ -55,7 +67,7 @@
:p ["<cmd>:tabp<CR>" :p ["<cmd>:tabp<CR>"
"Buffer Previous"]} "Buffer Previous"]}
; Search ; Search
"s" {:Name "Search" "s" {:name "Search"
:b ["<cmd>Telescope current_buffer_fuzzy_find<CR>" :b ["<cmd>Telescope current_buffer_fuzzy_find<CR>"
"Search in current buffer"] "Search in current buffer"]
:s ["<cmd>Telescope live_grep<CR>" :s ["<cmd>Telescope live_grep<CR>"
@ -65,7 +77,7 @@
:c ["<cmd>let @/ = \"\"<CR>:echo 'Search highlight cleared'<CR>" :c ["<cmd>let @/ = \"\"<CR>:echo 'Search highlight cleared'<CR>"
"Clear search"]} "Clear search"]}
; Code ; Code
"c" {:Name "Code" "c" {:name "Code"
:d [":lua vim.lsp.buf.definition()<CR>" :d [":lua vim.lsp.buf.definition()<CR>"
"Go to Definition"] "Go to Definition"]
:i [":lua require('telescope.builtin').lsp_implementation()<CR>" :i [":lua require('telescope.builtin').lsp_implementation()<CR>"
@ -79,6 +91,6 @@
:o [":LSoutlineToggle<CR>" :o [":LSoutlineToggle<CR>"
"Outline"]} "Outline"]}
; Kitaab ; Kitaab
"z" {:Name "Kitaab"}}) "z" {:name "Kitaab"}})
(wk.register normal-map-leader {:prefix "<leader>"}) (wk.register normal-map-leader {:prefix "<leader>"})

View file

@ -0,0 +1,22 @@
(local nvim (require :lib/nvim))
(nvim.g :tidal_target "terminal")
(local navic (require :nvim-navic))
(let [lualine (require :lualine)]
(lualine.setup {:options {:theme "ayu"}
:sections {:lualine_c [:filename {1 navic.get_location
:cond navic.is_available}]
:lualine_y [(fn []
(let [msg "No Active Lsp"
buf_ft (vim.api.nvim_buf_get_option 0 "filetype")
clients (vim.lsp.get_active_clients)]
(if (= (next clients) nil) msg)
(each [_ client (ipairs clients)]
(let [filetypes (. client :config :filetypes)]
(if (and filetypes (vim.fn.index filetypes buf_ft)) client.name)))
msg))]
:lualine_x [:filetype]}}))
(require :neo-tree)

View file

@ -1,10 +1,3 @@
-- A function that applies passes the output of string.format to the print
-- function
---@param string string #template string
local function fprint(string, ...)
print(string.format(string, ...))
end
if pcall(require, "hotpot") then if pcall(require, "hotpot") then
-- Setup hotpot.nvim -- Setup hotpot.nvim
require("hotpot").setup({ require("hotpot").setup({
@ -31,7 +24,3 @@ if pcall(require, "hotpot") then
else else
print("Unable to require hotpot") print("Unable to require hotpot")
end end
-- vim.cmd[[colorscheme tokyonight]]
-- -- vim.cmd[[colorscheme lumona]]
-- vim.cmd[[packadd cfilter]]

File diff suppressed because it is too large Load diff