From e5910e34777592a1ce36ba5ac9e7f9a7aab7f09c Mon Sep 17 00:00:00 2001 From: natto1784 Date: Fri, 4 Jun 2021 05:07:04 +0530 Subject: [PATCH] nvim: added nvim-tree-lua, Satori:changed wierguard config --- configs/nvim.nix | 3 ++- configs/nvim/init.lua | 24 +++++++++++++++++++++++- hosts/personal/satori/networking.nix | 6 +++--- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/configs/nvim.nix b/configs/nvim.nix index 6470aca..d56286f 100644 --- a/configs/nvim.nix +++ b/configs/nvim.nix @@ -18,8 +18,9 @@ nvim-lspconfig barbar-nvim nvim-web-devicons + vim-rooter vim-polyglot - coc-explorer + nvim-tree-lua (gruvbox.overrideAttrs (oa: { patches = [ ./nvim/gruvbox.patch ]; })) ]; }; diff --git a/configs/nvim/init.lua b/configs/nvim/init.lua index ccd29d4..20aee0e 100644 --- a/configs/nvim/init.lua +++ b/configs/nvim/init.lua @@ -125,12 +125,30 @@ bind('n', "", ":call v:lua.Repl()", {silent=true}) --PLUGINS CONFIG +--nvim-tree.lua + +vim.g.nvim_tree_auto_close = 1 +vim.g.nvim_tree_auto_ignore_ft = { "startify" } +vim.g.nvim_tree_follow = 1 +vim.g.nvim_tree_git_hl = 1 +vim.g.nvim_tree_highlight_opened_files = 1 +vim.g.nvim_tree_width_allow_resize = 1 +vim.g.nvim_tree_lsp_diagnostics = 1 +vim.g.nvim_tree_lsp_diagnostics = 1 +vim.g.nvim_tree_window_picker_exclude = { + ['buftype'] = { 'terminal' } +} +bind('n', "", ":NvimTreeToggle", {noremap=true, silent=true}) +--bind('n', "r", ":NvimTreeRefresh", {noremap=true, silent=true}) +--bind('n', "f", ":NvimTreeFindFile", {noremap=true, silent=true}) + --gruvbox vim.g.gruvbox_italic=1 vim.g.gruvbox_contrast_dark="hard" vim.g.gruvbox_contrast_light="hard" set("background=dark") comm("colorscheme gruvbox") + --floaterm vim.g.floaterm_keymap_toggle = '' vim.g.floaterm_keymap_next = '' @@ -142,19 +160,23 @@ vim.g.floaterm_width=1.0 vim.g.floaterm_height=0.3 vim.g.floaterm_shell="/usr/bin/env zsh" vim.g.floaterm_wintype = "split" + --closetag vim.g.closetag_filenames = "*.html,*.xhtml,*.phtml,*.js,*.erb,*.jsx" vim.g.closetag_xhtml_filenames = "*.xhtml,*.jsx,*.js,*.erb" vim.g.closetag_emptyTags_caseSensitive = 1 vim.g.closetag_shortcut = '>' + --nerdcommenter bind('n',"","NERDCommenterToggle", {noremap=true, silent=true}) bind('n',"","NERDCommenterSexy", {noremap=true, silent=true}) + --barbar bind('n', "", ":BufferPrevious", {silent=true, noremap=true}) bind('n', "", ":BufferNext", {silent=true, noremap=true}) bind('n', "", ":BufferMovePrevious", {silent=true, noremap=true}) bind('n', ">", ":BufferMoveNext", {silent=true, noremap=true}) +bind('n', "", ":BufferClose", {silent=true, noremap=true}) for i = 1,8,1 do bind('n', string.format("", i), string.format(":BufferGoto %d", i), {silent=true, noremap=true}) @@ -163,7 +185,7 @@ end --lsp and compe stuff i got from various places vim.api.nvim_buf_set_keymap(0, 'n', 'gD', 'lua vim.lsp.buf.declaration()', {silent=true, noremap=true}) vim.api.nvim_buf_set_keymap(0, 'n', 'gd', 'lua vim.lsp.buf.definition()', {silent=true, noremap=true}) -vim.api.nvim_buf_set_keymap(0, 'n', 'K', 'lua vim.lsp.buf.hover()', {silent=true, noremap=true}) +vim.api.nvim_buf_set_keymap(0, 'n', 'gk', 'lua vim.lsp.buf.hover()', {silent=true, noremap=true}) vim.api.nvim_buf_set_keymap(0, 'n', 'gi', 'lua vim.lsp.buf.implementation()', {silent=true, noremap=true}) vim.api.nvim_buf_set_keymap(0, 'n', 'gr', 'lua vim.lsp.buf.references()', {silent=true, noremap=true}) vim.api.nvim_buf_set_keymap(0, 'n', "f", "lua vim.lsp.buf.formatting()", {silent=true, noremap=true}) diff --git a/hosts/personal/satori/networking.nix b/hosts/personal/satori/networking.nix index 7b3c4f6..1f1f467 100644 --- a/hosts/personal/satori/networking.nix +++ b/hosts/personal/satori/networking.nix @@ -19,15 +19,15 @@ }; }; wireguard.interfaces.wg0 = { - ips = [ "100.0.0.3/32" ]; + ips = [ "10.55.0.3/32" ]; listenPort = 17840; privateKeyFile = "/var/secrets/wg"; peers = [ { #Oracle VM1 publicKey = "z0Y2VNEWcyVQVSqRHiwmiJ5/0MgSPM+HZfEcwIccSxM="; - allowedIPs = [ "100.0.0.0/24" ]; - endpoint = "140.238.230.155:17840"; + allowedIPs = [ "10.55.0.0/24" ]; + endpoint = "weirdnatto.in:17840"; persistentKeepalive = 25; } ];