From abbbab08e5355b603b8080fde01f3f53dcde3239 Mon Sep 17 00:00:00 2001 From: Jim Richter Date: Wed, 17 Nov 2021 14:04:03 +0100 Subject: [PATCH 1/3] some stuff --- .gitignore | 1 + .pnpm-debug.log | 14 -- configs/lua/autoformat.lua | 46 ++++ configs/nvim/.gitignore | 1 + configs/nvim/init.lua | 188 +++++++------- configs/nvim/lua/.pnpm-debug.log | 14 -- configs/nvim/lua/autocommands.lua | 2 +- configs/nvim/lua/keymappings.lua | 9 +- configs/nvim/lua/lsp-utils.lua | 324 ++++++++++++------------- configs/nvim/lua/lspinstaller-conf.lua | 16 +- configs/nvim/lua/overlays.lua | 80 +++--- configs/nvim/lua/plugins.lua | 30 ++- configs/nvim/lua/snippets.lua | 45 ++++ configs/nvim/lua/treesitter-conf.lua | 48 ++-- configs/nvim/lua/utils.lua | 48 ++-- configs/zsh/aliases.sh | 1 + 16 files changed, 480 insertions(+), 387 deletions(-) create mode 100644 .gitignore delete mode 100644 .pnpm-debug.log create mode 100644 configs/lua/autoformat.lua create mode 100644 configs/nvim/.gitignore delete mode 100644 configs/nvim/lua/.pnpm-debug.log create mode 100644 configs/nvim/lua/snippets.lua diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ef62189 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.pnpm-debug.log diff --git a/.pnpm-debug.log b/.pnpm-debug.log deleted file mode 100644 index 3a7b839..0000000 --- a/.pnpm-debug.log +++ /dev/null @@ -1,14 +0,0 @@ -{ - "0 debug pnpm:scope": { - "selected": 1 - }, - "1 error pnpm": { - "code": "ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND", - "err": { - "name": "pnpm", - "message": "No package.json (or package.yaml, or package.json5) was found in \"/home/jim/.dotfiles\".", - "code": "ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND", - "stack": "pnpm: No package.json (or package.yaml, or package.json5) was found in \"/home/jim/.dotfiles\".\n at readProjectManifest (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:40641:13)\n at async Object.readProjectManifestOnly (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:40645:28)\n at async Object.readProjectManifestOnly (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:40864:24)\n at async Object.handler (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:129763:24)\n at async /home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:133951:20\n at async run (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:133926:34)\n at async runPnpm (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:134137:5)\n at async /home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:134129:7" - } - } -} \ No newline at end of file diff --git a/configs/lua/autoformat.lua b/configs/lua/autoformat.lua new file mode 100644 index 0000000..d8107b4 --- /dev/null +++ b/configs/lua/autoformat.lua @@ -0,0 +1,46 @@ +require "format".setup { + ["*"] = { + {cmd = {"sed -i 's/[ \t]*$//'"}} -- remove trailing whitespace + }, + vim = { + { + cmd = {"luafmt -w replace"}, + start_pattern = "^lua << EOF$", + end_pattern = "^EOF$" + } + }, + vimwiki = { + { + cmd = {"prettier -w --parser babel"}, + start_pattern = "^{{{javascript$", + end_pattern = "^}}}$" + } + }, + lua = { + { + cmd = { + function(file) + return string.format("luafmt -l %s -w replace %s", vim.bo.textwidth, file) + end + } + } + }, + go = { + { + cmd = {"gofmt -w", "goimports -w"}, + tempfile_postfix = ".tmp" + } + }, + javascript = { + {cmd = {"prettier -w", "./node_modules/.bin/eslint --fix"}} + }, + markdown = { + {cmd = {"prettier -w"}}, + { + cmd = {"black"}, + start_pattern = "^```python$", + end_pattern = "^```$", + target = "current" + } + } +} diff --git a/configs/nvim/.gitignore b/configs/nvim/.gitignore new file mode 100644 index 0000000..8cb205e --- /dev/null +++ b/configs/nvim/.gitignore @@ -0,0 +1 @@ +plugin diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index c5be891..16be235 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -10,23 +10,37 @@ local opt = vim.opt require ("plugins") if u.has_plugin("cmp") then - -- Global options - o.number = true -- show line number - o.tabstop = 2 - o.shiftwidth = 2 -- Indents will have a width of 4 - o.softtabstop = 2 -- Sets the number of columns for a TAB - o.expandtab = true -- Dont expand TABs to spaces - o.autoindent = true + + vim.g.did_load_filetypes = 1 + + -- Global options + o.number = true -- show line number o.showmatch = true -- show matching brackets o.swapfile = false + -- Indentation options + vim.cmd [[ + set autoindent + set expandtab + set shiftwidth=2 + set softtabstop=2 + set tabstop=2 + ]] + + -- Debug indentations + if false then + vim.cmd [[ + set list + set listchars=eol:⏎,tab:->,trail:_,nbsp:⎵ + ]] + end + + g.hidden = true --unload buffers when hidden + g.filetype = true -- execute autocommands based on filetype o.autoread = true o.lazyredraw = true - g.hidden = true --unload buffers when hidden - g.filetype = true -- execute autocommands based on filetype - -- Search o.inccommand = 'nosplit' -- show substitutions incrementally o.ignorecase = true @@ -50,107 +64,119 @@ if u.has_plugin("cmp") then g.loaded_zip = 1 cmd [[set mouse=a]] -- enable mouse interaction - cmd [[set undofile]] - cmd [[set fcs=eob:\ ]] --disable showing ~ in empty lines + cmd [[set undofile]] + cmd [[set fcs=eob:\ ]] --disable showing ~ in empty lines + + cmd [[command Format :lua vim.lsp.buf.formatting()]] + cmd [[command FormatSync :lua vim.lsp.buf.formatting_sync()]] + + cmd [[set noshowmode]] --to get rid of thing like --INSERT-- + cmd [[set noshowcmd]] --to get rid of display of last command + cmd [[set shortmess+=F]] --to get rid of the file name displayed in the command line bar - cmd [[set noshowmode]] --to get rid of thing like --INSERT-- - cmd [[set noshowcmd]] --to get rid of display of last command cmd [[set noruler]] g.ale_fixers = {"prettier", "eslint"} -- Enable Theming / Syntax - o.syntax = "enable" - o.termguicolors = true + o.syntax = "enable" + o.termguicolors = true cmd("colorscheme material") g.material_terminal_italics = 1 g.material_theme_style = "darker" - -- Remove background color - require("transparent").setup({enable = true}) - cmd("highlight Normal guibg=none") - cmd("highlight NonText guibg=none") + + -- Remove background color + require("transparent").setup({enable = true}) + cmd("highlight Normal guibg=none") + cmd("highlight NonText guibg=none") require('neoscroll').setup() - + -- Configure nvim-tree g.nvim_tree_special_files = {} - g.nvim_tree_icons = { - default = "", - symlink = "", - git = { - unstaged = "*", - staged = "✓", - unmerged = "", - renamed = "➜", - untracked = "★", - deleted = "", - ignored = "◌" - }, - folder = { - arrow_open = " ", - arrow_closed = " ", - default = "", - open = "", - empty = "", - empty_open = "", - symlink = "", - symlink_open = "" - }, - lsp = { - hint = "", - info = "", - warning = "", - error = "" - } - } + g.nvim_tree_icons = { + default = "", + symlink = "", + git = { + unstaged = "*", + staged = "✓", + unmerged = "", + renamed = "➜", + untracked = "★", + deleted = "", + ignored = "◌" + }, + folder = { + arrow_open = " ", + arrow_closed = " ", + default = "", + open = "", + empty = "", + empty_open = "", + symlink = "", + symlink_open = "" + }, + lsp = { + hint = "", + info = "", + warning = "", + error = "" + } + } - require("nvim-tree").setup { - auto_open = 1, - gitignore = 1, - group_empty = 1, + require("nvim-tree").setup { + auto_open = 1, + gitignore = 1, + group_empty = 1, hijack_cursor = 1, update_focused_file = { enable = false, }, - diagnostics = { + diagnostics = { enable = true }, view = { auto_resize = true, hide_root_folder = true, - winopts = { - signcolumn = "no" - } - } - } + winopts = { + signcolumn = "no" + } + } + } require('nvim-tree.view').View.winopts.signcolumn = 'no' -- Configure Wiki - g.wiki_root = "~/Notes" - g.wiki_filetypes = {"md"} - g.wiki_link_extension = ".md" - - -- KeyBindings - g.mapleader = " " - require "keymappings" + g.wiki_root = "~/Notes" + g.wiki_filetypes = {"md"} + g.wiki_link_extension = ".md" - require "nvim-tmux-navigation".setup { - keybindings = { - left = "", - down = "", - up = "", - right = "", - last_active = "", - next = "" - } - } + -- KeyBindings + g.mapleader = " " + require "keymappings" - require'nvim-autopairs'.setup() + require "nvim-tmux-navigation".setup { + keybindings = { + left = "", + down = "", + up = "", + right = "", + last_active = "", + next = "" + } + } - -- Treesitter config - require "treesitter-conf" + require'nvim-autopairs'.setup() - -- Toggleterm / Lazygit setup + -- Treesitter config + require "treesitter-conf" + + -- Autocompletion Setup + o.completeopt = "menuone,noselect,noinsert" + require "autocomplete" + require "snippets" + + -- LSP Config + require "lspinstaller-conf" require "lazy-git" require "autocommands" diff --git a/configs/nvim/lua/.pnpm-debug.log b/configs/nvim/lua/.pnpm-debug.log deleted file mode 100644 index cdd38b9..0000000 --- a/configs/nvim/lua/.pnpm-debug.log +++ /dev/null @@ -1,14 +0,0 @@ -{ - "0 debug pnpm:scope": { - "selected": 1 - }, - "1 error pnpm": { - "code": "ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND", - "err": { - "name": "pnpm", - "message": "No package.json (or package.yaml, or package.json5) was found in \"/home/jim/.dotfiles/configs/nvim/lua\".", - "code": "ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND", - "stack": "pnpm: No package.json (or package.yaml, or package.json5) was found in \"/home/jim/.dotfiles/configs/nvim/lua\".\n at readProjectManifest (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:40641:13)\n at async Object.readProjectManifestOnly (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:40645:28)\n at async Object.readProjectManifestOnly (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:40864:24)\n at async Object.handler (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:129763:24)\n at async /home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:133951:20\n at async run (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:133926:34)\n at async runPnpm (/home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:134137:5)\n at async /home/jim/.asdf/installs/nodejs/16.11.0/pnpm-global/5/node_modules/.pnpm/pnpm@6.17.2/node_modules/pnpm/dist/pnpm.cjs:134129:7" - } - } -} \ No newline at end of file diff --git a/configs/nvim/lua/autocommands.lua b/configs/nvim/lua/autocommands.lua index 6d48fe8..5547439 100644 --- a/configs/nvim/lua/autocommands.lua +++ b/configs/nvim/lua/autocommands.lua @@ -3,7 +3,7 @@ local cmd = vim.cmd; cmd [[ augroup auto_format au! - au BufWritePre * silent! lua vim.lsp.buf.formatting_sync(nil, 300) + au BufWritePre * silent! FormatSync augroup END augroup highlight_yank diff --git a/configs/nvim/lua/keymappings.lua b/configs/nvim/lua/keymappings.lua index 29fc9b4..449e842 100644 --- a/configs/nvim/lua/keymappings.lua +++ b/configs/nvim/lua/keymappings.lua @@ -5,15 +5,11 @@ local cmd = vim.cmd; local options = {noremap = true} local remap = {noremap = false} ---map("n", "", "", remap) ---map("n", " ", "", remap) g.mapleader = " " map("n", "", ":Telescope find_files", options) ---map("n", "", ":Telescope grep_string", options) map("n", "", ":Telescope live_grep", options) - -- LSP Functionality map("n", "gD", "lua vim.lsp.buf.declaration()", options) map("n", "gd", "lua vim.lsp.buf.definition()", options) @@ -23,7 +19,7 @@ map("n", "K", "lua vim.lsp.buf.hover()", options) map("n", "e", "lua vim.lsp.diagnostic.show_line_diagnostics()", options) map("n", "rn", "lua vim.lsp.buf.rename()", options) map("n", "c", "lua vim.lsp.buf.code_action()", options) -map("n", "", "lua vim.lsp.buf.formatting()", options) +map("n", "", ":Format", options) map("n", "[d", "lua vim.lsp.diagnostic.goto_prev()", options) map("n", "]d", "lua vim.lsp.diagnostic.goto_next()", options) @@ -69,6 +65,3 @@ map("i", "", ":wi", options) -- Update vim config map("n", "", ":source $MYVIMRC", options) - --- Y yank until the end of line -map("n", "Y", "y$", {noremap = true}) diff --git a/configs/nvim/lua/lsp-utils.lua b/configs/nvim/lua/lsp-utils.lua index 795bcef..1a836b8 100644 --- a/configs/nvim/lua/lsp-utils.lua +++ b/configs/nvim/lua/lsp-utils.lua @@ -4,53 +4,51 @@ local utils = require("utils") -- function to attach completion when setting up lsp local function on_attach(client) - local function buf_set_keymap(...) - vim.api.nvim_buf_set_keymap(bufnr, ...) - end - local function buf_set_option(...) - vim.api.nvim_buf_set_option(bufnr, ...) - end + local function buf_set_keymap(...) + vim.api.nvim_buf_set_keymap(bufnr, ...) + end + local function buf_set_option(...) + vim.api.nvim_buf_set_option(bufnr, ...) + end - buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") + buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") - -- Mappings. - local opts = {noremap = true, silent = true} + -- Mappings. + local opts = {noremap = true, silent = true} -- Set some keybinds conditional on server capabilities - if client.resolved_capabilities.document_formatting then - vim.cmd [[command Format :lua vim.lsp.buf.formatting()]] - buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) - elseif client.resolved_capabilities.document_range_formatting then - vim.cmd [[command Format :lua vim.lsp.buf.range_formatting()]] - buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) - end + if client.resolved_capabilities.document_formatting then + buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) + elseif client.resolved_capabilities.document_range_formatting then + buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) + end - -- Set autocommands conditional on server_capabilities - if client.resolved_capabilities.document_highlight then - vim.api.nvim_exec( - [[ - augroup lsp_document_highlight - autocmd! * - autocmd CursorHold lua vim.lsp.buf.document_highlight() - autocmd CursorMoved lua vim.lsp.buf.clear_references() - autocmd CursorHold *.* :lua vim.lsp.diagnostic.show_line_diagnostics() - augroup END - ]], - false - ) - end + -- Set autocommands conditional on server_capabilities + if client.resolved_capabilities.document_highlight then + vim.api.nvim_exec( + [[ + augroup lsp_document_highlight + autocmd! * + autocmd CursorHold lua vim.lsp.buf.document_highlight() + autocmd CursorMoved lua vim.lsp.buf.clear_references() + autocmd CursorHold *.* :lua vim.lsp.diagnostic.show_line_diagnostics() + augroup END + ]], + false + ) + end end local system_name = "" -- Lua Language Server if vim.fn.has("mac") == 1 then - system_name = "macOS" + system_name = "macOS" elseif vim.fn.has("unix") == 1 then - system_name = "Linux" + system_name = "Linux" elseif vim.fn.has("win32") == 1 then - system_name = "Windows" + system_name = "Windows" else - print("Unsupported system for sumneko") + print("Unsupported system for sumneko") end local sumneko_root_path = "/home/jim/.local/share/lua-language-server" @@ -61,164 +59,164 @@ table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?/init.lua") nvim_lsp.sumneko_lua.setup { - on_attach = on_attach, - capabilities = lsp_status.capabilities, - cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - -- Setup your lua path - path = runtime_path - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = {"vim"} - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true) - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false - } - } - } + on_attach = on_attach, + capabilities = lsp_status.capabilities, + cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + -- Setup your lua path + path = runtime_path + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = {"vim"} + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true) + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false + } + } + } } -- Go Language Server nvim_lsp.gopls.setup { - on_attach = on_attach, - capabilities = lsp_status.capabilities + on_attach = on_attach, + capabilities = lsp_status.capabilities } -- Html Setup nvim_lsp.html.setup { - on_attach = on_attach, - capabilities = lsp_status.capabilities, - filetypes = {"html"} + on_attach = on_attach, + capabilities = lsp_status.capabilities, + filetypes = {"html"} } -- Svelte Language Server nvim_lsp.svelte.setup { - on_attach = on_attach, - capabilities = lsp_status.capabilities + on_attach = on_attach, + capabilities = lsp_status.capabilities } -- Typescript Language Server local function organize_imports() - local params = { - command = "_typescript.organizeImports", - arguments = {vim.api.nvim_buf_get_name(0)}, - title = "" - } - vim.lsp.buf.execute_command(params) + local params = { + command = "_typescript.organizeImports", + arguments = {vim.api.nvim_buf_get_name(0)}, + title = "" + } + vim.lsp.buf.execute_command(params) end nvim_lsp.tsserver.setup { - on_attach = on_attach, - capabilities = lsp_status.capabilities, - commands = { - OrganizeImports = { - organize_imports, - description = "Organize Imports" - } - } + on_attach = on_attach, + capabilities = lsp_status.capabilities, + commands = { + OrganizeImports = { + organize_imports, + description = "Organize Imports" + } + } } -- Setup diagnostics formaters and linters for non LSP provided files nvim_lsp.diagnosticls.setup { - on_attach = on_attach, - capabilities = lsp_status.capabilities, - cmd = {"diagnostic-languageserver", "--stdio"}, - filetypes = { - "lua", - "sh", - "markdown", - "json", + on_attach = on_attach, + capabilities = lsp_status.capabilities, + cmd = {"diagnostic-languageserver", "--stdio"}, + filetypes = { + "lua", + "sh", + "markdown", + "json", "jsonc", - "yaml", - "toml" - }, - init_options = { - linters = { - shellcheck = { - command = "shellcheck", - debounce = 100, - args = {"--format", "json", "-"}, - sourceName = "shellcheck", - parseJson = { - line = "line", - column = "column", - endLine = "endLine", - endColumn = "endColumn", - message = "${message} [${code}]", - security = "level" - }, - securities = { - error = "error", - warning = "warning", - info = "info", - style = "hint" - } - }, - markdownlint = { - command = "markdownlint", - isStderr = true, - debounce = 100, - args = {"--stdin"}, - offsetLine = 0, - offsetColumn = 0, - sourceName = "markdownlint", - formatLines = 1, - formatPattern = { - "^.*?:\\s?(\\d+)(:(\\d+)?)?\\s(MD\\d{3}\\/[A-Za-z0-9-/]+)\\s(.*)$", - { - line = 1, - column = 3, - message = {4} - } - } - } - }, - filetypes = { - sh = "shellcheck", - markdown = "markdownlint" - }, - formatters = { - shfmt = { - command = "shfmt", - args = {"-i", "2", "-bn", "-ci", "-sr"} - }, - prettier = { - command = "prettier", - args = {"--stdin-filepath", "%filepath"} - } - }, - formatFiletypes = { - sh = "shfmt", - json = "prettier", - yaml = "prettier", - toml = "prettier", - markdown = "prettier", - lua = "prettier" - } - } + "yaml", + "toml" + }, + init_options = { + linters = { + shellcheck = { + command = "shellcheck", + debounce = 100, + args = {"--format", "json", "-"}, + sourceName = "shellcheck", + parseJson = { + line = "line", + column = "column", + endLine = "endLine", + endColumn = "endColumn", + message = "${message} [${code}]", + security = "level" + }, + securities = { + error = "error", + warning = "warning", + info = "info", + style = "hint" + } + }, + markdownlint = { + command = "markdownlint", + isStderr = true, + debounce = 100, + args = {"--stdin"}, + offsetLine = 0, + offsetColumn = 0, + sourceName = "markdownlint", + formatLines = 1, + formatPattern = { + "^.*?:\\s?(\\d+)(:(\\d+)?)?\\s(MD\\d{3}\\/[A-Za-z0-9-/]+)\\s(.*)$", + { + line = 1, + column = 3, + message = {4} + } + } + } + }, + filetypes = { + sh = "shellcheck", + markdown = "markdownlint" + }, + formatters = { + shfmt = { + command = "shfmt", + args = {"-i", "2", "-bn", "-ci", "-sr"} + }, + prettier = { + command = "prettier", + args = {"--stdin-filepath", "%filepath"} + } + }, + formatFiletypes = { + sh = "shfmt", + json = "prettier", + yaml = "prettier", + toml = "prettier", + markdown = "prettier", + lua = "prettier" + } + } } -- Enable diagnostics vim.lsp.handlers["textDocument/publishDiagnostics"] = - vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, - { - underline = true, - virtual_text = false, - signs = true, - update_in_insert = true - } + vim.lsp.with( + vim.lsp.diagnostic.on_publish_diagnostics, + { + underline = true, + virtual_text = false, + signs = true, + update_in_insert = true + } ) diff --git a/configs/nvim/lua/lspinstaller-conf.lua b/configs/nvim/lua/lspinstaller-conf.lua index 81bd493..1b57cfe 100644 --- a/configs/nvim/lua/lspinstaller-conf.lua +++ b/configs/nvim/lua/lspinstaller-conf.lua @@ -1,14 +1,14 @@ local lsp_installer = require("nvim-lsp-installer") lsp_installer.on_server_ready(function(server) - local opts = {} + local opts = {} - -- (optional) Customize the options passed to the server - -- if server.name == "tsserver" then - -- opts.root_dir = function() ... end - -- end + -- (optional) Customize the options passed to the server + -- if server.name == "tsserver" then + -- opts.root_dir = function() ... end + -- end - -- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart) - server:setup(opts) - vim.cmd [[ do User LspAttachBuffers ]] + -- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart) + server:setup(opts) + vim.cmd [[ do User LspAttachBuffers ]] end) diff --git a/configs/nvim/lua/overlays.lua b/configs/nvim/lua/overlays.lua index 7a3d66f..27a1129 100644 --- a/configs/nvim/lua/overlays.lua +++ b/configs/nvim/lua/overlays.lua @@ -1,68 +1,68 @@ local Terminal = require("toggleterm.terminal").Terminal local u = require("utils") local lazygit = - Terminal:new( - { - cmd = "lazygit", - dir = "git_dir", - direction = "float", - float_opts = { - winblend = 0, - border = "shadow" - }, - on_open = function(term) - vim.cmd("startinsert!") - vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", {noremap = true, silent = true}) - end, - on_close = function(term) - Terminal:close() - end - } + Terminal:new( + { + cmd = "lazygit", + dir = "git_dir", + direction = "float", + float_opts = { + winblend = 0, + border = "shadow" + }, + on_open = function(term) + vim.cmd("startinsert!") + vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "close", {noremap = true, silent = true}) + end, + on_close = function(term) + Terminal:close() + end + } ) function _lazygit_toggle() - lazygit:toggle() + lazygit:toggle() end vim.api.nvim_set_keymap("n", "", "lua _lazygit_toggle()", {noremap = true, silent = true}) local pnpm = - Terminal:new( - { - cmd = "pnpm dev", - dir = "git_dir", - size = 5, - direction = "vertical", - on_close = function(term) - Terminal:close() - end - } + Terminal:new( + { + cmd = "pnpm dev", + dir = "git_dir", + size = 5, + direction = "vertical", + on_close = function(term) + Terminal:close() + end + } ) function _pnpm_toggle() - pnpm:toggle() + pnpm:toggle() end vim.api.nvim_set_keymap("n", "d", "lua _pnpm_toggle()", {noremap = true, silent = true}) local nvimConfig = - Terminal:new( - { - cmd = "cd $HOME/.dotfiles && nvim configs/init.lua && cd -", - direction = "float", - on_close = function(term) - Terminal:close() - u.ReloadConfig() - end - } + Terminal:new( + { + cmd = "cd $HOME/.dotfiles && nvim configs/init.lua && cd -", + direction = "float", + on_close = function(term) + Terminal:close() + u.ReloadConfig() + end + } ) function _nvimConfig_toggle() - nvimConfig:toggle() + nvimConfig:toggle() end vim.api.nvim_set_keymap("n", "", "lua _nvimConfig_toggle()", {noremap = true, silent = true}) require("toggleterm").setup { - shade_terminals = true + shade_terminals = true } diff --git a/configs/nvim/lua/plugins.lua b/configs/nvim/lua/plugins.lua index 1567d44..d0a8739 100644 --- a/configs/nvim/lua/plugins.lua +++ b/configs/nvim/lua/plugins.lua @@ -5,7 +5,10 @@ return require("packer").startup(function() -- General Helper Functions use "nvim-lua/plenary.nvim" - + + -- Faster Filetype Detection + use "nathom/filetype.nvim" + use "alexghergh/nvim-tmux-navigation" -- Theming Section @@ -17,10 +20,12 @@ return require("packer").startup(function() use "kyazdani42/nvim-tree.lua" use "nvim-lua/popup.nvim" use "mhinz/vim-startify" - use "lukas-reineke/indent-blankline.nvim" + --use "lukas-reineke/indent-blankline.nvim" use "karb94/neoscroll.nvim" use "tpope/vim-fugitive" + use "tpope/vim-surround" + use "editorconfig/editorconfig-vim" -- Code Navigation use "dense-analysis/ale" @@ -35,20 +40,26 @@ return require("packer").startup(function() -- use "lervag/wiki.vim" -- Syntax / Autocomplete - use "preservim/nerdcommenter" use "neovim/nvim-lspconfig" - use "williamboman/nvim-lsp-installer" - use "nvim-lua/lsp-status.nvim" - use "hrsh7th/nvim-cmp" + use "hrsh7th/nvim-cmp" use "hrsh7th/cmp-nvim-lsp" use "hrsh7th/cmp-path" - use "weilbith/nvim-code-action-menu" -- Need to find better alternative + use "hrsh7th/cmp-buffer" + use "hrsh7th/cmp-cmdline" + use "L3MON4D3/LuaSnip" + use "saadparwaiz1/cmp_luasnip" + use "rafamadriz/friendly-snippets" + + use "tpope/vim-commentary" + + use "williamboman/nvim-lsp-installer" + use "nvim-lua/lsp-status.nvim" use "L3MON4D3/LuaSnip" use "windwp/nvim-autopairs" use "neoclide/jsonc.vim" use { - 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate' + 'nvim-treesitter/nvim-treesitter', + run = ':TSUpdate' } -- Preview Markdown @@ -56,6 +67,7 @@ return require("packer").startup(function() -- Autoformat --use "sbdchd/neoformat" + -- use "lukas-reineke/format.nvim" -- General Popup Window use "akinsho/nvim-toggleterm.lua" diff --git a/configs/nvim/lua/snippets.lua b/configs/nvim/lua/snippets.lua new file mode 100644 index 0000000..c83f529 --- /dev/null +++ b/configs/nvim/lua/snippets.lua @@ -0,0 +1,45 @@ +local ls = require("luasnip") + +-- some shorthands... +local s = ls.snippet +local sn = ls.snippet_node +local t = ls.text_node +local i = ls.insert_node +local f = ls.function_node +local c = ls.choice_node +local d = ls.dynamic_node + +local types = require("luasnip.util.types") + +-- Every unspecified option will be set to the default. +ls.config.set_config({ + history = true, + -- Update more often, :h events for more info. + updateevents = "TextChanged,TextChangedI", + ext_opts = { + [types.choiceNode] = { + active = { + virt_text = { { "choiceNode", "Comment" } }, + }, + }, + }, + -- treesitter-hl has 100, use something higher (default is 200). + ext_base_prio = 300, + -- minimal increase in priority. + ext_prio_increase = 1, + enable_autosnippets = true, +}) + + +ls.snippets = { + all = { + + }, + svelte = { + s("slt", { + t(''), + }), + } +} diff --git a/configs/nvim/lua/treesitter-conf.lua b/configs/nvim/lua/treesitter-conf.lua index 6056b6f..c24ee00 100644 --- a/configs/nvim/lua/treesitter-conf.lua +++ b/configs/nvim/lua/treesitter-conf.lua @@ -1,26 +1,24 @@ local parser_configs = require("nvim-treesitter.parsers").get_parser_configs() - parser_configs.http = { - install_info = { - url = "https://github.com/NTBBloodbath/tree-sitter-http", - files = {"src/parser.c"}, - branch = "main" - } - } - require "nvim-treesitter.configs".setup { - ensure_installed = { - "bash", - "yaml", - "http", - "svelte", - "css", - "svelte", - "typescript", - "javascript", - "go", - "lua", - "yaml" - }, - highlight = {enable = true} - } - - + parser_configs.http = { + install_info = { + url = "https://github.com/NTBBloodbath/tree-sitter-http", + files = {"src/parser.c"}, + branch = "main" + } + } + require "nvim-treesitter.configs".setup { + ensure_installed = { + "bash", + "yaml", + "http", + "svelte", + "css", + "svelte", + "typescript", + "javascript", + "go", + "lua", + "yaml" + }, + highlight = {enable = true} + } diff --git a/configs/nvim/lua/utils.lua b/configs/nvim/lua/utils.lua index 36cb918..b5e9aa4 100644 --- a/configs/nvim/lua/utils.lua +++ b/configs/nvim/lua/utils.lua @@ -2,40 +2,40 @@ local M = {} local cmd = vim.cmd function M.create_augroup(autocmds, name) - cmd('augroup ' .. name) - cmd('autocmd!') - for _, autocmd in ipairs(autocmds) do - cmd('autocmd ' .. table.concat(autocmd, ' ')) - end - cmd('augroup END') + cmd('augroup ' .. name) + cmd('autocmd!') + for _, autocmd in ipairs(autocmds) do + cmd('autocmd ' .. table.concat(autocmd, ' ')) + end + cmd('augroup END') end function M.ReloadConfig() - for name,_ in pairs(package.loaded) do - if name:match('^cnull') then - package.loaded[name] = nil - end - end + for name,_ in pairs(package.loaded) do + if name:match('^cnull') then + package.loaded[name] = nil + end + end - dofile(vim.env.MYVIMRC) + dofile(vim.env.MYVIMRC) end local function dump(o) - if type(o) == 'table' then - local s = '{ ' - for k,v in pairs(o) do - if type(k) ~= 'number' then k = '"'..k..'"' end - s = s .. '['..k..'] = ' .. dump(v) .. ',' - end - return s .. '} ' - else - return tostring(o) - end + if type(o) == 'table' then + local s = '{ ' + for k,v in pairs(o) do + if type(k) ~= 'number' then k = '"'..k..'"' end + s = s .. '['..k..'] = ' .. dump(v) .. ',' + end + return s .. '} ' + else + return tostring(o) + end end function M.has_plugin(pluginName) - local status = pcall(require, pluginName); - return status + local status = pcall(require, pluginName); + return status end return M diff --git a/configs/zsh/aliases.sh b/configs/zsh/aliases.sh index b6bd1be..4bda303 100644 --- a/configs/zsh/aliases.sh +++ b/configs/zsh/aliases.sh @@ -27,6 +27,7 @@ alias D="pnpm dev" alias B="pnpm build" alias T="pnpm test" alias P="git push" +alias p="git pull" alias lt="tree -L 2 --filelimit 150 --dirsfirst" From 7c95e0827e66c10c075601484297d03319febc6e Mon Sep 17 00:00:00 2001 From: Jim Richter Date: Wed, 17 Nov 2021 14:09:07 +0100 Subject: [PATCH 2/3] fix: autoformat --- configs/nvim/lua/autocommands.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/nvim/lua/autocommands.lua b/configs/nvim/lua/autocommands.lua index 5547439..a4d965a 100644 --- a/configs/nvim/lua/autocommands.lua +++ b/configs/nvim/lua/autocommands.lua @@ -3,7 +3,7 @@ local cmd = vim.cmd; cmd [[ augroup auto_format au! - au BufWritePre * silent! FormatSync + au BufWritePre * FormatSync augroup END augroup highlight_yank From 4cb55ad327aafa4888417f3844ef0e07f3f68642 Mon Sep 17 00:00:00 2001 From: Jim Richter Date: Mon, 22 Nov 2021 18:45:07 +0100 Subject: [PATCH 3/3] stuph --- configs/alacritty/alacritty.yml | 39 ----- configs/lua/autoformat.lua | 46 ------ configs/nvim/init.lua | 26 +--- configs/nvim/lua/autocommands.lua | 5 - configs/nvim/lua/autocomplete.lua | 51 ------- configs/nvim/lua/cmp-conf.lua | 92 ++++++++++++ configs/nvim/lua/formatter-conf.lua | 8 + configs/nvim/lua/keymappings.lua | 7 +- .../nvim/lua/{lsp-utils.lua => lsp-conf.lua} | 77 +++------- configs/nvim/lua/overlays.lua | 2 +- configs/nvim/lua/plugins.lua | 25 +++- configs/nvim/lua/treesitter-conf.lua | 10 ++ node_modules/.modules.yaml | 21 +++ node_modules/.pnpm/lock.yaml | 15 ++ .../node_modules/vite-plugin-fonts/README.md | 113 ++++++++++++++ .../vite-plugin-fonts/dist/index.d.ts | 30 ++++ .../vite-plugin-fonts/dist/index.js | 138 ++++++++++++++++++ .../vite-plugin-fonts/dist/index.mjs | 138 ++++++++++++++++++ .../vite-plugin-fonts/package.json | 34 +++++ node_modules/vite-plugin-fonts | 1 + package.json | 5 + pnpm-lock.yaml | 15 ++ 22 files changed, 676 insertions(+), 222 deletions(-) delete mode 100644 configs/lua/autoformat.lua delete mode 100644 configs/nvim/lua/autocomplete.lua create mode 100644 configs/nvim/lua/cmp-conf.lua create mode 100644 configs/nvim/lua/formatter-conf.lua rename configs/nvim/lua/{lsp-utils.lua => lsp-conf.lua} (70%) create mode 100644 node_modules/.modules.yaml create mode 100644 node_modules/.pnpm/lock.yaml create mode 100644 node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/README.md create mode 100644 node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.d.ts create mode 100644 node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.js create mode 100644 node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.mjs create mode 100644 node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/package.json create mode 120000 node_modules/vite-plugin-fonts create mode 100644 package.json create mode 100644 pnpm-lock.yaml diff --git a/configs/alacritty/alacritty.yml b/configs/alacritty/alacritty.yml index 8915b12..4833a53 100644 --- a/configs/alacritty/alacritty.yml +++ b/configs/alacritty/alacritty.yml @@ -1,49 +1,11 @@ -# Configuration for Alacritty, the GPU enhanced terminal emulator. - -# Import additional configuration files -# -# Imports are loaded in order, skipping all missing files, with the importing -# file being loaded last. If a field is already present in a previous import, it -# will be replaced. -# -# All imports must either be absolute paths starting with `/`, or paths relative -# to the user's home directory starting with `~/`. -#import: -# - /path/to/alacritty.yml - -# Any items in the `env` entry below will be added as -# environment variables. Some entries may override variables -# set by alacritty itself. #env: - # TERM variable - # - # This value is used to set the `$TERM` environment variable for - # each instance of Alacritty. If it is not present, alacritty will - # check the local terminfo database and use `alacritty` if it is - # available, otherwise `xterm-256color` is used. #TERM: alacritty - - # Window dimensions (changes require restart) - # - # Number of lines/columns (not pixels) in the terminal. The number of columns - # must be at least `2`, while using a value of `0` for columns and lines will - # fall back to the window manager's recommended size. #dimensions: # columns: 0 # lines: 0 - - # Window position (changes require restart) - # - # Specified in number of pixels. - # If the position is not set, the window manager will handle the placement. #position: # x: 0 # y: 0 - - # Window padding (changes require restart) - # - # Blank space added around the window in pixels. This padding is scaled - # by DPI and the specified value is always added at both opposing sides. window: padding: x: 10 @@ -175,7 +137,6 @@ font: # Colors (Tomorrow Night) colors: - # Default colors primary: background: '#000000' foreground: '#c5c8c6' diff --git a/configs/lua/autoformat.lua b/configs/lua/autoformat.lua deleted file mode 100644 index d8107b4..0000000 --- a/configs/lua/autoformat.lua +++ /dev/null @@ -1,46 +0,0 @@ -require "format".setup { - ["*"] = { - {cmd = {"sed -i 's/[ \t]*$//'"}} -- remove trailing whitespace - }, - vim = { - { - cmd = {"luafmt -w replace"}, - start_pattern = "^lua << EOF$", - end_pattern = "^EOF$" - } - }, - vimwiki = { - { - cmd = {"prettier -w --parser babel"}, - start_pattern = "^{{{javascript$", - end_pattern = "^}}}$" - } - }, - lua = { - { - cmd = { - function(file) - return string.format("luafmt -l %s -w replace %s", vim.bo.textwidth, file) - end - } - } - }, - go = { - { - cmd = {"gofmt -w", "goimports -w"}, - tempfile_postfix = ".tmp" - } - }, - javascript = { - {cmd = {"prettier -w", "./node_modules/.bin/eslint --fix"}} - }, - markdown = { - {cmd = {"prettier -w"}}, - { - cmd = {"black"}, - start_pattern = "^```python$", - end_pattern = "^```$", - target = "current" - } - } -} diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index 16be235..e3aa88e 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -27,20 +27,10 @@ if u.has_plugin("cmp") then set tabstop=2 ]] - -- Debug indentations - if false then - vim.cmd [[ - set list - set listchars=eol:⏎,tab:->,trail:_,nbsp:⎵ - ]] - end - g.hidden = true --unload buffers when hidden g.filetype = true -- execute autocommands based on filetype o.autoread = true - o.lazyredraw = true - -- Search o.inccommand = 'nosplit' -- show substitutions incrementally o.ignorecase = true @@ -69,7 +59,7 @@ if u.has_plugin("cmp") then cmd [[command Format :lua vim.lsp.buf.formatting()]] cmd [[command FormatSync :lua vim.lsp.buf.formatting_sync()]] - + cmd [[set noshowmode]] --to get rid of thing like --INSERT-- cmd [[set noshowcmd]] --to get rid of display of last command cmd [[set shortmess+=F]] --to get rid of the file name displayed in the command line bar @@ -81,9 +71,11 @@ if u.has_plugin("cmp") then -- Enable Theming / Syntax o.syntax = "enable" o.termguicolors = true - cmd("colorscheme material") + cmd("colorscheme tokyonight") g.material_terminal_italics = 1 g.material_theme_style = "darker" + g.tokyonight_style = "night" + g.tokyonight_transparent_sidebar = true; -- Remove background color require("transparent").setup({enable = true}) @@ -151,7 +143,6 @@ if u.has_plugin("cmp") then g.wiki_link_extension = ".md" -- KeyBindings - g.mapleader = " " require "keymappings" require "nvim-tmux-navigation".setup { @@ -171,9 +162,8 @@ if u.has_plugin("cmp") then require "treesitter-conf" -- Autocompletion Setup - o.completeopt = "menuone,noselect,noinsert" - require "autocomplete" require "snippets" + require "cmp-conf" -- LSP Config require "lspinstaller-conf" @@ -198,13 +188,9 @@ if u.has_plugin("cmp") then } ) - -- Autocompletion Setup - o.completeopt = "menuone,noselect,noinsert" - require "autocomplete" - -- LSP Config require "lspinstaller-conf" - require "lsp-utils" + require "lsp-conf" else vim.cmd[[PackerSync]] diff --git a/configs/nvim/lua/autocommands.lua b/configs/nvim/lua/autocommands.lua index a4d965a..57ac743 100644 --- a/configs/nvim/lua/autocommands.lua +++ b/configs/nvim/lua/autocommands.lua @@ -1,11 +1,6 @@ local cmd = vim.cmd; cmd [[ - augroup auto_format - au! - au BufWritePre * FormatSync - augroup END - augroup highlight_yank au! au TextYankPost * silent! lua vim.highlight.on_yank { timeout = 150 } diff --git a/configs/nvim/lua/autocomplete.lua b/configs/nvim/lua/autocomplete.lua deleted file mode 100644 index 507ccbc..0000000 --- a/configs/nvim/lua/autocomplete.lua +++ /dev/null @@ -1,51 +0,0 @@ --- luasnip setup -local luasnip = require "luasnip" - -local cmp = require "cmp" - -cmp.setup { - completion = { - completeopt = "menu,menuone,noselect" - }, - preselect = "none", - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end - }, - mapping = { - [""] = cmp.mapping.complete(), - [""] = cmp.mapping.close(), - [""] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true - }, - [""] = function(fallback) - if vim.fn.pumvisible() == 1 then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") - elseif luasnip.expand_or_jumpable() then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-expand-or-jump", true, true, true), "") - else - fallback() - end - end, - [""] = function(fallback) - if vim.fn.pumvisible() == 1 then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("", true, true, true), "n") - elseif luasnip.jumpable(-1) then - vim.fn.feedkeys(vim.api.nvim_replace_termcodes("luasnip-jump-prev", true, true, true), "") - else - fallback() - end - end - }, - sources = { - {name = "nvim_lsp"}, - {name = "luasnip"}, - {name = "path"} - } -} - --- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers.. -local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities) diff --git a/configs/nvim/lua/cmp-conf.lua b/configs/nvim/lua/cmp-conf.lua new file mode 100644 index 0000000..a15ea71 --- /dev/null +++ b/configs/nvim/lua/cmp-conf.lua @@ -0,0 +1,92 @@ +-- luasnip setup +local luasnip = require "luasnip" +local lspkind = require "lspkind" +local cmp = require "cmp" +local cmp_autopairs = require('nvim-autopairs.completion.cmp') + +local has_words_before = function() + local line, col = unpack(vim.api.nvim_win_get_cursor(0)) + return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil +end + +cmp.setup { + formatting = { + format = lspkind.cmp_format({with_text = true, menu = ({ + buffer = "[Buffer]", + nvim_lsp = "[LSP]", + luasnip = "[LuaSnip]", + nvim_lua = "[Lua]", + latex_symbols = "[Latex]", + })}), + }, + completion = { + completeopt = "menu,menuone", + }, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end + }, + mapping = { + [''] = cmp.mapping.complete(), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() + else + fallback() + end + end, { "i", "s" }), + + [''] = cmp.mapping.confirm({ + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }), + + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + }, + sources = { + {name = "nvim_lsp"}, + {name = "luasnip"}, + {name = "path"}, + {name = "buffer"}, + {name = "calc"} + } +} + +-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline('/', { + sources = { + { name = 'buffer' } + } +}) + +-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). +cmp.setup.cmdline(':', { + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) +}) + + +-- The nvim-cmp almost supports LSP's capabilities so You should advertise it to LSP servers.. +-- Setup lspconfig. +local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()) +require'lspconfig'.html.setup { + capabilities = capabilities +} + +cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } })) diff --git a/configs/nvim/lua/formatter-conf.lua b/configs/nvim/lua/formatter-conf.lua new file mode 100644 index 0000000..4c6f44f --- /dev/null +++ b/configs/nvim/lua/formatter-conf.lua @@ -0,0 +1,8 @@ +local cmd = vim.cmd; + +cmd [[ + augroup auto_format + au! + au BufWritePre * FormatSync + augroup END +]] diff --git a/configs/nvim/lua/keymappings.lua b/configs/nvim/lua/keymappings.lua index 449e842..6614cc2 100644 --- a/configs/nvim/lua/keymappings.lua +++ b/configs/nvim/lua/keymappings.lua @@ -22,6 +22,7 @@ map("n", "c", "lua vim.lsp.buf.code_action()", options) map("n", "", ":Format", options) map("n", "[d", "lua vim.lsp.diagnostic.goto_prev()", options) map("n", "]d", "lua vim.lsp.diagnostic.goto_next()", options) +map("n", "t", ":TroubleToggle", remap) -- Navigate Buffers map("n", "", "h", options) @@ -33,8 +34,10 @@ map("n", "Y", "yy", options) map("n", "k", "{",options) map("n", "j", "}",options) -map("n", "", "move +1", options) -map("n", "", "move -2", options) +map("n", "", "move +1", options) +map("n", "", "move -2", options) +map("i", "", "move +1", options) +map("i", "", "move -2", options) -- Faster git merge map("n", "gd", ":Gvdiffsplit!", options) diff --git a/configs/nvim/lua/lsp-utils.lua b/configs/nvim/lua/lsp-conf.lua similarity index 70% rename from configs/nvim/lua/lsp-utils.lua rename to configs/nvim/lua/lsp-conf.lua index 1a836b8..e3d6ccf 100644 --- a/configs/nvim/lua/lsp-utils.lua +++ b/configs/nvim/lua/lsp-conf.lua @@ -1,42 +1,9 @@ -local nvim_lsp = require "lspconfig" +local lsp = require "lspconfig" local lsp_status = require("lsp-status") -local utils = require("utils") -- function to attach completion when setting up lsp -local function on_attach(client) - local function buf_set_keymap(...) - vim.api.nvim_buf_set_keymap(bufnr, ...) - end - local function buf_set_option(...) - vim.api.nvim_buf_set_option(bufnr, ...) - end - - buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") - - -- Mappings. - local opts = {noremap = true, silent = true} - - -- Set some keybinds conditional on server capabilities - if client.resolved_capabilities.document_formatting then - buf_set_keymap("n", "f", "lua vim.lsp.buf.formatting()", opts) - elseif client.resolved_capabilities.document_range_formatting then - buf_set_keymap("n", "f", "lua vim.lsp.buf.range_formatting()", opts) - end - - -- Set autocommands conditional on server_capabilities - if client.resolved_capabilities.document_highlight then - vim.api.nvim_exec( - [[ - augroup lsp_document_highlight - autocmd! * - autocmd CursorHold lua vim.lsp.buf.document_highlight() - autocmd CursorMoved lua vim.lsp.buf.clear_references() - autocmd CursorHold *.* :lua vim.lsp.diagnostic.show_line_diagnostics() - augroup END - ]], - false - ) - end +local function on_attach() + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") end local system_name = "" @@ -58,7 +25,7 @@ local runtime_path = vim.split(package.path, ";") table.insert(runtime_path, "lua/?.lua") table.insert(runtime_path, "lua/?/init.lua") -nvim_lsp.sumneko_lua.setup { +lsp.sumneko_lua.setup { on_attach = on_attach, capabilities = lsp_status.capabilities, cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, @@ -72,7 +39,7 @@ nvim_lsp.sumneko_lua.setup { }, diagnostics = { -- Get the language server to recognize the `vim` global - globals = {"vim"} + globals = {"vim", "bufnr", "use"} }, workspace = { -- Make the server aware of Neovim runtime files @@ -88,37 +55,36 @@ nvim_lsp.sumneko_lua.setup { -- Go Language Server -nvim_lsp.gopls.setup { +lsp.gopls.setup { on_attach = on_attach, capabilities = lsp_status.capabilities } -- Html Setup -nvim_lsp.html.setup { +lsp.html.setup { on_attach = on_attach, capabilities = lsp_status.capabilities, filetypes = {"html"} } -- Svelte Language Server - -nvim_lsp.svelte.setup { +lsp.svelte.setup { on_attach = on_attach, capabilities = lsp_status.capabilities } -- Typescript Language Server - local function organize_imports() - local params = { - command = "_typescript.organizeImports", - arguments = {vim.api.nvim_buf_get_name(0)}, - title = "" - } - vim.lsp.buf.execute_command(params) + local params = { + command = "_typescript.organizeImports", + arguments = {vim.api.nvim_buf_get_name(bufnr)}, + title = "" + } + + vim.lsp.buf_request_sync(bufnr, "workspace/executeCommand", params, 500) end -nvim_lsp.tsserver.setup { +lsp.tsserver.setup { on_attach = on_attach, capabilities = lsp_status.capabilities, commands = { @@ -129,17 +95,20 @@ nvim_lsp.tsserver.setup { } } +-- JSON ls setup +lsp.jsonls.setup { + on_attach = on_attach, + capabilities = lsp_status.capabilities +} + -- Setup diagnostics formaters and linters for non LSP provided files -nvim_lsp.diagnosticls.setup { +lsp.diagnosticls.setup { on_attach = on_attach, capabilities = lsp_status.capabilities, cmd = {"diagnostic-languageserver", "--stdio"}, filetypes = { - "lua", "sh", "markdown", - "json", - "jsonc", "yaml", "toml" }, diff --git a/configs/nvim/lua/overlays.lua b/configs/nvim/lua/overlays.lua index 27a1129..096a5ee 100644 --- a/configs/nvim/lua/overlays.lua +++ b/configs/nvim/lua/overlays.lua @@ -50,7 +50,7 @@ local nvimConfig = { cmd = "cd $HOME/.dotfiles && nvim configs/init.lua && cd -", direction = "float", - on_close = function(term) + on_close = function() Terminal:close() u.ReloadConfig() end diff --git a/configs/nvim/lua/plugins.lua b/configs/nvim/lua/plugins.lua index d0a8739..ef11324 100644 --- a/configs/nvim/lua/plugins.lua +++ b/configs/nvim/lua/plugins.lua @@ -12,7 +12,7 @@ return require("packer").startup(function() use "alexghergh/nvim-tmux-navigation" -- Theming Section - use "kaicataldo/material.vim" + use 'folke/tokyonight.nvim' use "xiyaowong/nvim-transparent" -- Layout Plugins @@ -39,22 +39,39 @@ return require("packer").startup(function() -- Obsidian / Roam like features -- use "lervag/wiki.vim" + -- Lsp Errors + use "folke/lsp-colors.nvim" + use "onsails/lspkind-nvim" + use { + "folke/trouble.nvim", + requires = "kyazdani42/nvim-web-devicons", + config = function() + require("trouble").setup { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + } + end + } + -- Syntax / Autocomplete use "neovim/nvim-lspconfig" use "hrsh7th/nvim-cmp" use "hrsh7th/cmp-nvim-lsp" use "hrsh7th/cmp-path" + use "hrsh7th/cmp-calc" use "hrsh7th/cmp-buffer" use "hrsh7th/cmp-cmdline" use "L3MON4D3/LuaSnip" use "saadparwaiz1/cmp_luasnip" use "rafamadriz/friendly-snippets" + use "beyondmarc/glsl.vim" + use "tpope/vim-commentary" use "williamboman/nvim-lsp-installer" use "nvim-lua/lsp-status.nvim" - use "L3MON4D3/LuaSnip" use "windwp/nvim-autopairs" use "neoclide/jsonc.vim" use { @@ -64,8 +81,8 @@ return require("packer").startup(function() -- Preview Markdown use "ellisonleao/glow.nvim" - - -- Autoformat + + -- Autoformat --use "sbdchd/neoformat" -- use "lukas-reineke/format.nvim" diff --git a/configs/nvim/lua/treesitter-conf.lua b/configs/nvim/lua/treesitter-conf.lua index c24ee00..999c261 100644 --- a/configs/nvim/lua/treesitter-conf.lua +++ b/configs/nvim/lua/treesitter-conf.lua @@ -1,4 +1,5 @@ local parser_configs = require("nvim-treesitter.parsers").get_parser_configs() + parser_configs.http = { install_info = { url = "https://github.com/NTBBloodbath/tree-sitter-http", @@ -6,7 +7,16 @@ local parser_configs = require("nvim-treesitter.parsers").get_parser_configs() branch = "main" } } + + parser_configs.glsl = { + filetype = "vert", + filetypes = {"vert","frag"} + } + require "nvim-treesitter.configs".setup { + indent = { + enable = true + }, ensure_installed = { "bash", "yaml", diff --git a/node_modules/.modules.yaml b/node_modules/.modules.yaml new file mode 100644 index 0000000..48c2340 --- /dev/null +++ b/node_modules/.modules.yaml @@ -0,0 +1,21 @@ +hoistPattern: + - '*' +hoistedDependencies: {} +included: + dependencies: true + devDependencies: true + optionalDependencies: true +layoutVersion: 5 +packageManager: pnpm@6.22.2 +pendingBuilds: [] +prunedAt: Wed, 17 Nov 2021 13:45:43 GMT +publicHoistPattern: + - '*types*' + - '*eslint*' + - '@prettier/plugin-*' + - '*prettier-plugin-*' +registries: + default: https://registry.npmjs.org/ +skipped: [] +storeDir: /home/jim/.pnpm-store/v3 +virtualStoreDir: .pnpm diff --git a/node_modules/.pnpm/lock.yaml b/node_modules/.pnpm/lock.yaml new file mode 100644 index 0000000..f212c3c --- /dev/null +++ b/node_modules/.pnpm/lock.yaml @@ -0,0 +1,15 @@ +lockfileVersion: 5.3 + +specifiers: + vite-plugin-fonts: ^0.2.2 + +devDependencies: + vite-plugin-fonts: 0.2.2 + +packages: + + /vite-plugin-fonts/0.2.2: + resolution: {integrity: sha512-fhzhsrTiuzlDjSO6g5sV5EVIIvbb8lmsaIY6eUTBM4lcF55x40UBpHrcyvNwIhQG211g0lu83XC7oZlkmvdkMA==} + peerDependencies: + vite: ^2.0.0 + dev: true diff --git a/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/README.md b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/README.md new file mode 100644 index 0000000..6e1a6f8 --- /dev/null +++ b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/README.md @@ -0,0 +1,113 @@ +# vite-plugin-fonts + +Webfont loader for vite + +### Install + +```sh +npm i --save-dev vite-plugin-fonts # yarn add -D vite-plugin-fonts +``` + +### Add it to vite.config.js + +```ts +// vite.config.js +import ViteFonts from 'vite-plugin-fonts' + +export default { + plugins: [ + ViteFonts({ + google: { + families: ['Source Sans Pro'] + }, + }) + ], +} +``` + + +## Options + +```ts +// vite.config.js +import ViteFonts from 'vite-plugin-fonts' + +export default { + plugins: [ + ViteFonts({ + // Typekit API + typekit: { + /** + * Typekit project id + */ + id: '', + + /** + * enable non-blocking renderer + * + * default: true + */ + defer: true + }, + + // Google Fonts API V2 + google: { + /** + * enable preconnect link injection + * + * default: true + */ + preconnect: false, + + /** + * values: auto, block, swap(default), fallback, optional + * default: 'swap' + */ + display: 'block', + + /** + * values: auto, block, swap(default), fallback, optional + * default: undefined + */ + text: 'ViteAwsom', + + + /** + * Fonts families lists + */ + families: [ + // families can be either strings (only regular 400 will be loaded) + 'Source Sans Pro', + + // or objects + { + /** + * Family name (required) + */ + name: 'Roboto', + + /** + * Family styles + */ + styles: 'ital,wght@0,400;1,200', + + /** + * enable non-blocking renderer + * + * default: true + */ + defer: true + } + ] + }, + }) + ], +} +``` + + +## Ressources + +- https://web.dev/optimize-webfont-loading/ +- https://csswizardry.com/2020/05/the-fastest-google-fonts/ +- _(unmaintained)_ https://www.npmjs.com/package/webfontloader \ No newline at end of file diff --git a/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.d.ts b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.d.ts new file mode 100644 index 0000000..8dda173 --- /dev/null +++ b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.d.ts @@ -0,0 +1,30 @@ +import { HtmlTagDescriptor } from 'vite'; + +declare type GoogleFontFamily = { + name: string; + styles?: string; + defer?: boolean; +}; +declare type GoogleFonts = { + families: (string | GoogleFontFamily)[]; + text?: string; + display?: 'auto' | 'block' | 'swap' | 'fallback' | 'optional'; + preconnect?: boolean; +}; + +declare type TypeKitFonts = { + id: string; + defer?: boolean; +}; + +declare type VitePluginFontsOptions = { + google?: GoogleFonts; + typekit?: TypeKitFonts; +}; +declare function VitePluginFonts(options?: VitePluginFontsOptions): { + name: string; + transformIndexHtml(): HtmlTagDescriptor[]; +}; + +export default VitePluginFonts; +export { VitePluginFonts as Plugin, VitePluginFontsOptions }; diff --git a/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.js b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.js new file mode 100644 index 0000000..9b658aa --- /dev/null +++ b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.js @@ -0,0 +1,138 @@ +"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/google-fonts.ts +var GoogleFontsBase = "https://fonts.googleapis.com/css2"; +function injectFonts({ + families, + text, + preconnect = true, + display = "swap" +}) { + const specs = []; + const deferedSpecs = []; + const tags = []; + if (!Array.isArray(families)) { + console.warn("Google font families is required"); + return tags; + } + if (families.length >= 0) { + for (const family of families) { + if (typeof family === "string") { + deferedSpecs.push(family); + continue; + } + if (!family) + continue; + const { + name, + styles, + defer = true + } = family; + if (!name) { + console.warn("A google font family name is missing"); + continue; + } + let spec = name; + if (typeof styles === "string") + spec += `:${styles}`; + if (defer) + deferedSpecs.push(spec); + else + specs.push(spec); + } + } + if (preconnect && specs.length + deferedSpecs.length > 0) { + tags.push({ + tag: "link", + attrs: { + rel: "preconnect", + href: "https://fonts.gstatic.com/", + crossorigin: true + } + }); + } + if (deferedSpecs.length > 0) { + let href = `${GoogleFontsBase}?family=${deferedSpecs.join("&family=")}`; + if (typeof display === "string" && display !== "auto") + href += `&display=${display}`; + if (typeof text === "string" && text.length > 0) + href += `&text=${text}`; + tags.push({ + tag: "link", + attrs: { + rel: "preload", + as: "style", + onload: "this.rel='stylesheet'", + href + } + }); + } + if (specs.length > 0) { + let href = `${GoogleFontsBase}?family=${specs.join("&family=")}`; + if (typeof display === "string" && display !== "auto") + href += `&display=${display}`; + if (typeof text === "string" && text.length > 0) + href += `&text=${text}`; + tags.push({ + tag: "link", + attrs: { + rel: "stylesheet", + href + } + }); + } + return tags; +} +var google_fonts_default = injectFonts; + +// src/typekit.ts +var TypekitFontBase = "https://use.typekit.net/"; +function injectFonts2({ + id, + defer = true +}) { + const tags = []; + if (typeof id !== "string") { + console.warn("A Typekit id is required"); + return tags; + } + if (defer) { + tags.push({ + tag: "link", + attrs: { + rel: "preload", + as: "style", + onload: "this.rel='stylesheet'", + href: `${TypekitFontBase}${id}.css` + } + }); + } else { + tags.push({ + tag: "link", + attrs: { + rel: "stylesheet", + href: `${TypekitFontBase}${id}.css` + } + }); + } + return tags; +} +var typekit_default = injectFonts2; + +// src/index.ts +function VitePluginFonts(options = {}) { + return { + name: "vite-plugin-fonts", + transformIndexHtml() { + const tags = []; + if (options.typekit) + tags.push(...typekit_default(options.typekit)); + if (options.google) + tags.push(...google_fonts_default(options.google)); + return tags; + } + }; +} +var src_default = VitePluginFonts; + + + +exports.Plugin = VitePluginFonts; exports.default = src_default; diff --git a/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.mjs b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.mjs new file mode 100644 index 0000000..2ca5c3f --- /dev/null +++ b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/dist/index.mjs @@ -0,0 +1,138 @@ +// src/google-fonts.ts +var GoogleFontsBase = "https://fonts.googleapis.com/css2"; +function injectFonts({ + families, + text, + preconnect = true, + display = "swap" +}) { + const specs = []; + const deferedSpecs = []; + const tags = []; + if (!Array.isArray(families)) { + console.warn("Google font families is required"); + return tags; + } + if (families.length >= 0) { + for (const family of families) { + if (typeof family === "string") { + deferedSpecs.push(family); + continue; + } + if (!family) + continue; + const { + name, + styles, + defer = true + } = family; + if (!name) { + console.warn("A google font family name is missing"); + continue; + } + let spec = name; + if (typeof styles === "string") + spec += `:${styles}`; + if (defer) + deferedSpecs.push(spec); + else + specs.push(spec); + } + } + if (preconnect && specs.length + deferedSpecs.length > 0) { + tags.push({ + tag: "link", + attrs: { + rel: "preconnect", + href: "https://fonts.gstatic.com/", + crossorigin: true + } + }); + } + if (deferedSpecs.length > 0) { + let href = `${GoogleFontsBase}?family=${deferedSpecs.join("&family=")}`; + if (typeof display === "string" && display !== "auto") + href += `&display=${display}`; + if (typeof text === "string" && text.length > 0) + href += `&text=${text}`; + tags.push({ + tag: "link", + attrs: { + rel: "preload", + as: "style", + onload: "this.rel='stylesheet'", + href + } + }); + } + if (specs.length > 0) { + let href = `${GoogleFontsBase}?family=${specs.join("&family=")}`; + if (typeof display === "string" && display !== "auto") + href += `&display=${display}`; + if (typeof text === "string" && text.length > 0) + href += `&text=${text}`; + tags.push({ + tag: "link", + attrs: { + rel: "stylesheet", + href + } + }); + } + return tags; +} +var google_fonts_default = injectFonts; + +// src/typekit.ts +var TypekitFontBase = "https://use.typekit.net/"; +function injectFonts2({ + id, + defer = true +}) { + const tags = []; + if (typeof id !== "string") { + console.warn("A Typekit id is required"); + return tags; + } + if (defer) { + tags.push({ + tag: "link", + attrs: { + rel: "preload", + as: "style", + onload: "this.rel='stylesheet'", + href: `${TypekitFontBase}${id}.css` + } + }); + } else { + tags.push({ + tag: "link", + attrs: { + rel: "stylesheet", + href: `${TypekitFontBase}${id}.css` + } + }); + } + return tags; +} +var typekit_default = injectFonts2; + +// src/index.ts +function VitePluginFonts(options = {}) { + return { + name: "vite-plugin-fonts", + transformIndexHtml() { + const tags = []; + if (options.typekit) + tags.push(...typekit_default(options.typekit)); + if (options.google) + tags.push(...google_fonts_default(options.google)); + return tags; + } + }; +} +var src_default = VitePluginFonts; +export { + VitePluginFonts as Plugin, + src_default as default +}; diff --git a/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/package.json b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/package.json new file mode 100644 index 0000000..92ad7e7 --- /dev/null +++ b/node_modules/.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts/package.json @@ -0,0 +1,34 @@ +{ + "name": "vite-plugin-fonts", + "version": "0.2.2", + "description": "Webfont loader for vite", + "author": "stafyniaksacha", + "repository": "stafyniaksacha/vite-plugin-fonts", + "license": "MIT", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "dev": "npm run build -- --watch", + "example:dev": "npm -C example run dev", + "example:build": "npm -C example run build", + "build": "tsup src/index.ts --dts --format cjs,esm", + "lint": "eslint --ext .ts ./src", + "lint:fix": "eslint --fix --ext .ts ./src" + }, + "peerDependencies": { + "vite": "^2.0.0" + }, + "devDependencies": { + "@antfu/eslint-config-ts": "^0.5.0", + "@typescript-eslint/eslint-plugin": "^4.17.0", + "eslint": "^7.22.0", + "eslint-plugin-eslint-comments": "^3.2.0", + "tsup": "^4.6.1", + "typescript": "^4.2.3", + "vite": "^2.0.5" + } +} diff --git a/node_modules/vite-plugin-fonts b/node_modules/vite-plugin-fonts new file mode 120000 index 0000000..cb60995 --- /dev/null +++ b/node_modules/vite-plugin-fonts @@ -0,0 +1 @@ +.pnpm/vite-plugin-fonts@0.2.2/node_modules/vite-plugin-fonts \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..fc57561 --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "devDependencies": { + "vite-plugin-fonts": "^0.2.2" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..f212c3c --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,15 @@ +lockfileVersion: 5.3 + +specifiers: + vite-plugin-fonts: ^0.2.2 + +devDependencies: + vite-plugin-fonts: 0.2.2 + +packages: + + /vite-plugin-fonts/0.2.2: + resolution: {integrity: sha512-fhzhsrTiuzlDjSO6g5sV5EVIIvbb8lmsaIY6eUTBM4lcF55x40UBpHrcyvNwIhQG211g0lu83XC7oZlkmvdkMA==} + peerDependencies: + vite: ^2.0.0 + dev: true