From c39dde3549c44d81ab78939067174898713f5c86 Mon Sep 17 00:00:00 2001 From: Javier Pacheco Date: Sat, 10 Jun 2023 06:01:52 -0500 Subject: [PATCH] moving config chops to a single file on custom --- .github/ISSUE_TEMPLATE/bug_report.md | 28 --- .gitignore | 7 +- assets/markdown.css | 319 +++++++++++++++++++++++++++ doc/kickstart.txt | 24 -- init.lua | 18 +- lua/custom/plugins/format.lua | 40 ---- lua/custom/plugins/init.lua | 116 ++++++++++ lua/custom/plugins/markdown.lua | 31 --- lua/custom/plugins/notes.lua | 13 -- lua/custom/plugins/zenmode.lua | 16 -- lua/settings.lua | 6 +- 11 files changed, 454 insertions(+), 164 deletions(-) delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 assets/markdown.css delete mode 100644 doc/kickstart.txt delete mode 100644 lua/custom/plugins/format.lua create mode 100644 lua/custom/plugins/init.lua delete mode 100644 lua/custom/plugins/markdown.lua delete mode 100644 lua/custom/plugins/notes.lua delete mode 100644 lua/custom/plugins/zenmode.lua diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 2ad4d31..0000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,28 +0,0 @@ ---- -name: Bug report -about: Create a report to help us improve -title: '' -labels: '' -assignees: '' - ---- - - - -## Describe the bug - - -## To Reproduce - -1. ... - -## Desktop - -- OS: -- Terminal: - -## Neovim Version - - -``` -``` diff --git a/.gitignore b/.gitignore index ea93eda..a89305f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,2 @@ -tags -test.sh -.luarc.json -nvim -lazy-lock.json +lazy-lock.json +.stylua.toml diff --git a/assets/markdown.css b/assets/markdown.css new file mode 100644 index 0000000..7aa2469 --- /dev/null +++ b/assets/markdown.css @@ -0,0 +1,319 @@ +/* + * github like style + * https://github.com/iamcco/markdown.css/blob/master/dest/github/markdown.css + */ +:root { + --color-text-primary: #333; + --color-text-tertiary: #777; + --color-text-link: #4078c0; + --color-bg-primary: #fff; + --color-bg-secondary: #fafbfc; + --color-bg-tertiary: #f8f8f8; + --color-border-primary: #ddd; + --color-border-secondary: #eaecef; + --color-border-tertiary: #d1d5da; + --color-kbd-foreground: #444d56; + --color-markdown-blockquote-border: #dfe2e5; + --color-markdown-table-border: #dfe2e5; + --color-markdown-table-tr-border: #c6cbd1; + --color-markdown-code-bg: #1b1f230d; +} +[data-theme="dark"] { + --color-text-primary: #c9d1d9; + --color-text-tertiary: #8b949e; + --color-text-link: #58a6ff; + --color-bg-primary: #0d1117; + --color-bg-secondary: #0d1117; + --color-bg-tertiary: #161b22; + --color-border-primary: #30363d; + --color-border-secondary: #21262d; + --color-border-tertiary: #6e7681; + --color-kbd-foreground: #b1bac4; + --color-markdown-blockquote-border: #3b434b; + --color-markdown-table-border: #3b434b; + --color-markdown-table-tr-border: #272c32; + --color-markdown-code-bg: #f0f6fc26; +} +.markdown-body ol ol, +.markdown-body ul ol, +.markdown-body ol ul, +.markdown-body ul ul, +.markdown-body ol ul ol, +.markdown-body ul ul ol, +.markdown-body ol ul ul, +.markdown-body ul ul ul { + margin-top: 0; + margin-bottom: 0; +} +.markdown-body { + font-family: "MonoLisa","Helvetica Neue", Helvetica, "Segoe UI", Arial, freesans, + sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 12px; + color: var(--color-text-primary); + line-height: 1.6; + word-wrap: break-word; + padding: 45px; + background: var(--color-bg-primary); +} +.markdown-body > *:first-child { + margin-top: 0 !important; +} +.markdown-body > *:last-child { + margin-bottom: 0 !important; +} +.markdown-body .table-of-contents ol { + list-style: none; +} +.markdown-body .table-of-contents > ol { + padding-left: 0; +} +.markdown-body * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} +.markdown-body h1, +.markdown-body h2, +.markdown-body h3, +.markdown-body h4, +.markdown-body h5, +.markdown-body h6 { + margin-top: 1em; + margin-bottom: 16px; + font-weight: bold; + line-height: 1.4; +} +.markdown-body h1 .anchor, +.markdown-body h2 .anchor, +.markdown-body h3 .anchor, +.markdown-body h4 .anchor, +.markdown-body h5 .anchor, +.markdown-body h6 .anchor { + margin-left: -24px; + visibility: hidden; +} +.markdown-body h1:hover .anchor, +.markdown-body h2:hover .anchor, +.markdown-body h3:hover .anchor, +.markdown-body h4:hover .anchor, +.markdown-body h5:hover .anchor, +.markdown-body h6:hover .anchor { + visibility: visible; +} +.markdown-body p, +.markdown-body blockquote, +.markdown-body ul, +.markdown-body ol, +.markdown-body dl, +.markdown-body table, +.markdown-body pre { + margin-top: 0; + margin-bottom: 16px; +} +.markdown-body h1 { + margin: 0.67em 0; + padding-bottom: 0.3em; + font-size: 2.25em; + line-height: 1.2; + border-bottom: 1px solid var(--color-border-secondary); +} +.markdown-body h2 { + padding-bottom: 0.3em; + font-size: 1.75em; + line-height: 1.225; + border-bottom: 1px solid var(--color-border-secondary); +} +.markdown-body h3 { + font-size: 1.5em; + line-height: 1.43; +} +.markdown-body h4 { + font-size: 1.25em; +} +.markdown-body h5 { + font-size: 1em; +} +.markdown-body h6 { + font-size: 1em; + color: var(--color-text-tertiary); +} +.markdown-body hr { + margin-top: 20px; + margin-bottom: 20px; + height: 0; + border: 0; + border-top: 1px solid var(--color-border-primary); +} +.markdown-body ol, +.markdown-body ul { + padding-left: 2em; +} +.markdown-body ol ol, +.markdown-body ul ol { + list-style-type: lower-roman; +} +.markdown-body ol ul, +.markdown-body ul ul { + list-style-type: circle; +} +.markdown-body ol ul ul, +.markdown-body ul ul ul { + list-style-type: square; +} +.markdown-body ol { + list-style-type: decimal; +} +.markdown-body ul { + list-style-type: disc; +} +.markdown-body dl { + margin-bottom: 1.3em; +} +.markdown-body dl dt { + font-weight: 700; +} +.markdown-body dl dd { + margin-left: 0; +} +.markdown-body dl dd p { + margin-bottom: 0.8em; +} +.markdown-body blockquote { + margin-left: 0; + margin-right: 0; + padding: 0 15px; + color: var(--color-text-tertiary); + border-left: 4px solid var(--color-markdown-blockquote-border); +} +.markdown-body table { + display: block; + width: 100%; + overflow: auto; + word-break: normal; + word-break: keep-all; + border-collapse: collapse; + border-spacing: 0; +} +.markdown-body table tr { + background-color: var(--color-bg-primary); + border-top: 1px solid var(--color-markdown-table-tr-border); +} +.markdown-body table tr:nth-child(2n) { + background-color: var(--color-bg-tertiary); +} +.markdown-body table th, +.markdown-body table td { + padding: 6px 13px; + border: 1px solid var(--color-markdown-table-border); + vertical-align: top; +} +.markdown-body kbd { + display: inline-block; + padding: 5px 6px; + font: 14px SFMono-Regular, Consolas, Liberation Mono, Menlo, monospace; + line-height: 10px; + color: var(--color-kbd-foreground); + vertical-align: middle; + background-color: var(--color-bg-secondary); + border: 1px solid var(--color-border-tertiary); + border-radius: 3px; + box-shadow: inset 0 -1px 0 var(--color-border-tertiary); +} +.markdown-body pre { + word-wrap: normal; + padding: 16px; + overflow: auto; + font-size: 85%; + line-height: 1.45; + background-color: var(--color-bg-tertiary); + -webkit-border-radius: 3px; + border-radius: 3px; +} +.markdown-body pre code { + display: inline; + max-width: initial; + padding: 0; + margin: 0; + overflow: initial; + font-size: 100%; + line-height: inherit; + word-wrap: normal; + white-space: pre; + border: 0; + -webkit-border-radius: 3px; + border-radius: 3px; + background-color: transparent; +} +.markdown-body pre code:before, +.markdown-body pre code:after { + content: normal; +} +.markdown-body code { + font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace; + padding: 0; + padding-top: 0.2em; + padding-bottom: 0.2em; + margin: 0; + font-size: 85%; + background-color: var(--color-markdown-code-bg); + -webkit-border-radius: 3px; + border-radius: 3px; +} +.markdown-body code:before, +.markdown-body code:after { + letter-spacing: -0.2em; + content: "\00a0"; +} +.markdown-body a { + color: var(--color-text-link); + text-decoration: none; + background: transparent; +} +.markdown-body img { + max-width: 100%; + max-height: 100%; + padding: 1rem; +} +.markdown-body strong { + font-weight: bold; +} +.markdown-body em { + font-style: italic; +} +.markdown-body del { + text-decoration: line-through; +} +.task-list-item { + list-style-type: none; +} +.task-list-item input { + font: 13px/1.4 Helvetica, arial, nimbussansl, liberationsans, freesans, clean, + sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + margin: 0 0.35em 0.25em -1.6em; + vertical-align: middle; +} +.task-list-item input[disabled] { + cursor: default; +} +.task-list-item input[type="checkbox"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +.task-list-item input[type="radio"] { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + padding: 0; +} +.markdown-body h1, +.markdown-body h2, +.markdown-body h3, +.markdown-body h4, +.markdown-body h4 { + clear: both; +} +#page-header { + display: none; +} diff --git a/doc/kickstart.txt b/doc/kickstart.txt deleted file mode 100644 index cb87ac3..0000000 --- a/doc/kickstart.txt +++ /dev/null @@ -1,24 +0,0 @@ -================================================================================ -INTRODUCTION *kickstart.nvim* - -Kickstart.nvim is a project to help you get started on your neovim journey. - - *kickstart-is-not* -It is not: -- Complete framework for every plugin under the sun -- Place to add every plugin that could ever be useful - - *kickstart-is* -It is: -- Somewhere that has a good start for the most common "IDE" type features: - - autocompletion - - goto-definition - - find references - - fuzzy finding - - and hinting at what more can be done :) -- A place to _kickstart_ your journey. - - You should fork this project and use/modify it so that it matches your - style and preferences. If you don't want to do that, there are probably - other projects that would fit much better for you (and that's great!)! - - vim:tw=78:ts=8:ft=help:norl: diff --git a/init.lua b/init.lua index eaf017c..78dcda2 100644 --- a/init.lua +++ b/init.lua @@ -59,6 +59,8 @@ require('lazy').setup({ -- Snippet Engine & its associated nvim-cmp source 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip', + 'hrsh7th/cmp-path', + 'hrsh7th/cmp-buffer', -- Adds LSP completion capabilities 'hrsh7th/cmp-nvim-lsp', @@ -108,7 +110,7 @@ require('lazy').setup({ -- See `:help lualine.txt` opts = { options = { - icons_enabled = false, + icons_enabled = true, component_separators = '|', section_separators = '', }, @@ -269,7 +271,7 @@ vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { de -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, + ensure_installed = { 'c', 'lua', 'python', 'rust', 'vimdoc', 'vim' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, @@ -337,6 +339,18 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) +local sign = function(opts) +vim.fn.sign_define(opts.name, { + texthl = opts.name, + text = opts.text, + numhl = '' +}) +end +sign({name = 'DiagnosticSignError', text = '✘'}) +sign({name = 'DiagnosticSignWarn', text = ''}) +sign({name = 'DiagnosticSignHint', text = '󱦲'}) +sign({name = 'DiagnosticSignInfo', text = '󰙎'}) + -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) diff --git a/lua/custom/plugins/format.lua b/lua/custom/plugins/format.lua deleted file mode 100644 index ebfc403..0000000 --- a/lua/custom/plugins/format.lua +++ /dev/null @@ -1,40 +0,0 @@ -return{ - -- [[ Eyecandy & fancy prgramming stuff ]] - - {'tpope/vim-sleuth'}, -- Detect tabstop and shiftwidth automatically - - {'matze/vim-move'}, - - {'windwp/nvim-autopairs', - config = function () - require('nvim-autopairs').setup() - end - }, - - {'tpope/vim-surround'}, - - {'lilydjwg/colorizer'}, - - {'stevearc/dressing.nvim', - config = function() - require('dressing').setup() - end - }, - - {"yamatsum/nvim-cursorline", - config = function() - require('nvim-cursorline').setup { - cursorline = { - enable = false, - timeout = 1000, - number = false, - }, - cursorword = { - enable = true, - min_length = 2, - hl = { underline = true }, - } - } - end - }, -} diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua new file mode 100644 index 0000000..cd6c75a --- /dev/null +++ b/lua/custom/plugins/init.lua @@ -0,0 +1,116 @@ +-- [[ insert your plugins below ]] + +return { + -- [[ Null ]] + ({'jose-elias-alvarez/null-ls.nvim', + config = function () + local null_ls = require("null-ls") + + null_ls.setup({ + sources = { + null_ls.builtins.formatting.stylua, + null_ls.builtins.diagnostics.eslint, + null_ls.builtins.completion.spell, + }, + }) + end +}), + -- [[ Eyecandy & fancy prgramming stuff ]] + + {'tpope/vim-sleuth'}, -- Detect tabstop and shiftwidth automatically + + {'matze/vim-move'}, + + {'windwp/nvim-autopairs', + config = function () + require('nvim-autopairs').setup() + end + }, + + {'tpope/vim-surround'}, + + {'lilydjwg/colorizer'}, + + {'stevearc/dressing.nvim', + config = function() + require('dressing').setup() + end + }, + + {"yamatsum/nvim-cursorline", + config = function() + require('nvim-cursorline').setup { + cursorline = { + enable = false, + timeout = 1000, + number = false, + }, + cursorword = { + enable = true, + min_length = 2, + hl = { underline = true }, + } + } + end + }, + + -- [[ Markdown Preview ]] + + -- Preview in browser + { + "iamcco/markdown-preview.nvim", + build = "cd app && npm install", + config = function() + vim.g.mkdp_filetypes = { "markdown" } + vim.g.mkdp_page_title = "${name}" + vim.g.mkdp_markdown_css = vim.fn.stdpath("config") .. "/assets/markdown.css" + end, + ft = { "markdown" }, + }, + + -- Table mode + -- https://github.com/dhruvasagar/vim-table-mode + { + "dhruvasagar/vim-table-mode", + ft = { "markdown" }, + config = function() + -- Bug: changing prefix doesn't work https://github.com/dhruvasagar/vim-table-mode/issues/222 + -- :h table-mode-mappings + -- For Markdown-compatible tables use + vim.g.table_mode_map_prefix = "t" + vim.g.table_mode_corner = "|" + -- vim.cmd("let g:table_mode_map_prefix = 't'") + -- vim.g.toggle_mode_options_toggle_map = "tm" + -- vim.g.table_mode_commands_tableize = "tt" + end, + }, + + -- [[ notes ]] + + {"renerocksai/telekasten.nvim", + dependencies = { + {'mzlogin/vim-markdown-toc'}, + {'renerocksai/calendar-vim'}, + }, + config = function() + require('telekasten').setup({ + home = vim.fn.expand("~/zettelkasten"), -- Put the name of your notes directory here + }) + end + }, + + -- [[ Zen mode ]] + 'folke/zen-mode.nvim', + dependencies = {'folke/twilight.nvim'}, + config = function () + require("zen-mode").setup({ + window = { + width = .75, -- width will be 85% of the editor width + options = { + number = false, + relativenumber = false, + }, + } + }) + end, +} diff --git a/lua/custom/plugins/markdown.lua b/lua/custom/plugins/markdown.lua deleted file mode 100644 index 7b455dc..0000000 --- a/lua/custom/plugins/markdown.lua +++ /dev/null @@ -1,31 +0,0 @@ -return { - -- Preview in browser - { - "iamcco/markdown-preview.nvim", - build = "cd app && npm install", - config = function() - vim.g.mkdp_filetypes = { "markdown" } - vim.g.mkdp_page_title = "${name}" - vim.g.mkdp_markdown_css = vim.fn.stdpath("config") .. "/assets/markdown.css" - end, - ft = { "markdown" }, - }, - - -- Table mode - -- https://github.com/dhruvasagar/vim-table-mode - { - "dhruvasagar/vim-table-mode", - ft = { "markdown" }, - config = function() - -- Bug: changing prefix doesn't work https://github.com/dhruvasagar/vim-table-mode/issues/222 - -- :h table-mode-mappings - vim.g.table_mode_map_prefix = "t" - -- vim.cmd("let g:table_mode_map_prefix = 't'") - -- vim.g.toggle_mode_options_toggle_map = "tm" - -- vim.g.table_mode_commands_tableize = "tt" - - -- For Markdown-compatible tables use - vim.g.table_mode_corner = "|" - end, - }, -} diff --git a/lua/custom/plugins/notes.lua b/lua/custom/plugins/notes.lua deleted file mode 100644 index abc47d0..0000000 --- a/lua/custom/plugins/notes.lua +++ /dev/null @@ -1,13 +0,0 @@ -return { - ({"renerocksai/telekasten.nvim", - dependencies = { - {'mzlogin/vim-markdown-toc'}, - {'renerocksai/calendar-vim'}, - }, - config = function() - require('telekasten').setup({ - home = vim.fn.expand("~/zettelkasten"), -- Put the name of your notes directory here - }) - end - }), - } diff --git a/lua/custom/plugins/zenmode.lua b/lua/custom/plugins/zenmode.lua deleted file mode 100644 index b9b153e..0000000 --- a/lua/custom/plugins/zenmode.lua +++ /dev/null @@ -1,16 +0,0 @@ -return { - {'folke/zen-mode.nvim', - dependencies = {'folke/twilight.nvim'}, - config = function () - require("zen-mode").setup({ - window = { - width = .75, -- width will be 85% of the editor width - options = { - number = false, - relativenumber = false, - }, - } - }) - end - }, - } diff --git a/lua/settings.lua b/lua/settings.lua index 0c7b655..ba83f72 100644 --- a/lua/settings.lua +++ b/lua/settings.lua @@ -107,7 +107,6 @@ map("n", "md", ":MarkdownPreview", opts) map("n", "doc", ":silent ! pandoc % --pdf-engine=xelatex --template eisvogel.tex -o %.pdf", opts) map("n", "zz", ":ZenMode", opts) -map("n", "qw", ":MindOpenMain", opts) -- -- open my main notes file if os == "Windows_NT" then @@ -121,15 +120,12 @@ end map("n", "", ":%s/\\<\\>//gI", opts) map("v", "<", "", ">gv", opts) --- map('i', '', opts) -map("n", "x", ":MkdnToggleToDo", opts) map("n", "ps", ":PackerSync", opts) map("n", "", ":!", opts) -- Meta X like emacs. This is blasphemy.... -map("n", "hrr", ":so%", opts) +map("n", "hrr", ":so%", opts) map("n", "", ":enew", opts) map("i", "jk", "l", opts) map("i", "jj", "l", opts) -map("i", "aa", "A", opts) map("i", "qw", "$", opts) map("n", "cw", "ciw", opts) map("n", "vw", "viw", opts)