diff --git a/nvim/lua/trianta/colors.lua b/nvim/lua/trianta/colors.lua new file mode 100644 index 0000000..3c3f201 --- /dev/null +++ b/nvim/lua/trianta/colors.lua @@ -0,0 +1,7 @@ +return { + { "catppuccin/nvim", as = "catppuccin" }, + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + } +} diff --git a/nvim/lua/trianta/focus.lua b/nvim/lua/trianta/focus.lua new file mode 100644 index 0000000..117d193 --- /dev/null +++ b/nvim/lua/trianta/focus.lua @@ -0,0 +1,45 @@ +return { + { + "folke/twilight.nvim", + opts = { + dimming = { + alpha = 0.25, + color = { "Normal", "#ffffff" }, + term_bg = "#000000", + inactive = false, + }, + context = 10, + treesitter = true, + expand = { + "function", + "method", + "table", + "if_statement" + }, + }, + }, + { + "folke/zen-mode.nvim", + opts = { + { + window = { + backdrop = 0.95, + width = 120, + height = 1, + }, + plugins = { + options = { + enabled = true, + ruler = false, + showcmd = false, + }, + twilight = { enabled = true }, + }, + on_open = function(win) + end, + on_close = function() + end, + } + } + } +} diff --git a/nvim/lua/trianta/init.lua b/nvim/lua/trianta/init.lua index eddc4a1..184d657 100644 --- a/nvim/lua/trianta/init.lua +++ b/nvim/lua/trianta/init.lua @@ -1,3 +1,4 @@ +require("trianta.set") require("trianta.remap") require("trianta.lazy") -require("trianta.set") + diff --git a/nvim/lua/trianta/lazy.lua b/nvim/lua/trianta/lazy.lua index 1553b2f..d640899 100644 --- a/nvim/lua/trianta/lazy.lua +++ b/nvim/lua/trianta/lazy.lua @@ -2,14 +2,14 @@ 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, - }) + 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) @@ -25,130 +25,10 @@ return require('lazy').setup({ -- refer to the configuration section below } }, - { "catppuccin/nvim", as = "catppuccin" }, - { - "nvim-telescope/telescope.nvim", branch = '0.1.x', - -- or , branch = '0.1.x', - dependencies = {"nvim-lua/plenary.nvim"}, - }, - - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - }, - "nvim-treesitter/playground", - "ThePrimeagen/harpoon", - { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v1.x', - dependencies = { - -- LSP Support - "neovim/nvim-lspconfig", -- Required - 'williamboman/mason.nvim', -- Optional - 'williamboman/mason-lspconfig.nvim', -- Optional - - -- Autocompletion - 'hrsh7th/nvim-cmp', -- Required - 'hrsh7th/cmp-nvim-lsp', -- Required - 'hrsh7th/cmp-buffer', -- Optional - 'hrsh7th/cmp-path', -- Optional - 'saadparwaiz1/cmp_luasnip', -- Optional - 'hrsh7th/cmp-nvim-lua', -- Optional - - -- Snippets - 'L3MON4D3/LuaSnip', -- Required - 'rafamadriz/friendly-snippets', -- Optional - }, - }, - { - "epwalsh/obsidian.nvim", - version = "*", -- recommended, use latest release instead of latest commit - lazy = true, - ft = "markdown", - dependencies = { - "nvim-lua/plenary.nvim", - }, - opts = { - workspaces = { - { - name = "trinote", - path = "~/sync/obsidian/Trinote/", - }, - }, - }, - ui = { - enable = true - } - }, - { - "folke/twilight.nvim", - opts = { - dimming = { - alpha = 0.25, -- amount of dimming - -- we try to get the foreground from the highlight groups or fallback color - color = { "Normal", "#ffffff" }, - term_bg = "#000000", -- if guibg=NONE, this will be used to calculate text color - inactive = false, -- when true, other windows will be fully dimmed (unless they contain the same buffer) - }, - context = 10, -- amount of lines we will try to show around the current line - treesitter = true, -- use treesitter when available for the filetype - -- treesitter is used to automatically expand the visible text, - -- but you can further control the types of nodes that should always be fully expanded - expand = { -- for treesitter, we we always try to expand to the top-most ancestor with these types - "function", - "method", - "table", - "if_statement", - }, - exclude = {}, -- exclude these filetypes - }, -}, --- Lua -{ - "folke/zen-mode.nvim", - opts = { - -- your configuration comes here - -- or leave it empty to use the default settings - -- refer to the configuration section below - { - window = { - backdrop = 0.95, -- shade the backdrop of the Zen window. Set to 1 to keep the same as Normal - -- height and width can be: - -- * an absolute number of cells when > 1 - -- * a percentage of the width / height of the editor when <= 1 - -- * a function that returns the width or the height - width = 120, -- width of the Zen window - height = 1, -- height of the Zen window - -- by default, no options are changed for the Zen window - -- uncomment any of the options below, or add other vim.wo options you want to apply - options = { - -- signcolumn = "no", -- disable signcolumn - -- number = false, -- disable number column - -- relativenumber = false, -- disable relative numbers - -- cursorline = false, -- disable cursorline - -- cursorcolumn = false, -- disable cursor column - -- foldcolumn = "0", -- disable fold column - -- list = false, -- disable whitespace characters - }, - }, - plugins = { - options = { - enabled = true, - ruler = false, -- disables the ruler text in the cmd line area - showcmd = false, -- disables the command in the last line of the screen - -- you may turn on/off statusline in zen mode by setting 'laststatus' - -- statusline will be shown only if 'laststatus' == 3 - laststatus = 0, -- turn off the statusline in zen mode - }, - twilight = { enabled = true }, -- enable to start Twilight when zen mode opens - }, - -- callback where you can add custom code when the Zen window opens - on_open = function(win) - end, - -- callback where you can add custom code when the Zen window closes - on_close = function() - end, - } - } -} + require("trianta.colors"), + require("trianta.lsp"), + require("trianta.nav"), + require("trianta.focus"), + require("trianta.obsidian"), + require("trianta.ollama"), }) diff --git a/nvim/lua/trianta/lsp.lua b/nvim/lua/trianta/lsp.lua new file mode 100644 index 0000000..07cf36c --- /dev/null +++ b/nvim/lua/trianta/lsp.lua @@ -0,0 +1,22 @@ +return { + 'VonHeikemen/lsp-zero.nvim', + branch = 'v1.x', + dependencies = { + -- LSP Support + "neovim/nvim-lspconfig", -- Required + 'williamboman/mason.nvim', -- Optional + 'williamboman/mason-lspconfig.nvim', -- Optional + + -- Autocompletion + 'hrsh7th/nvim-cmp', -- Required + 'hrsh7th/cmp-nvim-lsp', -- Required + 'hrsh7th/cmp-buffer', -- Optional + 'hrsh7th/cmp-path', -- Optional + 'saadparwaiz1/cmp_luasnip', -- Optional + 'hrsh7th/cmp-nvim-lua', -- Optional + + -- Snippets + 'L3MON4D3/LuaSnip', -- Required + 'rafamadriz/friendly-snippets', -- Optional + }, +} diff --git a/nvim/lua/trianta/nav.lua b/nvim/lua/trianta/nav.lua new file mode 100644 index 0000000..4d625c6 --- /dev/null +++ b/nvim/lua/trianta/nav.lua @@ -0,0 +1,9 @@ +return { + { + "nvim-telescope/telescope.nvim", branch = '0.1.x', + -- or , branch = '0.1.x', + dependencies = {"nvim-lua/plenary.nvim"}, + }, + + "ThePrimeagen/harpoon" +} diff --git a/nvim/lua/trianta/obsidian.lua b/nvim/lua/trianta/obsidian.lua new file mode 100644 index 0000000..67a2db8 --- /dev/null +++ b/nvim/lua/trianta/obsidian.lua @@ -0,0 +1,22 @@ +return { + { + "epwalsh/obsidian.nvim", + version = "*", -- recommended, use latest release instead of latest commit + lazy = true, + ft = "markdown", + dependencies = { + "nvim-lua/plenary.nvim", + }, + opts = { + workspaces = { + { + name = "trinote", + path = "~/sync/obsidian/Trinote/", + }, + }, + }, + ui = { + enable = true + } + } +} diff --git a/nvim/lua/trianta/ollama.lua b/nvim/lua/trianta/ollama.lua new file mode 100644 index 0000000..2863541 --- /dev/null +++ b/nvim/lua/trianta/ollama.lua @@ -0,0 +1,49 @@ +return { + "nomnivore/ollama.nvim", + dependencies = { + "nvim-lua/plenary.nvim", + }, + + -- All the user commands added by the plugin + cmd = { "Ollama", "OllamaModel", "OllamaServe", "OllamaServeStop" }, + + keys = { + -- Sample keybind for prompt menu. Note that the is important for selections to work properly. + { + "oo", + ":lua require('ollama').prompt()", + desc = "ollama prompt", + mode = { "n", "v" }, + }, + + -- Sample keybind for direct prompting. Note that the is important for selections to work properly. + { + "oG", + ":lua require('ollama').prompt('Generate_Code')", + desc = "ollama Generate Code", + mode = { "n", "v" }, + }, + }, + + ---@type Ollama.Config + opts = { + model = "codellama-gpu-25-cpu-2", + url = "factory.lan:11434", + serve = { + on_start = false, + command = "ollama", + args = { "serve" }, + stop_command = "pkill", + stop_args = { "-SIGTERM", "ollama" }, + }, + -- View the actual default prompts in ./lua/ollama/prompts.lua + prompts = { + Sample_Prompt = { + prompt = "This is a sample prompt that receives $input and $sel(ection), among others.", + input_label = "> ", + model = "mistral", + action = "display", + } + } + } +}