From 868cba50d9b640f63ee6346fc263e2b23626899d Mon Sep 17 00:00:00 2001 From: Trevor Vallender Date: Thu, 16 Nov 2023 19:50:07 +0000 Subject: [PATCH] Updates --- .bashrc | 7 +-- .config/git/config | 1 + .config/kitty/gruvbox_dark_soft.conf | 33 ++++++++++ .config/kitty/kitty.conf | 10 +++ .config/nvim/init.lua | 94 +++++++++++++++++++++++++++- .config/nvim/lazy-lock.json | 3 + .config/nvim/lua/tsv/remap.lua | 7 +++ .fzf.bash | 13 ++++ 8 files changed, 161 insertions(+), 7 deletions(-) create mode 100644 .config/kitty/gruvbox_dark_soft.conf create mode 100644 .config/kitty/kitty.conf create mode 100644 .fzf.bash diff --git a/.bashrc b/.bashrc index f0ad341..a134e96 100644 --- a/.bashrc +++ b/.bashrc @@ -36,11 +36,6 @@ PS1+=' $(__git_ps1 [$YELLOW%s$CLEAR]) \n' PS1+="➮ \[$BOLD\]" trap 'printf "\033[0m" >&2' DEBUG -if command -v fzf-share >/dev/null; then - source "$(fzf-share)/key-bindings.bash" - source "$(fzf-share)/completion.bash" -fi - # If not running interactively, don't do anything case $- in *i*) ;; @@ -105,3 +100,5 @@ if ! shopt -oq posix; then fi eval "$(~/.rbenv/bin/rbenv init - bash)" + +[ -f ~/.fzf.bash ] && source ~/.fzf.bash diff --git a/.config/git/config b/.config/git/config index d47f31a..a49f957 100644 --- a/.config/git/config +++ b/.config/git/config @@ -16,6 +16,7 @@ aap = !git add --intent-to-add . && git add --patch br = branch cb = clone --bare + cp = cherry-pick co = checkout cm = commit cma = commit --amend diff --git a/.config/kitty/gruvbox_dark_soft.conf b/.config/kitty/gruvbox_dark_soft.conf new file mode 100644 index 0000000..54e6ea5 --- /dev/null +++ b/.config/kitty/gruvbox_dark_soft.conf @@ -0,0 +1,33 @@ +## name: Gruvbox Dark Soft +## author: Pavel Pertsev +## license: MIT/X11 +## upstream: https://raw.githubusercontent.com/gruvbox-community/gruvbox-contrib/master/kitty/gruvbox-dark-soft.conf + + +selection_foreground #ebdbb2 +selection_background #d65d0e + +background #32302f +foreground #ebdbb2 + +color0 #3c3836 +color1 #cc241d +color2 #98971a +color3 #d79921 +color4 #458588 +color5 #b16286 +color6 #689d6a +color7 #a89984 +color8 #928374 +color9 #fb4934 +color10 #b8bb26 +color11 #fabd2f +color12 #83a598 +color13 #d3869b +color14 #8ec07c +color15 #fbf1c7 + +cursor #bdae93 +cursor_text_color #665c54 + +url_color #458588 diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf new file mode 100644 index 0000000..e66d7e9 --- /dev/null +++ b/.config/kitty/kitty.conf @@ -0,0 +1,10 @@ +font_family JetBrainsMono Nerd Font +italic_font Source Code Pro +bold_italic_font Source Code Pro +font_size 10.0 +include gruvbox_dark_soft.conf +background_opacity 0.95 +enable_audio_bell no +window_padding_width 10 +disable_ligatures cursor + diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 3e8ce2b..3624e5d 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -7,7 +7,7 @@ set.softtabstop = 2 set.expandtab = true set.number = true set.relativenumber = true -set.mouse='r' +--set.mouse='r' --- Plugins local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" @@ -54,6 +54,8 @@ require("lazy").setup({ "mfussenegger/nvim-dap", "rcarriga/nvim-dap-ui", "chaoren/vim-wordmotion", + "tpope/vim-fugitive", + "tpope/vim-surround", }) require("tsv.remap") @@ -66,6 +68,21 @@ require("gruvbox").setup({ }) vim.cmd([[colorscheme gruvbox]]) +local _border = "single" +vim.lsp.handlers["textDocument/hover"] = vim.lsp.with( + vim.lsp.handlers.hover, { + border = _border + } +) +vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with( + vim.lsp.handlers.signature_help, { + border = _border + } +) +vim.diagnostic.config{ + float={border=_border} +} + -- Improve terminal setup vim.api.nvim_command("autocmd TermOpen * startinsert") vim.api.nvim_command("autocmd TermOpen * setlocal nonumber norelativenumber") @@ -126,6 +143,79 @@ cmp.setup { }) } local capabilities = require('cmp_nvim_lsp').default_capabilities() +-- +--Enable (broadcasting) snippet capability for completion +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true -require"lspconfig".ruby_ls.setup{} +-- LSP servers +-- Stimulus +require'lspconfig'.stimulus_ls.setup{} +-- Ruby +require'lspconfig'.ruby_ls.setup{} +-- CSS +require'lspconfig'.cssls.setup { + capabilities = capabilities, +} +-- SQL +require'lspconfig'.sqlls.setup{} +-- JavaScript +require'lspconfig'.eslint.setup{} +-- HTML +require'lspconfig'.html.setup { + capabilities = capabilities, +} +-- JSON +require'lspconfig'.jsonls.setup { + capabilities = capabilities, +} +-- BASH +require'lspconfig'.bashls.setup{} +-- Cucumber +require'lspconfig'.cucumber_language_server.setup{} +-- Docker +require'lspconfig'.dockerls.setup{} +require'lspconfig'local dap, dapui = require("dap"), require("dapui") +dap.listeners.after.event_initialized["dapui_config"] = function() + dapui.open() +end +dap.listeners.before.event_terminated["dapui_config"] = function() + dapui.close() +end +dap.listeners.before.event_exited["dapui_config"] = function() + dapui.close() +end +require("dapui").setup() +dap.adapters.ruby = function(callback, config) + callback { + type = "server", + host = "127.0.0.1", + port = "${port}", + executable = { + command = "bundle", + args = { "exec", "rdbg", "-n", "--open", "--port", "${port}", + "-c", "--", "bundle", "exec", config.command, config.script, + }, + }, + } +end + +dap.configurations.ruby = { + { + type = "ruby", + name = "debug current file", + request = "attach", + localfs = true, + command = "ruby", + script = "${file}", + }, + { + type = "ruby", + name = "run current spec file", + request = "attach", + localfs = true, + command = "rspec", + script = "${file}", + }, +} diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 62ef837..0d35377 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -9,6 +9,7 @@ "mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" }, "nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" }, "nvim-dap": { "branch": "master", "commit": "9d81c11fd185a131f81841e64941859305f6c42d" }, + "nvim-dap-ruby": { "branch": "main", "commit": "fc15c7d50e557379e13f3a825bc58adcc7323cc3" }, "nvim-dap-ui": { "branch": "master", "commit": "34160a7ce6072ef332f350ae1d4a6a501daf0159" }, "nvim-lspconfig": { "branch": "master", "commit": "b0852218bc5fa6514a71a9da6d5cfa63a263c83d" }, "nvim-tree.lua": { "branch": "master", "commit": "a2aaf8b430c11af36b869cf1c0ad2f7c8ceeaf2c" }, @@ -16,6 +17,8 @@ "nvim-web-devicons": { "branch": "master", "commit": "47103b80c38c59f7a1b5408c232b92bf5d018651" }, "plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" }, "telescope.nvim": { "branch": "master", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" }, + "vim-fugitive": { "branch": "master", "commit": "46eaf8918b347906789df296143117774e827616" }, + "vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "vim-wordmotion": { "branch": "master", "commit": "81d9bd298376ab0dc465c85d55afa4cb8d5f47a1" }, "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } } \ No newline at end of file diff --git a/.config/nvim/lua/tsv/remap.lua b/.config/nvim/lua/tsv/remap.lua index 5f4a7ca..f77e55b 100644 --- a/.config/nvim/lua/tsv/remap.lua +++ b/.config/nvim/lua/tsv/remap.lua @@ -37,6 +37,13 @@ vim.keymap.set('n', 'tlq', vim.diagnostic.setloclist, {}) vim.keymap.set('n', 'P', vim.diagnostic.open_float, {}) vim.keymap.set('n', 'H', function() vim.lsp.buf.hover() end, opts) vim.keymap.set("n", "tlf", vim.lsp.buf.format) -- Format code +-- DAP +vim.keymap.set('n', 'db', require('dap').toggle_breakpoint) +vim.keymap.set('n', 'dc', require('dap').continue) +vim.keymap.set('n', 'di', require('dap').step_into) +vim.keymap.set('n', 'do', require('dap').step_over) +vim.keymap.set('n', 'dr', require('dap').repl.open) +vim.keymap.set('n', 'dx', require('dap').terminate) vim.keymap.set('n', 'e', vim.diagnostic.open_float) diff --git a/.fzf.bash b/.fzf.bash new file mode 100644 index 0000000..eb70831 --- /dev/null +++ b/.fzf.bash @@ -0,0 +1,13 @@ +# Setup fzf +# --------- +if [[ ! "$PATH" == */home/tsv/.fzf/bin* ]]; then + PATH="${PATH:+${PATH}:}/home/tsv/.fzf/bin" +fi + +# Auto-completion +# --------------- +source "/home/tsv/.fzf/shell/completion.bash" + +# Key bindings +# ------------ +source "/home/tsv/.fzf/shell/key-bindings.bash"