From 98d6570a08449834a2c19b19dacb6d61cbe43565 Mon Sep 17 00:00:00 2001 From: cmccay Date: Sat, 12 Nov 2022 15:19:55 -0600 Subject: [PATCH] lsp and nvim stuff --- alacritty/.config/alacritty/alacritty.config | 2 +- alacritty/.config/alacritty/alacritty.yml | 5 +- i3/.config/i3/config | 148 ------------- i3/.config/i3/scratchpads.conf | 17 -- i3/.config/i3/themes/current.conf | 20 -- i3/.config/i3/workspaces.conf | 45 ---- i3blocks/.config/i3blocks/config | 40 ---- i3status/.config/i3status/config | 53 ----- nvim/.config/nvim/ftplugin/python.lua | 11 + nvim/.config/nvim/init.lua | 15 ++ nvim/.config/nvim/lua/completion.lua | 57 +++++ nvim/.config/nvim/lua/keybindings.lua | 9 + nvim/.config/nvim/lua/lsp.lua | 59 +++++ nvim/.config/nvim/lua/plugins.lua | 36 ++- nvim/.config/nvim/lua/settings.lua | 6 +- nvim/.config/nvim/plugin/packer_compiled.lua | 219 +++++++++++++++++++ tmux/.config/tmux/statusline.conf | 15 +- tmux/.config/tmux/tmux.conf | 8 +- 18 files changed, 422 insertions(+), 343 deletions(-) delete mode 100644 i3/.config/i3/config delete mode 100644 i3/.config/i3/scratchpads.conf delete mode 100644 i3/.config/i3/themes/current.conf delete mode 100644 i3/.config/i3/workspaces.conf delete mode 100644 i3blocks/.config/i3blocks/config delete mode 100644 i3status/.config/i3status/config create mode 100644 nvim/.config/nvim/lua/completion.lua create mode 100644 nvim/.config/nvim/plugin/packer_compiled.lua diff --git a/alacritty/.config/alacritty/alacritty.config b/alacritty/.config/alacritty/alacritty.config index 31e0ce2..ad3e9b0 100644 --- a/alacritty/.config/alacritty/alacritty.config +++ b/alacritty/.config/alacritty/alacritty.config @@ -1 +1 @@ -background_opacity: 1.0 +background_opacity: 0.5 diff --git a/alacritty/.config/alacritty/alacritty.yml b/alacritty/.config/alacritty/alacritty.yml index 705396d..d2a8348 100644 --- a/alacritty/.config/alacritty/alacritty.yml +++ b/alacritty/.config/alacritty/alacritty.yml @@ -1,9 +1,10 @@ window: - opacity: 0.85 + opacity: 0.8 font: + size: 14 normal: - family: monospace + family: FiraMono Nerd Font style: Regular # Colors (Oxide) diff --git a/i3/.config/i3/config b/i3/.config/i3/config deleted file mode 100644 index 2aab87a..0000000 --- a/i3/.config/i3/config +++ /dev/null @@ -1,148 +0,0 @@ -###################################### -# Includes -###################################### - -include $HOME/.config/i3/workspaces.conf -include $HOME/.config/i3/scratchpads.conf -include $HOME/.config/i3/themes/current.conf - -###################################### -# Basic Set up -###################################### - -set $mod Mod4 -floating_modifier $mod -font pango:monospace 8 - -# Start XDG autostart .desktop files using dex. See also -# https://wiki.archlinux.org/index.php/XDG_Autostart -exec --no-startup-id dex --autostart --environment i3 - -# xss-lock grabs a logind suspend inhibit lock and will use i3lock to lock the -# screen before suspend. Use loginctl lock-session to lock your screen. -exec --no-startup-id xss-lock --transfer-sleep-lock -- i3lock --nofork - -# Use pactl to adjust volume in PulseAudio. -set $refresh_i3status killall -SIGUSR1 i3status -bindsym F11 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ +10% && $refresh_i3status -bindsym F10 exec --no-startup-id pactl set-sink-volume @DEFAULT_SINK@ -10% && $refresh_i3status -bindsym F9 exec --no-startup-id pactl set-sink-mute @DEFAULT_SINK@ toggle && $refresh_i3status - -# Fix monitor setup on bootup -exec ~/scripts/xrandr_dual_monitor.sh - -# turn picom on on start up -exec_always --no-startup-id picom & - -# turn off borders (required for i3-gaps) -for_window [class=".*"] border pixel 2 - -# gaps -gaps inner 12 - -# polybar -exec_always --no-startup-id $HOME/.config/polybar/launch.sh - -# set background on startup -set $wallpaper /home/clint/Pictures/wallpapers/_current_wallpaper.jpg -exec --no-startup-id feh --bg-fill $wallpaper - - -###################################### -# Key Bindings -###################################### - -# start a terminal -bindsym $mod+Return exec --no-startup-id alacritty - -# kill focused window -bindsym $mod+Shift+q kill -bindsym $mod+q kill - -# start dmenu (a program launcher) -bindsym $mod+d exec --no-startup-id rofi -show run - -# you can use the cursor keys: -bindsym $mod+Left focus left -bindsym $mod+Down focus down -bindsym $mod+Up focus up -bindsym $mod+Right focus right - -# you can use the cursor keys: -bindsym $mod+Shift+Left move left -bindsym $mod+Shift+Down move down -bindsym $mod+Shift+Up move up -bindsym $mod+Shift+Right move right - -# split in horizontal orientation -bindsym $mod+h split h - -# split in vertical orientation -bindsym $mod+v split v - -# enter fullscreen mode for the focused container -bindsym $mod+f fullscreen toggle - -# toggle tiling / floating -bindsym $mod+Shift+space floating toggle - -# change focus between tiling / floating windows -bindsym $mod+space focus mode_toggle - -# focus the parent container -bindsym $mod+a focus parent - -# lock screen -bindsym $mod+l exec ~/scripts/lock.sh - -# dmenu stuff -bindsym $mod+c exec ~/scripts/dmenu_configs.sh -bindsym $mod+p exec ~/scripts/dmenu_images.sh -bindsym $mod+x exec ~/scripts/dmenu_shutdown.sh - -# common programs -bindsym $mod+Shift+w exec firefox -bindsym $mod+Shift+p exec pycharm - -# reload the configuration file -bindsym $mod+Shift+c reload -# restart i3 inplace (preserves your layout/session, can be used to upgrade i3) -bindsym $mod+Shift+r restart -# exit i3 (logs you out of your X session) -bindsym $mod+Shift+e exec "i3-nagbar -t warning -m 'You pressed the exit shortcut. Do you really want to exit i3? This will end your X session.' -B 'Yes, exit i3' 'i3-msg exit'" - -# Volume controls -#bindsym F9 exec pactl set-sink-mute @DEFAULT_SINK@ toggle -#bindsym F11 exec pactl set-sink-volume 0 +10% -#bindsym F10 exec pactl set-sink-volume 0 -10% - -# set which programs open in which workspaces -# to find the class, run xprop in a terminal and click on a program -#assign [class="firefox"] $ws2 - -# these programs will float -for_window [class="kcalc"] floating enable - -###################################### -# Resizing Windows -###################################### - -bindsym $mod+r mode "resize" - -mode "resize" { - bindsym j resize shrink width 10 px or 10 ppt - bindsym k resize grow height 10 px or 10 ppt - bindsym l resize shrink height 10 px or 10 ppt - bindsym semicolon resize grow width 10 px or 10 ppt - - bindsym Left resize shrink width 10 px or 10 ppt - bindsym Down resize grow height 10 px or 10 ppt - bindsym Up resize shrink height 10 px or 10 ppt - bindsym Right resize grow width 10 px or 10 ppt - - # back to normal: Enter or Escape or $mod+r - bindsym Return mode "default" - bindsym Escape mode "default" - bindsym $mod+r mode "default" -} - diff --git a/i3/.config/i3/scratchpads.conf b/i3/.config/i3/scratchpads.conf deleted file mode 100644 index eb30699..0000000 --- a/i3/.config/i3/scratchpads.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Calculator -exec --no-startup-id kcalc -for_window [class="kcalc"] , move scratchpad -bindsym $mod+g [class="kcalc"] scratchpad show - -# Task Manager -exec_always --no-startup-id pgrep -f '^alacritty -t TaskManager --class taskman,taskman' || alacritty -t TaskManager --class taskman,taskman -e btm -for_window [class="taskman"] , move scratchpad -bindsym $mod+F1 [class="taskman"] scratchpad show - -# Pacman Updates - used in Polybar -for_window [class="update"] , move window to scratchpad, scratchpad show - -# Spotify -exec_always --no-startup-id pgrep -f '^alacritty -t Spotify --class spotify,spotify' || alacritty -t Spotify --class spotify,spotify -e spt -for_window [class="spotify"] , move scratchpad -bindsym $mod+m [class="spotify"] scratchpad show diff --git a/i3/.config/i3/themes/current.conf b/i3/.config/i3/themes/current.conf deleted file mode 100644 index 9b011f3..0000000 --- a/i3/.config/i3/themes/current.conf +++ /dev/null @@ -1,20 +0,0 @@ -# messin with colors -#set $bd-color #1de071 -#set $bd-indicator #d42069 - -set $bd-color #76b5c5 -set $bd-indicator #ffffff - -# colorclass border bg text indicator child_border -client.focused $bd-color #111111 #ffffff $bd-indicator $bd-color -client.focused_inactive $bd-color #111111 #ffffff #333333 #111111 -client.unfocused $bd-color #111111 #ffffff #333333 #333333 - -# bar color definitions -set $bar-text #ADF1D2 -set $bar-background #231c1c -set $bar-statusline #eeeeee -set $bar-separator #eeeeee -set $bar-focused_workspace #553555 - - diff --git a/i3/.config/i3/workspaces.conf b/i3/.config/i3/workspaces.conf deleted file mode 100644 index ed3807f..0000000 --- a/i3/.config/i3/workspaces.conf +++ /dev/null @@ -1,45 +0,0 @@ -# i3 workspace conf - -set $ws1 "1" -set $ws2 "2" -set $ws3 "3" -set $ws4 "4" -set $ws5 "5" -set $ws6 "6" -set $ws7 "7" -set $ws8 "8" -set $ws9 "9" -set $ws10 "0" - -# switch to workspace -bindsym $mod+1 workspace number $ws1 -bindsym $mod+2 workspace number $ws2 -bindsym $mod+3 workspace number $ws3 -bindsym $mod+4 workspace number $ws4 -bindsym $mod+5 workspace number $ws5 -bindsym $mod+6 workspace number $ws6 -bindsym $mod+7 workspace number $ws7 -bindsym $mod+8 workspace number $ws8 -bindsym $mod+9 workspace number $ws9 -bindsym $mod+0 workspace number $ws10 - -# move focused container to workspace -bindsym $mod+Shift+1 move container to workspace number $ws1 -bindsym $mod+Shift+2 move container to workspace number $ws2 -bindsym $mod+Shift+3 move container to workspace number $ws3 -bindsym $mod+Shift+4 move container to workspace number $ws4 -bindsym $mod+Shift+5 move container to workspace number $ws5 -bindsym $mod+Shift+6 move container to workspace number $ws6 -bindsym $mod+Shift+7 move container to workspace number $ws7 -bindsym $mod+Shift+8 move container to workspace number $ws8 -bindsym $mod+Shift+9 move container to workspace number $ws9 -bindsym $mod+Shift+0 move container to workspace number $ws10 - -# tryin some stuff, not sure if this is what i want -workspace $ws1 output HDMI-0 -workspace $ws2 output HDMI-1 -workspace $ws3 output HDMI-0 -workspace $ws4 output HDMI-1 - -# Programs default workspace -assign [class="firefox"] $ws2 diff --git a/i3blocks/.config/i3blocks/config b/i3blocks/.config/i3blocks/config deleted file mode 100644 index 844d591..0000000 --- a/i3blocks/.config/i3blocks/config +++ /dev/null @@ -1,40 +0,0 @@ -[pacman] -command=~/.scripts/i3_pacman.sh -interval=3600 - -[spotifyd] -command=ps aux | grep spotifyd | wc -l -interval=5 - -[finance] -command=~/.scripts/i3_finance.sh -interval=3000 -color=#00b7ff - -[cpu] -command=~/.scripts/i3_cpu.sh -interval=3600 -color=#A4C2F4 - -[mem] -command=~/.scripts/i3_mem.sh -interval=3600 -color=#A4C2F4 - -[ip] -command=~/.scripts/i3_ip.sh -interval=once -color=#91E78B - -[wifi] -command=~/.scripts/i3_wifi.sh -interval=3600 - -[weather] -command=~/.scripts/i3_weather.sh -interval=3600 -color=#C9E42E - -[time] -command=~/.scripts/i3_cal.sh -interval=5 diff --git a/i3status/.config/i3status/config b/i3status/.config/i3status/config deleted file mode 100644 index cf185ec..0000000 --- a/i3status/.config/i3status/config +++ /dev/null @@ -1,53 +0,0 @@ -# i3status configuration file. -# see "man i3status" for documentation. - -# It is important that this file is edited as UTF-8. -# The following line should contain a sharp s: -# ß -# If the above line is not correctly displayed, fix your editor first! - -general { - colors = false - interval = 5 -} - -#order += "ipv6" -order += "wireless _first_" -#order += "ethernet _first_" -#order += "battery all" -#order += "disk /" -#order += "load" -order += "memory" -order += "tztime local" - -wireless _first_ { - format_up = "W:%quality at %essid %ip" - format_down = "W: down" -} - -ethernet _first_ { - format_up = "E: %ip (%speed)" - format_down = "E: down" -} - -battery all { - format = "%status %percentage %remaining" -} - -disk "/" { - format = "%avail" -} - -load { - format = "%1min" -} - -memory { - format = "%used | %available" - threshold_degraded = "1G" - format_degraded = "MEMORY < %available" -} - -tztime local { - format = "%A %b %d, %Y %I:%M:%S%p " - diff --git a/nvim/.config/nvim/ftplugin/python.lua b/nvim/.config/nvim/ftplugin/python.lua index d461f16..0a6e796 100644 --- a/nvim/.config/nvim/ftplugin/python.lua +++ b/nvim/.config/nvim/ftplugin/python.lua @@ -2,6 +2,7 @@ local keymap = vim.api.nvim_set_keymap local default_ops = { noremap = true, silent = true } local settings = vim.opt +vim.g.mapleader = '\\' -- Set up settings.colorcolumn = "80" @@ -12,3 +13,13 @@ keymap('n', '', ":w:exec '!clear;python' shellescape(@%, 1)", defaul -- Handy stuff keymap('n', 'm', 'iif __name__ == "__main__":omain()o', default_ops) -- keymap('n', 'f', 'idef ():bi', default_ops) + +-- Comment/Uncomment +keymap('n', '\\', '0i# ', default_ops) +keymap('n', '-', '0xx', default_ops) +keymap('v', '\\', 'kI# ', default_ops) +keymap('v', '-', 'klx', default_ops) + +-- Indenting +keymap('v', '<', '', '>gv', default_ops) diff --git a/nvim/.config/nvim/init.lua b/nvim/.config/nvim/init.lua index e9834bd..3aaa95f 100644 --- a/nvim/.config/nvim/init.lua +++ b/nvim/.config/nvim/init.lua @@ -3,3 +3,18 @@ require("keybindings") require("settings") require("colorscheme") require("lsp") + +-- todo: move this to plugins.lua +require("telescope").setup{ + defaults = { + prompt_prefix = "$ ", + mappings = { + i = { + ["C-a"] = function() print("asdf") end + } + } + } +} + +require("telescope").load_extension("fzf") +require("telescope").load_extension("file_browser") diff --git a/nvim/.config/nvim/lua/completion.lua b/nvim/.config/nvim/lua/completion.lua new file mode 100644 index 0000000..cd04840 --- /dev/null +++ b/nvim/.config/nvim/lua/completion.lua @@ -0,0 +1,57 @@ +local cmp = require'cmp' +local capabilities = require('cmp_nvim_lsp').default_capabilities() + + cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + }, { + { name = 'buffer' }, + }) + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) + diff --git a/nvim/.config/nvim/lua/keybindings.lua b/nvim/.config/nvim/lua/keybindings.lua index 231e95e..d1dee0d 100644 --- a/nvim/.config/nvim/lua/keybindings.lua +++ b/nvim/.config/nvim/lua/keybindings.lua @@ -1,3 +1,7 @@ +-- Generic Keybindings for all files +-- +-- + local keymap = vim.api.nvim_set_keymap local default_ops = { noremap = true, silent = true } @@ -20,3 +24,8 @@ keymap('n', '', 'za', default_ops) -- NERDTree stuff keymap('n', '', ':NERDTreeToggle', default_ops) +-- Telescope stuff +keymap('n', 'ff', ':Telescope find_files hidden=true', default_ops) +keymap('n', 'gf', ':Telescope git_files', default_ops) +keymap('n', 'lg', ':Telescope live_grep', default_ops) +keymap('n', 'd', ':Telescope diagnostics', default_ops) diff --git a/nvim/.config/nvim/lua/lsp.lua b/nvim/.config/nvim/lua/lsp.lua index 2c9dbc9..c58146f 100644 --- a/nvim/.config/nvim/lua/lsp.lua +++ b/nvim/.config/nvim/lua/lsp.lua @@ -1,7 +1,66 @@ +local cmp = require'cmp' +local capabilities = require('cmp_nvim_lsp').default_capabilities() + require'lspconfig'.jedi_language_server.setup{ on_attach = function() vim.keymap.set("n", "K", vim.lsp.buf.hover, {buffer=0}) vim.keymap.set("n", "gd", vim.lsp.buf.definition, {buffer=0}) + vim.keymap.set("n", "r", vim.lsp.buf.rename, {buffer=0}) end } + + cmp.setup({ + snippet = { + -- REQUIRED - you must specify a snippet engine + expand = function(args) + vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. + require('luasnip').lsp_expand(args.body) -- For `luasnip` users. + end, + }, + window = { + -- completion = cmp.config.window.bordered(), + -- documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete(), + [''] = cmp.mapping.abort(), + [''] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + sources = cmp.config.sources({ + { name = 'nvim_lsp' }, + { name = 'luasnip' }, -- For luasnip users. + }, { + { name = 'buffer' }, + }) + }) + + -- Set configuration for specific filetype. + cmp.setup.filetype('gitcommit', { + sources = cmp.config.sources({ + { name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it. + }, { + { name = 'buffer' }, + }) + }) + + -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline({ '/', '?' }, { + mapping = cmp.mapping.preset.cmdline(), + sources = { + { name = 'buffer' } + } + }) + + -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). + cmp.setup.cmdline(':', { + mapping = cmp.mapping.preset.cmdline(), + sources = cmp.config.sources({ + { name = 'path' } + }, { + { name = 'cmdline' } + }) + }) + diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua index a2eac90..1f0997d 100644 --- a/nvim/.config/nvim/lua/plugins.lua +++ b/nvim/.config/nvim/lua/plugins.lua @@ -18,6 +18,10 @@ return require('packer').startup(function(use) -- airline use('vim-airline/vim-airline') + use('vim-airline/vim-airline-themes') + + -- Git + use('tpope/vim-fugitive') -- NerdTree stuff use('preservim/nerdtree') @@ -28,23 +32,35 @@ return require('packer').startup(function(use) use('ervandew/supertab') -- Auto-Complete - use('ncm2/ncm2') - use('roxma/nvim-yarp') - -- enable ncm2 for all buffers - -- autocmd BufEnter * call ncm2#enable_for_buffer() - -- IMPORTANT: :help Ncm2PopupOpen for more information - -- set completeopt=noinsert,menuone,noselect - use('ncm2/ncm2-bufword') -- Basic completion - use('ncm2/ncm2-path') -- Path completion - use('ncm2/ncm2-jedi') -- Python completion +-- use('ncm2/ncm2') +-- use('roxma/nvim-yarp') +-- -- enable ncm2 for all buffers +-- -- autocmd BufEnter * call ncm2#enable_for_buffer() +-- -- IMPORTANT: :help Ncm2PopupOpen for more information +-- -- set completeopt=noinsert,menuone,noselect +-- use('ncm2/ncm2-bufword') -- Basic completion +-- use('ncm2/ncm2-path') -- Path completion +-- use('ncm2/ncm2-jedi') -- Python completion + -- better auto complete maybe + use('hrsh7th/cmp-nvim-lsp') + use('hrsh7th/cmp-nvim-lua') + use('hrsh7th/cmp-buffer') + use('hrsh7th/cmp-path') + use('hrsh7th/nvim-cmp') + use('saadparwaiz1/cmp_luasnip') -- Slime, for tmux repl-ing use('jpalardy/vim-slime') -- Telescope, fuzzy finding use('nvim-lua/plenary.nvim') use('nvim-telescope/telescope.nvim') + use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' } + use( "nvim-telescope/telescope-file-browser.nvim") -- Treesitter - use('nvim-treesitter/nvim-treesitter') + -- use('nvim-treesitter/nvim-treesitter') + + -- Devicons + use('kyazdani42/nvim-web-devicons') end) diff --git a/nvim/.config/nvim/lua/settings.lua b/nvim/.config/nvim/lua/settings.lua index c9480a0..e526e2d 100644 --- a/nvim/.config/nvim/lua/settings.lua +++ b/nvim/.config/nvim/lua/settings.lua @@ -14,7 +14,7 @@ settings.shiftwidth = 4 settings.softtabstop = 4 settings.autoindent = true settings.smartindent = true -settings.colorcolumn = "80" +-- settings.colorcolumn = "80" -- Folding settings.foldmethod = "indent" @@ -27,3 +27,7 @@ vim.g.slime_default_config = { socket_name = vim.api.nvim_eval('get(split($TMUX, ","), 0)'), target_pane = '{bottom}', } + +-- Airline +vim.g.airline_powerline_fonts = 1 +vim.g.airline_extensions_tabline_enabled = 1 diff --git a/nvim/.config/nvim/plugin/packer_compiled.lua b/nvim/.config/nvim/plugin/packer_compiled.lua new file mode 100644 index 0000000..4e107fa --- /dev/null +++ b/nvim/.config/nvim/plugin/packer_compiled.lua @@ -0,0 +1,219 @@ +-- Automatically generated packer.nvim plugin loader code + +if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then + vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"') + return +end + +vim.api.nvim_command('packadd packer.nvim') + +local no_errors, error_msg = pcall(function() + +_G._packer = _G._packer or {} +_G._packer.inside_compile = true + +local time +local profile_info +local should_profile = false +if should_profile then + local hrtime = vim.loop.hrtime + profile_info = {} + time = function(chunk, start) + if start then + profile_info[chunk] = hrtime() + else + profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6 + end + end +else + time = function(chunk, start) end +end + +local function save_profiles(threshold) + local sorted_times = {} + for chunk_name, time_taken in pairs(profile_info) do + sorted_times[#sorted_times + 1] = {chunk_name, time_taken} + end + table.sort(sorted_times, function(a, b) return a[2] > b[2] end) + local results = {} + for i, elem in ipairs(sorted_times) do + if not threshold or threshold and elem[2] > threshold then + results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms' + end + end + if threshold then + table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)') + end + + _G._packer.profile_output = results +end + +time([[Luarocks path setup]], true) +local package_path_str = "/Users/clintmccay/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/clintmccay/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/clintmccay/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/clintmccay/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua" +local install_cpath_pattern = "/Users/clintmccay/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so" +if not string.find(package.path, package_path_str, 1, true) then + package.path = package.path .. ';' .. package_path_str +end + +if not string.find(package.cpath, install_cpath_pattern, 1, true) then + package.cpath = package.cpath .. ';' .. install_cpath_pattern +end + +time([[Luarocks path setup]], false) +time([[try_loadstring definition]], true) +local function try_loadstring(s, component, name) + local success, result = pcall(loadstring(s), name, _G.packer_plugins[name]) + if not success then + vim.schedule(function() + vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {}) + end) + end + return result +end + +time([[try_loadstring definition]], false) +time([[Defining packer_plugins]], true) +_G.packer_plugins = { + ["ayu-vim"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/ayu-vim", + url = "https://github.com/ayu-theme/ayu-vim" + }, + gruvbox = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/gruvbox", + url = "https://github.com/morhetz/gruvbox" + }, + minimalist = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/minimalist", + url = "https://github.com/dikiaap/minimalist" + }, + ncm2 = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/ncm2", + url = "https://github.com/ncm2/ncm2" + }, + ["ncm2-bufword"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/ncm2-bufword", + url = "https://github.com/ncm2/ncm2-bufword" + }, + ["ncm2-jedi"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/ncm2-jedi", + url = "https://github.com/ncm2/ncm2-jedi" + }, + ["ncm2-path"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/ncm2-path", + url = "https://github.com/ncm2/ncm2-path" + }, + nerdtree = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/nerdtree", + url = "https://github.com/preservim/nerdtree" + }, + ["nerdtree-git-plugin"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/nerdtree-git-plugin", + url = "https://github.com/Xuyuanp/nerdtree-git-plugin" + }, + ["nvim-lspconfig"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", + url = "https://github.com/neovim/nvim-lspconfig" + }, + ["nvim-web-devicons"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/nvim-web-devicons", + url = "https://github.com/kyazdani42/nvim-web-devicons" + }, + ["nvim-yarp"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/nvim-yarp", + url = "https://github.com/roxma/nvim-yarp" + }, + ["packer.nvim"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/packer.nvim", + url = "https://github.com/wbthomason/packer.nvim" + }, + ["plenary.nvim"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/plenary.nvim", + url = "https://github.com/nvim-lua/plenary.nvim" + }, + supertab = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/supertab", + url = "https://github.com/ervandew/supertab" + }, + ["telescope-file-browser.nvim"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/telescope-file-browser.nvim", + url = "https://github.com/nvim-telescope/telescope-file-browser.nvim" + }, + ["telescope-fzf-native.nvim"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/telescope-fzf-native.nvim", + url = "https://github.com/nvim-telescope/telescope-fzf-native.nvim" + }, + ["telescope.nvim"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/telescope.nvim", + url = "https://github.com/nvim-telescope/telescope.nvim" + }, + ["tender.vim"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/tender.vim", + url = "https://github.com/jacoborus/tender.vim" + }, + ["vim-airline"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/vim-airline", + url = "https://github.com/vim-airline/vim-airline" + }, + ["vim-desert-warm-256"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/vim-desert-warm-256", + url = "https://github.com/rainux/vim-desert-warm-256" + }, + ["vim-deus"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/vim-deus", + url = "https://github.com/ajmwagar/vim-deus" + }, + ["vim-devicons"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/vim-devicons", + url = "https://github.com/ryanoasis/vim-devicons" + }, + ["vim-railscasts-theme"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/vim-railscasts-theme", + url = "https://github.com/jpo/vim-railscasts-theme" + }, + ["vim-slime"] = { + loaded = true, + path = "/Users/clintmccay/.local/share/nvim/site/pack/packer/start/vim-slime", + url = "https://github.com/jpalardy/vim-slime" + } +} + +time([[Defining packer_plugins]], false) + +_G._packer.inside_compile = false +if _G._packer.needs_bufread == true then + vim.cmd("doautocmd BufRead") +end +_G._packer.needs_bufread = false + +if should_profile then save_profiles() end + +end) + +if not no_errors then + error_msg = error_msg:gsub('"', '\\"') + vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None') +end diff --git a/tmux/.config/tmux/statusline.conf b/tmux/.config/tmux/statusline.conf index 6f7361e..66d457b 100644 --- a/tmux/.config/tmux/statusline.conf +++ b/tmux/.config/tmux/statusline.conf @@ -1,17 +1,22 @@ # general +# set -g default-terminal "screen-256color" # left status -set-window-option -g status-left " #S " -set-window-option -g status-left-style "fg=green bg=black" +set-window-option -g status-left " (( #S )) " +set-window-option -g status-left-style "fg=blue bg=black" +set-window-option -g status-left-length 30 # right status set-window-option -g status-right " %I:%M%p %d-%b-%y " -set-window-option -g status-right-style "fg=green bg=black" +set-window-option -g status-right-style "fg=blue bg=black" -# ianctive windows +# inactive windows set-window-option -g window-status-format " #I: #W " # active windows set-window-option -g window-status-current-format " #I: #W " -set-window-option -g window-status-current-style "bg=black fg=green bright" +set-window-option -g window-status-current-style "bg=black fg=blue bright" + +# main bg color +set -g status-bg blue diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index 0fdc97c..a374901 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -5,6 +5,9 @@ unbind C-b set-option -g prefix '`' bind-key '`' send-prefix +# mouse scrolling +setw -g mouse on + # 0 is too far from Ctrl-a. set -g base-index 1 @@ -21,7 +24,7 @@ unbind '"' unbind % # reload config file (change file location to your the tmux.conf you want to use) -bind r source-file ~/.tmux.conf\; display ' Reloaded tmux config.' +bind r source-file ~/.config/tmux/tmux.conf\; display ' Reloaded tmux config.' # switch panes using Alt-arrow without prefix bind -n M-Left select-pane -L @@ -33,4 +36,7 @@ bind -n M-Down select-pane -D bind-key -n S-Left previous-window bind-key -n S-Right next-window +# Faster Esc +set-option -sg escape-time 10 + source ~/.config/tmux/statusline.conf