Assuming you have followed all the steps to install / setup WSL2 -> https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
**Tested on Ubuntu 20.04** | |
Step 1 - Find out default gateway and DNS servers | |
- Navigate to `Control Panel\Network and Internet\Network Connections` | |
- Right click on relevant connection type WiFi or Ethernet and select `Status` | |
- Status screen will be displayed, click on `Details` button | |
- Network Connection details screen will be displayed | |
- Note down `IPv4 default gateway` and `IPv4 DNS Servers` if available |
#!/usr/bin/env bash | |
LID_TMP='/tmp/lidscript.tmp' | |
# Read hoved windows from file | |
readarray moved_windows < $LID_TMP | |
# remove newlines after every element... | |
newMovedWindows=() | |
for i in "${!moved_windows[@]}"; do | |
without_newline=${moved_windows[$i]%$'\n'} | |
if [[ $without_newline != "" ]]; then |
This is a guide to Vim Script development for Python developers. Sample code for the various expressions, statements, functions and programming constructs is shown in both Python and Vim Script. This is not intended to be a tutorial for developing Vim scripts. It is assumed that the reader is familiar with Python programming.
For an introduction to Vim Script development, refer to usr_41.txt, eval.txt and Learn Vimscript the Hard Way
For a guide similar to this one for JavaScript developers, refer to Vim Script for the JavaScripter
This guide only describes the programming constructs that are present in both Python and Vim. The constructs that are unique to Vim (e.g. autocommands, [key-mapping](https://vimhelp.org/map.txt.html#key-m
Vim will move the cursor to the beginning of an object after invoking operator upon it. From an interactive editing perspective this may be considered annoying however it is the consistent choice as operators can be destructive. As such restoring the cursor to its prior position after invoking an operator on an object may not make sense.
There are many ways possible to alter this behaviour to your preference with mappings and/or scripting. But with custom operator mappings this can be particularly ugly.
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# If file exists (likely) copy fragment below into existing script: | |
# If stdin is a terminal | |
if [ -t 0 ]; then | |
# Set GPG_TTY so gpg-agent knows where to prompt. See gpg-agent(1) | |
export GPG_TTY="$(tty)" | |
# Set PINENTRY_USER_DATA so pinentry-auto knows to present a text UI. | |
export PINENTRY_USER_DATA=USE_TTY=1 |
function! Toggle_Surround(char) | |
let pos = getcurpos() | |
let cur = col(".") | |
exe "norm! va".a:char | |
let start = col("v") | |
let end = col(".") | |
exe "norm! \<esc>" | |
call cursor(pos[1], pos[2]) | |
if start <= cur && cur <= end && start != end | |
" inside quote :) |
I use the below described development process and tools for developing Vim features. | |
I use a Ubuntu system for most of the development. But the tools mentioned below | |
are also available on MacOS. | |
1. Clone the Vim source code from https://github.com/vim/vim.git. | |
2. Modify src/Makefile to enable additional compiler diagnostics: | |
CFLAGS=-Wall -Wextra -pedantic |