diff options
Diffstat (limited to 'lua/user')
| -rw-r--r-- | lua/user/autocommands.lua | 1 | ||||
| -rw-r--r-- | lua/user/cmp.lua | 2 | ||||
| -rw-r--r-- | lua/user/jaq.lua | 80 | ||||
| -rw-r--r-- | lua/user/keymaps.lua | 8 | ||||
| -rw-r--r-- | lua/user/orgmode.lua | 10 | ||||
| -rw-r--r-- | lua/user/pandoc.lua | 5 | ||||
| -rw-r--r-- | lua/user/plugins.lua | 15 | ||||
| -rw-r--r-- | lua/user/toggleterm.lua | 10 | ||||
| -rw-r--r-- | lua/user/treesitter.lua | 34 | ||||
| -rw-r--r-- | lua/user/zenmode.lua | 3 |
10 files changed, 132 insertions, 36 deletions
diff --git a/lua/user/autocommands.lua b/lua/user/autocommands.lua index 1c27d6e..a991963 100644 --- a/lua/user/autocommands.lua +++ b/lua/user/autocommands.lua @@ -28,7 +28,6 @@ vim.api.nvim_create_autocmd({ "BufEnter" }, { local buf_ft = vim.bo.filetype if buf_ft == "" or buf_ft == nil then vim.cmd [[ - nnoremap <silent> <buffer> q :close<CR> nnoremap <silent> <buffer> <c-j> j<CR> nnoremap <silent> <buffer> <c-k> k<CR> set nobuflisted diff --git a/lua/user/cmp.lua b/lua/user/cmp.lua index 9f115e7..44c22f2 100644 --- a/lua/user/cmp.lua +++ b/lua/user/cmp.lua @@ -20,10 +20,12 @@ end -- return split_lines(search_result) -- end +require("luasnip/loaders/from_vscode").lazy_load() require("luasnip/loaders/from_vscode").lazy_load({ -- paths = glob_runtimepath('luasnip_snippets/*.json') paths = "~/.config/nvim/luasnip_snippets/*.json" }) +require("luasnip/loaders/from_snipmate").lazy_load() local check_backspace = function() local col = vim.fn.col "." - 1 diff --git a/lua/user/jaq.lua b/lua/user/jaq.lua new file mode 100644 index 0000000..9ea672e --- /dev/null +++ b/lua/user/jaq.lua @@ -0,0 +1,80 @@ +M = {} +local status_ok, jaq_nvim = pcall(require, "jaq-nvim") +if not status_ok then + return +end + +jaq_nvim.setup { + -- Commands used with 'Jaq' + cmds = { + -- Default UI used (see `Usage` for options) + default = "term", + + -- Uses external commands such as 'g++' and 'cargo' + external = { + typescript = "deno run %", + javascript = "node %", + -- markdown = "glow %", + python = "ipython %", + -- rust = "rustc % && ./$fileBase && rm $fileBase", + rust = "cargo run", + cpp = "g++ % -o $fileBase && ./$fileBase", + go = "go run %", + sh = "sh %", + }, + + -- Uses internal commands such as 'source' and 'luafile' + internal = { + -- lua = "luafile %", + -- vim = "source %", + }, + }, + + behavior = { + -- Default type + default = "terminal", + + -- Start in insert mode + startinsert = false, + + -- Use `wincmd p` on startup + wincmd = false, + + -- Auto-save files + autosave = false, + }, + + -- UI settings + ui = { + -- Floating Window / FTerm settings + float = { + -- Floating window border (see ':h nvim_open_win') + border = "none", + + -- Num from `0 - 1` for measurements + height = 0.8, + width = 0.8, + x = 0.5, + y = 0.5, + + -- Highlight group for floating window/border (see ':h winhl') + border_hl = "FloatBorder", + float_hl = "Normal", + + -- Floating Window Transparency (see ':h winblend') + blend = 0, + }, + + terminal = { + -- Position of terminal + position = "vert", + + -- Open the terminal without line numbers + line_no = false, + + -- Size of terminal + size = 60, + }, + }, +} +return M diff --git a/lua/user/keymaps.lua b/lua/user/keymaps.lua index a1388d7..04987a4 100644 --- a/lua/user/keymaps.lua +++ b/lua/user/keymaps.lua @@ -64,6 +64,7 @@ keymap("t", "<C-h>", "<C-\\><C-N><C-w>h", term_opts) keymap("t", "<C-j>", "<C-\\><C-N><C-w>j", term_opts) keymap("t", "<C-k>", "<C-\\><C-N><C-w>k", term_opts) keymap("t", "<C-l>", "<C-\\><C-N><C-w>l", term_opts) +keymap("t", "<C-p>", ":ToggleTermSendVisualSelection", term_opts) -- Open corresponding .pdf/.html or preview keymap("n","<leader>p", ":!opout <C-r>%<CR><CR>", opts) @@ -104,3 +105,10 @@ keymap("n", "<leader>P", ":<cmd>lua require('nabla').popup()<CR>", opts) keymap("n", "<leader><A-e><A-p>", ":<cmd>lua require('pandoc').equation.show()<CR>", opts) keymap("n", "<leader><A-p><A-r>", ":<cmd>lua require('pandoc').render.init()<CR>", opts) keymap("n", "<leader><A-p><A-s>", ":<cmd>lua require('pandoc').render.build({ input = vim.api.nvim_get_buf_name(0), args = {{'--standalone'},{'toc'},{'--filter','pandoc-crossref'},{'--pdf-engine','xelatex'}}, output = 'pandoc.pdf' })<CR>", opts) + +--Jaq +keymap("n", "<m-r>", ":silent only | Jaq<cr>", opts) + +--Zen Mode +keymap("n", "<localleader>zm", ":ZenMode<cr>", opts) + diff --git a/lua/user/orgmode.lua b/lua/user/orgmode.lua index 7c0443e..c1a1a4e 100644 --- a/lua/user/orgmode.lua +++ b/lua/user/orgmode.lua @@ -1,12 +1,10 @@ -local orgmode_status_ok = pcall(require, "orgmode") +local orgmode_status_ok, orgmode = pcall(require, "orgmode") if not orgmode_status_ok then return end -require("orgmode").setup_ts_grammer() -require("orgmode").setup({ +orgmode.setup({ org_agenda_files = {'~/org/**/*'}, org_default_notes_files = {'~/org/refile.org'} -}) - - +} +) diff --git a/lua/user/pandoc.lua b/lua/user/pandoc.lua index 40b3e9a..099cf50 100644 --- a/lua/user/pandoc.lua +++ b/lua/user/pandoc.lua @@ -2,7 +2,4 @@ local status_ok = pcall(require, "pandoc") if not status_ok then return end - -local pandoc =require "pandoc" - -pandoc.setup() +require "pandoc".setup() diff --git a/lua/user/plugins.lua b/lua/user/plugins.lua index 451b55f..713c2d2 100644 --- a/lua/user/plugins.lua +++ b/lua/user/plugins.lua @@ -52,12 +52,15 @@ return packer.startup(function(use) use {"kyazdani42/nvim-tree.lua", commit = ""} use {"lewis6991/impatient.nvim", commit = ""} use {"lukas-reineke/indent-blankline.nvim", commit = ""} - --use {"moll/vim-bbye", commit = ""} + use {"moll/vim-bbye", commit = ""} use {"numToStr/Comment.nvim", commit = ""} -- Easily comment stuff use {"nvim-lualine/lualine.nvim", commit = ""} use {"windwp/nvim-autopairs", commit = ""} -- Autopairs, integrates with both cmp and treesitter use {"vimwiki/vimwiki", commit = ""} use {"zane-/howdoi.nvim", commit = ""} + use {"folke/zen-mode.nvim", commit = ""} + use {"nvim-orgmode/orgmode", commit = ""} + use {"mickael-menu/zk-nvim", commit = ""} -- Colorschemes use {"lunarvim/colorschemes", commit = ""} -- A bunch of colorschemes you can try out @@ -97,7 +100,7 @@ return packer.startup(function(use) use {"rafamadriz/friendly-snippets", commit = ""} -- a bunch of snippets to use use {"smjonas/snippet-converter.nvim", commit = ""} - use {"SirVer/ultisnips", commit = ""} --snippet engine + -- use {"SirVer/ultisnips", commit = ""} --snippet engine use {"honza/vim-snippets", commit = ""} --snippets to use -- use {"molleweide/LuaSnip-snippets.nvim", commit = ""} -- a bunch of snippets to use @@ -115,10 +118,8 @@ return packer.startup(function(use) use {"nvim-telescope/telescope-dap.nvim", commit = ""} -- Treesitter - use { - "nvim-treesitter/nvim-treesitter", commit = "", - run = ":TSUpdate", - } + use { "nvim-treesitter/nvim-treesitter", require('orgmode').setup_ts_grammar(), run = ":TSUpdate"} + use {"nvim-treesitter/nvim-treesitter-textobjects"} use {"JoosepAlviste/nvim-ts-context-commentstring", commit = ""} use {"windwp/nvim-ts-autotag", commit = ""} use {"romgrk/nvim-treesitter-context", commit = ""} @@ -152,6 +153,8 @@ return packer.startup(function(use) use {"GCBallesteros/jupytext.vim", commit = ""} use {"dccsillag/magma-nvim", commit = "", run = ":UpdateRemotePlugins" } + -- Code runner + use {"is0n/jaq-nvim"} diff --git a/lua/user/toggleterm.lua b/lua/user/toggleterm.lua index c08f5d0..7342573 100644 --- a/lua/user/toggleterm.lua +++ b/lua/user/toggleterm.lua @@ -4,7 +4,13 @@ if not status_ok then end toggleterm.setup({ - size = 20, + size = function(term) + if term.direction == "horizontal" then + return 20 + elseif term.direction == "vertical" then + return vim.o.columns * 0.45 + end + end, open_mapping = [[<c-\>]], hide_numbers = true, shade_filetypes = {}, @@ -13,7 +19,7 @@ toggleterm.setup({ start_in_insert = true, insert_mappings = true, persist_size = true, - direction = "float", + direction = "vertical", close_on_exit = true, shell = vim.o.shell, float_opts = { diff --git a/lua/user/treesitter.lua b/lua/user/treesitter.lua index 99fa7ec..5c1e390 100644 --- a/lua/user/treesitter.lua +++ b/lua/user/treesitter.lua @@ -1,28 +1,28 @@ +local status_ok, configs = pcall(require, "nvim-treesitter.configs") +if not status_ok then + return +end + +local parser_config = require "nvim-treesitter.parsers".get_parser_configs() +parser_config.org = { + install_info = { + url = 'https://github.com/milisims/tree-sitter-org', + revision = 'main', + files = { 'src/parser.c', 'src/scanner.cc' }, + }, + filetype = 'org', +} - - - - - - - - - - - - - -local configs = require("nvim-treesitter.configs") configs.setup { - ensure_installed = {"python","lua","json","org"}, - sync_install = false, + ensure_installed = {"org","python","lua","json"}, + sync_install = false, ignore_install = { "" }, -- List of parsers to ignore installing autopairs = { enable = true, }, highlight = { enable = true, -- false will disable the whole extension - disable = { "" }, -- list of language that will be disabled + disable = { "org" }, -- list of language that will be disabled additional_vim_regex_highlighting = true, }, diff --git a/lua/user/zenmode.lua b/lua/user/zenmode.lua new file mode 100644 index 0000000..3459de0 --- /dev/null +++ b/lua/user/zenmode.lua @@ -0,0 +1,3 @@ +local config = require("zen-mode") +config.setup { +} |
