Skip to content

Commit

Permalink
Merge pull request #15 from DMcP89/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
DMcP89 authored Oct 22, 2024
2 parents 852bbec + 79e1f2e commit 1d17f01
Show file tree
Hide file tree
Showing 38 changed files with 1,106 additions and 743 deletions.
48 changes: 42 additions & 6 deletions .config/nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
-- Set nocompatible
vim.o.compatible = false
-- Plugins

local vim = vim
local Plug = vim.fn['plug#']
-- Set nocompatible
vim.o.compatible = false

-- Plugins
vim.call('plug#begin')

Plug('tpope/vim-fugitive')
Expand Down Expand Up @@ -49,12 +48,12 @@ vim.cmd('nnoremap <Leader>h :nohlsearch<CR>')
vim.o.foldenable = true --enable folding
vim.o.foldlevelstart = 10 --open most folds by default
vim.o.foldnestmax = 10 -- 10 nested fold max
vim.ofoldmethod = indent
vim.o.foldmethod = indent
-- space open/closes folds
vim.cmd('nnoremap <space> za')

-- Search and Replace
vim.cmd('nnoremap <Leader>r :%s/<C-r><C-w>//g<Left><Left>')
vim.cmd('nnoremap <Leader>R :%s/<C-r><C-w>//g<Left><Left>')


-- Auto close brackets
Expand All @@ -72,4 +71,41 @@ vim.cmd('noremap <Down> <Nop>')
vim.cmd('noremap <Left> <Nop>')
vim.cmd('noremap <Right> <Nop>')

-- Plugin keymappings

-- NERDTree
vim.cmd('autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif')
vim.cmd('map <C-n> :NERDTreeToggle<CR>')
vim.cmd('let NERDTreeMapOpenInTab="\r"')

-- FZF
vim.cmd('nnoremap <Leader>f :FZF<CR>')

-- Fugitive
vim.cmd('nnoremap <Leader>d :Gvdiffsplit')

-- vim-go
-- Go syntax highlighting
vim.g.go_highlight_fields = 1
vim.g.go_highlight_functions = 1
vim.g.go_highlight_function_calls = 1
vim.g.go_highlight_extra_types = 1
vim.g.go_highlight_operators = 1

-- formatting and importing
vim.g.go_fmt_autosave = 1
vim.g.go_fmt_command = "goimports"

-- Status line types/signatures
vim.g.go_auto_type_info = 1

vim.cmd('autocmd FileType go nmap <leader>r <Plug>(go-run)')
vim.cmd('autocmd FileType go nmap <leader>t <Plug>(go-test)')
vim.cmd('autocmd FileType go nmap <leader>b <Plug>(go-build)')

vim.cmd('au filetype go inoremap <buffer> . .<C-x><C-o>')

-- QOL Fixes
vim.o.completeopt = "menu,menuone,noinsert"
vim.cmd("inoremap <expr> <CR> pumvisible() ? '<C-y>' : '<C-g>u<CR>'")

3 changes: 0 additions & 3 deletions .config/powerline/themes/zsh/default_leftonly.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
"function": "powerline.segments.common.env.user",
"priority": 30
},
{
"function": "powerline.segments.common.bat.battery"
},
{
"function": "powerline.segments.common.time.date",
"args": {
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/run-test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: dotfiles-test

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "main" ]

workflow_dispatch:

jobs:
install:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.vim/bundle
vim/.vim/bundle
*ssh
.bash_secrets
*history*
Expand Down
12 changes: 0 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,6 @@ showenv:
@echo 'Module: '${MODULE}
@echo 'Tag: '${TAG}

copy-files:
@echo 'Copying dotfiles from home directory'
@cp $(HOME)/.bash_aliases $(CURDIR)
# @cp $(HOME)/.zsh* $(CURDIR)
@cp $(HOME)/.bashrc $(CURDIR)
@cp $(HOME)/.gitconfig $(CURDIR)
@cp $(HOME)/.vimrc $(CURDIR)
@cp $(HOME)/.profile $(CURDIR)
@cp $(HOME)/.tmux.conf $(CURDIR)
@cp -r $(HOME)/.vim/colors $(CURDIR)/.vim/
# @cp -r $(HOME)/.config $(CURDIR)


install-ansible:
@echo 'Installing ansible'
Expand Down
15 changes: 15 additions & 0 deletions alacritty/.config/alacritty/alacritty.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[font.bold]
family = "JetBrainsMono Nerd Font"
style = "Bold"

[font.bold_italic]
family = "JetBrainsMono Nerd Font"
style = "Bold Italic"

[font.italic]
family = "JetBrainsMono Nerd Font"
style = "Italic"

[font.normal]
family = "JetBrainsMono Nerd Font"
style = "Regular"
5 changes: 4 additions & 1 deletion ansible-playbooks/apt-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@
- ncurses-base
- ncurses-bin
- ncurses-term
- neovim
- openssh-server
- openssh-sftp-server
- pkg-config
Expand Down Expand Up @@ -156,6 +155,10 @@
- libmysqlclient-dev
- zsh
- jq
- stow
- snapd
- hsetroot
- rofi
- name: Add my user to docker group
ansible.builtin.user:
name: "{{ ansible_user_id }}"
Expand Down
4 changes: 4 additions & 0 deletions ansible-playbooks/cli-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
- name: cli-packages
hosts: localhost
tasks:
- name: Instal ZSH autosuggestions
git:
repo: 'https://github.com/zsh-users/zsh-autosuggestions'
dest: ~/.local/bin/zsh-autosuggestions/zsh-autosuggestions.zsh
- name: Download AWS zip
shell: 'curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "{{ playbook_dir }}/awscliv2.zip"'

Expand Down
46 changes: 17 additions & 29 deletions ansible-playbooks/dotfile-copy.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,20 @@
---
- name: Copy dotfiles
- name: Configure dotfiles
hosts: localhost
tasks:
- name: Copy .bashrc
copy:
src: "{{ playbook_dir }}/../.bashrc"
dest: "/home/{{ ansible_user_id }}"
- name: Copy .bash_aliases
copy:
src: "{{ playbook_dir }}/../.bash_aliases"
dest: "/home/{{ ansible_user_id }}"
- name: Copy .profile
copy:
src: "{{ playbook_dir }}/../.profile"
dest: "/home/{{ ansible_user_id }}"
- name: Copy .vimrc
copy:
src: "{{ playbook_dir }}/../.vimrc"
dest: "/home/{{ ansible_user_id }}"
- name: Copy .gitconfig
copy:
src: "{{ playbook_dir }}/../.gitconfig"
dest: "/home/{{ ansible_user_id }}"
- name: Copy .vim
copy:
src: "{{ playbook_dir }}/../.vim"
dest: "/home/{{ ansible_user_id }}"
- name: Copy .config
copy:
src: "{{ playbook_dir }}/../.config"
dest: "/home/{{ ansible_user_id }}"
- name: Stow dotfile packages
shell: |
stow bash
stow git
stow btop
stow mdless
stow powerline
stow pypoetry
stow tmux
stow zsh
stow vim
stow nvim
stow i3
stow alacritty
args:
chdir: "{{ playbook_dir }}/.."
5 changes: 4 additions & 1 deletion ansible-playbooks/setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@
- name: Install apt packages
import_playbook: apt-packages.yml

- name: Install snap packages
import_playbook: snap-packages.yml

- name: Copy dotfiles
import_playbook: dotfile-copy.yml

- name: Install vundle
import_playbook: vundle-install.yml
import_playbook: vim-package-managers-install.yml

- name: Install gems
import_playbook: gem-packages.yml
Expand Down
9 changes: 9 additions & 0 deletions ansible-playbooks/snap-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
- name: snap-pacakges
hosts: localhost
tasks:
- name: Install "nvim" with option --classic
community.general.snap:
name: nvim
classic: true
become: true
15 changes: 15 additions & 0 deletions ansible-playbooks/vim-package-managers-install.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- name: vundle-install
hosts: localhost
tasks:
- name: Install vundle plugin manager for Vim
git:
repo: 'https://github.com/VundleVim/Vundle.vim.git'
dest: ~/.vim/bundle/Vundle.vim
- name: vim-plug-install
hosts: localhost
tasks:
- name: Install vim-plug
shell: >
curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
8 changes: 0 additions & 8 deletions ansible-playbooks/vundle-install.yml

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion .bashrc → bash/.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ fi
# Powerline
export PATH=$PATH:$HOME/.local/bin

if [ -f $HOME/.local/lib/python3.*/site-packages/powerline/bindings/bash/powerline.sh ]; then
if [ -f $HOME/.local/bin/powerline-daemon ]; then
$HOME/.local/bin/powerline-daemon -q
POWERLINE_BASH_CONTINUATION=1
POWERLINE_BASH_SELECT=1
Expand Down
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 1d17f01

Please sign in to comment.