From: Georgios Atheridis Date: Wed, 28 Dec 2022 02:19:43 +0000 (+0000) Subject: Updated deprecation warnings. Support for multiple terminals X-Git-Url: https://git.atheridis.org/?a=commitdiff_plain;h=cd70192127e2a477ac4e7a809190595b6e03b163;p=configs%2Fneovim.git Updated deprecation warnings. Support for multiple terminals --- diff --git a/install.sh b/install.sh index 9dca5d3..d217df0 100755 --- a/install.sh +++ b/install.sh @@ -1,5 +1,15 @@ #!/bin/sh +install_dependencies() { + if [[ -f /bin/dnf ]] + then + echo "installing dependencies" + sudo dnf install g++ libstdc++ -y + else + echo "Cannot find dnf, please install g++ and libstdc++ using your package manager" + fi +} + check_nvim_directory() { if [ -d ~/.config/nvim ]; then uuid=$(cat /proc/sys/kernel/random/uuid) @@ -27,3 +37,4 @@ if [[ $version -eq 0 ]]; then elif [[ $version -eq 1 ]]; then version_no_lua fi +install_dependencies diff --git a/nvim/init.lua b/nvim/init.lua index 1639c06..639698e 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -17,7 +17,7 @@ require("nvim.colorizer") require("nvim.lualine") require("nvim.toggleterm") require("nvim.impatient") +require("nvim.ts-autotag") vim.cmd("highlight QuickScopePrimary guifg='#00ff00' gui=underline ctermfg=105 cterm=underline") vim.cmd("highlight QuickScopeSecondary guifg='#ff0000' gui=underline ctermfg=81 cterm=underline") - diff --git a/nvim/lua/nvim/keymaps.lua b/nvim/lua/nvim/keymaps.lua index 3bf231e..477edef 100644 --- a/nvim/lua/nvim/keymaps.lua +++ b/nvim/lua/nvim/keymaps.lua @@ -65,9 +65,15 @@ tnoremap("", "j") tnoremap("", "k") tnoremap("", "l") +nnoremap("", 'exe v:count1 . "ToggleTerm"') +inoremap("", 'exe v:count1 . "ToggleTerm"') + -- Telescope nnoremap( "f", "lua require'telescope.builtin'.find_files(require('telescope.themes').get_dropdown({ previewer = false }))" ) nnoremap("", "Telescope live_grep") + +-- Sane buffer delete +nnoremap("bd", ":Bdelete") diff --git a/nvim/lua/nvim/lsp/handlers.lua b/nvim/lua/nvim/lsp/handlers.lua index 53110e7..96d5881 100644 --- a/nvim/lua/nvim/lsp/handlers.lua +++ b/nvim/lua/nvim/lsp/handlers.lua @@ -46,7 +46,7 @@ end local function lsp_highlight_document(client) -- Set autocommands conditional on server_capabilities - if client.resolved_capabilities.document_highlight then + if client.server_capabilities.document_highlight then vim.api.nvim_exec( [[ augroup lsp_document_highlight @@ -81,8 +81,8 @@ local function lsp_keymaps(bufnr) ) vim.api.nvim_buf_set_keymap(bufnr, "n", "]d", 'lua vim.diagnostic.goto_next({ border = "rounded" })', opts) vim.api.nvim_buf_set_keymap(bufnr, "n", "q", "lua vim.diagnostic.setloclist()", opts) - vim.cmd([[ command! Format execute 'lua vim.lsp.buf.formatting()' ]]) - vim.cmd([[ + vim.cmd([[ command! Format execute 'lua vim.lsp.buf.format()' ]]) + vim.cmd([[ augroup FormatOnSave autocmd! autocmd BufWritePre * :Format @@ -92,7 +92,7 @@ end M.on_attach = function(client, bufnr) if client.name == "tsserver" or client.name == "sumneko_lua" then - client.resolved_capabilities.document_formatting = false + client.server_capabilities.document_formatting = false end lsp_keymaps(bufnr) lsp_highlight_document(client) @@ -105,6 +105,6 @@ if not status_ok then return end -M.capabilities = cmp_nvim_lsp.update_capabilities(capabilities) +M.capabilities = cmp_nvim_lsp.default_capabilities(capabilities) return M diff --git a/nvim/lua/nvim/nvim-ide.lua b/nvim/lua/nvim/nvim-ide.lua new file mode 100644 index 0000000..d2ccbb5 --- /dev/null +++ b/nvim/lua/nvim/nvim-ide.lua @@ -0,0 +1,2 @@ +require('ide').setup({ +}) diff --git a/nvim/lua/nvim/nvim-tree.lua b/nvim/lua/nvim/nvim-tree.lua index cf58272..d27f83d 100644 --- a/nvim/lua/nvim/nvim-tree.lua +++ b/nvim/lua/nvim/nvim-tree.lua @@ -26,7 +26,6 @@ require("nvim-tree").setup({ -- BEGIN_DEFAULT_OPTS view = { adaptive_size = false, width = 30, - height = 30, hide_root_folder = false, side = "left", preserve_window_proportions = false, diff --git a/nvim/lua/nvim/options.lua b/nvim/lua/nvim/options.lua index a88a855..a5c67c1 100644 --- a/nvim/lua/nvim/options.lua +++ b/nvim/lua/nvim/options.lua @@ -30,6 +30,7 @@ local options = { scrolloff = 8, sidescrolloff = 8, guifont = "monospace:h17", + mouse = "", } vim.opt.shortmess:append("c") @@ -45,9 +46,9 @@ vim.cmd([[ augroup END ]]) -vim.cmd([[ - augroup Format - autocmd! - autocmd BufWritePre *.html :normal mZgg=G`Z:delmarks Z - augroup END -]]) +-- vim.cmd([[ +-- augroup Format +-- autocmd! +-- autocmd BufWritePre *.html :normal mZgg=G`Z:delmarks Z +-- augroup END +-- ]]) diff --git a/nvim/lua/nvim/plugins.lua b/nvim/lua/nvim/plugins.lua index 6dccdf4..526189e 100644 --- a/nvim/lua/nvim/plugins.lua +++ b/nvim/lua/nvim/plugins.lua @@ -159,8 +159,10 @@ return packer.startup(function(use) -- NON LUA PLUGINS use("moll/vim-bbye") - use("mitsuhiko/vim-jinja") - -- + --[[ use("mitsuhiko/vim-jinja") ]] + --[[ use("theHamsta/tree-sitter-jinja2") ]] + --[[ use("tpope/vim-endwise") ]] + -- Surround use("tpope/vim-surround") @@ -169,6 +171,10 @@ return packer.startup(function(use) -- Fixing a bug with python indentation and treesitter use("Vimjas/vim-python-pep8-indent") + -- HTML Tag Completer + use("windwp/nvim-ts-autotag") + + --[[ use("ldelossa/nvim-ide") ]] -- PLUGINS END -- -- Automatically set up your configuration after cloning packer.nvim diff --git a/nvim/lua/nvim/ts-autotag.lua b/nvim/lua/nvim/ts-autotag.lua new file mode 100644 index 0000000..1bc7340 --- /dev/null +++ b/nvim/lua/nvim/ts-autotag.lua @@ -0,0 +1,19 @@ +-- enable html parser in htmldjango file +local import_parsers, parsers = pcall(require, 'nvim-treesitter.parsers') +if import_parsers then + local parsername = parsers.filetype_to_parsername + parsername.htmldjango = 'html' + parsername.htmljinja = 'html' +end + + +local import_tag, autotag = pcall(require, "nvim-ts-autotag") +if not import_tag then return end +autotag.setup({ + autotag = { + enable = true, + }, + filetypes = { + 'html', 'htmldjango', + }, +})