From 469ebea2799e654e69c0c4a7f461a53ff9e09040 Mon Sep 17 00:00:00 2001 From: Jovan Djokic-Sumarac Date: Fri, 12 Jul 2024 22:10:34 +0200 Subject: [PATCH 1/2] replace options dir to be fennel code --- fnl/options/colors.fnl | 1 + fnl/options/harpoon.fnl | 18 ++ fnl/options/init.fnl | 4 + fnl/options/keybind.fnl | 36 ++++ fnl/options/opts.fnl | 65 +++++++ {lua => fnl}/plugins/devicons.lua | 0 {lua => fnl}/plugins/gitsigns.lua | 0 {lua => fnl}/plugins/harpoon.lua | 0 {lua => fnl}/plugins/hlblocks.lua | 0 {lua => fnl}/plugins/init.lua | 0 {lua => fnl}/plugins/lazy.lua | 0 {lua => fnl}/plugins/lsp-zero.lua | 0 {lua => fnl}/plugins/lualine.lua | 0 {lua => fnl}/plugins/mini.lua | 0 {lua => fnl}/plugins/oil.lua | 0 {lua => fnl}/plugins/telescope.lua | 0 {lua => fnl}/plugins/treesitter.lua | 0 {lua => fnl}/plugins/wilder.lua | 0 init.fnl | 26 +++ init.lua | 68 +++---- lua/options/colors.lua | 3 +- lua/options/harpoon.lua | 50 +++-- lua/options/init.lua | 2 + lua/options/keybind.lua | 98 ++++------ lua/options/opts.lua | 110 ++++------- lua/tangerine_vimrc.lua | 3 + lua_bak/options/colors.lua | 1 + lua_bak/options/harpoon.lua | 17 ++ lua_bak/options/init.lua | 3 + lua_bak/options/keybind.lua | 63 +++++++ lua_bak/options/opts.lua | 72 ++++++++ lua_bak/plugins/devicons.lua | 47 +++++ lua_bak/plugins/gitsigns.lua | 45 +++++ lua_bak/plugins/harpoon.lua | 17 ++ lua_bak/plugins/hlblocks.lua | 39 ++++ lua_bak/plugins/init.lua | 12 ++ lua_bak/plugins/lazy.lua | 115 ++++++++++++ lua_bak/plugins/lsp-zero.lua | 67 +++++++ lua_bak/plugins/lualine.lua | 276 ++++++++++++++++++++++++++++ lua_bak/plugins/mini.lua | 108 +++++++++++ lua_bak/plugins/oil.lua | 177 ++++++++++++++++++ lua_bak/plugins/telescope.lua | 30 +++ lua_bak/plugins/treesitter.lua | 27 +++ lua_bak/plugins/wilder.lua | 28 +++ 44 files changed, 1444 insertions(+), 184 deletions(-) create mode 100644 fnl/options/colors.fnl create mode 100644 fnl/options/harpoon.fnl create mode 100755 fnl/options/init.fnl create mode 100755 fnl/options/keybind.fnl create mode 100644 fnl/options/opts.fnl rename {lua => fnl}/plugins/devicons.lua (100%) rename {lua => fnl}/plugins/gitsigns.lua (100%) rename {lua => fnl}/plugins/harpoon.lua (100%) rename {lua => fnl}/plugins/hlblocks.lua (100%) rename {lua => fnl}/plugins/init.lua (100%) rename {lua => fnl}/plugins/lazy.lua (100%) rename {lua => fnl}/plugins/lsp-zero.lua (100%) rename {lua => fnl}/plugins/lualine.lua (100%) rename {lua => fnl}/plugins/mini.lua (100%) rename {lua => fnl}/plugins/oil.lua (100%) rename {lua => fnl}/plugins/telescope.lua (100%) rename {lua => fnl}/plugins/treesitter.lua (100%) rename {lua => fnl}/plugins/wilder.lua (100%) create mode 100644 init.fnl mode change 100755 => 100644 lua/options/colors.lua mode change 100755 => 100644 lua/options/init.lua mode change 100755 => 100644 lua/options/keybind.lua mode change 100755 => 100644 lua/options/opts.lua create mode 100644 lua/tangerine_vimrc.lua create mode 100755 lua_bak/options/colors.lua create mode 100644 lua_bak/options/harpoon.lua create mode 100755 lua_bak/options/init.lua create mode 100755 lua_bak/options/keybind.lua create mode 100755 lua_bak/options/opts.lua create mode 100755 lua_bak/plugins/devicons.lua create mode 100755 lua_bak/plugins/gitsigns.lua create mode 100644 lua_bak/plugins/harpoon.lua create mode 100755 lua_bak/plugins/hlblocks.lua create mode 100755 lua_bak/plugins/init.lua create mode 100755 lua_bak/plugins/lazy.lua create mode 100755 lua_bak/plugins/lsp-zero.lua create mode 100755 lua_bak/plugins/lualine.lua create mode 100755 lua_bak/plugins/mini.lua create mode 100644 lua_bak/plugins/oil.lua create mode 100644 lua_bak/plugins/telescope.lua create mode 100755 lua_bak/plugins/treesitter.lua create mode 100755 lua_bak/plugins/wilder.lua diff --git a/fnl/options/colors.fnl b/fnl/options/colors.fnl new file mode 100644 index 0000000..fe3901e --- /dev/null +++ b/fnl/options/colors.fnl @@ -0,0 +1 @@ +(vim.cmd "colorscheme carbonfox") diff --git a/fnl/options/harpoon.fnl b/fnl/options/harpoon.fnl new file mode 100644 index 0000000..a5096bf --- /dev/null +++ b/fnl/options/harpoon.fnl @@ -0,0 +1,18 @@ +(local harpoon (require :harpoon)) + +;; REQUIRED +(harpoon.setup) +;; REQUIRED + +(vim.keymap.set :n :ha (fn [] (harpoon.list:append))) + +(vim.keymap.set :n : (fn [] (harpoon.ui.toggle_quick_menu (harpoon.list)))) + +(vim.keymap.set :n : (fn [] (harpoon.list:select 1))) +(vim.keymap.set :n : (fn [] (harpoon.list:select 2))) +(vim.keymap.set :n : (fn [] (harpoon.list:select 3))) +(vim.keymap.set :n : (fn [] (harpoon.list:select 4))) + +;; Toggle previous & next buffers stored within Harpoon list +(vim.keymap.set :n : (fn [] (harpoon.list:prev))) +(vim.keymap.set :n : (fn [] (harpoon.list:next))) diff --git a/fnl/options/init.fnl b/fnl/options/init.fnl new file mode 100755 index 0000000..91201e6 --- /dev/null +++ b/fnl/options/init.fnl @@ -0,0 +1,4 @@ +(require :options.colors) +(require :options.keybind) +(require :options.opts) +(require :options.harpoon) diff --git a/fnl/options/keybind.fnl b/fnl/options/keybind.fnl new file mode 100755 index 0000000..07b2eaf --- /dev/null +++ b/fnl/options/keybind.fnl @@ -0,0 +1,36 @@ +(require-macros :hibiscus.core) +(require-macros :hibiscus.vim) + +(g! mapleader " ") + + +(map! [n :noremap] : "Telescope buffers") + +(map! [n :noremap] :tw "lua MiniTrailspace.trim()") + +(map! [n :noremap] :ff "Telescope find_files") +(map! [n :noremap] :fs "Telescope current_buffer_fuzzy_find") +(map! [n :noremap] :gs "Telescope git_status") +(map! [n :noremap] :gg "Telescope live_grep") + +; remap keys so that they dont skip camelCase +(map! [n :noremap :silent] :w "CamelCaseMotion_w") +(map! [n :noremap :silent] :b "CamelCaseMotion_b") +(map! [n :noremap :silent] :e "CamelCaseMotion_e") +(map! [n :noremap :silent] :ge "CamelCaseMotion_ge") + +; this little guy helps you move text, really helpful +(map! [v :noremap] :J ":m '>+1gv=gv") +(map! [v :noremap] :K ":m '<-2gv=gv") + +; Cursor always stays on center +(map! [n :noremap] :J "mzJ`z") +(map! [n :noremap] : "zz") +(map! [n :noremap] : "zz") +(map! [n :noremap] :n "nzzzv") +(map! [n :noremap] :N "Nzzzv") + +(map! [x :noremap] :p (fn [] [:_dP])) +(map! [x :noremap] :p (fn [] [:+dP])) +(map! [n :noremap] :s (fn [] ":%s/\\<\\>//gI")) +(map! [nv :noremap] :d (fn [] [:_d])) diff --git a/fnl/options/opts.fnl b/fnl/options/opts.fnl new file mode 100644 index 0000000..8ce7523 --- /dev/null +++ b/fnl/options/opts.fnl @@ -0,0 +1,65 @@ +(import-macros {: set!} :hibiscus.vim) + +(set! number true) ; enable line number +(set! relativenumber true) ; enable relative line number +(set! undofile true) ; persistent undo +(set! backup false) ; disable backup +(set! autowrite true) ; auto write buffer when it's not focused +(set! ignorecase true) ; case insensitive on search.. +(set! list true) ; display listchars +(set! smartindent true) ; smarter indentation +(set! splitright true) ; split right instead of left +(set! splitkeep "screen") ; stabilize split +(set! startofline false) ; don't go to the start of the line when moving to another file +(set! swapfile false) ; disable swapfile +(set! termguicolors true) ; true colours for better experience +(set! wrap false) ; don't wrap lines +(set! backupcopy "yes") ; fix weirdness for stuff that replaces the entire file when hot reloading + +(set! smarttab false) +(set! tabstop 4) +(set! softtabstop 4) +(set! shiftwidth 4) + +(set! compatible false) ; disable compatibility with old vi +(set! showmatch true) ; show matches while searching for text +(set! hlsearch true) ; highlight text that has been searched +(set! incsearch true) ; incramentally search +(set! shiftwidth 4) +(set! autoindent true) +(set! wildmode "longest,list") +(set! mouse "v") +(set! mouse "a") +(set! clipboard "unnamedplus") ; use system clipboard) +(set! ttyfast true) +(set! cursorline true) +(set! splitbelow true) +(set! autochdir true) +(set! signcolumn "yes:1") +(set! shell "/bin/zsh") +(set! splitright false) + +; disable builtin plugins as they are not needed +(local disabled_built_ins [ + :netrw + :netrwPlugin + :netrwSettings + :netrwFileHandlers + :gzip + :zip + :zipPlugin + :tar + :tarPlugin + :getscript + :getscriptPlugin + :vimball + :vimballPlugin + :2html_plugin + :logipat + :rrhelper + :spellfile_plugin + :matchit +]) + +(each [_ plugin (pairs disabled_built_ins)] + (tset vim.g (.. :loaded_ plugin) 1)) diff --git a/lua/plugins/devicons.lua b/fnl/plugins/devicons.lua similarity index 100% rename from lua/plugins/devicons.lua rename to fnl/plugins/devicons.lua diff --git a/lua/plugins/gitsigns.lua b/fnl/plugins/gitsigns.lua similarity index 100% rename from lua/plugins/gitsigns.lua rename to fnl/plugins/gitsigns.lua diff --git a/lua/plugins/harpoon.lua b/fnl/plugins/harpoon.lua similarity index 100% rename from lua/plugins/harpoon.lua rename to fnl/plugins/harpoon.lua diff --git a/lua/plugins/hlblocks.lua b/fnl/plugins/hlblocks.lua similarity index 100% rename from lua/plugins/hlblocks.lua rename to fnl/plugins/hlblocks.lua diff --git a/lua/plugins/init.lua b/fnl/plugins/init.lua similarity index 100% rename from lua/plugins/init.lua rename to fnl/plugins/init.lua diff --git a/lua/plugins/lazy.lua b/fnl/plugins/lazy.lua similarity index 100% rename from lua/plugins/lazy.lua rename to fnl/plugins/lazy.lua diff --git a/lua/plugins/lsp-zero.lua b/fnl/plugins/lsp-zero.lua similarity index 100% rename from lua/plugins/lsp-zero.lua rename to fnl/plugins/lsp-zero.lua diff --git a/lua/plugins/lualine.lua b/fnl/plugins/lualine.lua similarity index 100% rename from lua/plugins/lualine.lua rename to fnl/plugins/lualine.lua diff --git a/lua/plugins/mini.lua b/fnl/plugins/mini.lua similarity index 100% rename from lua/plugins/mini.lua rename to fnl/plugins/mini.lua diff --git a/lua/plugins/oil.lua b/fnl/plugins/oil.lua similarity index 100% rename from lua/plugins/oil.lua rename to fnl/plugins/oil.lua diff --git a/lua/plugins/telescope.lua b/fnl/plugins/telescope.lua similarity index 100% rename from lua/plugins/telescope.lua rename to fnl/plugins/telescope.lua diff --git a/lua/plugins/treesitter.lua b/fnl/plugins/treesitter.lua similarity index 100% rename from lua/plugins/treesitter.lua rename to fnl/plugins/treesitter.lua diff --git a/lua/plugins/wilder.lua b/fnl/plugins/wilder.lua similarity index 100% rename from lua/plugins/wilder.lua rename to fnl/plugins/wilder.lua diff --git a/init.fnl b/init.fnl new file mode 100644 index 0000000..67dce36 --- /dev/null +++ b/init.fnl @@ -0,0 +1,26 @@ +; ████████╗██████╗ ██╗██╗ ██╗██╗ ██╗ +; ╚══██╔══╝██╔══██╗██║╚██╗██╔╝╚██╗ ██╔╝ +; ██║ ██████╔╝██║ ╚███╔╝ ╚████╔╝ +; ██║ ██╔══██╗██║ ██╔██╗ ╚██╔╝ +; ██║ ██║ ██║██║██╔╝ ██╗ ██║ +; ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═ + +; Listen up, you motherfuckers, +; Those Ivy League dopes, they wanna +; mock us. Tell 'em all this is war. +; And not fighting a war is for suckers. + + +; (when (vim.g.neovide) +; (do +; (set (vim.o.guifont) "FiraCode Nerd Font:h14") +; (set (vim.g.neovide_scale_factor) 1.0) +; (set (vim.g.neovide_refresh_rate) 120) +; (set (vim.g.neovide_refresh_rate_idle) 5) +; (set (vim.g.neovide_cursor_antialiasing) true) +; (set (vim.g.neovide_cursor_animate_in_insert_mode) true) +; (set (vim.g.neovide_cursor_vfx_mode) "ripple"))) + + +(require :plugins) +(require :options) diff --git a/init.lua b/init.lua index c3eb692..7dbc60c 100755 --- a/init.lua +++ b/init.lua @@ -1,37 +1,37 @@ --- _.gd8888888bp._ --- ████████╗██████╗ ██╗██╗ ██╗██╗ ██╗ .g88888888888888888p. --- ╚══██╔══╝██╔══██╗██║╚██╗██╔╝╚██╗ ██╔╝ .d8888P"" ""Y8888b. --- ██║ ██████╔╝██║ ╚███╔╝ ╚████╔╝ "Y8P" "Y8P' --- ██║ ██╔══██╗██║ ██╔██╗ ╚██╔╝ `. ,' --- ██║ ██║ ██║██║██╔╝ ██╗ ██║ \ .-. / --- ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═╝ \ (___) / --- .------------------._______________________:__________j --- / | | |`-.,_ --- \###################|######################|###########|,-'` --- `------------------' : ___ l --- / ( ) \ --- / `-' \ --- ,' `. --- Listen up, you motherfuckers, .d8b. .d8b. --- Those Ivy League dopes, they wanna "Y8888p.. ,.d8888P" --- mock us. Tell 'em all this is war. "Y88888888888888888P" --- And not fighting a war is for suckers. ""YY8888888PP"" +vim.tbl_islist = vim.islist +local default_plugins = {"2html_plugin", "getscript", "getscriptPlugin", "gzip", "logipat", "netrw", "netrwPlugin", "netrwSettings", "netrwFileHandlers", "matchit", "tar", "tarPlugin", "rrhelper", "spellfile_plugin", "vimball", "vimballPlugin", "zip", "zipPlugin", "tutor", "rplugin", "syntax", "synmenu", "optwin", "compiler", "bugreport", "ftplugin"} - --- Setup Lazy.nvim and plugins -require("plugins") - --- Setup standard neovim options -require("options") - - -if vim.g.neovide then - vim.o.guifont = "FiraCode Nerd Font:h14" - vim.g.neovide_scale_factor = 1.0 - vim.g.neovide_refresh_rate = 120 - vim.g.neovide_refresh_rate_idle = 5 - vim.g.neovide_cursor_antialiasing = true - vim.g.neovide_cursor_animate_in_insert_mode = true - vim.g.neovide_cursor_vfx_mode = "ripple" +for _, plugin in pairs(default_plugins) do + vim.g[("loaded_" .. plugin)] = 1 end + +local function bootstrap(url, ref) + local name = url:gsub(".*/", "") + local path + + path = vim.fn.stdpath("data") .. "/lazy/" .. name + vim.opt.rtp:prepend(path) + + if vim.fn.isdirectory(path) == 0 then + print(name .. ": installing in data dir...") + + vim.fn.system {"git", "clone", url, path} + if ref then + vim.fn.system {"git", "-C", path, "checkout", ref} + end + + vim.cmd "redraw" + print(name .. ": finished installing") + end +end + +bootstrap("https://github.com/udayvir-singh/tangerine.nvim") +bootstrap("https://github.com/udayvir-singh/hibiscus.nvim") + +require "tangerine".setup { + compiler = { + verbose = false, + hooks = { "onsave", "oninit" } + } +} diff --git a/lua/options/colors.lua b/lua/options/colors.lua old mode 100755 new mode 100644 index 57a0c86..b982d98 --- a/lua/options/colors.lua +++ b/lua/options/colors.lua @@ -1 +1,2 @@ -vim.cmd("colorscheme carbonfox") +-- :fennel:1720804753 +return vim.cmd("colorscheme carbonfox") \ No newline at end of file diff --git a/lua/options/harpoon.lua b/lua/options/harpoon.lua index 2b35e12..a2093a9 100644 --- a/lua/options/harpoon.lua +++ b/lua/options/harpoon.lua @@ -1,17 +1,35 @@ +-- :fennel:1720806691 local harpoon = require("harpoon") - --- REQUIRED -harpoon:setup() --- REQUIRED - -vim.keymap.set("n", "ha", function() harpoon:list():append() end) -vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) - -vim.keymap.set("n", "", function() harpoon:list():select(1) end) -vim.keymap.set("n", "", function() harpoon:list():select(2) end) -vim.keymap.set("n", "", function() harpoon:list():select(3) end) -vim.keymap.set("n", "", function() harpoon:list():select(4) end) - --- Toggle previous & next buffers stored within Harpoon list -vim.keymap.set("n", "", function() harpoon:list():prev() end) -vim.keymap.set("n", "", function() harpoon:list():next() end) +harpoon.setup() +local function _1_() + return (harpoon.list):append() +end +vim.keymap.set("n", "ha", _1_) +local function _2_() + return harpoon.ui.toggle_quick_menu(harpoon.list()) +end +vim.keymap.set("n", "", _2_) +local function _3_() + return (harpoon.list):select(1) +end +vim.keymap.set("n", "", _3_) +local function _4_() + return (harpoon.list):select(2) +end +vim.keymap.set("n", "", _4_) +local function _5_() + return (harpoon.list):select(3) +end +vim.keymap.set("n", "", _5_) +local function _6_() + return (harpoon.list):select(4) +end +vim.keymap.set("n", "", _6_) +local function _7_() + return (harpoon.list):prev() +end +vim.keymap.set("n", "", _7_) +local function _8_() + return (harpoon.list):next() +end +return vim.keymap.set("n", "", _8_) \ No newline at end of file diff --git a/lua/options/init.lua b/lua/options/init.lua old mode 100755 new mode 100644 index 53edfe7..45505d6 --- a/lua/options/init.lua +++ b/lua/options/init.lua @@ -1,3 +1,5 @@ +-- :fennel:1720814990 require("options.colors") require("options.keybind") require("options.opts") +return require("options.harpoon") \ No newline at end of file diff --git a/lua/options/keybind.lua b/lua/options/keybind.lua old mode 100755 new mode 100644 index 39d8a48..e08f85c --- a/lua/options/keybind.lua +++ b/lua/options/keybind.lua @@ -1,63 +1,35 @@ -vim.g.mapleader = " " - -local map = vim.api.nvim_set_keymap -local cmap = vim.keymap.set - -local options = { noremap = true } -local cmd_options = { noremap = true, silent = true } - - -map('n', '', 'Telescope buffers', options) - --- slef explanitory -map("n", "tw", "lua MiniTrailspace.trim()", options) - -vim.keymap.set("n", "fo", function() - require("oil").open() -end) - - -map("n", "ff", "Telescope find_files", options) -map("n", "fs", "Telescope current_buffer_fuzzy_find", options) -map("n", "gs", "Telescope git_status", options) -map("n", "gg", "Telescope live_grep", options) - - --- remap keys so that they dont skip camelCase -map("n", "w", "CamelCaseMotion_w", cmd_options) -map("n", "b", "CamelCaseMotion_b", cmd_options) -map("n", "e", "CamelCaseMotion_e", cmd_options) -map("n", "ge", "CamelCaseMotion_ge", cmd_options) - - --- this little guy helps you move text, really helpful -map("v", "J", ":m '>+1gv=gv", options) -map("v", "K", ":m '<-2gv=gv", options) - - --- Cursor always stays on center -map("n", "J", "mzJ`z", options) -map("n", "", "zz", options) -map("n", "", "zz", options) -map("n", "n", "nzzzv", options) -map("n", "N", "Nzzzv", options) - - - --- paste text but DONT copy the overridden text -cmap("x", "p", [["_dP]]) -cmap("x", "p", [["+dP]]) --- delete text but DONT copy to clipboard -cmap({ "n", "v" }, "d", [["_d]]) - --- quickfix stuff --- --- --- map("n", "", "cnextzz", options) --- map("n", "", "cprevzz", options) --- map("n", "k", "lnextzz", options) --- map("n", "j", "lprevzz", options) - - --- search and replace every instance of word under cursor -cmap("n", "s", [[:%s/\<\>//gI]]) +-- :fennel:1720807954 +vim.g["mapleader"] = " " +vim.keymap.set({"n"}, "", "Telescope buffers", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "tw", "lua MiniTrailspace.trim()", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "ff", "Telescope find_files", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "fs", "Telescope current_buffer_fuzzy_find", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "gs", "Telescope git_status", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "gg", "Telescope live_grep", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "w", "CamelCaseMotion_w", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "b", "CamelCaseMotion_b", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "e", "CamelCaseMotion_e", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "ge", "CamelCaseMotion_ge", {noremap = true, silent = true}) +vim.keymap.set({"v"}, "J", ":m '>+1gv=gv", {noremap = true, silent = true}) +vim.keymap.set({"v"}, "K", ":m '<-2gv=gv", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "J", "mzJ`z", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "", "zz", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "", "zz", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "n", "nzzzv", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "N", "Nzzzv", {noremap = true, silent = true}) +local function _1_() + return {"_dP"} +end +vim.keymap.set({"x"}, "p", _1_, {noremap = true, silent = true}) +local function _2_() + return {"+dP"} +end +vim.keymap.set({"x"}, "p", _2_, {noremap = true, silent = true}) +local function _3_() + return ":%s/\\<\\>//gI" +end +vim.keymap.set({"n"}, "s", _3_, {noremap = true, silent = true}) +local function _4_() + return {"_d"} +end +return vim.keymap.set({"n", "v"}, "d", _4_, {noremap = true, silent = true}) \ No newline at end of file diff --git a/lua/options/opts.lua b/lua/options/opts.lua old mode 100755 new mode 100644 index 1355a35..32f1f15 --- a/lua/options/opts.lua +++ b/lua/options/opts.lua @@ -1,72 +1,42 @@ -local o = vim.opt - -o.number = true -- enable line number -o.relativenumber = true -- enable relative line number -o.undofile = true -- persistent undo -o.backup = false -- disable backup -o.autowrite = true -- auto write buffer when it's not focused -o.ignorecase = true -- case insensitive on search.. -o.list = true -- display listchars -o.smartindent = true -- smarter indentation -o.splitright = true -- split right instead of left -o.splitkeep = "screen" -- stabilize split -o.startofline = false -- don't go to the start of the line when moving to another file -o.swapfile = false -- disable swapfile -o.termguicolors = true -- true colours for better experience -o.wrap = false -- don't wrap lines -o.backupcopy = "yes" -- fix weirdness for stuff that replaces the entire file when hot reloading - -o.smarttab = false -o.tabstop = 4 -o.softtabstop = 4 -o.shiftwidth = 4 - -o.compatible = false -- disable compatibility with old vi -o.showmatch = true -- show matches while searching for text -o.hlsearch = true -- highlight text that has been searched -o.incsearch = true -- incramentally search -o.shiftwidth = 4 -o.autoindent = true -o.wildmode = "longest,list" -o.mouse = "v" -o.mouse = "a" -o.clipboard = "unnamedplus" -- use system clipboard -o.ttyfast = true -o.cursorline = true -o.splitbelow = true -o.autochdir = true -o.signcolumn ="yes:1" -o.shell = "/bin/zsh" -o.splitright = false - --- vim.api.nvim_command("filetype off") --- vim.api.nvim_command("let &runtimepath.=',~/.vim/bundle/neoterm'") --- vim.api.nvim_command("filetype plugin on") --- vim.api.nvim_command("filetype plugin indent on") --- vim.api.nvim_command("syntax on") - --- disable builtin plugins as they are not needed -local disabled_built_ins = { - "netrw", - "netrwPlugin", - "netrwSettings", - "netrwFileHandlers", - "gzip", - "zip", - "zipPlugin", - "tar", - "tarPlugin", - "getscript", - "getscriptPlugin", - "vimball", - "vimballPlugin", - "2html_plugin", - "logipat", - "rrhelper", - "spellfile_plugin", - "matchit" -} - +-- :fennel:1720814968 +vim.opt["number"] = true +vim.opt["relativenumber"] = true +vim.opt["undofile"] = true +vim.opt["backup"] = false +vim.opt["autowrite"] = true +vim.opt["ignorecase"] = true +vim.opt["list"] = true +vim.opt["smartindent"] = true +vim.opt["splitright"] = true +vim.opt["splitkeep"] = "screen" +vim.opt["startofline"] = false +vim.opt["swapfile"] = false +vim.opt["termguicolors"] = true +vim.opt["wrap"] = false +vim.opt["backupcopy"] = "yes" +vim.opt["smarttab"] = false +vim.opt["tabstop"] = 4 +vim.opt["softtabstop"] = 4 +vim.opt["shiftwidth"] = 4 +vim.opt["compatible"] = false +vim.opt["showmatch"] = true +vim.opt["hlsearch"] = true +vim.opt["incsearch"] = true +vim.opt["shiftwidth"] = 4 +vim.opt["autoindent"] = true +vim.opt["wildmode"] = "longest,list" +vim.opt["mouse"] = "v" +vim.opt["mouse"] = "a" +vim.opt["clipboard"] = "unnamedplus" +vim.opt["ttyfast"] = true +vim.opt["cursorline"] = true +vim.opt["splitbelow"] = true +vim.opt["autochdir"] = true +vim.opt["signcolumn"] = "yes:1" +vim.opt["shell"] = "/bin/zsh" +vim.opt["splitright"] = false +local disabled_built_ins = {"netrw", "netrwPlugin", "netrwSettings", "netrwFileHandlers", "gzip", "zip", "zipPlugin", "tar", "tarPlugin", "getscript", "getscriptPlugin", "vimball", "vimballPlugin", "2html_plugin", "logipat", "rrhelper", "spellfile_plugin", "matchit"} for _, plugin in pairs(disabled_built_ins) do - vim.g["loaded_" .. plugin] = 1 + vim.g[("loaded_" .. plugin)] = 1 end +return nil \ No newline at end of file diff --git a/lua/tangerine_vimrc.lua b/lua/tangerine_vimrc.lua new file mode 100644 index 0000000..32af00b --- /dev/null +++ b/lua/tangerine_vimrc.lua @@ -0,0 +1,3 @@ +-- :fennel:1720807198 +require("plugins") +return require("options") \ No newline at end of file diff --git a/lua_bak/options/colors.lua b/lua_bak/options/colors.lua new file mode 100755 index 0000000..57a0c86 --- /dev/null +++ b/lua_bak/options/colors.lua @@ -0,0 +1 @@ +vim.cmd("colorscheme carbonfox") diff --git a/lua_bak/options/harpoon.lua b/lua_bak/options/harpoon.lua new file mode 100644 index 0000000..2b35e12 --- /dev/null +++ b/lua_bak/options/harpoon.lua @@ -0,0 +1,17 @@ +local harpoon = require("harpoon") + +-- REQUIRED +harpoon:setup() +-- REQUIRED + +vim.keymap.set("n", "ha", function() harpoon:list():append() end) +vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + +vim.keymap.set("n", "", function() harpoon:list():select(1) end) +vim.keymap.set("n", "", function() harpoon:list():select(2) end) +vim.keymap.set("n", "", function() harpoon:list():select(3) end) +vim.keymap.set("n", "", function() harpoon:list():select(4) end) + +-- Toggle previous & next buffers stored within Harpoon list +vim.keymap.set("n", "", function() harpoon:list():prev() end) +vim.keymap.set("n", "", function() harpoon:list():next() end) diff --git a/lua_bak/options/init.lua b/lua_bak/options/init.lua new file mode 100755 index 0000000..53edfe7 --- /dev/null +++ b/lua_bak/options/init.lua @@ -0,0 +1,3 @@ +require("options.colors") +require("options.keybind") +require("options.opts") diff --git a/lua_bak/options/keybind.lua b/lua_bak/options/keybind.lua new file mode 100755 index 0000000..39d8a48 --- /dev/null +++ b/lua_bak/options/keybind.lua @@ -0,0 +1,63 @@ +vim.g.mapleader = " " + +local map = vim.api.nvim_set_keymap +local cmap = vim.keymap.set + +local options = { noremap = true } +local cmd_options = { noremap = true, silent = true } + + +map('n', '', 'Telescope buffers', options) + +-- slef explanitory +map("n", "tw", "lua MiniTrailspace.trim()", options) + +vim.keymap.set("n", "fo", function() + require("oil").open() +end) + + +map("n", "ff", "Telescope find_files", options) +map("n", "fs", "Telescope current_buffer_fuzzy_find", options) +map("n", "gs", "Telescope git_status", options) +map("n", "gg", "Telescope live_grep", options) + + +-- remap keys so that they dont skip camelCase +map("n", "w", "CamelCaseMotion_w", cmd_options) +map("n", "b", "CamelCaseMotion_b", cmd_options) +map("n", "e", "CamelCaseMotion_e", cmd_options) +map("n", "ge", "CamelCaseMotion_ge", cmd_options) + + +-- this little guy helps you move text, really helpful +map("v", "J", ":m '>+1gv=gv", options) +map("v", "K", ":m '<-2gv=gv", options) + + +-- Cursor always stays on center +map("n", "J", "mzJ`z", options) +map("n", "", "zz", options) +map("n", "", "zz", options) +map("n", "n", "nzzzv", options) +map("n", "N", "Nzzzv", options) + + + +-- paste text but DONT copy the overridden text +cmap("x", "p", [["_dP]]) +cmap("x", "p", [["+dP]]) +-- delete text but DONT copy to clipboard +cmap({ "n", "v" }, "d", [["_d]]) + +-- quickfix stuff +-- +-- +-- map("n", "", "cnextzz", options) +-- map("n", "", "cprevzz", options) +-- map("n", "k", "lnextzz", options) +-- map("n", "j", "lprevzz", options) + + +-- search and replace every instance of word under cursor +cmap("n", "s", [[:%s/\<\>//gI]]) diff --git a/lua_bak/options/opts.lua b/lua_bak/options/opts.lua new file mode 100755 index 0000000..1355a35 --- /dev/null +++ b/lua_bak/options/opts.lua @@ -0,0 +1,72 @@ +local o = vim.opt + +o.number = true -- enable line number +o.relativenumber = true -- enable relative line number +o.undofile = true -- persistent undo +o.backup = false -- disable backup +o.autowrite = true -- auto write buffer when it's not focused +o.ignorecase = true -- case insensitive on search.. +o.list = true -- display listchars +o.smartindent = true -- smarter indentation +o.splitright = true -- split right instead of left +o.splitkeep = "screen" -- stabilize split +o.startofline = false -- don't go to the start of the line when moving to another file +o.swapfile = false -- disable swapfile +o.termguicolors = true -- true colours for better experience +o.wrap = false -- don't wrap lines +o.backupcopy = "yes" -- fix weirdness for stuff that replaces the entire file when hot reloading + +o.smarttab = false +o.tabstop = 4 +o.softtabstop = 4 +o.shiftwidth = 4 + +o.compatible = false -- disable compatibility with old vi +o.showmatch = true -- show matches while searching for text +o.hlsearch = true -- highlight text that has been searched +o.incsearch = true -- incramentally search +o.shiftwidth = 4 +o.autoindent = true +o.wildmode = "longest,list" +o.mouse = "v" +o.mouse = "a" +o.clipboard = "unnamedplus" -- use system clipboard +o.ttyfast = true +o.cursorline = true +o.splitbelow = true +o.autochdir = true +o.signcolumn ="yes:1" +o.shell = "/bin/zsh" +o.splitright = false + +-- vim.api.nvim_command("filetype off") +-- vim.api.nvim_command("let &runtimepath.=',~/.vim/bundle/neoterm'") +-- vim.api.nvim_command("filetype plugin on") +-- vim.api.nvim_command("filetype plugin indent on") +-- vim.api.nvim_command("syntax on") + +-- disable builtin plugins as they are not needed +local disabled_built_ins = { + "netrw", + "netrwPlugin", + "netrwSettings", + "netrwFileHandlers", + "gzip", + "zip", + "zipPlugin", + "tar", + "tarPlugin", + "getscript", + "getscriptPlugin", + "vimball", + "vimballPlugin", + "2html_plugin", + "logipat", + "rrhelper", + "spellfile_plugin", + "matchit" +} + +for _, plugin in pairs(disabled_built_ins) do + vim.g["loaded_" .. plugin] = 1 +end diff --git a/lua_bak/plugins/devicons.lua b/lua_bak/plugins/devicons.lua new file mode 100755 index 0000000..34d22f1 --- /dev/null +++ b/lua_bak/plugins/devicons.lua @@ -0,0 +1,47 @@ +require'nvim-web-devicons'.setup { + -- your personnal icons can go here (to override) + -- you can specify color or cterm_color instead of specifying both of them + -- DevIcon will be appended to `name` + override = { + zsh = { + icon = "", + color = "#428850", + cterm_color = "65", + name = "Zsh" + } + }; + + + -- globally enable different highlight colors per icon (default to true) + -- if set to false all icons will have the default icon's color + color_icons = true; + + -- globally enable default icons (default to false) + -- will get overriden by `get_icons` option + default = true; + + -- globally enable "strict" selection of icons - icon will be looked up in + -- different tables, first by filename, and if not found by extension; this + -- prevents cases when file doesn't have any extension but still gets some icon + -- because its name happened to match some extension (default to false) + strict = true; + + -- same as `override` but specifically for overrides by filename + -- takes effect when `strict` is true + override_by_filename = { + [".gitignore"] = { + icon = "", + color = "#f1502f", + name = "Gitignore" + } + }; + -- same as `override` but specifically for overrides by extension + -- takes effect when `strict` is true + override_by_extension = { + ["log"] = { + icon = "", + color = "#81e043", + name = "Log" + } + }; +} diff --git a/lua_bak/plugins/gitsigns.lua b/lua_bak/plugins/gitsigns.lua new file mode 100755 index 0000000..238be07 --- /dev/null +++ b/lua_bak/plugins/gitsigns.lua @@ -0,0 +1,45 @@ +require('gitsigns').setup { + signs = { + add = { text = '▍' }, + change = { text = '▍' }, + delete = { text = '▍' }, + topdelete = { text = '▍' }, + changedelete = { text = '▍' }, + untracked = { text = '▎' }, + }, + + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + + watch_gitdir = { + follow_files = true + }, + + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + + current_line_blame_opts = { + virt_text = true, + virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + + current_line_blame_formatter = ', - ', + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + + preview_config = { + -- Options passed to nvim_open_win + border = 'single', + style = 'minimal', + relative = 'cursor', + row = 0, + col = 1 + }, + +} diff --git a/lua_bak/plugins/harpoon.lua b/lua_bak/plugins/harpoon.lua new file mode 100644 index 0000000..0aef657 --- /dev/null +++ b/lua_bak/plugins/harpoon.lua @@ -0,0 +1,17 @@ +local harpoon = require("harpoon") + +-- REQUIRED +harpoon:setup() +-- REQUIRED + +vim.keymap.set("n", "a", function() harpoon:list():append() end) +vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) + +vim.keymap.set("n", "", function() harpoon:list():select(1) end) +vim.keymap.set("n", "", function() harpoon:list():select(2) end) +vim.keymap.set("n", "", function() harpoon:list():select(3) end) +vim.keymap.set("n", "", function() harpoon:list():select(4) end) + +-- Toggle previous & next buffers stored within Harpoon list +vim.keymap.set("n", "", function() harpoon:list():prev() end) +vim.keymap.set("n", "", function() harpoon:list():next() end) diff --git a/lua_bak/plugins/hlblocks.lua b/lua_bak/plugins/hlblocks.lua new file mode 100755 index 0000000..e90fa48 --- /dev/null +++ b/lua_bak/plugins/hlblocks.lua @@ -0,0 +1,39 @@ +require('hlchunk').setup({ + indent = { + chars = { "·", "·", "·", "·", }, + --chars = { "│", "¦", "┆", "┊", }, -- more code can be found in https://unicodeplus.com/ + + style = { + "#888888", + "#666666", + "#444444", + "#333333", + "#333333", + "#333333", + "#333333", + "#333333", + } + + + }, + + blank = { + enable = false, + }, + + chunk = { + chars = { + horizontal_line = "", + vertical_line = "", + left_top = "", + left_bottom = "", + right_arrow = "", + }, + style = "#FF7F00", + }, + + line_num = { + style = "#FFFFFF", + }, + +}) diff --git a/lua_bak/plugins/init.lua b/lua_bak/plugins/init.lua new file mode 100755 index 0000000..fc276c0 --- /dev/null +++ b/lua_bak/plugins/init.lua @@ -0,0 +1,12 @@ +require("plugins.lazy") +require("plugins.devicons") +require("plugins.gitsigns") +require("plugins.harpoon") +require("plugins.hlblocks") +require("plugins.lsp-zero") +require("plugins.lualine") +require("plugins.mini") +require("plugins.oil") +require("plugins.telescope") +require("plugins.treesitter") +require("plugins.wilder") diff --git a/lua_bak/plugins/lazy.lua b/lua_bak/plugins/lazy.lua new file mode 100755 index 0000000..a213ec5 --- /dev/null +++ b/lua_bak/plugins/lazy.lua @@ -0,0 +1,115 @@ +local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' + +if not vim.loop.fs_stat(lazypath) then + vim.fn.system({ + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', + '--branch=stable', -- latest stable release + lazypath, + }) +end + +vim.opt.rtp:prepend(lazypath) + +require('lazy').setup({ + + 'EdenEast/nightfox.nvim', + 'luckasRanarison/tree-sitter-hypr', + + 'lambdalisue/nerdfont.vim', + 'gelguy/wilder.nvim', + + 'bkad/camelcasemotion', + 'lewis6991/gitsigns.nvim', + + { + 'nvim-telescope/telescope.nvim', + tag = '0.1.8', + dependencies = { + 'nvim-lua/plenary.nvim' + } + }, + + { + 'stevearc/oil.nvim', + dependencies = { + 'nvim-tree/nvim-web-devicons' + }, + }, + + { + 'kylechui/nvim-surround', + version = '*', -- Use for stability; omit to use `main` branch for the latest features + config = function() + require('nvim-surround').setup() + end + }, + + { + 'OXY2DEV/markview.nvim', + config = function() + require('markview').setup() + end, + dependencies = { + -- You may not need this if you don't lazy load + -- Or if the parsers are in your $RUNTIMEPATH + "nvim-treesitter/nvim-treesitter", + + "nvim-tree/nvim-web-devicons" + }, + }, + + { + 'shellRaining/hlchunk.nvim', + event = { + 'UIEnter' + }, + }, + + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + dependencies = { + 'nvim-lua/plenary.nvim' + } + }, + + { + 'nvim-lualine/lualine.nvim', + dependencies = + { + 'nvim-tree/nvim-web-devicons', + opt = true + } + }, + + { + 'nvim-treesitter/nvim-treesitter', + build = ':TSUpdate' + }, + + { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v3.x', + dependencies = { + -- LSP Support + 'neovim/nvim-lspconfig', + 'williamboman/mason.nvim', + 'williamboman/mason-lspconfig.nvim', + + -- Autocompletion + 'hrsh7th/nvim-cmp', + 'hrsh7th/cmp-nvim-lsp', + 'L3MON4D3/LuaSnip', + } + }, + + { + 'echasnovski/mini.nvim', + version = false + }, +}) + +vim.opt.laststatus=2 diff --git a/lua_bak/plugins/lsp-zero.lua b/lua_bak/plugins/lsp-zero.lua new file mode 100755 index 0000000..740a26b --- /dev/null +++ b/lua_bak/plugins/lsp-zero.lua @@ -0,0 +1,67 @@ +require('mason').setup() +local lsp = require('lsp-zero').preset({}) + +lsp.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp.default_keymaps({buffer = bufnr}) +end) + +-- (Optional) Configure lua language server for neovim +require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) + + +require('lspconfig').pylsp.setup{ + settings = { + pylsp = { + plugins = { + pycodestyle = { + ignore = {'W391', 'E303', 'E226'}, + maxLineLength = 120 + } + } + } + } +} + +lsp.setup() + +-- You need to setup `cmp` after lsp-zero +local cmp = require('cmp') +local cmp_action = require('lsp-zero').cmp_action() + + +cmp.setup({ + mapping = { + -- `Enter` key to confirm completion + [''] = cmp.mapping.confirm({select = true}), + + + + -- Cycle with tab, as intended by divine creation + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, {"i", "s"}), + + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + end, {"i", "s"}), + + + -- Ctrl+Space to trigger completion menu + [''] = cmp.mapping.complete(), + + -- Navigate between snippet placeholder + [''] = cmp_action.luasnip_jump_forward(), + [''] = cmp_action.luasnip_jump_backward(), + } +}) diff --git a/lua_bak/plugins/lualine.lua b/lua_bak/plugins/lualine.lua new file mode 100755 index 0000000..f36f783 --- /dev/null +++ b/lua_bak/plugins/lualine.lua @@ -0,0 +1,276 @@ +-- Eviline config for lualine +-- Author: shadmansaleh +-- Credit: glepnir +local lualine = require('lualine') + +local colors = { + bg = '#202328', + fg = '#bbc2cf', + yellow = '#ECBE7B', + cyan = '#008080', + darkblue = '#081633', + green = '#98be65', + orange = '#FF8800', + violet = '#a9a1e1', + magenta = '#c678dd', + blue = '#51afef', + red = '#ec5f67', +} + + +local conditions = { + buffer_not_empty = function() + return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 + end, + hide_in_width = function() + return vim.fn.winwidth(0) > 80 + end, + check_git_workspace = function() + local filepath = vim.fn.expand('%:p:h') + local gitdir = vim.fn.finddir('.git', filepath .. ';') + return gitdir and #gitdir > 0 and #gitdir < #filepath + end, +} + +-- Config +local config = { + options = { + component_separators = '', + section_separators = '', + theme = { + + normal = { + c = { + fg = colors.fg, + bg = colors.bg + } + }, + + inactive = { + c = { + fg = colors.fg, + bg = colors.bg + } + }, + + }, + }, + + + sections = { + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, + inactive_sections = { + lualine_a = {}, + lualine_b = {}, + lualine_y = {}, + lualine_z = {}, + lualine_c = {}, + lualine_x = {}, + }, +} + +local function ins_left(component) + table.insert(config.sections.lualine_c, component) +end + +local function ins_right(component) + table.insert(config.sections.lualine_x, component) +end + +ins_left { + function() + return '▊' + end, + + color = { fg = colors.blue }, + + padding = { + left = 0, + right = 1 + }, +} + + + +ins_left { + function() + return '' + --return '' + -- local mode_string = { + -- n = 'Normal', + -- i = 'Insert', + -- v = 'Visual', + -- V = 'Visual line', + -- c = 'Change', + -- no = 'dunno1', + -- s = 'dunno2', + -- S = 'dunno3', + -- [''] = 'dunno4', + -- ic = 'dunno5', + -- R = 'dunno6', + -- Rv = 'dunno7', + -- cv = 'dunno8', + -- ce = 'dunno9', + -- r = 'dunno10', + -- rm = 'dunno11', + -- ['r?'] = 'dunno12', + -- ['!'] = 'dunno13', + -- t = 'dunno14', + -- } + -- return mode_string[vim.fn.mode()] + -- + end, + color = function() + local mode_color = { + n = colors.blue, + i = colors.red, + v = colors.green, + [''] = colors.orange, + V = colors.green, + c = colors.magenta, + no = colors.red, + s = colors.orange, + S = colors.orange, + [''] = colors.orange, + ic = colors.yellow, + R = colors.violet, + Rv = colors.violet, + cv = colors.red, + ce = colors.red, + r = colors.cyan, + rm = colors.cyan, + ['r?'] = colors.cyan, + ['!'] = colors.red, + t = colors.red, + } + return { fg = mode_color[vim.fn.mode()] } + end, + padding = { right = 1 }, +} + + +ins_left { + 'branch', + icon = '', + + color = { + fg = colors.violet, + gui = 'bold' + }, +} + +ins_left { + 'diff', + + symbols = { + added = ' ', + modified = ' ', + removed = ' ' + }, + + diff_color = { + added = { fg = colors.green }, + modified = { fg = colors.orange }, + removed = { fg = colors.red }, + }, + + cond = conditions.hide_in_width, +} + + + +ins_left { + 'diagnostics', + + sources = { 'nvim_diagnostic' }, + + symbols = { + error = ' ', + warn = ' ', + info = ' ' + }, + + diagnostics_color = { + color_error = { fg = colors.red }, + color_warn = { fg = colors.yellow }, + color_info = { fg = colors.cyan }, + }, +} + +ins_left { + function() + return '%=' + end, +} + + +ins_left { + 'filename', + cond = conditions.buffer_not_empty, + + color = { + fg = colors.magenta, + gui = 'bold' + }, +} + + +ins_right { + 'filetype', + colored = true, + icon_only = false, + icon = { align = 'right' } +} + +ins_right { + 'progress', + + color = { + fg = colors.fg, + gui = 'bold' + } +} + + +ins_right { + 'o:encoding', + + fmt = string.upper, + cond = conditions.hide_in_width, + + color = { + fg = colors.green, + gui = 'bold' + }, +} + + +ins_right { + 'fileformat', + + fmt = string.upper, + icons_enabled = false, + + color = { + fg = colors.green, + gui = 'bold' + }, +} + + +ins_right { + function() + return '▊' + end, + + color = { fg = colors.blue }, + padding = { left = 1 }, +} + +lualine.setup(config) diff --git a/lua_bak/plugins/mini.lua b/lua_bak/plugins/mini.lua new file mode 100755 index 0000000..e1a616b --- /dev/null +++ b/lua_bak/plugins/mini.lua @@ -0,0 +1,108 @@ +require('mini.cursorword').setup() +require('mini.trailspace').setup() +require('mini.pairs').setup() + + +local miniclue = require('mini.clue') +miniclue.setup({ + triggers = { + -- Leader triggers + { mode = 'n', keys = '' }, + { mode = 'x', keys = '' }, + + -- Built-in completion + { mode = 'i', keys = '' }, + + -- `g` key + { mode = 'n', keys = 'g' }, + { mode = 'x', keys = 'g' }, + + -- Marks + { mode = 'n', keys = "'" }, + { mode = 'n', keys = '`' }, + { mode = 'x', keys = "'" }, + { mode = 'x', keys = '`' }, + + -- Registers + { mode = 'n', keys = '"' }, + { mode = 'x', keys = '"' }, + { mode = 'i', keys = '' }, + { mode = 'c', keys = '' }, + + -- Window commands + { mode = 'n', keys = '' }, + + -- `z` key + { mode = 'n', keys = 'z' }, + { mode = 'x', keys = 'z' }, + }, + + clues = { + -- Enhance this by adding descriptions for mapping groups + miniclue.gen_clues.builtin_completion(), + miniclue.gen_clues.g(), + miniclue.gen_clues.marks(), + miniclue.gen_clues.registers(), + miniclue.gen_clues.windows(), + miniclue.gen_clues.z(), + }, + + -- Array of opt-in triggers which start custom key query process. + -- **Needs to have something in order to show clues**. + -- Clue window settings + window = { + -- Floating window config + config = {}, + + -- Delay before showing clue window + delay = 400, + + -- Keys to scroll inside the clue window + scroll_down = '', + scroll_up = '', + }, +}) + + +require('mini.surround').setup( + { + -- Add custom surroundings to be used on top of builtin ones. For more + -- information with examples, see `:h MiniSurround.config`. + custom_surroundings = nil, + + -- Duration (in ms) of highlight when calling `MiniSurround.highlight()` + highlight_duration = 500, + + -- Module mappings. Use `''` (empty string) to disable one. + mappings = { + add = 'sa', -- Add surrounding in Normal and Visual modes + delete = 'sd', -- Delete surrounding + find = 'sf', -- Find surrounding (to the right) + find_left = 'sF', -- Find surrounding (to the left) + highlight = 'sh', -- Highlight surrounding + replace = 'sr', -- Replace surrounding + update_n_lines = 'sn', -- Update `n_lines` + + suffix_last = 'l', -- Suffix to search with "prev" method + suffix_next = 'n', -- Suffix to search with "next" method + }, + + -- Number of lines within which surrounding is searched + n_lines = 20, + + -- Whether to respect selection type: + -- - Place surroundings on separate lines in linewise mode. + -- - Place surroundings on each line in blockwise mode. + respect_selection_type = false, + + -- How to search for surrounding (first inside current line, then inside + -- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev', + -- 'cover_or_nearest', 'next', 'prev', 'nearest'. For more details, + -- see `:h MiniSurround.config`. + search_method = 'cover', + + -- Whether to disable showing non-error feedback + silent = false, + } +) + diff --git a/lua_bak/plugins/oil.lua b/lua_bak/plugins/oil.lua new file mode 100644 index 0000000..1e1aaca --- /dev/null +++ b/lua_bak/plugins/oil.lua @@ -0,0 +1,177 @@ +require("oil").setup({ + -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) + -- Set to false if you still want to use netrw. + default_file_explorer = true, + -- Id is automatically added at the beginning, and name at the end + -- See :help oil-columns + columns = { + "icon", + -- "permissions", + -- "size", + -- "mtime", + }, + -- Buffer-local options to use for oil buffers + buf_options = { + buflisted = false, + bufhidden = "hide", + }, + -- Window-local options to use for oil buffers + win_options = { + wrap = false, + signcolumn = "no", + cursorcolumn = false, + foldcolumn = "0", + spell = false, + list = false, + conceallevel = 3, + concealcursor = "nvic", + }, + -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) + delete_to_trash = false, + -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) + skip_confirm_for_simple_edits = false, + -- Selecting a new/moved/renamed file or directory will prompt you to save changes first + -- (:help prompt_save_on_select_new_entry) + prompt_save_on_select_new_entry = true, + -- Oil will automatically delete hidden buffers after this delay + -- You can set the delay to false to disable cleanup entirely + -- Note that the cleanup process only starts when none of the oil buffers are currently displayed + cleanup_delay_ms = 2000, + lsp_file_methods = { + -- Time to wait for LSP file operations to complete before skipping + timeout_ms = 1000, + -- Set to true to autosave buffers that are updated with LSP willRenameFiles + -- Set to "unmodified" to only save unmodified buffers + autosave_changes = false, + }, + -- Constrain the cursor to the editable parts of the oil buffer + -- Set to `false` to disable, or "name" to keep it on the file names + constrain_cursor = "editable", + -- Set to true to watch the filesystem for changes and reload oil + experimental_watch_for_changes = false, + -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap + -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" }) + -- Additionally, if it is a string that matches "actions.", + -- it will use the mapping at require("oil.actions"). + -- Set to `false` to remove a keymap + -- See :help oil-actions for a list of all available actions + keymaps = { + ["g?"] = "actions.show_help", + [""] = "actions.select", + [""] = "actions.select_vsplit", + [""] = "actions.select_split", + [""] = "actions.select_tab", + [""] = "actions.preview", + [""] = "actions.close", + [""] = "actions.refresh", + ["-"] = "actions.parent", + ["_"] = "actions.open_cwd", + ["`"] = "actions.cd", + ["~"] = "actions.tcd", + ["gs"] = "actions.change_sort", + ["gx"] = "actions.open_external", + ["g."] = "actions.toggle_hidden", + ["g\\"] = "actions.toggle_trash", + }, + -- Set to false to disable all of the above keymaps + use_default_keymaps = true, + view_options = { + -- Show files and directories that start with "." + show_hidden = false, + -- This function defines what is considered a "hidden" file + is_hidden_file = function(name, bufnr) + return vim.startswith(name, ".") + end, + -- This function defines what will never be shown, even when `show_hidden` is set + is_always_hidden = function(name, bufnr) + return false + end, + -- Sort file names in a more intuitive order for humans. Is less performant, + -- so you may want to set to false if you work with large directories. + natural_order = true, + sort = { + -- sort order can be "asc" or "desc" + -- see :help oil-columns to see which columns are sortable + { "type", "asc" }, + { "name", "asc" }, + }, + }, + -- Extra arguments to pass to SCP when moving/copying files over SSH + extra_scp_args = {}, + -- EXPERIMENTAL support for performing file operations with git + git = { + -- Return true to automatically git add/mv/rm files + add = function(path) + return false + end, + mv = function(src_path, dest_path) + return false + end, + rm = function(path) + return false + end, + }, + -- Configuration for the floating window in oil.open_float + float = { + -- Padding around the floating window + padding = 2, + max_width = 0, + max_height = 0, + border = "rounded", + win_options = { + winblend = 0, + }, + -- This is the config that will be passed to nvim_open_win. + -- Change values here to customize the layout + override = function(conf) + return conf + end, + }, + -- Configuration for the actions floating preview window + preview = { + -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_width and max_width can be a single value or a list of mixed integer/float types. + -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" + max_width = 0.9, + -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" + min_width = { 40, 0.4 }, + -- optionally define an integer/float for the exact width of the preview window + width = nil, + -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) + -- min_height and max_height can be a single value or a list of mixed integer/float types. + -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" + max_height = 0.9, + -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" + min_height = { 5, 0.1 }, + -- optionally define an integer/float for the exact height of the preview window + height = nil, + border = "rounded", + win_options = { + winblend = 0, + }, + -- Whether the preview window is automatically updated when the cursor is moved + update_on_cursor_moved = true, + }, + -- Configuration for the floating progress window + progress = { + max_width = 0.9, + min_width = { 40, 0.4 }, + width = nil, + max_height = { 10, 0.9 }, + min_height = { 5, 0.1 }, + height = nil, + border = "rounded", + minimized_border = "none", + win_options = { + winblend = 0, + }, + }, + -- Configuration for the floating SSH window + ssh = { + border = "rounded", + }, + -- Configuration for the floating keymaps help window + keymaps_help = { + border = "rounded", + }, +}) diff --git a/lua_bak/plugins/telescope.lua b/lua_bak/plugins/telescope.lua new file mode 100644 index 0000000..9808531 --- /dev/null +++ b/lua_bak/plugins/telescope.lua @@ -0,0 +1,30 @@ +require('telescope').setup{ + defaults = { + -- Default configuration for telescope goes here: + -- config_key = value, + mappings = { + i = { + -- map actions.which_key to (default: ) + -- actions.which_key shows the mappings for your picker, + -- e.g. git_{create, delete, ...}_branch for the git_branches picker + [""] = "which_key" + } + } + }, + pickers = { + -- Default configuration for builtin pickers goes here: + -- picker_name = { + -- picker_config_key = value, + -- ... + -- } + -- Now the picker_config_key will be applied every time you call this + -- builtin picker + }, + extensions = { + -- Your extension configuration goes here: + -- extension_name = { + -- extension_config_key = value, + -- } + -- please take a look at the readme of the extension you want to configure + } +} diff --git a/lua_bak/plugins/treesitter.lua b/lua_bak/plugins/treesitter.lua new file mode 100755 index 0000000..54407a8 --- /dev/null +++ b/lua_bak/plugins/treesitter.lua @@ -0,0 +1,27 @@ +require'nvim-treesitter.configs'.setup { + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "haskell", "go", "bash", "python" }, + + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + highlight = { + enable = true, + }, +} + + + +local parser_config = require("nvim-treesitter.parsers").get_parser_configs() +parser_config.hypr = { + install_info = { + url = "https://github.com/luckasRanarison/tree-sitter-hypr", + files = { "src/parser.c" }, + branch = "master", + }, + filetype = "hypr", +} diff --git a/lua_bak/plugins/wilder.lua b/lua_bak/plugins/wilder.lua new file mode 100755 index 0000000..5c7e58b --- /dev/null +++ b/lua_bak/plugins/wilder.lua @@ -0,0 +1,28 @@ +local wilder = require('wilder') + +wilder.setup({ + modes = {':', '/', '?'} +}) + + +wilder.set_option('renderer', wilder.renderer_mux({ + [':'] = wilder.popupmenu_renderer({ + highlighter = wilder.basic_highlighter(), + left = {' ', wilder.popupmenu_devicons()}, + right = {' ', wilder.popupmenu_scrollbar()}, + }), + ['/'] = wilder.wildmenu_renderer({ + highlighter = wilder.basic_highlighter(), + left = {' ', wilder.popupmenu_devicons()}, + right = {' ', wilder.popupmenu_scrollbar()}, + }), +})) + + +wilder.set_option('renderer', wilder.popupmenu_renderer({ + highlighter = wilder.basic_highlighter(), + left = {' ', wilder.popupmenu_devicons()}, + right = {' ', wilder.popupmenu_scrollbar()}, + max_height = '20%', + min_width = '100%' +})) From 2afcf3205bd83dda007f311e1746f359645c4851 Mon Sep 17 00:00:00 2001 From: Jovan Djokic-Sumarac Date: Sun, 14 Jul 2024 19:04:45 +0200 Subject: [PATCH 2/2] rewrite in fennel, second cour --- .gitignore | 1 + fnl/options/harpoon.fnl | 18 -- fnl/options/init.fnl | 10 +- fnl/options/keybind.fnl | 3 +- fnl/options/opts.fnl | 40 +--- fnl/plugins/devicons.fnl | 33 +++ fnl/plugins/devicons.lua | 47 ---- fnl/plugins/gitsigns.fnl | 46 ++++ fnl/plugins/gitsigns.lua | 45 ---- fnl/plugins/harpoon.fnl | 18 ++ fnl/plugins/harpoon.lua | 17 -- fnl/plugins/hlblocks.fnl | 39 ++++ fnl/plugins/hlblocks.lua | 39 ---- fnl/plugins/init.fnl | 15 ++ fnl/plugins/init.lua | 12 -- fnl/plugins/lazy.fnl | 91 ++++++++ fnl/plugins/{lazy.lua => lazyinlua.bak} | 0 fnl/plugins/lsp-zero.fnl | 43 ++++ fnl/plugins/lsp-zero.lua | 67 ------ fnl/plugins/lualine.fnl | 257 ++++++++++++++++++++++ fnl/plugins/lualine.lua | 276 ------------------------ fnl/plugins/mini.fnl | 14 ++ fnl/plugins/mini.lua | 108 ---------- fnl/plugins/oil.fnl | 2 + fnl/plugins/oil.lua | 177 --------------- fnl/plugins/telescope.fnl | 2 + fnl/plugins/telescope.lua | 30 --- fnl/plugins/treesitter.fnl | 28 +++ fnl/plugins/treesitter.lua | 27 --- fnl/plugins/wilder.fnl | 24 +++ fnl/plugins/wilder.lua | 28 --- init.fnl | 63 ++++-- init.lua | 10 +- lua/options/colors.lua | 2 - lua/options/harpoon.lua | 35 --- lua/options/init.lua | 5 - lua/options/keybind.lua | 35 --- lua/options/opts.lua | 42 ---- lua/tangerine_vimrc.lua | 3 - 39 files changed, 680 insertions(+), 1072 deletions(-) delete mode 100644 fnl/options/harpoon.fnl create mode 100755 fnl/plugins/devicons.fnl delete mode 100755 fnl/plugins/devicons.lua create mode 100755 fnl/plugins/gitsigns.fnl delete mode 100755 fnl/plugins/gitsigns.lua create mode 100644 fnl/plugins/harpoon.fnl delete mode 100644 fnl/plugins/harpoon.lua create mode 100755 fnl/plugins/hlblocks.fnl delete mode 100755 fnl/plugins/hlblocks.lua create mode 100755 fnl/plugins/init.fnl delete mode 100755 fnl/plugins/init.lua create mode 100755 fnl/plugins/lazy.fnl rename fnl/plugins/{lazy.lua => lazyinlua.bak} (100%) create mode 100755 fnl/plugins/lsp-zero.fnl delete mode 100755 fnl/plugins/lsp-zero.lua create mode 100755 fnl/plugins/lualine.fnl delete mode 100755 fnl/plugins/lualine.lua create mode 100644 fnl/plugins/mini.fnl delete mode 100755 fnl/plugins/mini.lua create mode 100644 fnl/plugins/oil.fnl delete mode 100644 fnl/plugins/oil.lua create mode 100644 fnl/plugins/telescope.fnl delete mode 100644 fnl/plugins/telescope.lua create mode 100755 fnl/plugins/treesitter.fnl delete mode 100755 fnl/plugins/treesitter.lua create mode 100755 fnl/plugins/wilder.fnl delete mode 100755 fnl/plugins/wilder.lua delete mode 100644 lua/options/colors.lua delete mode 100644 lua/options/harpoon.lua delete mode 100644 lua/options/init.lua delete mode 100644 lua/options/keybind.lua delete mode 100644 lua/options/opts.lua delete mode 100644 lua/tangerine_vimrc.lua diff --git a/.gitignore b/.gitignore index e033bc6..a4fa4cf 100755 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ +lua/ lazy-lock.json diff --git a/fnl/options/harpoon.fnl b/fnl/options/harpoon.fnl deleted file mode 100644 index a5096bf..0000000 --- a/fnl/options/harpoon.fnl +++ /dev/null @@ -1,18 +0,0 @@ -(local harpoon (require :harpoon)) - -;; REQUIRED -(harpoon.setup) -;; REQUIRED - -(vim.keymap.set :n :ha (fn [] (harpoon.list:append))) - -(vim.keymap.set :n : (fn [] (harpoon.ui.toggle_quick_menu (harpoon.list)))) - -(vim.keymap.set :n : (fn [] (harpoon.list:select 1))) -(vim.keymap.set :n : (fn [] (harpoon.list:select 2))) -(vim.keymap.set :n : (fn [] (harpoon.list:select 3))) -(vim.keymap.set :n : (fn [] (harpoon.list:select 4))) - -;; Toggle previous & next buffers stored within Harpoon list -(vim.keymap.set :n : (fn [] (harpoon.list:prev))) -(vim.keymap.set :n : (fn [] (harpoon.list:next))) diff --git a/fnl/options/init.fnl b/fnl/options/init.fnl index 91201e6..146112e 100755 --- a/fnl/options/init.fnl +++ b/fnl/options/init.fnl @@ -1,4 +1,6 @@ -(require :options.colors) -(require :options.keybind) -(require :options.opts) -(require :options.harpoon) +(local dir :options.) +(fn modul [name] (.. dir name)) + +(require (modul :colors)) +(require (modul :keybind)) +(require (modul :opts)) diff --git a/fnl/options/keybind.fnl b/fnl/options/keybind.fnl index 07b2eaf..39d9c3c 100755 --- a/fnl/options/keybind.fnl +++ b/fnl/options/keybind.fnl @@ -8,6 +8,7 @@ (map! [n :noremap] :tw "lua MiniTrailspace.trim()") +(map! [n :noremap] :fo "Oil") (map! [n :noremap] :ff "Telescope find_files") (map! [n :noremap] :fs "Telescope current_buffer_fuzzy_find") (map! [n :noremap] :gs "Telescope git_status") @@ -32,5 +33,5 @@ (map! [x :noremap] :p (fn [] [:_dP])) (map! [x :noremap] :p (fn [] [:+dP])) -(map! [n :noremap] :s (fn [] ":%s/\\<\\>//gI")) +(map! [n :noremap] :s ":%s/\\<\\>//gI") (map! [nv :noremap] :d (fn [] [:_d])) diff --git a/fnl/options/opts.fnl b/fnl/options/opts.fnl index 8ce7523..1ca36e2 100644 --- a/fnl/options/opts.fnl +++ b/fnl/options/opts.fnl @@ -9,12 +9,12 @@ (set! list true) ; display listchars (set! smartindent true) ; smarter indentation (set! splitright true) ; split right instead of left -(set! splitkeep "screen") ; stabilize split +(set! splitkeep :screen) ; stabilize split (set! startofline false) ; don't go to the start of the line when moving to another file (set! swapfile false) ; disable swapfile (set! termguicolors true) ; true colours for better experience (set! wrap false) ; don't wrap lines -(set! backupcopy "yes") ; fix weirdness for stuff that replaces the entire file when hot reloading +(set! backupcopy :yes) ; fix weirdness for stuff that replaces the entire file when hot reloading (set! smarttab false) (set! tabstop 4) @@ -25,41 +25,15 @@ (set! showmatch true) ; show matches while searching for text (set! hlsearch true) ; highlight text that has been searched (set! incsearch true) ; incramentally search -(set! shiftwidth 4) (set! autoindent true) (set! wildmode "longest,list") -(set! mouse "v") -(set! mouse "a") -(set! clipboard "unnamedplus") ; use system clipboard) +(set! mouse :v) +(set! mouse :a) +(set! clipboard :unnamedplus) ; use system clipboard (set! ttyfast true) (set! cursorline true) (set! splitbelow true) (set! autochdir true) -(set! signcolumn "yes:1") -(set! shell "/bin/zsh") +(set! signcolumn :yes:1) +(set! shell :/bin/zsh) (set! splitright false) - -; disable builtin plugins as they are not needed -(local disabled_built_ins [ - :netrw - :netrwPlugin - :netrwSettings - :netrwFileHandlers - :gzip - :zip - :zipPlugin - :tar - :tarPlugin - :getscript - :getscriptPlugin - :vimball - :vimballPlugin - :2html_plugin - :logipat - :rrhelper - :spellfile_plugin - :matchit -]) - -(each [_ plugin (pairs disabled_built_ins)] - (tset vim.g (.. :loaded_ plugin) 1)) diff --git a/fnl/plugins/devicons.fnl b/fnl/plugins/devicons.fnl new file mode 100755 index 0000000..8effdd2 --- /dev/null +++ b/fnl/plugins/devicons.fnl @@ -0,0 +1,33 @@ +(local plug (require :nvim-web-devicons)) + +(plug.setup [ + :strict true + :default true + :color_icons true + + :override [ + :zsh [ + :icon "" + :color "#428850" + :cterm_color "65" + :name "zsh" + ] + ] + + :override_by_filename [ + :.gitignore [ + :icon "" + :color "#f1502f" + :name "gitignore" + ] + ] + + :override_by_extension [ + :log [ + :icon "" + :color "#81e043" + :name "Log" + ] + ] + +]) diff --git a/fnl/plugins/devicons.lua b/fnl/plugins/devicons.lua deleted file mode 100755 index 34d22f1..0000000 --- a/fnl/plugins/devicons.lua +++ /dev/null @@ -1,47 +0,0 @@ -require'nvim-web-devicons'.setup { - -- your personnal icons can go here (to override) - -- you can specify color or cterm_color instead of specifying both of them - -- DevIcon will be appended to `name` - override = { - zsh = { - icon = "", - color = "#428850", - cterm_color = "65", - name = "Zsh" - } - }; - - - -- globally enable different highlight colors per icon (default to true) - -- if set to false all icons will have the default icon's color - color_icons = true; - - -- globally enable default icons (default to false) - -- will get overriden by `get_icons` option - default = true; - - -- globally enable "strict" selection of icons - icon will be looked up in - -- different tables, first by filename, and if not found by extension; this - -- prevents cases when file doesn't have any extension but still gets some icon - -- because its name happened to match some extension (default to false) - strict = true; - - -- same as `override` but specifically for overrides by filename - -- takes effect when `strict` is true - override_by_filename = { - [".gitignore"] = { - icon = "", - color = "#f1502f", - name = "Gitignore" - } - }; - -- same as `override` but specifically for overrides by extension - -- takes effect when `strict` is true - override_by_extension = { - ["log"] = { - icon = "", - color = "#81e043", - name = "Log" - } - }; -} diff --git a/fnl/plugins/gitsigns.fnl b/fnl/plugins/gitsigns.fnl new file mode 100755 index 0000000..0bf8bac --- /dev/null +++ b/fnl/plugins/gitsigns.fnl @@ -0,0 +1,46 @@ +(local gitsigns (require :gitsigns)) + +(gitsigns.setup { + :signs { + :add [:text :▍] + :change [:text :▍] + :delete [:text :▍] + :topdelete [:text :▍] + :changedelete [:text :▍] + :untracked [:text :▍] + } + + :signcolumn true + :numhl false + :linehl false + :word_diff false + + :watch_gitdir { + :follow_files true + } + + + :attach_to_untracked true + :current_line_blame false + + :current_line_blame_opts { + :virt_text true + :virt_text_pos :eol + :delay 1000 + :ignore_whitespace false + } + + :current_line_blame_formatter ", - " + :sign_priority 6 + :update_debounce 100 + :status_formatter nil + :max_file_length 40000 + + :preview_config { + :border :single + :style :minimal + :relative :cursor + :row 0 + :col 1 + } +}) diff --git a/fnl/plugins/gitsigns.lua b/fnl/plugins/gitsigns.lua deleted file mode 100755 index 238be07..0000000 --- a/fnl/plugins/gitsigns.lua +++ /dev/null @@ -1,45 +0,0 @@ -require('gitsigns').setup { - signs = { - add = { text = '▍' }, - change = { text = '▍' }, - delete = { text = '▍' }, - topdelete = { text = '▍' }, - changedelete = { text = '▍' }, - untracked = { text = '▎' }, - }, - - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - - watch_gitdir = { - follow_files = true - }, - - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - - current_line_blame_formatter = ', - ', - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, -- Disable if file is longer than this (in lines) - - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, - -} diff --git a/fnl/plugins/harpoon.fnl b/fnl/plugins/harpoon.fnl new file mode 100644 index 0000000..8cb3899 --- /dev/null +++ b/fnl/plugins/harpoon.fnl @@ -0,0 +1,18 @@ +(import-macros {: map!} :hibiscus.vim) + +(local harpoon (require :harpoon)) +(harpoon.setup) + +(map! [n :noremap] :ha (fn [] (harpoon.list:append))) + +(map! [n :noremap] : (fn [] (harpoon.ui.toggle_quick_menu (harpoon.list)))) + +(map! [n :noremap] : (fn [] (harpoon.list:select 1))) +(map! [n :noremap] : (fn [] (harpoon.list:select 2))) +(map! [n :noremap] : (fn [] (harpoon.list:select 3))) +(map! [n :noremap] : (fn [] (harpoon.list:select 4))) + +;; Toggle previous & next buffers stored within Harpoon list +(map! [n :noremap] : (fn [] (harpoon.list:prev))) +(map! [n :noremap] : (fn [] (harpoon.list:next))) + diff --git a/fnl/plugins/harpoon.lua b/fnl/plugins/harpoon.lua deleted file mode 100644 index 0aef657..0000000 --- a/fnl/plugins/harpoon.lua +++ /dev/null @@ -1,17 +0,0 @@ -local harpoon = require("harpoon") - --- REQUIRED -harpoon:setup() --- REQUIRED - -vim.keymap.set("n", "a", function() harpoon:list():append() end) -vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) - -vim.keymap.set("n", "", function() harpoon:list():select(1) end) -vim.keymap.set("n", "", function() harpoon:list():select(2) end) -vim.keymap.set("n", "", function() harpoon:list():select(3) end) -vim.keymap.set("n", "", function() harpoon:list():select(4) end) - --- Toggle previous & next buffers stored within Harpoon list -vim.keymap.set("n", "", function() harpoon:list():prev() end) -vim.keymap.set("n", "", function() harpoon:list():next() end) diff --git a/fnl/plugins/hlblocks.fnl b/fnl/plugins/hlblocks.fnl new file mode 100755 index 0000000..8d26f36 --- /dev/null +++ b/fnl/plugins/hlblocks.fnl @@ -0,0 +1,39 @@ +(local hlchunk (require :hlchunk)) + +(hlchunk.setup { + :indent { + :chars { "." "." "." "." } + + :style { + :#888888 + :#666666 + :#444444 + :#333333 + :#333333 + :#333333 + :#333333 + :#333333 + } + } + + :blank { + :enable false + } + + :chunk { + :chars { + :horizontal_line "" + :vertical_line "" + :left_top "" + :left_bottom "" + :right_arrow "" + } + + :style :#FF7F00 + } + + :line_num { + :style :#FFFFFF + } + +}) diff --git a/fnl/plugins/hlblocks.lua b/fnl/plugins/hlblocks.lua deleted file mode 100755 index e90fa48..0000000 --- a/fnl/plugins/hlblocks.lua +++ /dev/null @@ -1,39 +0,0 @@ -require('hlchunk').setup({ - indent = { - chars = { "·", "·", "·", "·", }, - --chars = { "│", "¦", "┆", "┊", }, -- more code can be found in https://unicodeplus.com/ - - style = { - "#888888", - "#666666", - "#444444", - "#333333", - "#333333", - "#333333", - "#333333", - "#333333", - } - - - }, - - blank = { - enable = false, - }, - - chunk = { - chars = { - horizontal_line = "", - vertical_line = "", - left_top = "", - left_bottom = "", - right_arrow = "", - }, - style = "#FF7F00", - }, - - line_num = { - style = "#FFFFFF", - }, - -}) diff --git a/fnl/plugins/init.fnl b/fnl/plugins/init.fnl new file mode 100755 index 0000000..30b9c5d --- /dev/null +++ b/fnl/plugins/init.fnl @@ -0,0 +1,15 @@ +(local dir :plugins.) +(fn modul [name] (.. dir name)) + +(require (modul :lazy)) +(require (modul :devicons)) +(require (modul :gitsigns)) +(require (modul :harpoon)) +(require (modul :hlblocks)) +(require (modul :lsp-zero)) +(require (modul :lualine)) +(require (modul :mini)) +(require (modul :oil)) +(require (modul :telescope)) +(require (modul :treesitter)) +(require (modul :wilder)) diff --git a/fnl/plugins/init.lua b/fnl/plugins/init.lua deleted file mode 100755 index fc276c0..0000000 --- a/fnl/plugins/init.lua +++ /dev/null @@ -1,12 +0,0 @@ -require("plugins.lazy") -require("plugins.devicons") -require("plugins.gitsigns") -require("plugins.harpoon") -require("plugins.hlblocks") -require("plugins.lsp-zero") -require("plugins.lualine") -require("plugins.mini") -require("plugins.oil") -require("plugins.telescope") -require("plugins.treesitter") -require("plugins.wilder") diff --git a/fnl/plugins/lazy.fnl b/fnl/plugins/lazy.fnl new file mode 100755 index 0000000..825d1ba --- /dev/null +++ b/fnl/plugins/lazy.fnl @@ -0,0 +1,91 @@ +(local lazypath (.. (vim.fn.stdpath :data) :/lazy/lazy.nvim)) + +(if (not (vim.loop.fs_stat lazypath)) + (vim.fn.system + [:git :clone :--filter=blob:none :https://github.com/folke/lazy.nvim.git :--branch=stable lazypath])) + +(vim.opt.rtp:prepend lazypath) + +(local lazy (require :lazy)) +(local plug 1) +(local opt 1) + +(lazy.setup [ + :EdenEast/nightfox.nvim + :lambdalisue/nerdfont.vim + :gelguy/wilder.nvim + + :bkad/camelcasemotion + :lewis6991/gitsigns.nvim + + { + plug :stevearc/oil.nvim + :dependencies [ + {plug :nvim-tree/nvim-web-devicons} + ] + } + + { + plug :nvim-telescope/telescope.nvim + :tag "0.1.8" + :dependencies [ + {plug :nvim-lua/plenary.nvim} + ] + } + + { + plug :OXY2DEV/markview.nvim + :dependencies [ + {plug :nvim-treesitter/nvim-treesitter} + {plug :nvim-tree/nvim-web-devicons} + ] + } + + { + plug :shellRaining/hlchunk.nvim + :event [ + {opt :UIEnter} + ] + } + + { + plug :ThePrimeagen/harpoon + :branch :harpoon2 + :dependencies [ + {plug :nvim-lua/plenary.nvim} + ] + } + + { + plug :nvim-lualine/lualine.nvim + :dependencies [ + {plug :nvim-tree/nvim-web-devicons} + ] + } + + { + plug :nvim-treesitter/nvim-treesitter + :build ":TSUpdate" + } + + { + plug :VonHeikemen/lsp-zero.nvim + :branch "v3.x" + :dependencies [ + {plug :neovim/nvim-lspconfig} + {plug :williamboman/mason.nvim} + {plug :williamboman/mason-lspconfig.nvim} + + {plug :hrsh7th/nvim-cmp} + {plug :hrsh7th/cmp-nvim-lsp} + {plug :L3MON4D3/LuaSnip} + ] + } + + { + plug :echasnovski/mini.nvim + :version false + } +]) + + diff --git a/fnl/plugins/lazy.lua b/fnl/plugins/lazyinlua.bak similarity index 100% rename from fnl/plugins/lazy.lua rename to fnl/plugins/lazyinlua.bak diff --git a/fnl/plugins/lsp-zero.fnl b/fnl/plugins/lsp-zero.fnl new file mode 100755 index 0000000..2de5905 --- /dev/null +++ b/fnl/plugins/lsp-zero.fnl @@ -0,0 +1,43 @@ +(local mason (require :mason)) +(mason.setup) + +(local lsp (require :lsp-zero)) +(lsp.preset) + +(local lspconfig (require :lspconfig)) +(lspconfig.lua_ls.setup (lsp.nvim_lua_ls)) + +(local cmp (require :cmp)) +(local cmp_action (lsp.cmp_action)) + + +(lsp.on_attach (fn [client bufnr] lsp.default_keymaps {:buffer bufnr})) + +(lspconfig.pylsp.setup { + :setings { + :pylsp { + :plugins { + :pycodestyle { + :ignore [:W391 :E303 :E226] + :maxLineLength 120 }}}}}) + +(lsp.setup) + +(cmp.setup { + :mapping { + : (cmp.mapping.confirm {:select true}) + + : (cmp.mapping (fn [fallback] + (if (cmp.visible) + (cmp.select_next_item) + (fallback)) [:i :s] )) + + : (cmp.mapping (fn [fallback] + (if (cmp.visible) + (cmp.select_prev_item) + (fallback)) [:i :s] )) + + : cmp.mapping.complete + + : cmp_action.luasnip_jump_forward + : cmp_action.luasnip_jump_backward }}) diff --git a/fnl/plugins/lsp-zero.lua b/fnl/plugins/lsp-zero.lua deleted file mode 100755 index 740a26b..0000000 --- a/fnl/plugins/lsp-zero.lua +++ /dev/null @@ -1,67 +0,0 @@ -require('mason').setup() -local lsp = require('lsp-zero').preset({}) - -lsp.on_attach(function(client, bufnr) - -- see :help lsp-zero-keybindings - -- to learn the available actions - lsp.default_keymaps({buffer = bufnr}) -end) - --- (Optional) Configure lua language server for neovim -require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls()) - - -require('lspconfig').pylsp.setup{ - settings = { - pylsp = { - plugins = { - pycodestyle = { - ignore = {'W391', 'E303', 'E226'}, - maxLineLength = 120 - } - } - } - } -} - -lsp.setup() - --- You need to setup `cmp` after lsp-zero -local cmp = require('cmp') -local cmp_action = require('lsp-zero').cmp_action() - - -cmp.setup({ - mapping = { - -- `Enter` key to confirm completion - [''] = cmp.mapping.confirm({select = true}), - - - - -- Cycle with tab, as intended by divine creation - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - else - fallback() - end - end, {"i", "s"}), - - - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - else - fallback() - end - end, {"i", "s"}), - - - -- Ctrl+Space to trigger completion menu - [''] = cmp.mapping.complete(), - - -- Navigate between snippet placeholder - [''] = cmp_action.luasnip_jump_forward(), - [''] = cmp_action.luasnip_jump_backward(), - } -}) diff --git a/fnl/plugins/lualine.fnl b/fnl/plugins/lualine.fnl new file mode 100755 index 0000000..5c16f9c --- /dev/null +++ b/fnl/plugins/lualine.fnl @@ -0,0 +1,257 @@ +(local lualine (require :lualine)) +(lualine.setup) + +; TODO: create a new theme + +; OLD THEME : + +; local lualine = require('lualine') +; +; local colors = { +; bg = '#202328', +; fg = '#bbc2cf', +; yellow = '#ECBE7B', +; cyan = '#008080', +; darkblue = '#081633', +; green = '#98be65', +; orange = '#FF8800', +; violet = '#a9a1e1', +; magenta = '#c678dd', +; blue = '#51afef', +; red = '#ec5f67', +; } +; +; +; local conditions = { +; buffer_not_empty = function() +; return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 +; end, +; hide_in_width = function() +; return vim.fn.winwidth(0) > 80 +; end, +; check_git_workspace = function() +; local filepath = vim.fn.expand('%:p:h') +; local gitdir = vim.fn.finddir('.git', filepath .. ';') +; return gitdir and #gitdir > 0 and #gitdir < #filepath +; end, +; } +; +; -- Config +; local config = { +; options = { +; component_separators = '', +; section_separators = '', +; theme = { +; +; normal = { +; c = { +; fg = colors.fg, +; bg = colors.bg +; } +; }, +; +; inactive = { +; c = { +; fg = colors.fg, +; bg = colors.bg +; } +; }, +; +; }, +; }, +; +; +; sections = { +; lualine_a = {}, +; lualine_b = {}, +; lualine_y = {}, +; lualine_z = {}, +; lualine_c = {}, +; lualine_x = {}, +; }, +; inactive_sections = { +; lualine_a = {}, +; lualine_b = {}, +; lualine_y = {}, +; lualine_z = {}, +; lualine_c = {}, +; lualine_x = {}, +; }, +; } +; +; local function ins_left(component) +; table.insert(config.sections.lualine_c, component) +; end +; +; local function ins_right(component) +; table.insert(config.sections.lualine_x, component) +; end +; +; ins_left { +; function() +; return '▊' +; end, +; +; color = { fg = colors.blue }, +; +; padding = { +; left = 0, +; right = 1 +; }, +; } +; +; +; +; ins_left { +; function() +; -- return '' +; return '' +; end, +; color = function() +; local mode_color = { +; n = colors.blue, +; i = colors.red, +; v = colors.green, +; [''] = colors.orange, +; V = colors.green, +; c = colors.magenta, +; no = colors.red, +; s = colors.orange, +; S = colors.orange, +; [''] = colors.orange, +; ic = colors.yellow, +; R = colors.violet, +; Rv = colors.violet, +; cv = colors.red, +; ce = colors.red, +; r = colors.cyan, +; rm = colors.cyan, +; ['r?'] = colors.cyan, +; ['!'] = colors.red, +; t = colors.red, +; } +; return { fg = mode_color[vim.fn.mode()] } +; end, +; padding = { right = 1 }, +; } +; +; +; ins_left { +; 'branch', +; icon = '', +; +; color = { +; fg = colors.violet, +; gui = 'bold' +; }, +; } +; +; ins_left { +; 'diff', +; +; symbols = { +; added = ' ', +; modified = ' ', +; removed = ' ' +; }, +; +; diff_color = { +; added = { fg = colors.green }, +; modified = { fg = colors.orange }, +; removed = { fg = colors.red }, +; }, +; +; cond = conditions.hide_in_width, +; } +; +; +; +; ins_left { +; 'diagnostics', +; +; sources = { 'nvim_diagnostic' }, +; +; symbols = { +; error = ' ', +; warn = ' ', +; info = ' ' +; }, +; +; diagnostics_color = { +; color_error = { fg = colors.red }, +; color_warn = { fg = colors.yellow }, +; color_info = { fg = colors.cyan }, +; }, +; } +; +; ins_left { +; function() +; return '%=' +; end, +; } +; +; +; ins_left { +; 'filename', +; cond = conditions.buffer_not_empty, +; +; color = { +; fg = colors.magenta, +; gui = 'bold' +; }, +; } +; +; +; ins_right { +; 'filetype', +; colored = true, +; icon_only = false, +; icon = { align = 'right' } +; } +; +; ins_right { +; 'progress', +; +; color = { +; fg = colors.fg, +; gui = 'bold' +; } +; } +; +; +; ins_right { +; 'o:encoding', +; +; fmt = string.upper, +; cond = conditions.hide_in_width, +; +; color = { +; fg = colors.green, +; gui = 'bold' +; }, +; } +; +; +; ins_right { +; 'fileformat', +; +; fmt = string.upper, +; icons_enabled = false, +; +; color = { +; fg = colors.green, +; gui = 'bold' +; }, +; } +; +; +; ins_right { +; function() +; return '▊' +; end, +; +; color = { fg = colors.blue }, +; padding = { left = 1 }, +; } +; +; lualine.setup(config) diff --git a/fnl/plugins/lualine.lua b/fnl/plugins/lualine.lua deleted file mode 100755 index f36f783..0000000 --- a/fnl/plugins/lualine.lua +++ /dev/null @@ -1,276 +0,0 @@ --- Eviline config for lualine --- Author: shadmansaleh --- Credit: glepnir -local lualine = require('lualine') - -local colors = { - bg = '#202328', - fg = '#bbc2cf', - yellow = '#ECBE7B', - cyan = '#008080', - darkblue = '#081633', - green = '#98be65', - orange = '#FF8800', - violet = '#a9a1e1', - magenta = '#c678dd', - blue = '#51afef', - red = '#ec5f67', -} - - -local conditions = { - buffer_not_empty = function() - return vim.fn.empty(vim.fn.expand('%:t')) ~= 1 - end, - hide_in_width = function() - return vim.fn.winwidth(0) > 80 - end, - check_git_workspace = function() - local filepath = vim.fn.expand('%:p:h') - local gitdir = vim.fn.finddir('.git', filepath .. ';') - return gitdir and #gitdir > 0 and #gitdir < #filepath - end, -} - --- Config -local config = { - options = { - component_separators = '', - section_separators = '', - theme = { - - normal = { - c = { - fg = colors.fg, - bg = colors.bg - } - }, - - inactive = { - c = { - fg = colors.fg, - bg = colors.bg - } - }, - - }, - }, - - - sections = { - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, - inactive_sections = { - lualine_a = {}, - lualine_b = {}, - lualine_y = {}, - lualine_z = {}, - lualine_c = {}, - lualine_x = {}, - }, -} - -local function ins_left(component) - table.insert(config.sections.lualine_c, component) -end - -local function ins_right(component) - table.insert(config.sections.lualine_x, component) -end - -ins_left { - function() - return '▊' - end, - - color = { fg = colors.blue }, - - padding = { - left = 0, - right = 1 - }, -} - - - -ins_left { - function() - return '' - --return '' - -- local mode_string = { - -- n = 'Normal', - -- i = 'Insert', - -- v = 'Visual', - -- V = 'Visual line', - -- c = 'Change', - -- no = 'dunno1', - -- s = 'dunno2', - -- S = 'dunno3', - -- [''] = 'dunno4', - -- ic = 'dunno5', - -- R = 'dunno6', - -- Rv = 'dunno7', - -- cv = 'dunno8', - -- ce = 'dunno9', - -- r = 'dunno10', - -- rm = 'dunno11', - -- ['r?'] = 'dunno12', - -- ['!'] = 'dunno13', - -- t = 'dunno14', - -- } - -- return mode_string[vim.fn.mode()] - -- - end, - color = function() - local mode_color = { - n = colors.blue, - i = colors.red, - v = colors.green, - [''] = colors.orange, - V = colors.green, - c = colors.magenta, - no = colors.red, - s = colors.orange, - S = colors.orange, - [''] = colors.orange, - ic = colors.yellow, - R = colors.violet, - Rv = colors.violet, - cv = colors.red, - ce = colors.red, - r = colors.cyan, - rm = colors.cyan, - ['r?'] = colors.cyan, - ['!'] = colors.red, - t = colors.red, - } - return { fg = mode_color[vim.fn.mode()] } - end, - padding = { right = 1 }, -} - - -ins_left { - 'branch', - icon = '', - - color = { - fg = colors.violet, - gui = 'bold' - }, -} - -ins_left { - 'diff', - - symbols = { - added = ' ', - modified = ' ', - removed = ' ' - }, - - diff_color = { - added = { fg = colors.green }, - modified = { fg = colors.orange }, - removed = { fg = colors.red }, - }, - - cond = conditions.hide_in_width, -} - - - -ins_left { - 'diagnostics', - - sources = { 'nvim_diagnostic' }, - - symbols = { - error = ' ', - warn = ' ', - info = ' ' - }, - - diagnostics_color = { - color_error = { fg = colors.red }, - color_warn = { fg = colors.yellow }, - color_info = { fg = colors.cyan }, - }, -} - -ins_left { - function() - return '%=' - end, -} - - -ins_left { - 'filename', - cond = conditions.buffer_not_empty, - - color = { - fg = colors.magenta, - gui = 'bold' - }, -} - - -ins_right { - 'filetype', - colored = true, - icon_only = false, - icon = { align = 'right' } -} - -ins_right { - 'progress', - - color = { - fg = colors.fg, - gui = 'bold' - } -} - - -ins_right { - 'o:encoding', - - fmt = string.upper, - cond = conditions.hide_in_width, - - color = { - fg = colors.green, - gui = 'bold' - }, -} - - -ins_right { - 'fileformat', - - fmt = string.upper, - icons_enabled = false, - - color = { - fg = colors.green, - gui = 'bold' - }, -} - - -ins_right { - function() - return '▊' - end, - - color = { fg = colors.blue }, - padding = { left = 1 }, -} - -lualine.setup(config) diff --git a/fnl/plugins/mini.fnl b/fnl/plugins/mini.fnl new file mode 100644 index 0000000..0fd7d40 --- /dev/null +++ b/fnl/plugins/mini.fnl @@ -0,0 +1,14 @@ +(local cursorword (require :mini.cursorword)) +(cursorword.setup) + +(local trailspace (require :mini.trailspace)) +(trailspace.setup) + +(local pairs (require :mini.pairs)) +(pairs.setup) + +(local clue (require :mini.clue)) +(clue.setup) + +(local surround (require :mini.surround)) +(surround.setup) diff --git a/fnl/plugins/mini.lua b/fnl/plugins/mini.lua deleted file mode 100755 index e1a616b..0000000 --- a/fnl/plugins/mini.lua +++ /dev/null @@ -1,108 +0,0 @@ -require('mini.cursorword').setup() -require('mini.trailspace').setup() -require('mini.pairs').setup() - - -local miniclue = require('mini.clue') -miniclue.setup({ - triggers = { - -- Leader triggers - { mode = 'n', keys = '' }, - { mode = 'x', keys = '' }, - - -- Built-in completion - { mode = 'i', keys = '' }, - - -- `g` key - { mode = 'n', keys = 'g' }, - { mode = 'x', keys = 'g' }, - - -- Marks - { mode = 'n', keys = "'" }, - { mode = 'n', keys = '`' }, - { mode = 'x', keys = "'" }, - { mode = 'x', keys = '`' }, - - -- Registers - { mode = 'n', keys = '"' }, - { mode = 'x', keys = '"' }, - { mode = 'i', keys = '' }, - { mode = 'c', keys = '' }, - - -- Window commands - { mode = 'n', keys = '' }, - - -- `z` key - { mode = 'n', keys = 'z' }, - { mode = 'x', keys = 'z' }, - }, - - clues = { - -- Enhance this by adding descriptions for mapping groups - miniclue.gen_clues.builtin_completion(), - miniclue.gen_clues.g(), - miniclue.gen_clues.marks(), - miniclue.gen_clues.registers(), - miniclue.gen_clues.windows(), - miniclue.gen_clues.z(), - }, - - -- Array of opt-in triggers which start custom key query process. - -- **Needs to have something in order to show clues**. - -- Clue window settings - window = { - -- Floating window config - config = {}, - - -- Delay before showing clue window - delay = 400, - - -- Keys to scroll inside the clue window - scroll_down = '', - scroll_up = '', - }, -}) - - -require('mini.surround').setup( - { - -- Add custom surroundings to be used on top of builtin ones. For more - -- information with examples, see `:h MiniSurround.config`. - custom_surroundings = nil, - - -- Duration (in ms) of highlight when calling `MiniSurround.highlight()` - highlight_duration = 500, - - -- Module mappings. Use `''` (empty string) to disable one. - mappings = { - add = 'sa', -- Add surrounding in Normal and Visual modes - delete = 'sd', -- Delete surrounding - find = 'sf', -- Find surrounding (to the right) - find_left = 'sF', -- Find surrounding (to the left) - highlight = 'sh', -- Highlight surrounding - replace = 'sr', -- Replace surrounding - update_n_lines = 'sn', -- Update `n_lines` - - suffix_last = 'l', -- Suffix to search with "prev" method - suffix_next = 'n', -- Suffix to search with "next" method - }, - - -- Number of lines within which surrounding is searched - n_lines = 20, - - -- Whether to respect selection type: - -- - Place surroundings on separate lines in linewise mode. - -- - Place surroundings on each line in blockwise mode. - respect_selection_type = false, - - -- How to search for surrounding (first inside current line, then inside - -- neighborhood). One of 'cover', 'cover_or_next', 'cover_or_prev', - -- 'cover_or_nearest', 'next', 'prev', 'nearest'. For more details, - -- see `:h MiniSurround.config`. - search_method = 'cover', - - -- Whether to disable showing non-error feedback - silent = false, - } -) - diff --git a/fnl/plugins/oil.fnl b/fnl/plugins/oil.fnl new file mode 100644 index 0000000..e96ab3c --- /dev/null +++ b/fnl/plugins/oil.fnl @@ -0,0 +1,2 @@ +(local oil (require :oil)) +(oil.setup) diff --git a/fnl/plugins/oil.lua b/fnl/plugins/oil.lua deleted file mode 100644 index 1e1aaca..0000000 --- a/fnl/plugins/oil.lua +++ /dev/null @@ -1,177 +0,0 @@ -require("oil").setup({ - -- Oil will take over directory buffers (e.g. `vim .` or `:e src/`) - -- Set to false if you still want to use netrw. - default_file_explorer = true, - -- Id is automatically added at the beginning, and name at the end - -- See :help oil-columns - columns = { - "icon", - -- "permissions", - -- "size", - -- "mtime", - }, - -- Buffer-local options to use for oil buffers - buf_options = { - buflisted = false, - bufhidden = "hide", - }, - -- Window-local options to use for oil buffers - win_options = { - wrap = false, - signcolumn = "no", - cursorcolumn = false, - foldcolumn = "0", - spell = false, - list = false, - conceallevel = 3, - concealcursor = "nvic", - }, - -- Send deleted files to the trash instead of permanently deleting them (:help oil-trash) - delete_to_trash = false, - -- Skip the confirmation popup for simple operations (:help oil.skip_confirm_for_simple_edits) - skip_confirm_for_simple_edits = false, - -- Selecting a new/moved/renamed file or directory will prompt you to save changes first - -- (:help prompt_save_on_select_new_entry) - prompt_save_on_select_new_entry = true, - -- Oil will automatically delete hidden buffers after this delay - -- You can set the delay to false to disable cleanup entirely - -- Note that the cleanup process only starts when none of the oil buffers are currently displayed - cleanup_delay_ms = 2000, - lsp_file_methods = { - -- Time to wait for LSP file operations to complete before skipping - timeout_ms = 1000, - -- Set to true to autosave buffers that are updated with LSP willRenameFiles - -- Set to "unmodified" to only save unmodified buffers - autosave_changes = false, - }, - -- Constrain the cursor to the editable parts of the oil buffer - -- Set to `false` to disable, or "name" to keep it on the file names - constrain_cursor = "editable", - -- Set to true to watch the filesystem for changes and reload oil - experimental_watch_for_changes = false, - -- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap - -- options with a `callback` (e.g. { callback = function() ... end, desc = "", mode = "n" }) - -- Additionally, if it is a string that matches "actions.", - -- it will use the mapping at require("oil.actions"). - -- Set to `false` to remove a keymap - -- See :help oil-actions for a list of all available actions - keymaps = { - ["g?"] = "actions.show_help", - [""] = "actions.select", - [""] = "actions.select_vsplit", - [""] = "actions.select_split", - [""] = "actions.select_tab", - [""] = "actions.preview", - [""] = "actions.close", - [""] = "actions.refresh", - ["-"] = "actions.parent", - ["_"] = "actions.open_cwd", - ["`"] = "actions.cd", - ["~"] = "actions.tcd", - ["gs"] = "actions.change_sort", - ["gx"] = "actions.open_external", - ["g."] = "actions.toggle_hidden", - ["g\\"] = "actions.toggle_trash", - }, - -- Set to false to disable all of the above keymaps - use_default_keymaps = true, - view_options = { - -- Show files and directories that start with "." - show_hidden = false, - -- This function defines what is considered a "hidden" file - is_hidden_file = function(name, bufnr) - return vim.startswith(name, ".") - end, - -- This function defines what will never be shown, even when `show_hidden` is set - is_always_hidden = function(name, bufnr) - return false - end, - -- Sort file names in a more intuitive order for humans. Is less performant, - -- so you may want to set to false if you work with large directories. - natural_order = true, - sort = { - -- sort order can be "asc" or "desc" - -- see :help oil-columns to see which columns are sortable - { "type", "asc" }, - { "name", "asc" }, - }, - }, - -- Extra arguments to pass to SCP when moving/copying files over SSH - extra_scp_args = {}, - -- EXPERIMENTAL support for performing file operations with git - git = { - -- Return true to automatically git add/mv/rm files - add = function(path) - return false - end, - mv = function(src_path, dest_path) - return false - end, - rm = function(path) - return false - end, - }, - -- Configuration for the floating window in oil.open_float - float = { - -- Padding around the floating window - padding = 2, - max_width = 0, - max_height = 0, - border = "rounded", - win_options = { - winblend = 0, - }, - -- This is the config that will be passed to nvim_open_win. - -- Change values here to customize the layout - override = function(conf) - return conf - end, - }, - -- Configuration for the actions floating preview window - preview = { - -- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_width and max_width can be a single value or a list of mixed integer/float types. - -- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total" - max_width = 0.9, - -- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total" - min_width = { 40, 0.4 }, - -- optionally define an integer/float for the exact width of the preview window - width = nil, - -- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%) - -- min_height and max_height can be a single value or a list of mixed integer/float types. - -- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total" - max_height = 0.9, - -- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total" - min_height = { 5, 0.1 }, - -- optionally define an integer/float for the exact height of the preview window - height = nil, - border = "rounded", - win_options = { - winblend = 0, - }, - -- Whether the preview window is automatically updated when the cursor is moved - update_on_cursor_moved = true, - }, - -- Configuration for the floating progress window - progress = { - max_width = 0.9, - min_width = { 40, 0.4 }, - width = nil, - max_height = { 10, 0.9 }, - min_height = { 5, 0.1 }, - height = nil, - border = "rounded", - minimized_border = "none", - win_options = { - winblend = 0, - }, - }, - -- Configuration for the floating SSH window - ssh = { - border = "rounded", - }, - -- Configuration for the floating keymaps help window - keymaps_help = { - border = "rounded", - }, -}) diff --git a/fnl/plugins/telescope.fnl b/fnl/plugins/telescope.fnl new file mode 100644 index 0000000..54dfd22 --- /dev/null +++ b/fnl/plugins/telescope.fnl @@ -0,0 +1,2 @@ +(local telescope (require :telescope)) +(telescope.setup) diff --git a/fnl/plugins/telescope.lua b/fnl/plugins/telescope.lua deleted file mode 100644 index 9808531..0000000 --- a/fnl/plugins/telescope.lua +++ /dev/null @@ -1,30 +0,0 @@ -require('telescope').setup{ - defaults = { - -- Default configuration for telescope goes here: - -- config_key = value, - mappings = { - i = { - -- map actions.which_key to (default: ) - -- actions.which_key shows the mappings for your picker, - -- e.g. git_{create, delete, ...}_branch for the git_branches picker - [""] = "which_key" - } - } - }, - pickers = { - -- Default configuration for builtin pickers goes here: - -- picker_name = { - -- picker_config_key = value, - -- ... - -- } - -- Now the picker_config_key will be applied every time you call this - -- builtin picker - }, - extensions = { - -- Your extension configuration goes here: - -- extension_name = { - -- extension_config_key = value, - -- } - -- please take a look at the readme of the extension you want to configure - } -} diff --git a/fnl/plugins/treesitter.fnl b/fnl/plugins/treesitter.fnl new file mode 100755 index 0000000..01be86d --- /dev/null +++ b/fnl/plugins/treesitter.fnl @@ -0,0 +1,28 @@ +(local configs (require :nvim-treesitter.configs)) +(local parsers (require :nvim-treesitter.parsers)) + +(configs.setup { + :ensure_installed [ + :c + :lua + :vim + :vimdoc + :query + :haskell + :go + :bash + :python + :fennel + :hyprlang + ] + + :sync_install false + :auto_install true + + :highlight { + :enable true + } +}) + +(vim.filetype.add { + :pattern { :.*/hypr/.*%.conf :hyprlang }}) diff --git a/fnl/plugins/treesitter.lua b/fnl/plugins/treesitter.lua deleted file mode 100755 index 54407a8..0000000 --- a/fnl/plugins/treesitter.lua +++ /dev/null @@ -1,27 +0,0 @@ -require'nvim-treesitter.configs'.setup { - -- A list of parser names, or "all" (the five listed parsers should always be installed) - ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "haskell", "go", "bash", "python" }, - - -- Install parsers synchronously (only applied to `ensure_installed`) - sync_install = false, - - -- Automatically install missing parsers when entering buffer - -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally - auto_install = true, - - highlight = { - enable = true, - }, -} - - - -local parser_config = require("nvim-treesitter.parsers").get_parser_configs() -parser_config.hypr = { - install_info = { - url = "https://github.com/luckasRanarison/tree-sitter-hypr", - files = { "src/parser.c" }, - branch = "master", - }, - filetype = "hypr", -} diff --git a/fnl/plugins/wilder.fnl b/fnl/plugins/wilder.fnl new file mode 100755 index 0000000..875d11b --- /dev/null +++ b/fnl/plugins/wilder.fnl @@ -0,0 +1,24 @@ +(local wilder (require :wilder)) + +(wilder.setup { + :modes [":" "/" "?"] +}) + +(wilder.set_option :renderer (wilder.renderer_mux { + ":" (wilder.popupmenu_renderer { + :highlighter wilder.basic_highlighter + :left [ " " wilder.popupmenu_devicons ] + :right [ " " wilder.popupmenu_scrollbar ] + }) + + "/" (wilder.popupmenu_renderer { + :highlighter wilder.basic_highlighter + :left [ "" wilder.popupmenu_devicons ] + :right [ "" wilder.popupmenu_scrollbar ] + }) +})) + +(wilder.set_option :renderer + (wilder.popupmenu_renderer + { :max_height :20% + :min_width :100% })) diff --git a/fnl/plugins/wilder.lua b/fnl/plugins/wilder.lua deleted file mode 100755 index 5c7e58b..0000000 --- a/fnl/plugins/wilder.lua +++ /dev/null @@ -1,28 +0,0 @@ -local wilder = require('wilder') - -wilder.setup({ - modes = {':', '/', '?'} -}) - - -wilder.set_option('renderer', wilder.renderer_mux({ - [':'] = wilder.popupmenu_renderer({ - highlighter = wilder.basic_highlighter(), - left = {' ', wilder.popupmenu_devicons()}, - right = {' ', wilder.popupmenu_scrollbar()}, - }), - ['/'] = wilder.wildmenu_renderer({ - highlighter = wilder.basic_highlighter(), - left = {' ', wilder.popupmenu_devicons()}, - right = {' ', wilder.popupmenu_scrollbar()}, - }), -})) - - -wilder.set_option('renderer', wilder.popupmenu_renderer({ - highlighter = wilder.basic_highlighter(), - left = {' ', wilder.popupmenu_devicons()}, - right = {' ', wilder.popupmenu_scrollbar()}, - max_height = '20%', - min_width = '100%' -})) diff --git a/init.fnl b/init.fnl index 67dce36..2925c4c 100644 --- a/init.fnl +++ b/init.fnl @@ -1,25 +1,58 @@ -; ████████╗██████╗ ██╗██╗ ██╗██╗ ██╗ -; ╚══██╔══╝██╔══██╗██║╚██╗██╔╝╚██╗ ██╔╝ -; ██║ ██████╔╝██║ ╚███╔╝ ╚████╔╝ -; ██║ ██╔══██╗██║ ██╔██╗ ╚██╔╝ -; ██║ ██║ ██║██║██╔╝ ██╗ ██║ -; ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═ +; ████████╗██████╗ ██╗██╗ ██╗██╗ ██╗ +; ╚══██╔══╝██╔══██╗██║╚██╗██╔╝╚██╗ ██╔╝ +; ██║ ██████╔╝██║ ╚███╔╝ ╚████╔╝ +; ██║ ██╔══██╗██║ ██╔██╗ ╚██╔╝ +; ██║ ██║ ██║██║██╔╝ ██╗ ██║ +; ╚═╝ ╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═ ; Listen up, you motherfuckers, ; Those Ivy League dopes, they wanna ; mock us. Tell 'em all this is war. ; And not fighting a war is for suckers. +(import-macros {: g! : set!} :hibiscus.vim) -; (when (vim.g.neovide) -; (do -; (set (vim.o.guifont) "FiraCode Nerd Font:h14") -; (set (vim.g.neovide_scale_factor) 1.0) -; (set (vim.g.neovide_refresh_rate) 120) -; (set (vim.g.neovide_refresh_rate_idle) 5) -; (set (vim.g.neovide_cursor_antialiasing) true) -; (set (vim.g.neovide_cursor_animate_in_insert_mode) true) -; (set (vim.g.neovide_cursor_vfx_mode) "ripple"))) +; When using neovide, use these settings +(when vim.g.neovide (do + (set! guifont "FiraCode Nerd Font:h14") + (g! neovide_scale_factor 1.0) + (g! neovide_refresh_rate 120) + (g! neovide_refresh_rate_idle 5) + (g! neovide_cursor_antialiasing true) + (g! neovide_cursor_animate_in_insert_mode true) + (g! neovide_cursor_vfx_mode "ripple"))) + +; Skip loading of following neovim builtins +(local default_plugins { + :2html_plugin + :getscript + :getscriptPlugin + :gzip + :logipat + :netrw + :netrwPlugin + :netrwSettings + :netrwFileHandlers + :matchit + :tar + :tarPlugin + :rrhelper + :spellfile_plugin + :vimball + :vimballPlugin + :zip + :zipPlugin + :tutor + :rplugin + :syntax + :synmenu + :optwin + :compiler + :bugreport + :ftplugin }) + +(each [id plug (ipairs default_plugins)] + (g! (.. :loaded plug) 1)) (require :plugins) diff --git a/init.lua b/init.lua index 7dbc60c..178ca06 100755 --- a/init.lua +++ b/init.lua @@ -1,11 +1,8 @@ + +-- needed to fix deprecation warning vim.tbl_islist = vim.islist -local default_plugins = {"2html_plugin", "getscript", "getscriptPlugin", "gzip", "logipat", "netrw", "netrwPlugin", "netrwSettings", "netrwFileHandlers", "matchit", "tar", "tarPlugin", "rrhelper", "spellfile_plugin", "vimball", "vimballPlugin", "zip", "zipPlugin", "tutor", "rplugin", "syntax", "synmenu", "optwin", "compiler", "bugreport", "ftplugin"} - -for _, plugin in pairs(default_plugins) do - vim.g[("loaded_" .. plugin)] = 1 -end - +-- bootstrap tangerine and hibiscus in order to have fennel support local function bootstrap(url, ref) local name = url:gsub(".*/", "") local path @@ -29,6 +26,7 @@ end bootstrap("https://github.com/udayvir-singh/tangerine.nvim") bootstrap("https://github.com/udayvir-singh/hibiscus.nvim") + require "tangerine".setup { compiler = { verbose = false, diff --git a/lua/options/colors.lua b/lua/options/colors.lua deleted file mode 100644 index b982d98..0000000 --- a/lua/options/colors.lua +++ /dev/null @@ -1,2 +0,0 @@ --- :fennel:1720804753 -return vim.cmd("colorscheme carbonfox") \ No newline at end of file diff --git a/lua/options/harpoon.lua b/lua/options/harpoon.lua deleted file mode 100644 index a2093a9..0000000 --- a/lua/options/harpoon.lua +++ /dev/null @@ -1,35 +0,0 @@ --- :fennel:1720806691 -local harpoon = require("harpoon") -harpoon.setup() -local function _1_() - return (harpoon.list):append() -end -vim.keymap.set("n", "ha", _1_) -local function _2_() - return harpoon.ui.toggle_quick_menu(harpoon.list()) -end -vim.keymap.set("n", "", _2_) -local function _3_() - return (harpoon.list):select(1) -end -vim.keymap.set("n", "", _3_) -local function _4_() - return (harpoon.list):select(2) -end -vim.keymap.set("n", "", _4_) -local function _5_() - return (harpoon.list):select(3) -end -vim.keymap.set("n", "", _5_) -local function _6_() - return (harpoon.list):select(4) -end -vim.keymap.set("n", "", _6_) -local function _7_() - return (harpoon.list):prev() -end -vim.keymap.set("n", "", _7_) -local function _8_() - return (harpoon.list):next() -end -return vim.keymap.set("n", "", _8_) \ No newline at end of file diff --git a/lua/options/init.lua b/lua/options/init.lua deleted file mode 100644 index 45505d6..0000000 --- a/lua/options/init.lua +++ /dev/null @@ -1,5 +0,0 @@ --- :fennel:1720814990 -require("options.colors") -require("options.keybind") -require("options.opts") -return require("options.harpoon") \ No newline at end of file diff --git a/lua/options/keybind.lua b/lua/options/keybind.lua deleted file mode 100644 index e08f85c..0000000 --- a/lua/options/keybind.lua +++ /dev/null @@ -1,35 +0,0 @@ --- :fennel:1720807954 -vim.g["mapleader"] = " " -vim.keymap.set({"n"}, "", "Telescope buffers", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "tw", "lua MiniTrailspace.trim()", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "ff", "Telescope find_files", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "fs", "Telescope current_buffer_fuzzy_find", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "gs", "Telescope git_status", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "gg", "Telescope live_grep", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "w", "CamelCaseMotion_w", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "b", "CamelCaseMotion_b", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "e", "CamelCaseMotion_e", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "ge", "CamelCaseMotion_ge", {noremap = true, silent = true}) -vim.keymap.set({"v"}, "J", ":m '>+1gv=gv", {noremap = true, silent = true}) -vim.keymap.set({"v"}, "K", ":m '<-2gv=gv", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "J", "mzJ`z", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "", "zz", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "", "zz", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "n", "nzzzv", {noremap = true, silent = true}) -vim.keymap.set({"n"}, "N", "Nzzzv", {noremap = true, silent = true}) -local function _1_() - return {"_dP"} -end -vim.keymap.set({"x"}, "p", _1_, {noremap = true, silent = true}) -local function _2_() - return {"+dP"} -end -vim.keymap.set({"x"}, "p", _2_, {noremap = true, silent = true}) -local function _3_() - return ":%s/\\<\\>//gI" -end -vim.keymap.set({"n"}, "s", _3_, {noremap = true, silent = true}) -local function _4_() - return {"_d"} -end -return vim.keymap.set({"n", "v"}, "d", _4_, {noremap = true, silent = true}) \ No newline at end of file diff --git a/lua/options/opts.lua b/lua/options/opts.lua deleted file mode 100644 index 32f1f15..0000000 --- a/lua/options/opts.lua +++ /dev/null @@ -1,42 +0,0 @@ --- :fennel:1720814968 -vim.opt["number"] = true -vim.opt["relativenumber"] = true -vim.opt["undofile"] = true -vim.opt["backup"] = false -vim.opt["autowrite"] = true -vim.opt["ignorecase"] = true -vim.opt["list"] = true -vim.opt["smartindent"] = true -vim.opt["splitright"] = true -vim.opt["splitkeep"] = "screen" -vim.opt["startofline"] = false -vim.opt["swapfile"] = false -vim.opt["termguicolors"] = true -vim.opt["wrap"] = false -vim.opt["backupcopy"] = "yes" -vim.opt["smarttab"] = false -vim.opt["tabstop"] = 4 -vim.opt["softtabstop"] = 4 -vim.opt["shiftwidth"] = 4 -vim.opt["compatible"] = false -vim.opt["showmatch"] = true -vim.opt["hlsearch"] = true -vim.opt["incsearch"] = true -vim.opt["shiftwidth"] = 4 -vim.opt["autoindent"] = true -vim.opt["wildmode"] = "longest,list" -vim.opt["mouse"] = "v" -vim.opt["mouse"] = "a" -vim.opt["clipboard"] = "unnamedplus" -vim.opt["ttyfast"] = true -vim.opt["cursorline"] = true -vim.opt["splitbelow"] = true -vim.opt["autochdir"] = true -vim.opt["signcolumn"] = "yes:1" -vim.opt["shell"] = "/bin/zsh" -vim.opt["splitright"] = false -local disabled_built_ins = {"netrw", "netrwPlugin", "netrwSettings", "netrwFileHandlers", "gzip", "zip", "zipPlugin", "tar", "tarPlugin", "getscript", "getscriptPlugin", "vimball", "vimballPlugin", "2html_plugin", "logipat", "rrhelper", "spellfile_plugin", "matchit"} -for _, plugin in pairs(disabled_built_ins) do - vim.g[("loaded_" .. plugin)] = 1 -end -return nil \ No newline at end of file diff --git a/lua/tangerine_vimrc.lua b/lua/tangerine_vimrc.lua deleted file mode 100644 index 32af00b..0000000 --- a/lua/tangerine_vimrc.lua +++ /dev/null @@ -1,3 +0,0 @@ --- :fennel:1720807198 -require("plugins") -return require("options") \ No newline at end of file