From 8994364bd77e3dd0a9512d006e30149cd9dfd482 Mon Sep 17 00:00:00 2001 From: ediw8311xht Date: Sat, 9 Nov 2024 10:23:19 -0500 Subject: [PATCH] nvim --- bashrc_files/exports.sh | 2 +- i3wm/modes.conf | 1 + mimeapps.list | 7 +- nvim/init.vim | 8 ++ .../templates/template_note.md | 15 ++-- nvim/lua/base.lua | 43 ++++++---- nvim/lua/mytreesitter.lua | 2 +- nvim/plugins.vim | 82 +++++++++---------- 8 files changed, 92 insertions(+), 68 deletions(-) diff --git a/bashrc_files/exports.sh b/bashrc_files/exports.sh index 682e505..752052e 100644 --- a/bashrc_files/exports.sh +++ b/bashrc_files/exports.sh @@ -25,7 +25,7 @@ export FZF_DEFAULT_OPTS=' --bind ctrl-g:preview-half-page-down --bind ctrl-h:preview-half-page-up --bind ctrl-K:clear-query - --bind ctrl-space:toggle-preview' + --bind ctrl-t:toggle-preview' export LS_PREVIEW='lsd \ --color=always \ --group-dirs="first" \ diff --git a/i3wm/modes.conf b/i3wm/modes.conf index 6605009..8508ffb 100644 --- a/i3wm/modes.conf +++ b/i3wm/modes.conf @@ -205,6 +205,7 @@ mode "run_program" { bindsym c exec chromium ; $mode_be_default bindsym d exec deluge ; $mode_be_default bindsym f exec firefox ; $mode_be_default + bindsym g exec geogebra ; $mode_be_default bindsym k exec keepassxc ; $mode_be_default bindsym l exec librewolf ; $mode_be_default bindsym o exec obsidian ; $mode_be_default diff --git a/mimeapps.list b/mimeapps.list index 6deee4d..1c92d82 100644 --- a/mimeapps.list +++ b/mimeapps.list @@ -6,9 +6,10 @@ x-scheme-handler/https=brave-browser.desktop; application/vnd.openxmlformats-officedocument.wordprocessingml.document=libreoffice-writer.desktop; [Default Applications] -application/x-xz-compressed-tar=org.gnome.FileRoller.desktop -application/x-compressed-tar=org.gnome.FileRoller.desktop -application/zip=org.gnome.FileRoller.desktop +image/vnd.djvu+multipage=org.pwmt.zathura-pdf-mupdf.desktop; +application/x-xz-compressed-tar=org.gnome.FileRoller.desktop; +application/x-compressed-tar=org.gnome.FileRoller.desktop; +application/zip=org.gnome.FileRoller.desktop; application/epub+zip=org.pwmt.zathura-pdf-mupdf.desktop; application/epub=zathura.desktop; application/gzip=engrampa.desktop; diff --git a/nvim/init.vim b/nvim/init.vim index 906c4f2..e811e1f 100644 --- a/nvim/init.vim +++ b/nvim/init.vim @@ -120,6 +120,14 @@ let g:html_mode = 1 let g:is_bash = 1 let g:vlime_leader = "~" +"-------Latex----------" +let g:tex_flavor='latex' +let g:vimtex_view_method='zathura' +let g:vimtex_quickfix_mode=0 +set conceallevel=1 +let g:tex_conceal='abdmg' +"----------------------" + source ${HOME}/.config/nvim/autocmd.vim source ${HOME}/.config/nvim/plugins.vim source ${HOME}/.config/nvim/functions.vim diff --git a/nvim/language_specific/templates/template_note.md b/nvim/language_specific/templates/template_note.md index cf93674..0730065 100644 --- a/nvim/language_specific/templates/template_note.md +++ b/nvim/language_specific/templates/template_note.md @@ -5,15 +5,12 @@ .markdown-body { background-color: #000 !important; } - * { - font-family: Agave !important; - } #page-ctn, #page-header, .markdown-body { max-width: min(1100px, 90vw) !important; } img { max-width: 90%; - max-height: 100%; + max-height: 300px !important; } img:hover { max-height: 900px !important; @@ -24,22 +21,28 @@ background-color: #000; padding: 10px; display: inline-block; + margin-bottom: 0px; + margin-top: 0px; } .katex-html { + font-size: 90%; + padding-top: 2px; + padding-bottom: 2px; color: #000 !important; padding-left: 4px; padding-right: 4px; background-color: #039 !important; } li { - padding-left: 9px; + margin-top: 3px; } u { color: #F90; text-decoration: none; } strong { - color: #AAA; + color: #777; + font-style: italic; font-weight: normal !important; } diff --git a/nvim/lua/base.lua b/nvim/lua/base.lua index 1a27837..8e820d8 100644 --- a/nvim/lua/base.lua +++ b/nvim/lua/base.lua @@ -1,19 +1,19 @@ -local HOME = os.getenv("HOME") -local lsp_status = require('lsp-status') - -local lspconfig = require('lspconfig') -local luasnip = require('luasnip') -local cmp = require('cmp') -local org = require('orgmode') -local elixir = require('elixir') -local which_key = require('which-key') -local elixirls = require('elixir.elixirls') -local lspsaga = require('lspsaga') -local gitsigns = require('gitsigns') -local marks = require('marks') -local lspstatus = require('lsp-status') -local cmp_capabilities = require('cmp_nvim_lsp').default_capabilities() +local HOME = os.getenv("HOME") +local lsp_status = require('lsp-status') +local lspconfig = require('lspconfig') +local luasnip = require('luasnip') +local cmp = require('cmp') +local org = require('orgmode') +local elixir = require('elixir') +local which_key = require('which-key') +local elixirls = require('elixir.elixirls') +local lspsaga = require('lspsaga') +local gitsigns = require('gitsigns') +local marks = require('marks') +local lspstatus = require('lsp-status') +local cmp_capabilities = require('cmp_nvim_lsp').default_capabilities() +-- local cmp_dictionary = require("cmp_dictionary") @@ -130,6 +130,8 @@ cmp.setup({ sources = cmp.config.sources({ { name = 'nvim_lsp' }, { name = 'luasnip' }, + -- { name = "latex_symbols" }, + -- { name = "dictionary", keyword_length = 2, }, }, { { name = 'buffer'}, { name = 'path'}, @@ -137,6 +139,17 @@ cmp.setup({ { name = 'dotenv'}, }) }) +cmp.setup.filetype("tex", { + enabled = true, + sources = { + { name = "latex_symbols" }, + } +}) + +-- cmp_dictionary.setup({ +-- paths = { "/usr/share/dict/words" }, +-- exact_length = 2, +-- }) gitsigns.setup({ signs = { add = { text = '+' }, diff --git a/nvim/lua/mytreesitter.lua b/nvim/lua/mytreesitter.lua index 945ff83..1d70de4 100644 --- a/nvim/lua/mytreesitter.lua +++ b/nvim/lua/mytreesitter.lua @@ -13,7 +13,7 @@ treesitter.setup { auto_install = true, -- List of parsers to ignore installing (or "all") - ignore_install = { } , + ignore_install = { "latex", } , ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! diff --git a/nvim/plugins.vim b/nvim/plugins.vim index 11c6305..485ed71 100644 --- a/nvim/plugins.vim +++ b/nvim/plugins.vim @@ -1,47 +1,45 @@ let g:my_plugins = { - \ "luasnip": [ 'L3MON4D3', 'LuaSnip' ], - \ "cmp": [ 'hrsh7th', 'cmp-nvim-lsp' ], - \ "cmp buffer": [ 'hrsh7th', 'cmp-buffer' ], - \ "cmp cmdline": [ 'hrsh7th', 'cmp-cmdline' ], - \ "cmp env": [ 'SergioRibera', 'cmp-dotenv' ], - \ "cmp luasnip": [ 'saadparwaiz1', 'cmp_luasnip' ], - \ "cmp path": [ 'hrsh7th', 'cmp-path' ], - \ "devicons": [ 'nvim-tree', 'nvim-web-devicons' ], - \ "elixir": [ 'elixir-tools', 'elixir-tools.nvim' ], - \ "elixirfiledetect": [ 'elixir-editors', 'vim-elixir' ], - \ "floatterm": [ 'voldikss', 'vim-floaterm' ], - \ "fzf": [ 'junegunn', 'fzf.vim' ], - \ "git": [ 'lewis6991', 'gitsigns.nvim' ], - \ "lf": [ 'ptzz', 'lf.vim' ], - \ "lisp paredit": [ 'vim-scripts', 'paredit.vim' ], - \ "lisp vlime": [ 'vlime', 'vlime', - \{'rtp': 'vim/'} ], - \ "live preview html": [ 'turbio', 'bracey.vim', - \{'do': 'npm install --prefix server'} ], - \ "lspconfig": [ 'neovim', 'nvim-lspconfig' ], - \ "lsp lines": [ 'maan2003', 'lsp_lines.nvim' ], - \ "lsp saga": [ 'nvimdev', 'lspsaga.nvim' ], - \ "lsp statusline": [ 'nvim-lua', 'lsp-status.nvim' ], - \ "markdown preview": [ 'iamcco', 'markdown-preview.nvim', - \{ 'do': 'cd app && yarn install' } ], - \ "marks": [ 'chentoast', 'marks.nvim' ], - \ "neoterm": [ 'kassio', 'neoterm' ], - \ "nui": [ 'MunifTanjim', 'nui.nvim' ], - \ "nvim cmp": [ 'hrsh7th', 'nvim-cmp' ], - \ "orgmode": [ 'nvim-orgmode', 'orgmode' ], - \ "plenary": [ 'nvim-lua', 'plenary.nvim' ], - \ "restore view": [ 'vim-scripts', 'restore_view.vim' ], - \ "show key hints": [ 'folke', 'which-key.nvim' ], - \ "tokyonight": [ 'folke', 'tokyonight.nvim' ], - \ "treesitter": [ 'nvim-treesitter', 'nvim-treesitter', - \{'do': ':TSUpdate'} ], - \ "treesitter-extra": [ 'nvim-treesitter', 'nvim-treesitter-textobjects' ], - \ "i3 syntax": [ 'PotatoesMaster', 'i3-vim-syntax' ], - \ "lf syntax": [ 'VebbNix', 'lf-vim' ], - \ "vimwiki": [ 'vimwiki', 'vimwiki' ], - \ 'luarocks for nvim': [ 'theHamsta', 'nvim_rocks', - \{'do': 'pipx install hererocks && python3 -mhererocks . -j2.1.0-beta3 -r3.0.0 && cp nvim_rocks.lua lua'}], +\ "luasnip": [ 'L3MON4D3', 'LuaSnip' ], +\ "cmp": [ 'hrsh7th', 'cmp-nvim-lsp' ], +\ "cmp buffer": [ 'hrsh7th', 'cmp-buffer' ], +\ "cmp cmdline": [ 'hrsh7th', 'cmp-cmdline' ], +\ "cmp env": [ 'SergioRibera', 'cmp-dotenv' ], +\ "cmp luasnip": [ 'saadparwaiz1', 'cmp_luasnip' ], +\ "cmp path": [ 'hrsh7th', 'cmp-path' ], +\ 'cmp plain english': [ 'uga-rosa', 'cmp-dictionary' ], +\ 'latex cmp': [ 'kdheepak', 'cmp-latex-symbols' ], +\ "devicons": [ 'nvim-tree', 'nvim-web-devicons' ], +\ "elixir": [ 'elixir-tools', 'elixir-tools.nvim' ], +\ "elixirfiledetect": [ 'elixir-editors', 'vim-elixir' ], +\ "floatterm": [ 'voldikss', 'vim-floaterm' ], +\ "fzf": [ 'junegunn', 'fzf.vim' ], +\ "git": [ 'lewis6991', 'gitsigns.nvim' ], +\ "lf": [ 'ptzz', 'lf.vim' ], +\ "lisp paredit": [ 'vim-scripts', 'paredit.vim' ], +\ "lisp vlime": [ 'vlime', 'vlime', {'rtp': 'vim/'} ], +\ "live preview html": [ 'turbio', 'bracey.vim', {'do': 'npm install --prefix server'} ], +\ "lspconfig": [ 'neovim', 'nvim-lspconfig' ], +\ "lsp lines": [ 'maan2003', 'lsp_lines.nvim' ], +\ "lsp saga": [ 'nvimdev', 'lspsaga.nvim' ], +\ "lsp statusline": [ 'nvim-lua', 'lsp-status.nvim' ], +\ "markdown preview": [ 'iamcco', 'markdown-preview.nvim', { 'do': 'cd app && yarn install' } ], +\ "marks": [ 'chentoast', 'marks.nvim' ], +\ "neoterm": [ 'kassio', 'neoterm' ], +\ "nui": [ 'MunifTanjim', 'nui.nvim' ], +\ "nvim cmp": [ 'hrsh7th', 'nvim-cmp' ], +\ "orgmode": [ 'nvim-orgmode', 'orgmode' ], +\ "plenary": [ 'nvim-lua', 'plenary.nvim' ], +\ "restore view": [ 'vim-scripts', 'restore_view.vim' ], +\ "show key hints": [ 'folke', 'which-key.nvim' ], +\ "tokyonight": [ 'folke', 'tokyonight.nvim' ], +\ "treesitter": [ 'nvim-treesitter', 'nvim-treesitter', {'do': ':TSUpdate'} ], +\ "treesitter-extra": [ 'nvim-treesitter', 'nvim-treesitter-textobjects' ], +\ "i3 syntax": [ 'PotatoesMaster', 'i3-vim-syntax' ], +\ "lf syntax": [ 'VebbNix', 'lf-vim' ], +\ "vimwiki": [ 'vimwiki', 'vimwiki' ], +\ 'luarocks for nvim': [ 'theHamsta', 'nvim_rocks', {'do': 'pipx install hererocks && python3 -mhererocks . -j2.1.0-beta3 -r3.0.0 && cp nvim_rocks.lua lua'}], +\ 'vim latex': [ 'lervag', 'vimtex' ], \} "vim closetag": [ 'alneotermvan', 'vim-closetag' ],