diff --git a/nvim/m-housh/lua/user/mappings.lua b/nvim/m-housh/lua/user/mappings.lua index 2805931..dc571a0 100644 --- a/nvim/m-housh/lua/user/mappings.lua +++ b/nvim/m-housh/lua/user/mappings.lua @@ -53,7 +53,11 @@ vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()') keymap('n', 'f', ':Format', default_options) keymap('n', 'F', ':FormatWrite', default_options) --- Finds +-- Telescope keymaps +vim.keymap.set('n', 'ff', telescope.find_files, {}) +vim.keymap.set('n', 'fg', telescope.live_grep, {}) +vim.keymap.set('n', 'fb', telescope.buffers, {}) +vim.keymap.set('n', 'fh', telescope.help_tags, {}) -- Find espanso config files. keymap('n', 'fe', function() diff --git a/nvim/m-housh/lua/user/plugin/go.lua b/nvim/m-housh/lua/user/plugin/go.lua index 03feecb..95e2d4a 100644 --- a/nvim/m-housh/lua/user/plugin/go.lua +++ b/nvim/m-housh/lua/user/plugin/go.lua @@ -12,7 +12,7 @@ return { config = function() require("go").setup() end, - event = {"CmdlineEnter"}, + --event = {'BufReadPre', 'BufNewFile'}, ft = {"go", 'gomod'}, build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries } diff --git a/nvim/m-housh/lua/user/plugin/neo-tree.lua b/nvim/m-housh/lua/user/plugin/neo-tree.lua index b5b9b24..f2e74ac 100644 --- a/nvim/m-housh/lua/user/plugin/neo-tree.lua +++ b/nvim/m-housh/lua/user/plugin/neo-tree.lua @@ -12,7 +12,9 @@ return { enable_diagnostics = true, filesystem = { always_show = { - "plugins" + "plugins", + ".zshrc", + ".zshenv" }, filtered_items = { hide_dotfiles = false diff --git a/nvim/m-housh/lua/user/plugin/swift.lua b/nvim/m-housh/lua/user/plugin/swift.lua index b5265de..31cbd4d 100644 --- a/nvim/m-housh/lua/user/plugin/swift.lua +++ b/nvim/m-housh/lua/user/plugin/swift.lua @@ -3,7 +3,7 @@ return { dependencies = { 'akinsho/toggleterm.nvim' }, - event = { 'BufReadPre', 'BufNewFile' }, + ft = { 'swfit' }, config = function() require('swift').setup() local default_options = { noremap = true, silent = true } diff --git a/nvim/m-housh/lua/user/plugin/telescope.lua b/nvim/m-housh/lua/user/plugin/telescope.lua index 4cdd7b2..30acd3b 100644 --- a/nvim/m-housh/lua/user/plugin/telescope.lua +++ b/nvim/m-housh/lua/user/plugin/telescope.lua @@ -4,6 +4,7 @@ return { dependencies = { 'nvim-lua/plenary.nvim' }, + lazy = true, config = function() local actions = require('telescope.actions') @@ -67,12 +68,5 @@ return { buffer_previewer_maker = require'telescope.previewers'.buffer_previewer_maker } }) - - local builtin = require('telescope.builtin') - -- Telescope keymaps - vim.keymap.set('n', 'ff', builtin.find_files, {}) - vim.keymap.set('n', 'fg', builtin.live_grep, {}) - vim.keymap.set('n', 'fb', builtin.buffers, {}) - vim.keymap.set('n', 'fh', builtin.help_tags, {}) end } diff --git a/nvim/m-housh/lua/user/plugin/toggleterm.lua b/nvim/m-housh/lua/user/plugin/toggleterm.lua index cf901a1..6352495 100644 --- a/nvim/m-housh/lua/user/plugin/toggleterm.lua +++ b/nvim/m-housh/lua/user/plugin/toggleterm.lua @@ -1,6 +1,7 @@ return { 'akinsho/toggleterm.nvim', enable = true, + lazy = true, opts = { size = 20, open_mapping = [[]], diff --git a/tmux/tmux.conf b/tmux/tmux.conf index b616d56..59aea17 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -70,7 +70,6 @@ bind -n M-h previous-window bind -n M-L next-window bind C-l send-keys 'C-l' - bind-key -r f run-shell "tmux neww ~/.local/scripts/tmux-sessionator" bind-key -r C run-shell "tmux neww ~/.local/scripts/tmux-sessionator ~/.dotfiles" bind-key -r S run-shell -b "~/.config/tmux/plugins/tmux-fzf/scripts/session.sh switch" diff --git a/zsh/config/.zshrc b/zsh/config/.zshrc index 4224026..3bfb6d0 100644 --- a/zsh/config/.zshrc +++ b/zsh/config/.zshrc @@ -32,17 +32,6 @@ export LESSHISTFILE="-" #------------------------------ path ------------------------------ -path_append() { - declare arg - for arg in "$@"; do - test -d "$arg" || continue - PATH=${PATH//":$arg:"/:} - PATH=${PATH/#"$arg:"/} - PATH=${PATH/%":$arg"/} - export PATH="${PATH:+"$PATH:"}$arg" - done -} && export path_append - path_prepend() { declare arg for arg in "$@"; do @@ -76,12 +65,6 @@ path_prepend \ "$HOME/.local/bin" \ "$SCRIPTS" -fpath_prepend \ - "$(brew --prefix)/share/zsh/site-functions" \ - "$(brew --prefix)/share/zsh-completions" \ - "$ZDOTDIR/completions" \ - "$HOME/.local/completions" - #------------------------------ history ------------------------------ setopt appendhistory # append to history setopt sharehistory # share history across multiple sessions @@ -166,24 +149,22 @@ alias tss='~/.local/scripts/tmux-sessionator --choose' alias tls='tmux list-sessions' alias temp='cd $(mktemp -d)' alias vi='nvim' -alias n='unset VIMINIT && unset MYVIMRC && nvim' alias nvim='unset VIMINIT && unset MYVIMRC && nvim' alias nvim-mhoush='NVIM_APPNAME=m-housh && nvim' alias nvim-kickstart='NVIM_APPNAME=kickstart nvim' alias nvim-lazy='NVIM_APPNAME=lazy nvim' - -#------------------------------ functions ------------------------------ - -# Create a directory and move into it. -mkcd() { - local dir="$1" - mkdir -p "$dir" && cd "$dir" -} && export mkcd - #------------------------------ local configs ------------------------------ _source_if "$ZDOTDIR/.zshrc-local" -# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +#------------------------------ functions ------------------------------ +fpath_prepend \ + "$(brew --prefix)/share/zsh/site-functions" \ + "$(brew --prefix)/share/zsh-completions" \ + "$ZDOTDIR/completions" \ + "$HOME/.local/completions" \ + "$ZDOTDIR/functions" + +autoload -Uz $fpath[1]/*(.:t) + -#test -d "$HOME/.tea" && source <("$HOME/.tea/tea.xyz/v*/bin/tea" --magic=zsh --silent) diff --git a/zsh/config/functions/n b/zsh/config/functions/n new file mode 100755 index 0000000..9f852e9 --- /dev/null +++ b/zsh/config/functions/n @@ -0,0 +1,17 @@ +#!/usr/bin/env zsh + +# Open's neovim. +# +# If the argument passed in is a directory or not supplied, then +# open neovim with telescope find files opened. Otherwise open the +# file that is supplied. +# + +function n() { + [ -d "$1" ] || [ -z "$1" ] \ + && nvim -c ":Telescope find_files" \ + && return 0 + + nvim "$1" +} +