diff options
| -rw-r--r-- | .bashrc | 23 | ||||
| -rw-r--r-- | .config/nvim/init.lua | 60 | ||||
| -rw-r--r-- | .fdignore | 9 | ||||
| -rwxr-xr-x | .local/bin/tmux-sessionizer | 15 | ||||
| -rw-r--r-- | .tmux.conf | 49 |
5 files changed, 110 insertions, 46 deletions
@@ -0,0 +1,23 @@ +sessionizer() { + DIR=$(fdfind --type d --strip-cwd-prefix -L -H | fzf) + SESSION_NAME="$DIR_$(date +%M%S)" + + if [ -n "$DIR" ] + then + if [ "$1" == "-cd" ] + then + cd $DIR + return + fi + tmux new-session -d -c "$DIR" -s "$SESSION_NAME" + if [ -n "$TMUX" ] + then + tmux switch -t "$SESSION_NAME" + else + tmux attach -t "$SESSION_NAME" + fi + fi +} + +bind '"\C-f": "sessionizer\n"' +bind '"\C-F": "sessionizer -cd\n"' diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 181c9de..ffb09a8 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -11,6 +11,7 @@ vim.opt.shiftwidth = 2 vim.opt.expandtab = true vim.opt.termguicolors = true vim.opt.splitbelow = true +vim.opt.scrolloff = 5 vim.opt.mouse = 'a' vim.api.nvim_set_option('clipboard','unnamedplus') vim.opt.ruler = false @@ -40,12 +41,11 @@ require('packer').startup(function(use) 'nvim-telescope/telescope.nvim', requires = { {'nvim-lua/plenary.nvim'} } } - use { - "nvim-telescope/telescope-file-browser.nvim", - requires = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" } - } + + use 'stevearc/oil.nvim' use 'akinsho/toggleterm.nvim' + use 'christoomey/vim-tmux-navigator' if install_plugins then require('packer').sync() @@ -56,13 +56,21 @@ if install_plugins then return end -require('indent_blankline').setup { - char = '▏', - show_trailing_blankline_indent = false, - show_first_indent_level = false, - show_current_context = false + +local oil = require('oil') +_G.oil = oil +oil.setup { + default_file_explorer = true, + columns = { + 'icon', + }, + view_options = { + show_hidden = true + } } +require('ibl').setup() + require('Comment').setup { padding = true, toggler = { @@ -117,7 +125,7 @@ cmp.setup.cmdline(':', { -- Set Up Lspconfig local lspconfig = require('lspconfig') local capabilities = require('cmp_nvim_lsp').default_capabilities() -servers = { 'pyright', 'ccls' } +servers = { 'pyright', 'ccls', 'gopls' } for _, lsp in pairs(servers) do lspconfig[lsp].setup { capabilities = capabilities @@ -126,7 +134,6 @@ end -- Set Up Telescope local actions = require('telescope.actions') -local fb_actions = require("telescope").extensions.file_browser.actions local telescope = require('telescope') telescope.setup({ pickers = { @@ -134,26 +141,13 @@ telescope.setup({ hidden = true } }, - extensions = { - file_browser = { - theme = "ivy", - hijack_netrw = true, - } - }, defaults = { layout_strategy = 'bottom_pane', layout_config = { height = 0.4 }, - - mappings = { - i = { - ["<A-a>"] = fb_actions.create, - }, - }, }, }) -telescope.load_extension "file_browser" -- Set Up ToggleTerm require('toggleterm').setup { @@ -173,20 +167,26 @@ vim.keymap.set('n', 'P', '<cmd>pu<cr>', { noremap = true }) vim.keymap.set('n', '<space><space>', '<cmd>Telescope find_files<cr>', { noremap = true }) vim.keymap.set('n', '<space>b', '<cmd>Telescope buffers<cr>', { noremap = true }) vim.keymap.set('n', '<space>f', '<cmd>Telescope live_grep<cr>', { noremap = true }) -vim.keymap.set('n', '<space>n', '<cmd>Telescope file_browser<cr>', { noremap = true }) -vim.keymap.set('n', 'cw', '<cmd>bdelete!<cr>', { noremap = true }) +vim.keymap.set('n', '<A-x>', '<cmd>close<cr>', { noremap = true }) +vim.keymap.set('n', '<A-q>', '<cmd>bdelete!<cr>', { noremap = true }) vim.keymap.set('t', '<Esc>', '<C-\\><C-n>', { noremap = true }) -vim.keymap.set('n', 'D', vim.lsp.buf.definition, { noremap = true }) -vim.keymap.set('n', 'F', vim.lsp.buf.declaration, { noremap = true }) +vim.keymap.set('n', '\\d', vim.lsp.buf.definition, { noremap = true }) +vim.keymap.set('n', '\\f', vim.lsp.buf.declaration, { noremap = true }) vim.keymap.set('n', 'K', vim.lsp.buf.hover, { noremap = true }) vim.keymap.set('n', '<A-y>', '<cmd>ToggleTerm<cr>', { noremap = true }) vim.keymap.set('t', '<A-y>', '<cmd>ToggleTerm<cr>', { noremap = true }) +vim.keymap.set('t', '<A-y>', '<cmd>ToggleTerm<cr>', { noremap = true }) + +vim.keymap.set('n', '<A-n>', '<cmd>bnext<cr>', { noremap = true }) +vim.keymap.set('n', '<A-p>', '<cmd>bprev<cr>', { noremap = true }) + +vim.keymap.set('n', '<A-a>', '<cmd>lua oil.toggle_float()<cr>', { noremap = true }) -- Splitting The Window -vim.api.nvim_set_keymap('n', '<C-x>|', ':vsplit<CR>', { noremap = true }) -vim.api.nvim_set_keymap('n', '<C-x>-', ':split<CR>', { noremap = true }) +vim.api.nvim_set_keymap('n', '<A-\\>', ':vsplit<CR>', { noremap = true }) +vim.api.nvim_set_keymap('n', '<A-->', ':split<CR>', { noremap = true }) diff --git a/.fdignore b/.fdignore new file mode 100644 index 0000000..44ba588 --- /dev/null +++ b/.fdignore @@ -0,0 +1,9 @@ +.git +cache +.cache +node_modules +.npm +site-packages +go/pkg +build +virtualenv diff --git a/.local/bin/tmux-sessionizer b/.local/bin/tmux-sessionizer new file mode 100755 index 0000000..8f1c263 --- /dev/null +++ b/.local/bin/tmux-sessionizer @@ -0,0 +1,15 @@ +#!/bin/bash + +DIR=$(fdfind --type d --strip-cwd-prefix -L -H | fzf) +SESSION_NAME="$DIR_$(date +%M%S)" + +if [ -n "$DIR" ] +then + tmux new-session -d -c "$DIR" -s "$SESSION_NAME" + if [ -n "$TMUX" ] + then + tmux switch -t "$SESSION_NAME" + else + tmux attach -t "$SESSION_NAME" + fi +fi @@ -1,34 +1,51 @@ -set -s escape-time 0 -set -g history-limit 50000 -set -g display-time 4000 +set -sg escape-time 20 +set -g history-limit 10000 + set -g status-interval 5 set -g default-terminal "screen-256color" set -g focus-events on -set -g @plugin 'o0th/tmux-nova' +set -g base-index 1 +set -g pane-base-index 1 +set-window-option -g pane-base-index 1 +set-option -g renumber-windows on + +set-option -g detach-on-destroy off -bind R source-file '/home/compromyse/.tmux.conf' +set -g @plugin 'christoomey/vim-tmux-navigator' +set -g @plugin 'tmux-plugins/tmux-yank' unbind C-b +unbind '"' +unbind % + set-option -g prefix C-x bind-key C-x send-prefix -bind | split-window -h -bind - split-window -v -unbind '"' -unbind % +bind -n M-h previous-window +bind -n M-l next-window -set -g mouse on -set-option -s set-clipboard off -bind-key -T copy-mode-vi MouseDragEnd1Pane send-keys -X copy-pipe-and-cancel "xclip -selection clipboard -i" +set-window-option -g mode-keys vi +bind-key -T copy-mode-vi v send-keys -X begin-selection -bind-key r command-prompt -I "#W" "rename-window '%%'" +bind | split-window -h -c "#{pane_current_path}" +bind - split-window -v -c "#{pane_current_path}" +bind-key r command-prompt -I "#W" "rename-window '%%'" bind-key b attach-session -c "#{pane_current_path}" - bind-key x kill-pane -set -g @nova-rows 0 -set -g @nova-pane "#I: #W" +unbind f +bind f split-pane "tmux-sessionizer" + +bg="#698DDA" + +set -g status-position "bottom" +set -g status-style bg=default,fg=default +set -g status-justify "centre" +set -g status-left " #[bg=${bg},fg=#ffffff] tmux " +set -g status-right "compromyse " +set -g window-status-format " #I:#W " +set -g window-status-current-format "#[bg=${bg},fg=#000000] #I:#W " run '~/.tmux/plugins/tpm/tpm' |
