From 531e92ef746d39a8eb3213ec9429142a77e38868 Mon Sep 17 00:00:00 2001 From: afranco Date: Mon, 12 Feb 2024 15:05:56 +0000 Subject: [PATCH] chore(NVIM): Added orgmode and change iskeyword definition --- .config/nvim/lua/core/theme.lua | 1 + .config/nvim/lua/core/variables.lua | 5 ++- .config/nvim/lua/plugins/jukit.lua | 26 ++++++++++++ .config/nvim/lua/plugins/lazy.lua | 55 +++++++++++++++++++++++++ .config/nvim/lua/plugins/themery.lua | 32 ++++++++++++++ .config/nvim/lua/plugins/treesitter.lua | 16 ++++--- 6 files changed, 128 insertions(+), 7 deletions(-) create mode 100644 .config/nvim/lua/plugins/jukit.lua diff --git a/.config/nvim/lua/core/theme.lua b/.config/nvim/lua/core/theme.lua index c814c32..6d1553f 100644 --- a/.config/nvim/lua/core/theme.lua +++ b/.config/nvim/lua/core/theme.lua @@ -31,6 +31,7 @@ information = { "underline" }, }, }, }) +vim.opt.background = "light" vim.cmd("colorscheme catppuccin-latte") diff --git a/.config/nvim/lua/core/variables.lua b/.config/nvim/lua/core/variables.lua index 2308228..591553d 100644 --- a/.config/nvim/lua/core/variables.lua +++ b/.config/nvim/lua/core/variables.lua @@ -12,6 +12,9 @@ vim.opt.smartindent = true --Move lines vim.keymap.set("v", "J", ":m '>+1gv=gv") vim.keymap.set("v", "K", ":m '<-2gv=gv") +--Change word definition +vim.opt.iskeyword:append("-") +vim.opt.iskeyword:append("_") --Remove Wrap vim.opt.wrap = false --Not let cursor go bellow 10 chars. @@ -35,6 +38,6 @@ vim.g.jukit_convert_overwrite_default = 1 vim.g.jukit_convert_open_default = 0 vim.g.jukit_shell_cmd = 'ipython3' vim.g.jukit_terminal = 'nvimterm' -vim.g.jukit_inline_plotting=1 vim.g.jukit_show_prompt = 1 vim.g.jukit_pdf_viewer = 'zathura' +vim.g.jukit_mappings = 1 diff --git a/.config/nvim/lua/plugins/jukit.lua b/.config/nvim/lua/plugins/jukit.lua new file mode 100644 index 0000000..7118fcc --- /dev/null +++ b/.config/nvim/lua/plugins/jukit.lua @@ -0,0 +1,26 @@ +-- Create new code cell below. Argument: Whether to create code cell (0) or markdown cell (1) +vim.api.nvim_set_keymap('n', 'jco', ':call jukit#cells#create_below(0)', { noremap = true, silent = true}) +-- Create new code cell above. Argument: Whether to create code cell (0) or markdown cell (1) +vim.api.nvim_set_keymap('n', 'jcO', ':call jukit#cells#create_above(0)', { noremap = true, silent = true}) + +-- Create new text (markdown) cell below. Argument: Whether to create code cell (0) or markdown cell (1) +vim.api.nvim_set_keymap('n', 'jct', ':call jukit#cells#create_below(1)', { noremap = true, silent = true }) +-- Create new text (markdown) cell above. Argument: Whether to create code cell (0) or markdown cell (1) +vim.api.nvim_set_keymap('n', 'jcT', ':call jukit#cells#create_above(1)', { noremap = true, silent = true }) + +-- Deletes the current cell +vim.api.nvim_set_keymap('n', 'jcd', ':call jukit#cells#delete()', { noremap = true, silent = true }) + +-- Send current section (argument: 0 indicates the current section) +vim.api.nvim_set_keymap('n', 'jcc', ':call jukit#send#section(0)', { noremap = true, silent = true }) + +-- Send all sections up to the current section +vim.api.nvim_set_keymap('n', 'jcac', ':call jukit#send#until_current_section()', { noremap = true, silent = true }) + +-- Send all sections +vim.api.nvim_set_keymap('n', 'jca', ':call jukit#send#all()', { noremap = true, silent = true }) + +-- Open an output split +vim.api.nvim_set_keymap('n', 'jos', ':call jukit#splits#output()', { noremap = true, silent = true }) + + diff --git a/.config/nvim/lua/plugins/lazy.lua b/.config/nvim/lua/plugins/lazy.lua index 6d6c167..7c1f71f 100644 --- a/.config/nvim/lua/plugins/lazy.lua +++ b/.config/nvim/lua/plugins/lazy.lua @@ -17,8 +17,63 @@ lazy.setup({ lazy = false, priority = 1000, }, + { "ellisonleao/gruvbox.nvim", priority = 1000 }, + + 'rose-pine/neovim', + -------------------------------------------------------MFP--------------------------------- + { + 'susliko/tla.nvim', + config = function() + require("tla").setup() + end + }, -------------------------------------------------------QOL--------------------------------- + + { + 'chipsenkbeil/distant.nvim', + branch = 'v0.3', + config = function() + require('distant'):setup({ + servers = { + ['10.8.0.9'] = { + launch = { + default = { + username = 'afonso', + args = '--port 8080 --shutdown lonely=1' + } + } + }, + } + }) + end + }, + --Python notebooks + { + 'luk400/vim-jukit', + config = function() + require 'plugins.jukit' + end + }, + --org mode + { + 'nvim-orgmode/orgmode', + dependencies = { + { 'nvim-treesitter/nvim-treesitter', lazy = true }, + }, + event = 'VeryLazy', + config = function() + -- Load treesitter grammar for org + require('orgmode').setup_ts_grammar() + + -- Setup orgmode + require('orgmode').setup({ + org_agenda_files = '~/orgfiles/**/*', + org_default_notes_file = '~/orgfiles/refile.org', + }) + end, + }, + { "zbirenbaum/copilot.lua", cmd = "Copilot", diff --git a/.config/nvim/lua/plugins/themery.lua b/.config/nvim/lua/plugins/themery.lua index 576cddc..5bcd52a 100644 --- a/.config/nvim/lua/plugins/themery.lua +++ b/.config/nvim/lua/plugins/themery.lua @@ -48,6 +48,7 @@ require("themery").setup({ }, }, }) + vim.opt.background = "dark" ]] }, { @@ -85,8 +86,39 @@ require("themery").setup({ }, }, }) + vim.opt.background = "light" ]] }, + { + name = "Rosé Pine", + colorscheme = "rose-pine", + before = [[ + require('rose-pine').setup({ + variant = "main" + }) + vim.opt.background = "dark" + ]] + }, + { + name = "Rosé Pine Moon", + colorscheme = "rose-pine", + before = [[ + require('rose-pine').setup({ + variant = "moon" + }) + vim.opt.background = "dark" + ]] + }, + { + name = "Rosé Pine Dawn", + colorscheme = "rose-pine", + before = [[ + require('rose-pine').setup({ + variant = "dawn" + }) + vim.opt.background = "light" + ]] + }, }, themeConfigFile = "~/.config/nvim/lua/core/theme.lua", -- Described below livePreview = true, -- Apply theme while browsing. Default to true. diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua index 107bfdd..d4a6fec 100644 --- a/.config/nvim/lua/plugins/treesitter.lua +++ b/.config/nvim/lua/plugins/treesitter.lua @@ -1,19 +1,23 @@ local present, treesitter = pcall(require, "nvim-treesitter.configs") - -require('nvim-treesitter.install').update({ with_sync = true }) - - if not present then return end +require('nvim-treesitter.install').update({ with_sync = true }) +local present, orgmode = pcall(require, "orgmode") +if present then + require('orgmode').setup_ts_grammar() +end + + + local options = { - ensure_installed = { "c", "lua", "haskell", "rust", "markdown", "org"}, + ensure_installed = { "c", "lua", "haskell", "rust", "markdown", "org" }, highlight = { enable = true, use_languagetree = true, - additional_vim_regex_highlighting = {"org"}, + additional_vim_regex_highlighting = { "org" }, }, indent = { enable = true,