Compare commits

..

3 Commits

Author SHA1 Message Date
Tiago Garcia 76ebe215a2
Setup update
Signed-off-by: TiagoRG <tiago.rgarcia@ua.pt>
2024-03-05 12:17:36 +00:00
Tiago Garcia cb2151e6fd
Update README.md 2024-03-05 11:27:31 +00:00
Tiago Garcia 92b3495f2a
Add setup script
Signed-off-by: TiagoRG <tiago.rgarcia@ua.pt>
2024-03-05 11:19:49 +00:00
16 changed files with 75 additions and 54 deletions

View File

@ -21,5 +21,5 @@ require("nvim-tree").setup({
}, },
}) })
vim.api.nvim_set_keymap('n', '<C-t>', ':NvimTreeToggle<CR>', { noremap = true, silent = true }) vim.keymap.set({'n', 'i'}, '<C-t>', '<cmd>NvimTreeToggle<CR>', { noremap = true, silent = true })
vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeFocus<CR>") vim.keymap.set("n", "<leader>e", "<cmd>NvimTreeFocus<CR>")

View File

@ -1,9 +1,9 @@
require 'nvim-treesitter.configs'.setup { require 'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed) -- A list of parser names, or "all" (the five listed parsers should always be installed)
-- ensure_installed = { "bash", "lua", "vim", "vimdoc", "query", "regex", ensure_installed = { "bash", "lua", "vim", "vimdoc", "query", "regex",
-- "c", "cpp", "c_sharp", "rust", "python", "c", "cpp", "c_sharp", "rust", "python",
-- "html", "css", "php", "javascript", "typescript", "sql" "html", "css", "php", "javascript", "typescript", "sql"
-- }, },
-- Install parsers synchronously (only applied to `ensure_installed`) -- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false, sync_install = false,
@ -25,7 +25,7 @@ require 'nvim-treesitter.configs'.setup {
rainbow = { rainbow = {
enable = true, enable = true,
-- list of languages you want to disable the plugin for -- list of languages you want to disable the plugin for
disable = { 'jsx' }, disable = { 'jsx', 'cpp' },
-- Which query to use for finding delimiters -- Which query to use for finding delimiters
query = 'rainbow-parens', query = 'rainbow-parens',
-- Highlight the entire buffer all at once -- Highlight the entire buffer all at once

View File

@ -1,7 +1,7 @@
require("trouble").setup { require("trouble").setup {
position = "bottom", position = "bottom",
auto_open = true, auto_open = true,
auto_close = false, auto_close = true,
auto_preview = false, auto_preview = false,
icons = true, icons = true,
} }

View File

@ -1 +1 @@
monokai-pro vscode

View File

@ -2,7 +2,7 @@ local function trim(str)
return str:gsub("^%s*(.-)%s*$", "%1") return str:gsub("^%s*(.-)%s*$", "%1")
end end
function ColorMyPencils() function LoadColors()
local color = nil local color = nil
local file = io.open("/home/tiagorg/.config/nvim/data/colorscheme.txt", "r") local file = io.open("/home/tiagorg/.config/nvim/data/colorscheme.txt", "r")
@ -24,10 +24,6 @@ function ColorMyPencils()
end end
vim.cmd.colorscheme(color) vim.cmd.colorscheme(color)
--vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
--vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end end
-- Define a function to be called when the colorscheme changes -- Define a function to be called when the colorscheme changes
@ -41,7 +37,12 @@ function OnColorschemeChanged()
file:write(newColorscheme) file:write(newColorscheme)
end end
ColorMyPencils() LoadColors()
-- Set up an autocmd to trigger the function when the colorscheme changes -- Set up an autocmd to trigger the function when the colorscheme changes
vim.cmd([[autocmd ColorScheme * lua OnColorschemeChanged()]]) vim.cmd([[autocmd ColorScheme * lua OnColorschemeChanged()]])
vim.api.nvim_create_user_command("TransparentBackground", function(opts)
vim.api.nvim_set_hl(0, "Normal", { bg = "none" })
vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" })
end, {})

View File

@ -1,6 +1,6 @@
require("tiagorg.set") require("tiagorg.set")
require("tiagorg.remap") require("tiagorg.remap")
require('tiagorg.colors')
require('Comment').setup() require('Comment').setup()
require("liveshare").setup()
require("nvim-surround").setup() require("nvim-surround").setup()

View File

@ -83,4 +83,5 @@ return require('packer').startup(function(use)
"nvim-telescope/telescope.nvim" "nvim-telescope/telescope.nvim"
} }
} }
use 'mfussenegger/nvim-jdtls'
end) end)

View File

@ -154,11 +154,6 @@ _G.packer_plugins = {
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim", path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
url = "https://github.com/lukas-reineke/indent-blankline.nvim" url = "https://github.com/lukas-reineke/indent-blankline.nvim"
}, },
["liveshare.nvim"] = {
loaded = true,
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/liveshare.nvim",
url = "https://github.com/TiagoRG/liveshare.nvim"
},
["lsp-zero.nvim"] = { ["lsp-zero.nvim"] = {
loaded = true, loaded = true,
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim", path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim",
@ -194,6 +189,11 @@ _G.packer_plugins = {
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-cmp", path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-cmp",
url = "https://github.com/hrsh7th/nvim-cmp" url = "https://github.com/hrsh7th/nvim-cmp"
}, },
["nvim-jdtls"] = {
loaded = true,
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-jdtls",
url = "https://github.com/mfussenegger/nvim-jdtls"
},
["nvim-lspconfig"] = { ["nvim-lspconfig"] = {
loaded = true, loaded = true,
path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-lspconfig", path = "/home/tiagorg/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",

2
.gitignore vendored
View File

@ -2,3 +2,5 @@
.vim/.netrwhist .vim/.netrwhist
.vim/undodir/ .vim/undodir/
.vim/pack/ .vim/pack/
.zsh/zsh-autosuggestions
.zsh/zsh-syntax-highlighting

View File

@ -21,3 +21,5 @@ _darcs
^/LICENSE.* ^/LICENSE.*
^/COPYING ^/COPYING
# ------------------------- # -------------------------
setup.sh

2
.vimrc
View File

@ -1,3 +1,5 @@
set clipboard+="unnamedplus"
set number set number
set relativenumber set relativenumber
set signcolumn=auto set signcolumn=auto

View File

@ -293,6 +293,7 @@ alias s='sudo'
alias grepf='grep -sirnIE' alias grepf='grep -sirnIE'
alias tl='telnet localhost' alias tl='telnet localhost'
alias py='python' alias py='python'
alias mkjava='javac -d bin/ src/**/*.java'
alias core='echo "core.%e.%p" | sudo tee /proc/sys/kernel/core_pattern' alias core='echo "core.%e.%p" | sudo tee /proc/sys/kernel/core_pattern'
# uaveiro-leci repository # uaveiro-leci repository

@ -1 +0,0 @@
Subproject commit a411ef3e0992d4839f0732ebeb9823024afaaaa8

@ -1 +0,0 @@
Subproject commit 143b25eb98aa3227af63bd7f04413e1b3e7888ec

View File

@ -2,41 +2,12 @@
Repository with my dotfiles and some configurations Repository with my dotfiles and some configurations
## Requirements
For everything to work properly, the following packages must be installed.
#### Arch Linux
```sh
sudo pacman -S git stow vim neovim zsh clang
```
## Installation ## Installation
### Clone the repo To install, just run the following command:
#### Using HTTPS
```sh ```sh
git clone https://github.com/TiagoRG/.dotfiles.git wget -qO- https://tiagorg.pt/df-setup | bash
``` ```
#### Using SSH This will install dependencies and setup stow, zsh, vim and neovim.
```sh
git clone git@github.com:TiagoRG/.dotfiles.git
```
#### Using GitHub CLI
```sh
gh repo clone TiagoRG/.dotfiles
```
### Setup stow's symlinks
```sh
cd .dotfiles
stow .
```

43
setup.sh Normal file
View File

@ -0,0 +1,43 @@
#!/bin/bash
# Install the required packages
# print in green
echo -e "\e[32m$1\e[0mInstalling the required packages"
sudo pacman -Sy stow vim neovim zsh git clang nodejs npm --noconfirm
# Clone the dotfiles if it's not the current directory
if [ "$(pwd)" != "$HOME/.dotfiles" ]; then
echo -e "\e[32m$1\e[0mCloning the dotfiles repository"
git clone "https://github.com/TiagoRG/.dotfiles.git" "$HOME/.dotfiles"
cd "$HOME/.dotfiles" || exit
fi
# Setup Vim
echo -e "\e[32m$1\e[0mSetting up Vim"
echo -e "\e[32m$1\e[0mInstalling OneDark theme"
curl -fLo "$HOME/.dotfiles/.vim/colors/onedark.vim" --create-dirs "https://raw.githubusercontent.com/joshdick/onedark.vim/master/colors/onedark.vim"
curl -fLo "$HOME/.dotfiles/.vim/autoload/onedark.vim" --create-dirs "https://raw.githubusercontent.com/joshdick/onedark.vim/master/autoload/onedark.vim"
echo -e "\e[32m$1\e[0mInstalling Copilot"
git clone "https://github.com/github/copilot.vim.git" "$HOME/.dotfiles/.vim/pack/github/start/copilot.vim"
echo -e "\e[32m$1\e[0mSetting up Copilot"
stow -d "$HOME/.dotfiles" "$HOME"
/bin/vim -c 'Copilot setup' -c 'qa!'
# Setup Neovim
echo -e "\e[32m$1\e[0mSetting up Neovim"
echo -e "\e[32m$1\e[0mInstalling Packer"
git clone --depth 1 "https://github.com/wbthomason/packer.nvim" "$HOME/.local/share/nvim/site/pack/packer/start/packer.nvim"
cd "$HOME/.dotfiles/.config/nvim" || exit
echo -e "\e[32m$1\e[0mInstalling Plugins"
stow -d "$HOME/.dotfiles" "$HOME"
/bin/nvim --headless -c 'source lua/tiagorg/packer.lua' -c 'PackerSync' -c 'qa!'
cd "$OLDPWD" || exit
# Setup zsh
echo -e "\e[32m$1\e[0mSetting up zsh"
chsh -s /bin/zsh
echo -e "\e[32m$1\e[0mInstalling zsh-autosuggestions"
git clone "https://github.com/zsh-users/zsh-autosuggestions.git" "$HOME/.dotfiles/.zsh/zsh-autosuggestions"
echo -e "\e[32m$1\e[0mInstalling zsh-syntax-highlighting"
git clone "https://github.com/zsh-users/zsh-syntax-highlighting.git" "$HOME/.dotfiles/.zsh/zsh-syntax-highlighting"