From e1984cbb56fbf2e01b95841d6f0a447a04d6cdc5 Mon Sep 17 00:00:00 2001 From: Norm Rasmussen Date: Thu, 7 Jul 2022 16:45:13 -0400 Subject: [PATCH] plugins --- data/lsp_servers/prosemd.lua | 16 +++++ init.lua | 2 +- lua/keymaps.lua | 15 +---- lua/plugins/mkdnflow.lua | 71 ++++++++++++++++++++++ lua/plugins/nvim-lspconfig.lua | 2 +- lua/plugins/nvim-treesitter.lua | 8 +++ lua/plugins/plugins.lua | 18 ++++-- lua/plugins/telescope.lua | 104 -------------------------------- lua/plugins/toggleterm.lua | 2 +- lua/plugins/vista.lua | 1 + lua/settings/init.lua | 17 +++++- plugin/packer_compiled.lua | 25 +++++--- 12 files changed, 146 insertions(+), 135 deletions(-) create mode 100644 data/lsp_servers/prosemd.lua create mode 100644 lua/plugins/mkdnflow.lua delete mode 100644 lua/plugins/telescope.lua diff --git a/data/lsp_servers/prosemd.lua b/data/lsp_servers/prosemd.lua new file mode 100644 index 0000000..93a4fb2 --- /dev/null +++ b/data/lsp_servers/prosemd.lua @@ -0,0 +1,16 @@ +local lsp_configs = require('plugins/nvim-lspconfig') + +lsp_configs.prosemd = { + default_config = { + -- Update the path to prosemd-lsp + cmd = { "/usr/local/bin/prosemd-lsp", "--stdio" }, + filetypes = { "markdown" }, + root_dir = function(fname) + return lsp_util.find_git_ancestor(fname) or vim.fn.getcwd() + end, + settings = {}, + } +} + +-- Use your attach function here +lsp.prosemd.setup{ on_attach = on_attach } diff --git a/init.lua b/init.lua index 118055e..eaba5b9 100755 --- a/init.lua +++ b/init.lua @@ -9,7 +9,6 @@ require('plugins/vista') require('plugins/nvim-cmp') require('plugins/nvim-lspconfig') require('plugins/nvim-treesitter') -require('plugins/telescope') require('plugins/alpha-nvim') require('plugins/symbols-outline') require('plugins/nvim-lsp-installer') @@ -17,3 +16,4 @@ require('plugins/neoscroll') require('plugins/marks') require('plugins/toggleterm') require('plugins/_mkdx') +require('plugins/mkdnflow') diff --git a/lua/keymaps.lua b/lua/keymaps.lua index 314c3f7..f3df427 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -15,9 +15,6 @@ map('n', '', 'j', default_opts) map('n', '', 'k', default_opts) map('n', '', 'l', default_opts) --- Close all windows and exit from Neovim with and q --- map('n', 'q', ':qa!', default_opts) - -- Neovim Tab Navigation map('n', 't', ':tabnew', default_opts) map('n', 'w', ':-tabnext', default_opts) @@ -28,9 +25,6 @@ map('n', 'r', ':tabclose', default_opts) -- Applications and Plugins shortcuts ----------------------------------------------------------- --- Open terminal as Float ---map('n', '', ':ToggleTerm dir=/Users/normrasmussen/ direction=float', default_opts) - -- Vista Shortcuts map('n', 'v', ':Vista!!', default_opts) -- show Vista panel @@ -44,13 +38,10 @@ map('n', '', ':Vista!!', default_opts) -- open/close -- Place Check box for To-Do style Lists map('i','', '- [ ] ', default_opts) map('n', '', '- [ ] ', default_opts) -map('n','', 'rX', default_opts) -map('n','x', '~~~', default_opts) +--map('n','', 'rX', default_opts) +--map('n','x', '~~~', default_opts) -- Vim Tmux Navigator -map('n', '-', ':TmuxNavigateDown', default_opts) +--map('n', '-', ':TmuxNavigateDown', default_opts) map('n', '[', ':TmuxNavigateLeft', default_opts) map('n', ']', ':TmuxNavigateRight', default_opts) - --- Telescope Open -map('n', '/', ':Telescope', default_opts) diff --git a/lua/plugins/mkdnflow.lua b/lua/plugins/mkdnflow.lua new file mode 100644 index 0000000..e83d8bb --- /dev/null +++ b/lua/plugins/mkdnflow.lua @@ -0,0 +1,71 @@ +-- ** DEFAULT SETTINGS; TO USE THESE, PASS AN EMPTY TABLE TO THE SETUP FUNCTION ** +require('mkdnflow').setup({ + filetypes = {md = true, rmd = true, markdown = true}, + create_dirs = true, + perspective = { + priority = 'first', + fallback = 'current', + root_tell = false, + nvim_wd_heel = true + }, + wrap = false, + bib = { + default_path = nil, + find_in_root = true + }, + silent = false, + links = { + style = 'markdown', + conceal = false, + implicit_extension = nil, + transform_implicit = false, + transform_explicit = function(text) + text = text:gsub(" ", "-") + text = text:lower() + text = os.date('%Y-%m-%d_')..text + return(text) + end + }, + to_do = { + symbols = {' ', '-', 'X'}, + update_parents = true, + not_started = ' ', + in_progress = '-', + complete = 'X' + }, + tables = { + trim_whitespace = true, + format_on_move = true + }, + use_mappings_table = true, + mappings = { + MkdnNextLink = {'n', ''}, + MkdnPrevLink = {'n', ''}, + MkdnNextHeading = {'n', ']'}, + MkdnPrevHeading = {'n', '['}, + MkdnGoBack = {'n', ''}, + MkdnGoForward = {'n', ''}, + MkdnFollowLink = {{'n', 'v'}, ''}, + MkdnDestroyLink = {'n', ''}, + MkdnMoveSource = {'n', ''}, + MkdnYankAnchorLink = {'n', 'ya'}, + MkdnYankFileAnchorLink = {'n', 'yfa'}, + MkdnIncreaseHeading = {'n', '+'}, + MkdnDecreaseHeading = {'n', '-'}, + MkdnToggleToDo = {{'n', 'v'}, ''}, + MkdnNewListItem = false, + MkdnExtendList = false, + MkdnUpdateNumbering = {'n', 'nn'}, + MkdnTableNextCell = {'i', 'nc'}, + MkdnTablePrevCell = {'i', 'pc'}, + MkdnTableNextRow = false, + MkdnTablePrevRow = {'i', ''}, + MkdnTableNewRowBelow = {{'n', 'i'}, 'ir'}, + MkdnTableNewRowAbove = {{'n', 'i'}, 'iR'}, + MkdnTableNewColAfter = {{'n', 'i'}, 'ic'}, + MkdnTableNewColBefore = {{'n', 'i'}, 'iC'}, + MkdnCR = false, + MkdnTab = false, + MkdnSTab = false + } +}) diff --git a/lua/plugins/nvim-lspconfig.lua b/lua/plugins/nvim-lspconfig.lua index 1b96e4f..181f057 100644 --- a/lua/plugins/nvim-lspconfig.lua +++ b/lua/plugins/nvim-lspconfig.lua @@ -86,7 +86,7 @@ https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.m -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches -local servers = { 'bashls', 'pyright', 'pylsp', 'clangd', 'html', 'tsserver', 'grammarly', 'dockerls', 'cssls', 'cssmodules_ls', 'arduino_language_server', 'pyre', 'gopls', 'theme_check' } +local servers = { 'bashls', 'pyright', 'pylsp', 'clangd', 'html', 'tsserver', 'marksman', 'prosemd_lsp', 'dockerls', 'cssls', 'cssmodules_ls', 'arduino_language_server', 'pyre', 'gopls', 'theme_check' } -- Set settings for language servers: diff --git a/lua/plugins/nvim-treesitter.lua b/lua/plugins/nvim-treesitter.lua index ff81bb2..acfbf05 100644 --- a/lua/plugins/nvim-treesitter.lua +++ b/lua/plugins/nvim-treesitter.lua @@ -6,7 +6,15 @@ -- Plugin: nvim-treesitter -- url: https://github.com/nvim-treesitter/nvim-treesitter +local parser_configs = require("nvim-treesitter.parsers").get_parser_configs() +parser_configs.markdown = { + install_info = { + url = "https://github.com/ikatyang/tree-sitter-markdown", + files = { "src/parser.c", "src/scanner.cc" }, + }, + filetype = "markdown", +} require('nvim-treesitter.configs').setup { highlight = { diff --git a/lua/plugins/plugins.lua b/lua/plugins/plugins.lua index 68e8005..7e1a21e 100755 --- a/lua/plugins/plugins.lua +++ b/lua/plugins/plugins.lua @@ -14,12 +14,22 @@ return require'packer'.startup(function() -- Markdown Extension for Customizable Keymappings use 'SidOfc/mkdx' + -- Markdown Flow + use { + "jakewvincent/mkdnflow.nvim", + config = function() + require('mkdnflow').setup() + end + } -- Headlines Extension use 'lukas-reineke/headlines.nvim' -- Follow MD Links use 'jghauser/follow-md-links.nvim' + -- Glow, a Markdown Preview plugin + use {"ellisonleao/glow.nvim", branch = 'main'} + -- Treesitter Language Stuff use 'nvim-treesitter/nvim-treesitter' @@ -66,7 +76,7 @@ return require'packer'.startup(function() use { 'sudormrfbin/cheatsheet.nvim', requires = { - {'nvim-telescope/telescope.nvim'}, + --{'nvim-telescope/telescope.nvim'}, {'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}, } @@ -76,7 +86,7 @@ return require'packer'.startup(function() tag = 'v1.*', config = function() require('toggleterm').setup({ - shell = '/usr/bin/local/fish', + shell = '/usr/bin/local/zsh', }) end, } @@ -97,7 +107,7 @@ return require'packer'.startup(function() 'goolord/alpha-nvim', requires = { 'kyazdani42/nvim-web-devicons' }, } - use { + --[[use { "nvim-telescope/telescope.nvim", requires = { "nvim-lua/popup.nvim", @@ -106,7 +116,7 @@ return require'packer'.startup(function() config = function() require "plugins/telescope" end, - } + }]]-- use { 'windwp/nvim-autopairs', config = function() diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua deleted file mode 100644 index 92e0ed1..0000000 --- a/lua/plugins/telescope.lua +++ /dev/null @@ -1,104 +0,0 @@ -local actions = require "telescope.actions" - -local M = {} - -M.project_files = function() - local opts = {} -- define here if you want to define something - local ok = pcall(require("telescope.builtin").git_files, opts) - if not ok then - require("telescope.builtin").find_files(opts) - end -end - -require("telescope").setup { - defaults = { - prompt_prefix = "/ ", - selection_caret = "⯈ ", - color_devicons = false, - mappings = { - i = { - [""] = actions.close, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.move_selection_next, - [""] = actions.move_selection_previous, - [""] = actions.close, - [""] = false, - [""] = false, - [""] = actions.select_default + actions.center, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - }, - n = { - [""] = actions.close, - [""] = actions.select_default + actions.center, - [""] = actions.select_horizontal, - [""] = actions.select_vertical, - ["j"] = actions.move_selection_next, - ["k"] = actions.move_selection_previous, - [""] = false, - [""] = false, - [""] = actions.preview_scrolling_up, - [""] = actions.preview_scrolling_down, - }, - }, - file_ignore_patterns = { - ".git/*", - "node_modules/*", - "bower_components/*", - ".svn/*", - ".hg/*", - "CVS/*", - ".next/*", - ".docz/*", - ".DS_Store", - }, - layout_strategy = "flex", - scroll_strategy = "cycle", - }, - pickers = { - find_files = { - theme = "ivy", - }, - git_files = { - theme = "ivy", - }, - live_grep = { - theme = "ivy", - previewer = false, - }, - file_browser = { - theme = "ivy", - previewer = false, - }, - }, -} - -vim.api.nvim_set_keymap( - "n", - "", - 'lua require("plugins/telescope").project_files()', - { noremap = true, silent = true } -) -vim.api.nvim_set_keymap( - "n", - "g", - 'lua require("telescope.builtin").live_grep()', - { noremap = true, silent = true } -) -vim.api.nvim_set_keymap( - "n", - "f", - 'lua require("telescope.builtin").file_browser()', - { noremap = true, silent = true } -) -vim.api.nvim_set_keymap( - "n", - "b", - 'lua require("telescope.builtin").buffers()', - { noremap = true, silent = true } -) - -return M diff --git a/lua/plugins/toggleterm.lua b/lua/plugins/toggleterm.lua index 8ca16f2..81965ed 100644 --- a/lua/plugins/toggleterm.lua +++ b/lua/plugins/toggleterm.lua @@ -5,7 +5,7 @@ end toggleterm.setup({ size = 10, - open_mapping = [[]], + open_mapping = [[]], hide_numbers = true, shade_filetypes = {}, shade_terminals = true, diff --git a/lua/plugins/vista.lua b/lua/plugins/vista.lua index 82cd63a..75b604c 100644 --- a/lua/plugins/vista.lua +++ b/lua/plugins/vista.lua @@ -22,6 +22,7 @@ g.vista_default_executive = 'ctags' -- Ensure you have installed some decent font to show these pretty symbols, --- then you can enable icon for the kind. cmd [[let g:vista#renderer#enable_icon = 1]] +cmd [[let g:vista_enable_markdown_extension = 1]] -- Change some default icons diff --git a/lua/settings/init.lua b/lua/settings/init.lua index 7f7d33b..efe229c 100755 --- a/lua/settings/init.lua +++ b/lua/settings/init.lua @@ -19,9 +19,10 @@ opt.clipboard = 'unnamedplus' -- Copy/paste to system clipboard opt.swapfile = false -- Don't use swapfile opt.shadafile = "NONE" opt.shadafile = "" -opt.shell = "/bin/bash" +opt.shell = "/bin/zsh" opt.updatetime = 200 opt.cursorline = true +g.markdown_folding = 1 ----------------------------------------------------------- -- Neovim UI ----------------------------------------------------------- @@ -55,10 +56,22 @@ opt.expandtab = true -- Use spaces instead of tabs opt.shiftwidth = 4 -- Shift 4 spaces when tab opt.tabstop = 4 -- 1 tab == 4 spaces opt.smartindent = true -- Autoindent new lines +----------------------------------------------------------- +-- Glow Settings +----------------------------------------------------------- +g.glow_binary_path = '/bin' +g.glow_border = 'rounded' +g.glow_width = 120 +g.glow_use_pager = true +g.glow_style = 'dark' +----------------------------------------------------------- +-- MKDX Settings, mkdx#settings. +----------------------------------------------------------- + -- 2 spaces for selected filetypes cmd [[ - autocmd FileType liquid,xml,html,xhtml,css,scss,javascript,lua,yaml setlocal shiftwidth=2 tabstop=2 + autocmd FileType md,liquid,xml,html,xhtml,css,scss,javascript,lua,yaml setlocal shiftwidth=2 tabstop=2 ]] local disabled_built_ins = { diff --git a/plugin/packer_compiled.lua b/plugin/packer_compiled.lua index 3f86737..d7aae7b 100644 --- a/plugin/packer_compiled.lua +++ b/plugin/packer_compiled.lua @@ -169,6 +169,11 @@ _G.packer_plugins = { path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/gloombuddy", url = "https://github.com/bkegley/gloombuddy" }, + ["glow.nvim"] = { + loaded = true, + path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/glow.nvim", + url = "https://github.com/ellisonleao/glow.nvim" + }, ["headlines.nvim"] = { loaded = true, path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/headlines.nvim", @@ -184,6 +189,12 @@ _G.packer_plugins = { path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/marks.nvim", url = "https://github.com/chentoast/marks.nvim" }, + ["mkdnflow.nvim"] = { + config = { "\27LJ\2\n:\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\rmkdnflow\frequire\0" }, + loaded = true, + path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/mkdnflow.nvim", + url = "https://github.com/jakewvincent/mkdnflow.nvim" + }, mkdx = { loaded = true, path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/mkdx", @@ -260,12 +271,6 @@ _G.packer_plugins = { path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/symbols-outline.nvim", url = "https://github.com/simrat39/symbols-outline.nvim" }, - ["telescope.nvim"] = { - config = { "\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/telescope\frequire\0" }, - loaded = true, - path = "/Users/normrasmussen/.local/share/nvim/site/pack/packer/start/telescope.nvim", - url = "https://github.com/nvim-telescope/telescope.nvim" - }, ["toggleterm.nvim"] = { config = { "\27LJ\2\nY\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\nshell\24/usr/bin/local/fish\nsetup\15toggleterm\frequire\0" }, loaded = true, @@ -308,10 +313,10 @@ time([[Config for nvim-autopairs]], false) time([[Config for toggleterm.nvim]], true) try_loadstring("\27LJ\2\nY\0\0\3\0\4\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0005\2\3\0B\0\2\1K\0\1\0\1\0\1\nshell\24/usr/bin/local/fish\nsetup\15toggleterm\frequire\0", "config", "toggleterm.nvim") time([[Config for toggleterm.nvim]], false) --- Config for: telescope.nvim -time([[Config for telescope.nvim]], true) -try_loadstring("\27LJ\2\n1\0\0\3\0\2\0\0046\0\0\0'\2\1\0B\0\2\1K\0\1\0\22plugins/telescope\frequire\0", "config", "telescope.nvim") -time([[Config for telescope.nvim]], false) +-- Config for: mkdnflow.nvim +time([[Config for mkdnflow.nvim]], true) +try_loadstring("\27LJ\2\n:\0\0\3\0\3\0\a6\0\0\0'\2\1\0B\0\2\0029\0\2\0004\2\0\0B\0\2\1K\0\1\0\nsetup\rmkdnflow\frequire\0", "config", "mkdnflow.nvim") +time([[Config for mkdnflow.nvim]], false) if should_profile then save_profiles() end end)