Skip to content

Instantly share code, notes, and snippets.

View phortonssf's full-sized avatar

Peter Horton phortonssf

View GitHub Profile

Integrating git status in lualine

Introduction

This gist shows a possible way how to integrate the status of the buffer related repository into the neovim plugin lualine.

The git status is indicated in the lower left corner of the screenshot, indicating (1 commit ahead, 1 staged, 1 modified and 1 untracked file):

I just started using lua, so the way how the code below works can certainly be improved.

@phortonssf
phortonssf / README.md
Created May 27, 2021 05:07 — forked from ascendbruce/README.md
Use mac style keyboard shortcuts on Windows with AutoHotkey (ahk) script

Use (most) macOS style keyboard shortcuts on Windows

Make Windows PC's shortcut act like macOS (Mac OS X)

With this AutoHotKey script, you can use most macOS style shortcuts (eg, cmd+c, cmd+v, ...) on Windows with a standard PC keyboard.

Note that:

  1. you shouldn't change the modifier keys mapping with keyboard DIP. This script assumes you use a standard PC keyboard layout, and wish to use shortcuts as if it was a mac keyboard layout.
  2. To use cmd + shift + ↑ / ↓ / ← / → (select text between cursor and top / bottom / beginning of line / end of line), You should disable the Between input languages shotcut from Control Panel\Clock, Language, and Region\Language\Advanced settings > Change lanugage bar hot keys due to conflicting.
@phortonssf
phortonssf / lightline-and-tmux-config.md
Created October 9, 2020 21:33 — forked from sainnhe/lightline-and-tmux-config.md
Sexy & Powerful Configuration for Lightline and Tmux

𝑺𝒆𝒙𝒚 & 𝑷𝒐𝒘𝒆𝒓𝒇𝒖𝒍 𝑪𝒐𝒏𝒇𝒊𝒈𝒖𝒓𝒂𝒕𝒊𝒐𝒏 𝒇𝒐𝒓 𝑳𝒊𝒈𝒉𝒕𝒍𝒊𝒏𝒆 𝒂𝒏𝒅 𝑻𝒎𝒖𝒙

Nerd Font

First of all, install a nerd font, and apply it: nerd font

{
"background" : "#1d2021",
"black" : "#665C54",
"blue" : "#7DAEA3",
"brightBlack" : "#928374",
"brightBlue" : "#7DAEA3",
"brightCyan" : "#89B482",
"brightGreen" : "#A9B665",
"brightPurple" : "#D3869B",
"brightRed" : "#EA6962",
@phortonssf
phortonssf / sequential.ts
Created September 18, 2020 15:57
RXJS sequential requests
this.products = new Array<Product>();
const firstElectronicProduct = this.productService.getProductsByDepartment('electronics').pipe(
map(data => {
if(data.length > 1)
return data[0];
})
)
const firstBookProduct = firstElectronicProduct.pipe(
@phortonssf
phortonssf / parrellel.ts
Created September 18, 2020 15:56
RXJS Parrell HTTP Requests
this.products = new Array<Product>();
forkJoin({
firstElectronicProduct: this.productService.getProductsByDepartment('electronics').pipe(
map(data => {
if(data.length > 1)
return data[0];
})
),
firstHomeProduct: this.productService.getProductsByDepartment('home').pipe(
@phortonssf
phortonssf / retryerrors.ts
Created September 18, 2020 15:55
RXJS retry errors
this.logs = [];
const request = interval(1000);
const example = request.pipe(
take(2),
map(index => {
if (index === 0) {
return this.productService.getProducts();
}
return this.productService.getProductsError().pipe
@phortonssf
phortonssf / search.service.ts
Last active September 18, 2020 15:48
RXJS Incremental Search
products: Product[];
searchField$ = new Subject<string>();
constructor(private sharedService: SharedService, private productService: ProductService) {
this.sharedService.NavTitle = 'Incremental Search';
this.products = [];
this.searchField$.pipe(
debounceTime(400),
distinctUntilChanged(),
@phortonssf
phortonssf / GreetingModule.ts
Last active September 18, 2020 22:29
Angular Custom Module
import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';
import { CommonModule } from '@angular/common';
import { GreetingComponent } from './greeting.component';
import { UserServiceConfig, } from './user.service';
@NgModule({
imports: [ CommonModule ],
@phortonssf
phortonssf / .vimrc
Last active August 27, 2020 21:12
Base VIM no plugins
"Old Setup
"call plug#begin('~/.vim/plugged')
"Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }Plug 'junegunn/vim-easy-align'
"Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
"Plug 'brooth/far.vim'
"Plug 'bling/vim-airline'Plug 'tpope/vim-surround'call plug#end()
syntax on
set guicursor=