From fd5fdf70873ae19d1a681131faf268c7281026a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ali=20=F0=9F=9A=B6?= Date: Sun, 28 Nov 2021 01:56:15 +1100 Subject: [PATCH] Remove lvim Fix minor bugs in zshrc --- lvim/config.lua | 162 ------------------------------------------------ lvim/ignore | 0 zshrc.zsh | 19 ++++-- 3 files changed, 15 insertions(+), 166 deletions(-) delete mode 100644 lvim/config.lua delete mode 100644 lvim/ignore diff --git a/lvim/config.lua b/lvim/config.lua deleted file mode 100644 index 8f124ad..0000000 --- a/lvim/config.lua +++ /dev/null @@ -1,162 +0,0 @@ ---[[ -lvim is the global options object - -Linters should be -filled in as strings with either -a global executable or a path to -an executable -]] --- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT - --- general -lvim.log.level = "warn" -lvim.format_on_save = true -lvim.colorscheme = "onedarker" - --- keymappings [view all the defaults by pressing Lk] -lvim.leader = "space" --- add your own keymapping -lvim.keys.normal_mode[""] = ":w" --- unmap a default keymapping --- lvim.keys.normal_mode[""] = "" --- edit a default keymapping --- lvim.keys.normal_mode[""] = ":q" - --- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode. --- we use protected-mode (pcall) just in case the plugin wasn't loaded yet. --- local _, actions = pcall(require, "telescope.actions") --- lvim.builtin.telescope.defaults.mappings = { --- -- for input mode --- i = { --- [""] = actions.move_selection_next, --- [""] = actions.move_selection_previous, --- [""] = actions.cycle_history_next, --- [""] = actions.cycle_history_prev, --- }, --- -- for normal mode --- n = { --- [""] = actions.move_selection_next, --- [""] = actions.move_selection_previous, --- }, --- } - --- Use which-key to add extra bindings with the leader-key prefix --- lvim.builtin.which_key.mappings["P"] = { "Telescope projects", "Projects" } --- lvim.builtin.which_key.mappings["t"] = { --- name = "+Trouble", --- r = { "Trouble lsp_references", "References" }, --- f = { "Trouble lsp_definitions", "Definitions" }, --- d = { "Trouble lsp_document_diagnostics", "Diagnostics" }, --- q = { "Trouble quickfix", "QuickFix" }, --- l = { "Trouble loclist", "LocationList" }, --- w = { "Trouble lsp_workspace_diagnostics", "Diagnostics" }, --- } - --- TODO: User Config for predefined plugins --- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile -lvim.builtin.dashboard.active = true -lvim.builtin.terminal.active = true -lvim.builtin.nvimtree.setup.view.side = "left" -lvim.builtin.nvimtree.show_icons.git = 0 - --- if you don't want all the parsers change this to a table of the ones you want -lvim.builtin.treesitter.ensure_installed = { - "bash", - "c", - "javascript", - "json", - "lua", - "python", - "typescript", - "css", - "rust", - "java", - "yaml", -} - -lvim.builtin.treesitter.ignore_install = { "haskell" } -lvim.builtin.treesitter.highlight.enabled = true - --- generic LSP settings - --- ---@usage disable automatic installation of servers --- lvim.lsp.automatic_servers_installation = false - --- ---@usage Select which servers should be configured manually. Requires `:LvimCacheRest` to take effect. --- See the full default list `:lua print(vim.inspect(lvim.lsp.override))` --- vim.list_extend(lvim.lsp.override, { "pyright" }) - --- ---@usage setup a server -- see: https://www.lunarvim.org/languages/#overriding-the-default-configuration --- local opts = {} -- check the lspconfig documentation for a list of all possible options --- require("lvim.lsp.manager").setup("pylsp", opts) - --- you can set a custom on_attach function that will be used for all the language servers --- See --- lvim.lsp.on_attach_callback = function(client, bufnr) --- local function buf_set_option(...) --- vim.api.nvim_buf_set_option(bufnr, ...) --- end --- --Enable completion triggered by --- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc") --- end --- you can overwrite the null_ls setup table (useful for setting the root_dir function) --- lvim.lsp.null_ls.setup = { --- root_dir = require("lspconfig").util.root_pattern("Makefile", ".git", "node_modules"), --- } --- or if you need something more advanced --- lvim.lsp.null_ls.setup.root_dir = function(fname) --- if vim.bo.filetype == "javascript" then --- return require("lspconfig/util").root_pattern("Makefile", ".git", "node_modules")(fname) --- or require("lspconfig/util").path.dirname(fname) --- elseif vim.bo.filetype == "php" then --- return require("lspconfig/util").root_pattern("Makefile", ".git", "composer.json")(fname) or vim.fn.getcwd() --- else --- return require("lspconfig/util").root_pattern("Makefile", ".git")(fname) or require("lspconfig/util").path.dirname(fname) --- end --- end - --- -- set a formatter, this will override the language server formatting capabilities (if it exists) --- local formatters = require "lvim.lsp.null-ls.formatters" --- formatters.setup { --- { exe = "black", filetypes = { "python" } }, --- { exe = "isort", filetypes = { "python" } }, --- { --- exe = "prettier", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- args = { "--print-with", "100" }, --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "typescript", "typescriptreact" }, --- }, --- } - --- -- set additional linters --- local linters = require "lvim.lsp.null-ls.linters" --- linters.setup { --- { exe = "flake8", filetypes = { "python" } }, --- { --- exe = "shellcheck", --- ---@usage arguments to pass to the formatter --- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}` --- args = { "--severity", "warning" }, --- }, --- { --- exe = "codespell", --- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports. --- filetypes = { "javascript", "python" }, --- }, --- } - --- Additional Plugins --- lvim.plugins = { --- {"folke/tokyonight.nvim"}, --- { --- "folke/trouble.nvim", --- cmd = "TroubleToggle", --- }, --- } - --- Autocommands (https://neovim.io/doc/user/autocmd.html) --- lvim.autocommands.custom_groups = { --- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" }, --- } diff --git a/lvim/ignore b/lvim/ignore deleted file mode 100644 index e69de29..0000000 diff --git a/zshrc.zsh b/zshrc.zsh index 38c8781..9d62865 100644 --- a/zshrc.zsh +++ b/zshrc.zsh @@ -30,6 +30,7 @@ SPACESHIP_VI_MODE_INSERT=I SPACESHIP_VI_MODE_NORMAL=N SPACESHIP_VI_MODE_COLOR=black SPACESHIP_TIME_SHOW=true +SPACESHIP_PROMPT_ORDER=(time user dir host git node venv exec_time line_sep battery vi_mode jobs exit_code char) # HELPERs ################################################################################ @@ -131,7 +132,7 @@ activate_homebrew() { ################################################################################ install_cli_tools() { - brew_install_or_upgrade git fd ripgrep fzf htop gnupg tmux + brew_install_or_upgrade git fd ripgrep fzf htop jq gnupg tmux # Install fzf key bindings $(brew --prefix fzf)/install --key-bindings --completion --no-update-rc --no-bash --no-fish ln -s $MYZSH_INSTALLED_DIR/tmux.conf $HOME/.tmux.conf @@ -179,7 +180,7 @@ activate_antigen() { source $ANTIGEN_EXEC_DIRECTORY/antigen.zsh antigen use oh-my-zsh antigen bundle vi-mode - # antigen bundle key-bindings + antigen bundle key-bindings if [ $MACHINE_TYPE = "Mac" ] then antigen bundle macos @@ -289,6 +290,16 @@ uninstall_neovim() { rm -rf $HOME/.cache/nvim } +# Mac key repeat for vscode +################################################################################ + +fix_key_repeat_for_vscode() { + if [ $MACHINE_TYPE = Linux ] + then + defaults write com.microsoft.VSCode ApplePressAndHoldEnabled -bool false + fi +} + # KEY BINDINGS ################################################################################ @@ -376,10 +387,10 @@ update_auto_completions() { setopt nobeep activate_homebrew -activate_cli_tools -activate_asdf update_auto_completions # should be before antigen activate_antigen +activate_cli_tools +activate_asdf activate_base16_shell myzsh_keybindings