From 89ef9a303cce255540e3c7b8cc739bcd351f2544 Mon Sep 17 00:00:00 2001 From: Ian Mancini Date: Tue, 12 Oct 2021 12:52:56 -0300 Subject: [PATCH] Update editor configs --- filesets/base/emacs/.doom.d/config.el | 64 +++++----- filesets/base/emacs/.doom.d/init.el | 43 +++---- filesets/base/emacs/.doom.d/packages.el | 1 - filesets/base/environment/.aliasrc | 2 +- .../nvim/lua/plugins/formatter-nvim.lua | 48 +++++++- .../nvim/.config/nvim/lua/plugins/init.lua | 66 +++++----- .../nvim/.config/nvim/lua/plugins/lsp.lua | 116 ++++++++---------- .../nvim/lua/plugins/nvim-toggleterm.lua | 13 +- .../.config/nvim/lua/plugins/nvim-tree.lua | 63 +++++++--- .../nvim/lua/plugins/whitespace-vim.lua | 2 +- hooks/pre.sh | 2 +- 11 files changed, 242 insertions(+), 178 deletions(-) diff --git a/filesets/base/emacs/.doom.d/config.el b/filesets/base/emacs/.doom.d/config.el index ba4bbff..275a9c7 100644 --- a/filesets/base/emacs/.doom.d/config.el +++ b/filesets/base/emacs/.doom.d/config.el @@ -19,13 +19,13 @@ ;; ;; They all accept either a font-spec, font string ("Input Mono-12"), or xlfd ;; font string. You generally only need these two: -(setq doom-font (font-spec :family "{{typography.mono.font}}" :size {{typography.mono.size}})) +(setq doom-font (font-spec :family "Iosevka Nerd Font" :size 14)) ;; doom-variable-pitch-font (font-spec :family "sans" :size 13)) ;; There are two ways to load a theme. Both assume the theme is installed and ;; available. You can either set `doom-theme' or manually load a theme with the ;; `load-theme' function. This is the default: -(setq doom-theme '{{colors.emacs_colorscheme}}) +(setq doom-theme 'doom-one) (setq doom-themes-treemacs-theme "doom-colors") ;; If you use `org' and don't want your org files in the default location below, @@ -83,6 +83,8 @@ (directory-files-recursively directory org-agenda-file-regexp)) '("~/.org/work/" "~/.org/projects/" "~/.org/learning/" "~/.org/calendars" "~/.org/conferences/")))) + (setq org-roam-directory (file-truename "~/.org/roam")) + (org-roam-db-autosync-mode) ) (use-package! org-fancy-priorities @@ -98,36 +100,30 @@ :config (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))) -(use-package! org-ref - :after org - :config - (setq bibtex-completion-pdf-field 'file) - (defun my/org-ref-open-pdf-at-point () - "Open the pdf for bibtex key under point if it exists." - (interactive) - (let* ((results (org-ref-get-bibtex-key-and-file)) - (key (car results)) - (pdf-file (car (bibtex-completion-find-pdf key)))) - (if (file-exists-p pdf-file) - (find-file pdf-file) ; original in org-ref-help, - ; opens external viewer (org-open-file pdf-file) - (message "No PDF found for %s" key)))) - (setq org-ref-open-pdf-function 'find-file) - - (setq bibtex-file "~/.org/biblio.bib" - bibtex-completion-bibliography bibtex-file - reftex-default-bibliography bibtex-file - org-ref-default-bibliography (list bibtex-file) - org-ref-completion-library 'org-ref-ivy-cite - org-ref-bibliography-notes "~/.org/biblio-notes.org" - org-ref-pdf-directory "~/.org/biblio-pdfs/") - ) - -(use-package! org-roam - :after org - :config - (setq org-roam-db-location "/home/ianmethyst/.local/share/emacs/org-roam.db")) - +; (use-package! org-ref +; :after org +; :config +; (setq bibtex-completion-pdf-field 'file) +; (defun my/org-ref-open-pdf-at-point () +; "Open the pdf for bibtex key under point if it exists." +; (interactive) +; (let* ((results (org-ref-get-bibtex-key-and-file)) +; (key (car results)) +; (pdf-file (car (bibtex-completion-find-pdf key)))) +; (if (file-exists-p pdf-file) +; (find-file pdf-file) ; original in org-ref-help, +; ; opens external viewer (org-open-file pdf-file) +; (message "No PDF found for %s" key)))) +; (setq org-ref-open-pdf-function 'find-file) +; +; (setq bibtex-file "~/.org/biblio.bib" +; bibtex-completion-bibliography bibtex-file +; reftex-default-bibliography bibtex-file +; org-ref-default-bibliography (list bibtex-file) +; org-ref-completion-library 'org-ref-ivy-cite +; org-ref-bibliography-notes "~/.org/biblio-notes.org" +; org-ref-pdf-directory "~/.org/biblio-pdfs/") +; ) (setq deft-directory "~/.org" deft-recursive t) @@ -138,7 +134,7 @@ (setq-default delete-by-moving-to-trash t) ; Delete files to trash (defvar holiday-custom-holidays nil - "Custom holidays") + "Custom holidays.") (setq holiday-custom-holidays '((holiday-fixed 1 1 "AƱo nuevo") @@ -192,3 +188,5 @@ 'org-caldav-sync :after #'fix-birthdays-timestamps)) + +(setq +format-with-lsp nil) diff --git a/filesets/base/emacs/.doom.d/init.el b/filesets/base/emacs/.doom.d/init.el index 4945c40..14aa2bb 100644 --- a/filesets/base/emacs/.doom.d/init.el +++ b/filesets/base/emacs/.doom.d/init.el @@ -23,18 +23,19 @@ (company +childframe) ; the ultimate code completion backend ;;helm ; the *other* search engine for love and life ;;ido ; the other *other* search engine... - (ivy +fuzzy +prescient) ; a search engine for love and life + ;;(ivy +fuzzy +prescient) ; a search engine for love and life + (vertico +icons) :ui deft ; notational velocity for Emacs doom ; what makes DOOM look the way it does doom-dashboard ; a nifty splash screen for Emacs doom-quit ; DOOM quit-message prompts when you quit Emacs - ;;(emoji +unicode) ; šŸ™‚ + (emoji +unicode) ; šŸ™‚ fill-column ; a `fill-column' indicator hl-todo ; highlight TODO/FIXME/NOTE/DEPRECATED/HACK/REVIEW ;;hydra - ;;indent-guides ; highlighted indent columns + indent-guides ; highlighted indent columns ligatures ; ligatures and symbols to make your code pretty again ;;minimap ; show a map of the code on the side modeline ; snazzy, Atom-inspired modeline, plus API @@ -55,9 +56,9 @@ (evil +everywhere); come to the dark side, we have cookies file-templates ; auto-snippets for empty files fold ; (nigh) universal code folding - ;;(format +onsave) ; automated prettiness + (format +onsave) ; automated prettiness ;;god ; run Emacs commands without modifier keys - ;;lispy ; vim for lisp, for people who don't like vim + ;lispy ; vim for lisp, for people who don't like vim ;;multiple-cursors ; editing in many places at once ;;objed ; text object editing for the innocent ;;parinfer ; turn lisp into python, sort of @@ -74,8 +75,8 @@ :term eshell ; the elisp shell that works everywhere - ;;shell ; simple shell REPL for Emacs - ;;term ; basic terminal emulator for Emacs + ;;shell ; simple shell REPL for Emacs + ;;term ; basic terminal emulator for Emacs vterm ; the best terminal emulation in Emacs :checkers @@ -93,11 +94,11 @@ (eval +overlay) ; run code, run (also, repls) ;;gist ; interacting with github gists lookup ; navigate your code and its documentation - ;;lsp + lsp magit ; a git porcelain for Emacs ;;make ; run make tasks from Emacs - pass ; password manager for nerds - pdf ; pdf enhancements + pass ; password manager for nerds + pdf ; pdf enhancements ;;prodigy ; FIXME managing external services & code builders rgb ; creating color strings ;;taskrunner ; taskrunner for all your projects @@ -118,11 +119,11 @@ ;;coq ; proofs-as-programs ;;crystal ; ruby at the speed of c ;;csharp ; unity, .NET, and mono shenanigans - ;;data ; config/data formats + data ; config/data formats ;;(dart +flutter) ; paint ui and not much else ;;elixir ; erlang done right ;;elm ; care for a cup of TEA? - emacs-lisp ; drown in parentheses + emacs-lisp ; drown in parentheses ;;erlang ; an elegant language for a more civilized age ;;ess ; emacs speaks statistics ;;factor @@ -136,22 +137,22 @@ ;;idris ; a language you can depend on ;;json ; At least it ain't XML ;;(java +meghanada) ; the poster child for carpal tunnel syndrome - ;;javascript ; all(hope(abandon(ye(who(enter(here)))))) + (javascript +lsp) ; all(hope(abandon(ye(who(enter(here)))))) ;;julia ; a better, faster MATLAB ;;kotlin ; a better, slicker Java(Script) ;;latex ; writing papers in Emacs has never been so fun ;;lean ; for folks with too much to prove ;;ledger ; be audit you can be - ;;lua ; one-based indices? one-based indices - markdown ; writing docs for people to ignore + (lua +lsp) ; one-based indices? one-based indices + markdown ; writing docs for people to ignore ;;nim ; python + lisp at the speed of c ;;nix ; I hereby declare "nix geht mehr!" ;;ocaml ; an objective camel - (org +dragndrop +roam) ; organize your plain life in plain text - ;;php ; perl's insecure younger brother + (org +dragndrop +roam2) ; organize your plain life in plain text + (php +lsp) ; perl's insecure younger brother ;;plantuml ; diagrams for confusing people more ;;purescript ; javascript, but functional - ;;python ; beautiful is better than ugly + (python +lsp +pyright +poetry +pyenv) ; beautiful is better than ugly ;;qt ; the 'cutest' gui framework ever ;;racket ; a DSL for DSLs ;;raku ; the artist formerly known as perl6 @@ -161,13 +162,13 @@ ;;rust ; Fe2O3.unwrap().unwrap().unwrap().unwrap() ;;scala ; java, but good ;;(scheme +guile) ; a fully conniving family of lisps - ;;sh ; she sells {ba,z,fi}sh shells on the C xor + sh ; she sells {ba,z,fi}sh shells on the C xor ;;sml ;;solidity ; do you need a blockchain? No. ;;swift ; who asked for emoji variables? ;;terra ; Earth and Moon in alignment for performance. - ;;web ; the tubes - ;;yaml ; JSON, but readable + web ; the tubes + yaml ; JSON, but readable ;;zig ; C, but simpler :email diff --git a/filesets/base/emacs/.doom.d/packages.el b/filesets/base/emacs/.doom.d/packages.el index db0134e..98a7793 100644 --- a/filesets/base/emacs/.doom.d/packages.el +++ b/filesets/base/emacs/.doom.d/packages.el @@ -56,7 +56,6 @@ (package! org-fancy-priorities) (package! org-ref) (package! org-caldav) -(package! org-roam-server) (package! nyan-mode) diff --git a/filesets/base/environment/.aliasrc b/filesets/base/environment/.aliasrc index 05d1be4..918b817 100644 --- a/filesets/base/environment/.aliasrc +++ b/filesets/base/environment/.aliasrc @@ -5,7 +5,7 @@ command -v vim >/dev/null && alias vi="vi" vim="vim" vimdiff="vimdiff" command -v nvim >/dev/null && alias vi="nvim" vim="nvim" vimdiff="nvim -d" # neovim-remote -nvr_command="nvr -cc split --remote-wait +'set bufhidden=wipe'" +nvr_command="nvr --remote-wait +'set bufhidden=wipe'" command -v nvr >/dev/null && alias vi="$nvr_command" vim="$nvr_command" # Verbose diff --git a/filesets/base/nvim/.config/nvim/lua/plugins/formatter-nvim.lua b/filesets/base/nvim/.config/nvim/lua/plugins/formatter-nvim.lua index 7dfc260..474b4a4 100644 --- a/filesets/base/nvim/.config/nvim/lua/plugins/formatter-nvim.lua +++ b/filesets/base/nvim/.config/nvim/lua/plugins/formatter-nvim.lua @@ -1,7 +1,10 @@ local prettier = function() return { exe = "prettier", - args = {"--stdin-filepath", vim.api.nvim_buf_get_name(0), '--single-quote', '--no-semi'}, + args = { + "--stdin-filepath", vim.api.nvim_buf_get_name(0), '--single-quote', + '--no-semi' + }, stdin = true } end @@ -14,20 +17,59 @@ local black = function() } end +local clang_format = function() + return { + exe = "clang-format", + args = {"--assume-filename", vim.api.nvim_buf_get_name(0)}, + stdin = true, + cwd = vim.fn.expand('%:p:h') + } +end + +local gofmt = function() + return { + exe = "gofmt", + stdin = true + } +end + +local blade_formatter = function() + return { + exe = "blade-formatter", + args = {"--stdin"}, + stdin = true + } +end + +local lua_formatter = function() + return { + exe = "lua-format", + stdin = true + } +end + require('formatter').setup({ logging = false, filetype = { + c = {clang_format}, + blade = {blade_formatter}, + go = {gofmt}, + cpp = {clang_format}, javascript = {prettier}, javascriptreact = {prettier}, typescript = {prettier}, typescriptreact = {prettier}, - python = {black} + php = {prettier}, + css = {prettier}, + html = {prettier}, + python = {black}, + lua = {lua_formatter} } }) vim.api.nvim_exec([[ augroup FormatAutogroup autocmd! -autocmd BufWritePost *.js,*.ts,*.jsx,*.tsx,*.py FormatWrite +autocmd BufWritePost *.c,*.h,*.cpp,*.go,*.html,*.css,*.js,*.ts,*.jsx,*.tsx,*.py,*.blade.php,*.php,*.lua FormatWrite augroup END ]], true) diff --git a/filesets/base/nvim/.config/nvim/lua/plugins/init.lua b/filesets/base/nvim/.config/nvim/lua/plugins/init.lua index 3c84275..c950df8 100644 --- a/filesets/base/nvim/.config/nvim/lua/plugins/init.lua +++ b/filesets/base/nvim/.config/nvim/lua/plugins/init.lua @@ -1,22 +1,22 @@ ---@diagnostic disable: undefined-global - return require('packer').startup(function() use 'wbthomason/packer.nvim' - use {'ibhagwan/fzf-lua', + -- Fuzzy finder + use { + 'ibhagwan/fzf-lua', requires = { - 'vijaymarupudi/nvim-fzf', - 'kyazdani42/nvim-web-devicons' -- optional for icons + 'vijaymarupudi/nvim-fzf', 'kyazdani42/nvim-web-devicons' -- optional for icons }, config = [[require('plugins.fzf-lua')]] } + -- File explorer use { 'kevinhwang91/rnvimr', config = [[require('plugins.rnvimr')]] } - -- File explorer use { 'kyazdani42/nvim-tree.lua', config = [[require('plugins.nvim-tree')]] @@ -29,19 +29,21 @@ return require('packer').startup(function() } -- Langugage specific LSP plugins - use { 'tjdevries/nlua.nvim' } + use {'tjdevries/nlua.nvim'} + use {'jose-elias-alvarez/nvim-lsp-ts-utils'} -- Additional LSP plugins use { - 'glepnir/lspsaga.nvim', + 'tami5/lspsaga.nvim', + commit = '373bc031b39730cbfe492533c3acfac36007899a', config = [[require('plugins.lspsaga-nvim')]] } - use { 'folke/lsp-colors.nvim' } + use {'folke/lsp-colors.nvim'} -- Outline (LSP) -- use { 'simrat39/symbols-outline.nvim' } - use { 'stevearc/aerial.nvim' } + use {'stevearc/aerial.nvim'} -- Diagnostics use { @@ -73,8 +75,8 @@ return require('packer').startup(function() } -- Snippets - use { 'hrsh7th/vim-vsnip' } - use { 'hrsh7th/vim-vsnip-integ' } + use {'hrsh7th/vim-vsnip'} + use {'hrsh7th/vim-vsnip-integ'} -- Terminal use { @@ -85,14 +87,14 @@ return require('packer').startup(function() -- Git use { 'lewis6991/gitsigns.nvim', - requires = { 'nvim-lua/plenary.nvim' }, + requires = {'nvim-lua/plenary.nvim'}, config = [[require('plugins.gitsigns-nvim')]] } - use { 'tpope/vim-fugitive' } + use {'tpope/vim-fugitive'} use { 'kdheepak/lazygit.nvim', config = [[require('plugins.lazygit-nvim')]] - } + } -- Indent lines use { @@ -101,9 +103,12 @@ return require('packer').startup(function() } -- Handy stuff - use { 'ygm2/rooter.nvim' } - use { 'dhruvasagar/vim-table-mode' } - use { 'tpope/vim-eunuch' } + use { + 'ygm2/rooter.nvim', + config = function() vim.g.outermost_root = false end + } + use {'dhruvasagar/vim-table-mode'} + use {'tpope/vim-eunuch'} -- Statusline -- use { @@ -112,26 +117,29 @@ return require('packer').startup(function() -- } use { - 'hoob3rt/lualine.nvim', - requires = {'kyazdani42/nvim-web-devicons', opt = true}, - config = [[require('plugins.lualine')]] + 'hoob3rt/lualine.nvim', + requires = { + 'kyazdani42/nvim-web-devicons', + opt = true + }, + config = [[require('plugins.lualine')]] } -- Syntax plugins - use { 'euclidianAce/BetterLua.vim' } + use {'euclidianAce/BetterLua.vim'} -- Color highlighting - use { 'norcalli/nvim-colorizer.lua' } + use {'norcalli/nvim-colorizer.lua'} -- Colorschemes use { 'Th3Whit3Wolf/onebuddy', - requires = { {'tjdevries/colorbuddy.vim'} } + requires = {'tjdevries/colorbuddy.vim'} } - use { 'RRethy/nvim-base16' } - use { 'NTBBloodbath/doom-one.nvim' } - use { 'folke/tokyonight.nvim' } - use { 'marko-cerovac/material.nvim' } + use {'RRethy/nvim-base16'} + use {'NTBBloodbath/doom-one.nvim'} + use {'folke/tokyonight.nvim'} + use {'marko-cerovac/material.nvim'} -- Cursorline -- use { 'xiyaowong/nvim-cursorword' } @@ -147,5 +155,7 @@ return require('packer').startup(function() 'petobens/poet-v', config = [[require('plugins.poet-v')]] } -end) + -- Blade + use {'Eduruiz/vim-blade'} +end) diff --git a/filesets/base/nvim/.config/nvim/lua/plugins/lsp.lua b/filesets/base/nvim/.config/nvim/lua/plugins/lsp.lua index af1c518..99c572b 100644 --- a/filesets/base/nvim/.config/nvim/lua/plugins/lsp.lua +++ b/filesets/base/nvim/.config/nvim/lua/plugins/lsp.lua @@ -1,16 +1,19 @@ local lsp = require("lspconfig") local aerial = require("aerial") -vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( -vim.lsp.diagnostic.on_publish_diagnostics, { - signs = true, - virtual_text = true, - underline = true -}) +vim.lsp.handlers["textDocument/publishDiagnostics"] = + vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { + signs = true, + virtual_text = true, + underline = true + }) local noremap = function(lhs, rhs, mode) mode = mode or 'n' - local opts = { noremap=true, silent=true } + local opts = { + noremap = true, + silent = true + } vim.api.nvim_buf_set_keymap(0, mode, lhs, rhs, opts) end @@ -29,7 +32,7 @@ local set_lsp_config = function(client, bufnr) ['gi'] = 'lua vim.lsp.buf.implementation()', ['gh'] = 'Lspsaga lsp_finder', ['gh'] = 'Lspsaga lsp_finder', - ['ca'] = 'Lspsaga code_action', + ['ca'] = 'Lspsaga code_action', ['K'] = 'Lspsaga hover_doc', ['gs'] = 'Lspsaga signature_help', ['gr'] = 'Lspsaga rename', @@ -39,7 +42,7 @@ local set_lsp_config = function(client, bufnr) [']e'] = 'Lspsaga diagnostic_jump_prev', ['co'] = 'AerialToggle!', ['[['] = 'AerialPrevUp', - [']]'] = 'AerialNext', + [']]'] = 'AerialNext' } } @@ -50,12 +53,26 @@ local set_lsp_config = function(client, bufnr) end end - -- Lua require('nlua.lsp.nvim').setup(lsp, { - on_attach = set_lsp_config, + on_attach = set_lsp_config }) +-- C/C++ +lsp.clangd.setup { + on_attach = set_lsp_config +} + +-- Golang +lsp.gopls.setup { + on_attach = set_lsp_config +} + +-- PHP +lsp.phpactor.setup { + on_attach = set_lsp_config +} + -- Typescript lsp.tsserver.setup { on_attach = function(client, bufnr) @@ -65,48 +82,9 @@ lsp.tsserver.setup { } -- Python - -lsp.pyright.setup{ - on_attach = set_lsp_config - } - - --- lsp.pyls.setup{ --- on_attach = set_lsp_config, --- settings = { --- pyls = { --- plugins = { --- jedi_completion = {enabled = false}, --- jedi_definition = {enabled = false}, --- yapf = {enabled = false}, --- rope_completion = {enabled = false}, --- pylint = {enabled = false}, --- pyflakes = {enabled = false}, --- pydocstyle = {enabled = false}, --- preload = {enabled = false}, --- mccabe = {enabled = false}, --- jedi_symbols = {enabled = false}, --- jedi_references = {enabled = false}, --- }}}} - --- EFM - --- local function eslint_config_exists() --- local eslintrc = vim.fn.glob(".eslintrc*", 0, 1) --- --- if not vim.tbl_isempty(eslintrc) then --- return true --- end --- --- if vim.fn.filereadable("package.json") then --- if vim.fn.json_decode(vim.fn.readfile("package.json"))["eslintConfig"] then --- return true --- end --- end --- --- return false --- end - +lsp.pyright.setup { + on_attach = set_lsp_config +} local eslint = { lintCommand = "eslint_d -f unix --stdin --stdin-filename ${INPUT}", @@ -125,31 +103,37 @@ local flake8 = { local isort = { formatCommand = "isort --profile black -", - formatStdin = true, + formatStdin = true +} + +local phpstan = { + lintCommand = "./vendor/bin/phpstan analyze --error-format raw --no-progress" } lsp.efm.setup { init_options = { + hover = true, + documentSymbol = true, + codeAction = true, + completion = true, documentFormatting = true }, - filetypes = {"javascript", "typescript", "javascriptreact", "typescriptreact", "python" }, - on_attach = function(client, bufnr) - set_lsp_config(client, bufnr) - end, - root_dir = function() - -- if not eslint_config_exists() then - -- return nil - -- end - return vim.fn.getcwd() - end, + filetypes = { + "javascript", "typescript", "javascriptreact", "typescriptreact", + "python", "php", "blade" + }, + on_attach = function(client, bufnr) set_lsp_config(client, bufnr) end, + root_dir = function() return vim.fn.getcwd() end, settings = { - rootMarkers = {".eslintrc", ".eslintrc.js", ".git/", "pyproject.toml" }, + rootMarkers = {".eslintrc", ".eslintrc.js", ".git/", "pyproject.toml"}, languages = { javascript = {eslint}, javascriptreact = {eslint}, typescript = {eslint}, typescriptreact = {eslint}, - python = {flake8, isort} + python = {flake8, isort}, + php = {phpstan}, + blade = {phpstan} } } } diff --git a/filesets/base/nvim/.config/nvim/lua/plugins/nvim-toggleterm.lua b/filesets/base/nvim/.config/nvim/lua/plugins/nvim-toggleterm.lua index 5e0639c..65bce2a 100644 --- a/filesets/base/nvim/.config/nvim/lua/plugins/nvim-toggleterm.lua +++ b/filesets/base/nvim/.config/nvim/lua/plugins/nvim-toggleterm.lua @@ -1,6 +1,4 @@ -local utils = require('utils') - -require("toggleterm").setup{ +require("toggleterm").setup { open_mapping = [[]], hide_numbers = true, shade_terminals = true, @@ -10,12 +8,15 @@ require("toggleterm").setup{ close_on_exit = false, float_opts = { winblend = 0, - border = 'single', + border = 'single' } } function _G.set_terminal_keymaps() - utils.map('t', '', [[]]) + local opts = { + noremap = true + } + vim.api.nvim_buf_set_keymap(0, 't', '', [[]], opts) end -vim.cmd('autocmd! TermOpen term://*toggleterm#* lua set_terminal_keymaps()') +vim.cmd('autocmd! TermOpen term://(*toggleterm#* lua set_terminal_keymaps()') diff --git a/filesets/base/nvim/.config/nvim/lua/plugins/nvim-tree.lua b/filesets/base/nvim/.config/nvim/lua/plugins/nvim-tree.lua index 2f10c63..79b6ddc 100644 --- a/filesets/base/nvim/.config/nvim/lua/plugins/nvim-tree.lua +++ b/filesets/base/nvim/.config/nvim/lua/plugins/nvim-tree.lua @@ -3,31 +3,60 @@ utils.map('n', 'op', 'NvimTreeToggle') vim.g.nvim_tree_special_files = {} vim.g.nvim_tree_git_hl = 1 -vim.g.nvim_tree_follow = 1 vim.g.nvim_tree_show_icons = { git = 0, - folders = 1, + folders = 1, files = 1, - folder_arrows = 1, + folder_arrows = 1 } - vim.g.nvim_tree_icons = { default = 'ī˜’', git = { - unstaged = 'ļ‘—', - staged = 'ļ‘™', - unmerged = 'īœ§', - renamed = 'ļ‘š', - untracked = 'ļ„Ø', - deleted = 'ļ‘˜', - ignored = "" + unstaged = 'ļ‘—', + staged = 'ļ‘™', + unmerged = 'īœ§', + renamed = 'ļ‘š', + untracked = 'ļ„Ø', + deleted = 'ļ‘˜', + ignored = "" + } +} + +require'nvim-tree'.setup { + disable_netrw = true, + hijack_netrw = true, + open_on_setup = false, + ignore_ft_on_setup = {}, + update_to_buf_dir = { + enable = true, + auto_open = true + }, + auto_close = false, + open_on_tab = false, + hijack_cursor = false, + update_cwd = false, + update_focused_file = { + enable = false, + update_cwd = false, + ignore_list = {} + }, + system_open = { + cmd = nil, + args = {} }, + view = { + width = 30, + height = 30, + side = 'left', + auto_resize = false, + mappings = { + custom_only = false, + list = {} + } + } } -vim.api.nvim_exec( -[[ -au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif -]], -false -) +vim.api.nvim_exec([[ + au BufEnter,BufWinEnter,WinEnter,CmdwinEnter * if bufname('%') == "NvimTree" | set laststatus=0 | else | set laststatus=2 | endif + ]], false) diff --git a/filesets/base/nvim/.config/nvim/lua/plugins/whitespace-vim.lua b/filesets/base/nvim/.config/nvim/lua/plugins/whitespace-vim.lua index 3b55ac0..814d8c2 100644 --- a/filesets/base/nvim/.config/nvim/lua/plugins/whitespace-vim.lua +++ b/filesets/base/nvim/.config/nvim/lua/plugins/whitespace-vim.lua @@ -1,2 +1,2 @@ vim.g.highlight_whitespace = 0 -vim.g.strip_whitespace_on_save = 1 +vim.g.strip_whitespace_on_save = 0 diff --git a/hooks/pre.sh b/hooks/pre.sh index 81cecf0..7faaa31 100755 --- a/hooks/pre.sh +++ b/hooks/pre.sh @@ -22,7 +22,7 @@ done if [ -d "$HOME/.dotfiles" ]; then cd "$HOME/.dotfiles" for dir in $(find . -maxdepth 1 -type d -printf "%f\n" | grep -v '\.'); do - stow -D -d "$HOME/.dotfiles" -t "$HOME" "$dir" &> /dev/null + stow -D -d "$HOME/.dotfiles" -t "$HOME" "$dir" &> /dev/null || true done cd $OLDIR