From fb591c88525d8e3e0f8968c1ef2b343198fe6392 Mon Sep 17 00:00:00 2001 From: Jovan Djokic-Sumarac Date: Wed, 14 Aug 2024 16:26:26 +0200 Subject: [PATCH] lua-only no fennel --- .gitignore | 3 +-- init.lua | 37 ++------------------------------ lua/options/colors.lua | 7 +++++++ lua/options/init.lua | 8 +++++++ lua/options/keybind.lua | 26 +++++++++++++++++++++++ lua/options/opts.lua | 43 ++++++++++++++++++++++++++++++++++++++ lua/plugins/colorizer.lua | 4 ++++ lua/plugins/devicons.lua | 3 +++ lua/plugins/gitsigns.lua | 3 +++ lua/plugins/harpoon.lua | 35 +++++++++++++++++++++++++++++++ lua/plugins/hlchunk.lua | 3 +++ lua/plugins/incline.lua | 3 +++ lua/plugins/init.lua | 17 +++++++++++++++ lua/plugins/lazy.lua | 11 ++++++++++ lua/plugins/lsp-zero.lua | 36 +++++++++++++++++++++++++++++++ lua/plugins/lualine.lua | 3 +++ lua/plugins/mini.lua | 11 ++++++++++ lua/plugins/oil.lua | 3 +++ lua/plugins/telescope.lua | 4 ++++ lua/plugins/treesitter.lua | 4 ++++ lua/plugins/wilder.lua | 1 + lua/tangerine_vimrc.lua | 3 +++ 22 files changed, 231 insertions(+), 37 deletions(-) create mode 100644 lua/options/colors.lua create mode 100644 lua/options/init.lua create mode 100644 lua/options/keybind.lua create mode 100644 lua/options/opts.lua create mode 100644 lua/plugins/colorizer.lua create mode 100644 lua/plugins/devicons.lua create mode 100644 lua/plugins/gitsigns.lua create mode 100644 lua/plugins/harpoon.lua create mode 100644 lua/plugins/hlchunk.lua create mode 100644 lua/plugins/incline.lua create mode 100644 lua/plugins/init.lua create mode 100644 lua/plugins/lazy.lua create mode 100644 lua/plugins/lsp-zero.lua create mode 100644 lua/plugins/lualine.lua create mode 100644 lua/plugins/mini.lua create mode 100644 lua/plugins/oil.lua create mode 100644 lua/plugins/telescope.lua create mode 100644 lua/plugins/treesitter.lua create mode 100644 lua/plugins/wilder.lua create mode 100644 lua/tangerine_vimrc.lua diff --git a/.gitignore b/.gitignore index 591f2d1..adea96b 100755 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -lua/ -lua_bak/ +fnl/ lazy-lock.json diff --git a/init.lua b/init.lua index 178ca06..1e0426f 100755 --- a/init.lua +++ b/init.lua @@ -1,35 +1,2 @@ - --- needed to fix deprecation warning -vim.tbl_islist = vim.islist - --- bootstrap tangerine and hibiscus in order to have fennel support -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" } - } -} +require("plugins") +require("options") diff --git a/lua/options/colors.lua b/lua/options/colors.lua new file mode 100644 index 0000000..8929f4b --- /dev/null +++ b/lua/options/colors.lua @@ -0,0 +1,7 @@ +-- :fennel:1721474653 +local espresso = require("catppuccin") +local color_overrides = {macchiato = {rosewater = "#F5B8AB", flamingo = "#F29D9D", pink = "#AD6FF7", mauve = "#FF8F40", red = "#E66767", maroon = "#EB788B", peach = "#FAB770", yellow = "#FACA64", green = "#70CF67", teal = "#4CD4BD", sky = "#61BDFF", sapphire = "#4BA8FA", blue = "#00BFFF", lavender = "#00BBCC", text = "#C1C9E6", subtext1 = "#A3AAC2", subtext0 = "#8E94AB", overlay2 = "#7D8296", overlay1 = "#676B80", overlay0 = "#464957", surface2 = "#3A3D4A", surface1 = "#2F313D", surface0 = "#1D1E29", base = "#0b0b0b", mantle = "#11111a", crust = "#191926"}} +local integrations = {cmp = true, gitsigns = true, treesitter = true, telescope = {enabled = true, style = "nvchad"}, mini = {enabled = true}} +espresso.setup({flavour = "macchiato", color_overrides = color_overrides, integrations = integrations}) +do end (vim.opt)["background"] = "dark" +return vim.cmd("colorscheme catppuccin") \ No newline at end of file diff --git a/lua/options/init.lua b/lua/options/init.lua new file mode 100644 index 0000000..567d904 --- /dev/null +++ b/lua/options/init.lua @@ -0,0 +1,8 @@ +-- :fennel:1721140474 +local dir = "options." +local function modul(name) + return (dir .. name) +end +require(modul("colors")) +require(modul("keybind")) +return require(modul("opts")) \ No newline at end of file diff --git a/lua/options/keybind.lua b/lua/options/keybind.lua new file mode 100644 index 0000000..5c9d204 --- /dev/null +++ b/lua/options/keybind.lua @@ -0,0 +1,26 @@ +-- :fennel:1721767243 +vim.g["mapleader"] = " " +vim.keymap.set({"n"}, "tw", "lua MiniTrailspace.trim()", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "fb", "Telescope buffers", {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"}, "fg", "Telescope live_grep", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "fh", "Telescope help_tags", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "fk", "Telescope keymaps", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "tt", "terminal", {noremap = true, silent = true}) +vim.keymap.set({"n"}, "", "bprev", {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}) +vim.keymap.set({"n", "v", "x"}, "y", "\"+y", {noremap = true, silent = true}) +vim.keymap.set({"n", "v", "x"}, "Y", "\"+yy", {noremap = true, silent = true}) +return vim.keymap.set({"n", "v", "x"}, "p", "\"+p", {noremap = true, silent = true}) \ No newline at end of file diff --git a/lua/options/opts.lua b/lua/options/opts.lua new file mode 100644 index 0000000..2035612 --- /dev/null +++ b/lua/options/opts.lua @@ -0,0 +1,43 @@ +-- :fennel:1722704128 +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"] = false +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["expandtab"] = false +vim.opt["compatible"] = false +vim.opt["showmatch"] = true +vim.opt["hlsearch"] = true +vim.opt["incsearch"] = true +vim.opt["autoindent"] = true +vim.opt["wildmode"] = "longest,list" +vim.opt["inccommand"] = "split" +vim.opt["mouse"] = "v" +vim.opt["mouse"] = "a" +vim.opt["ttyfast"] = true +vim.opt["cursorline"] = true +vim.opt["splitbelow"] = true +vim.opt["signcolumn"] = "yes:1" +vim.opt["showmode"] = false +vim.opt["cmdheight"] = 0 +vim.cmd("syntax match keyword \"\\\" conceal cchar=\206\187") +do end (vim.opt)["conceallevel"] = 1 +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 _, plug in ipairs(default_plugins) do + vim.g[("loaded" .. plug)] = 1 +end +return nil \ No newline at end of file diff --git a/lua/plugins/colorizer.lua b/lua/plugins/colorizer.lua new file mode 100644 index 0000000..9ee3ed2 --- /dev/null +++ b/lua/plugins/colorizer.lua @@ -0,0 +1,4 @@ +-- :fennel:1721474653 +vim.opt["termguicolors"] = true +local colorizer = require("nvim-highlight-colors") +return colorizer.setup() \ No newline at end of file diff --git a/lua/plugins/devicons.lua b/lua/plugins/devicons.lua new file mode 100644 index 0000000..5d22ad9 --- /dev/null +++ b/lua/plugins/devicons.lua @@ -0,0 +1,3 @@ +-- :fennel:1721474653 +local plug = require("nvim-web-devicons") +return 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"}}}) \ No newline at end of file diff --git a/lua/plugins/gitsigns.lua b/lua/plugins/gitsigns.lua new file mode 100644 index 0000000..36ad746 --- /dev/null +++ b/lua/plugins/gitsigns.lua @@ -0,0 +1,3 @@ +-- :fennel:1721566506 +local gitsigns = require("gitsigns") +return gitsigns.setup({signs = {add = {text = "\226\150\141"}, change = {text = "\226\150\141"}, delete = {text = "\226\150\141"}, topdelete = {text = "\226\150\141"}, changedelete = {text = "\226\150\141"}, untracked = {text = "\226\150\141"}}, signcolumn = true, watch_gitdir = {follow_files = true}, attach_to_untracked = true, 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}, current_line_blame = false, linehl = false, numhl = false, word_diff = false}) \ No newline at end of file diff --git a/lua/plugins/harpoon.lua b/lua/plugins/harpoon.lua new file mode 100644 index 0000000..8e156bf --- /dev/null +++ b/lua/plugins/harpoon.lua @@ -0,0 +1,35 @@ +-- :fennel:1721425793 +local harpoon = require("harpoon") +harpoon.setup() +local function _1_() + return (harpoon.list):append() +end +vim.keymap.set({"n"}, "ha", _1_, {noremap = true, silent = true}) +local function _2_() + return harpoon.ui.toggle_quick_menu(harpoon.list()) +end +vim.keymap.set({"n"}, "", _2_, {noremap = true, silent = true}) +local function _3_() + return (harpoon.list):select(1) +end +vim.keymap.set({"n"}, "", _3_, {noremap = true, silent = true}) +local function _4_() + return (harpoon.list):select(2) +end +vim.keymap.set({"n"}, "", _4_, {noremap = true, silent = true}) +local function _5_() + return (harpoon.list):select(3) +end +vim.keymap.set({"n"}, "", _5_, {noremap = true, silent = true}) +local function _6_() + return (harpoon.list):select(4) +end +vim.keymap.set({"n"}, "", _6_, {noremap = true, silent = true}) +local function _7_() + return (harpoon.list):prev() +end +vim.keymap.set({"n"}, "", _7_, {noremap = true, silent = true}) +local function _8_() + return (harpoon.list):next() +end +return vim.keymap.set({"n"}, "", _8_, {noremap = true, silent = true}) \ No newline at end of file diff --git a/lua/plugins/hlchunk.lua b/lua/plugins/hlchunk.lua new file mode 100644 index 0000000..e7d3da2 --- /dev/null +++ b/lua/plugins/hlchunk.lua @@ -0,0 +1,3 @@ +-- :fennel:1721474653 +local hlchunk = require("hlchunk") +return hlchunk.setup({indent = {enable = true, chars = {".", ".", ".", "."}, style = {["#888888"] = "#666666", ["#444444"] = "#333333", ["#333333"] = "#333333"}}, blank = {enable = false}, chunk = {enable = false}, line_num = {style = "#ADBC9F", enable = false}}) \ No newline at end of file diff --git a/lua/plugins/incline.lua b/lua/plugins/incline.lua new file mode 100644 index 0000000..6b1355f --- /dev/null +++ b/lua/plugins/incline.lua @@ -0,0 +1,3 @@ +-- :fennel:1721474653 +local incline = require("incline") +return incline.setup({highlight = {groups = {InclineNormal = {default = true, group = "lualine_a_normal"}, InclineNormalNC = {default = true, group = "Comment"}}}, window = {margin = {vertical = 0, horizontal = 1}}}) \ No newline at end of file diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua new file mode 100644 index 0000000..7cb6be5 --- /dev/null +++ b/lua/plugins/init.lua @@ -0,0 +1,17 @@ +-- :fennel:1721499601 +local dir = "plugins." +local function modul(name) + return (dir .. name) +end +require(modul("lazy")) +require(modul("devicons")) +require(modul("gitsigns")) +require(modul("harpoon")) +require(modul("lsp-zero")) +require(modul("lualine")) +require(modul("mini")) +require(modul("telescope")) +require(modul("treesitter")) +require(modul("wilder")) +require(modul("incline")) +return require(modul("colorizer")) \ No newline at end of file diff --git a/lua/plugins/lazy.lua b/lua/plugins/lazy.lua new file mode 100644 index 0000000..8a3c92a --- /dev/null +++ b/lua/plugins/lazy.lua @@ -0,0 +1,11 @@ +-- :fennel:1722759221 +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", lazypath}) +else +end +do end (vim.opt.rtp):prepend(lazypath) +local lazy = require("lazy") +local plug = 1 +local plugins = {"ThePrimeagen/vim-be-good", "udayvir-singh/tangerine.nvim", "udayvir-singh/hibiscus.nvim", "lambdalisue/nerdfont.vim", {[plug] = "catppuccin/nvim", name = "catppuccin", priority = 1000}, "gelguy/wilder.nvim", "bkad/camelcasemotion", "lewis6991/gitsigns.nvim", {[plug] = "b0o/incline.nvim", event = {"BufReadPre"}}, "echasnovski/mini.nvim", "brenoprata10/nvim-highlight-colors", {[plug] = "svampkorg/moody.nvim", event = {"ModeChanged", "BufWinEnter", "WinEnter"}, opts = {}}, {[plug] = "nvim-telescope/telescope-fzf-native.nvim", build = "make"}, {[plug] = "nvim-telescope/telescope.nvim", tag = "0.1.8", dependencies = {"nvim-lua/plenary.nvim"}}, {[plug] = "OXY2DEV/markview.nvim", dependencies = {"nvim-treesitter/nvim-treesitter", "nvim-tree/nvim-web-devicons"}}, {[plug] = "ThePrimeagen/harpoon", branch = "harpoon2", dependencies = {"nvim-lua/plenary.nvim"}}, {[plug] = "nvim-lualine/lualine.nvim", dependencies = {"nvim-tree/nvim-web-devicons"}}, {[plug] = "nvim-treesitter/nvim-treesitter", build = ":TSUpdate"}, {[plug] = "VonHeikemen/lsp-zero.nvim", branch = "v3.x", dependencies = {"neovim/nvim-lspconfig", "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", "hrsh7th/nvim-cmp", "hrsh7th/cmp-nvim-lsp", "L3MON4D3/LuaSnip"}}, {[plug] = "m4xshen/hardtime.nvim", dependencies = {"MunifTanjim/nui.nvim", "nvim-lua/plenary.nvim"}}} +return lazy.setup(plugins) \ No newline at end of file diff --git a/lua/plugins/lsp-zero.lua b/lua/plugins/lsp-zero.lua new file mode 100644 index 0000000..2308058 --- /dev/null +++ b/lua/plugins/lsp-zero.lua @@ -0,0 +1,36 @@ +-- :fennel:1721498140 +local lsp = require("lsp-zero") +lsp.preset() +local lspconfig = require("lspconfig") +lspconfig.lua_ls.setup(lsp.nvim_lua_ls()) +local mason = require("mason") +mason.setup() +local mason_lspc = require("mason-lspconfig") +mason_lspc.setup({["ensure-installed"] = {"fennel-ls", "lua-language-server", "python-lsp-server"}, automatic_installation = true}) +local cmp = require("cmp") +local cmp_action = lsp.cmp_action() +local function _1_(_, bufnr) + do local _ = lsp.default_keymaps end + return {buffer = bufnr} +end +lsp.on_attach(_1_) +lspconfig.pylsp.setup({setings = {pylsp = {plugins = {pycodestyle = {ignore = {"W391", "E303", "E226"}, maxLineLength = 120}}}}}) +lsp.setup() +lspconfig.racket_langserver.setup({}) +local function _2_(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + return {"i", "s"} +end +local function _4_(fallback) + if cmp.visible() then + cmp.select_prev_item() + else + fallback() + end + return {"i", "s"} +end +return cmp.setup({mapping = {[""] = cmp.mapping.confirm({select = true}), [""] = cmp.mapping(_2_), [""] = cmp.mapping(_4_), [""] = cmp.mapping.complete, [""] = cmp_action.luasnip_jump_forward, [""] = cmp_action.luasnip_jump_backward}}) \ No newline at end of file diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua new file mode 100644 index 0000000..c8a6337 --- /dev/null +++ b/lua/plugins/lualine.lua @@ -0,0 +1,3 @@ +-- :fennel:1721474653 +local lualine = require("lualine") +return lualine.setup({options = {section_separators = {left = "\238\130\188", right = "\238\130\186"}, component_separators = {left = "\238\130\189", right = "\238\130\187"}}}) \ No newline at end of file diff --git a/lua/plugins/mini.lua b/lua/plugins/mini.lua new file mode 100644 index 0000000..419cf53 --- /dev/null +++ b/lua/plugins/mini.lua @@ -0,0 +1,11 @@ +-- :fennel:1721140474 +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") +return surround.setup() \ No newline at end of file diff --git a/lua/plugins/oil.lua b/lua/plugins/oil.lua new file mode 100644 index 0000000..fa15f84 --- /dev/null +++ b/lua/plugins/oil.lua @@ -0,0 +1,3 @@ +-- :fennel:1721140474 +local oil = require("oil") +return oil.setup() \ No newline at end of file diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua new file mode 100644 index 0000000..753bbc6 --- /dev/null +++ b/lua/plugins/telescope.lua @@ -0,0 +1,4 @@ +-- :fennel:1721500726 +local telescope = require("telescope") +telescope.setup({extansions = {fzf = {fuzzy = true, override_generic_sorter = true, override_file_sorter = true, case_mode = "smart_case"}}}) +return telescope.load_extension("fzf") \ No newline at end of file diff --git a/lua/plugins/treesitter.lua b/lua/plugins/treesitter.lua new file mode 100644 index 0000000..fa2cd36 --- /dev/null +++ b/lua/plugins/treesitter.lua @@ -0,0 +1,4 @@ +-- :fennel:1721474653 +local configs = require("nvim-treesitter.configs") +configs.setup({ensure_installed = {"c", "lua", "vim", "vimdoc", "query", "haskell", "go", "bash", "python", "fennel", "hyprlang"}, auto_install = true, highlight = {enable = true}, sync_install = false}) +return vim.filetype.add({pattern = {[".*/hypr/.*%.conf"] = "hyprlang"}}) \ No newline at end of file diff --git a/lua/plugins/wilder.lua b/lua/plugins/wilder.lua new file mode 100644 index 0000000..154d7cb --- /dev/null +++ b/lua/plugins/wilder.lua @@ -0,0 +1 @@ +-- :fennel:1721497941 diff --git a/lua/tangerine_vimrc.lua b/lua/tangerine_vimrc.lua new file mode 100644 index 0000000..beb2e04 --- /dev/null +++ b/lua/tangerine_vimrc.lua @@ -0,0 +1,3 @@ +-- :fennel:1721567155 +require("plugins") +return require("options") \ No newline at end of file