GithubHelp home page GithubHelp logo

setup's Introduction

Setup

This repository is all about setting up a new system for me or my friends, in particular setting up Vim and the commandline for taking notes or other work. The end product will look something like this:

A hint of what's to come when this is all done

but with additionally all the extra stuff that comes with UltiSnips. The knowledge required to figure this all out and make the snippet files, understanding how to use Git properly has (unfortunately) taken up many many tens of hours and the hope is that this page will make it easier to get it done quickly first time.

In order to make this work, you're going to need to set up a few things first, depending on your platform.

One thing you may as well get done is look up how to remap the caps-lock key for your operating system to ESC, as this is endlessly useful.

Mac

In general, the process is a little simpler for a Mac as it is a Unix system ultimately and so a lot of things naturally run better.

If you're on an iMac, you're going to want to begin by installing Xcode's Command Line Tools. We aren't really going to be using them directly but occasionally other programs have them as a prerequisite.

xcode-select --install

That will probably take a while. Now we need to install brew, which will prove invaluable.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew update

The last line is probably unnecessary but we do it anyway. Now we're going to want to install a whole bunch of things with brew.

brew install vim python git node anaconda zsh toilet

This will take absolutely ages but it's going to be worth it as we use all these things regularly. We now perform

chsh -s /bin/zsh

which changes the main shell to zsh. After this, you'll probably want to restart your machine. When it has started again, open up a terminal and see if it says zsh is the default (if it isn't, it might give a prompt for how to fix this). Then go for

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

and you should see Oh-My-Zsh being installed.

Then go get yourself iTerm2, as it has various features as a terminal that we like (especially the pane-splitting with CMD-D). At this point, you may as well as install MacTex and also Skim, the pdf viewer.

Windows

First, make sure you have Windows updated to the latest version [though maybe stick with 10 for now :)].

Then, you will need to install WSL2, which they have now remarkably simplified to a single command and then restart! At the same time, you may as well get the "Windows Terminal" from the Windows Store and set the default profile to Ubuntu. Recall that for strange reasons in Windows you often start, upon opening the terminal, in some strange virtual file location so you should probably cd ~ to begin with. You now want to download and install the latest version of vcxsrv from here. Then Vim into your ~/.bashrc and append

export DISPLAY=`grep -oP "(?<=nameserver ).+" /etc/resolv.conf`:0.0

and turn on vcxsrv in the background. Exit and reenter the shell. You can try and see if your GUI is working according to the steps from here and hopefully if it doesn't work originally, then the video will give a fix. Now we install MikTex, Ubuntu installation instructions of which can be found here. It requires a few commands but shouldn't take too long. We can install zathura and toilet by typing

sudo apt-get install zathura toilet

which will act as our pdf viewer and a fun way for displaying ASCII text respectively. We now also install zsh by saying

sudo apt install zsh
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

and then restart the terminal. It should now look like zsh.

Finishing off both

We now finish both installations off. To finish installing the looks, we write

git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/themes/powerlevel10k

and then open ~/.zshrc and change ZSH_THEME to "powerlevel10k/powerlevel10k" (keep the quotes). After exiting out, you're going to want to restart your terminal and configure the theme. To get it to completely work on Windows, you'll want to download the MesloLGS NF font from here (you can also mess around with the theme in the terminal settings).

Almost done! To set up your Git config, type in

git config -—global user.name "First Last" (keep the quotes)
git config —-global user.email "Email" (keep the quotes)

with your GitHub details (the email can be found in account settings). Finally, we clone this Git repository in home with

git clone https://github.com/n-simplex/setup.git ~/setup

and then check all the .vimrc, .vim things are all there. If they are, mv or cp all the relevant files:

  • .vimrc into the Home directory (NOT THE .zshrc as this will mess up your OH MY ZSH installation location!)
  • cp the whole .vim folder into the Home directory using the -R flag.

and then type vim .vimrc to see if your Vim install gives any errors. Hopefully, it shows all the lines correctly and looks at least somewhat colourful. If so, type :PlugInstall to see all the plugins install themselves on your computer.

TiddlyWiki

The installation guide for TiddlyWiki is given here but we now tell you what to do anyway. Historically, it has gone through without issue on Mac but npm has had issues installing on Windows so unfortunately may require some debugging. We now have nvm which is a godsend!

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
nvm install node
node -v
npm -v

This should download and install nvm, the Node Version Manager! Very useful thing for updating and dealing with all the versions of node pottering about these days. Then type:

sudo npm install -g tiddlywiki
tiddlywiki --version

and that second command should output a healthy-looking number, like 5.2.5.

Now we want to clone two repositories, one for notes and one for the blog, which I won't link to here as they are private. Do this in some folder dedicated to TiddlyWiki things. Then, in the directory just above the notes and blog directories place the files savenotes.sh,save.sh and art.txt. If you are on Windows (i.e. implicitly Linux) you need to make both of these files executable with the commands

chmod +x save.sh
chmod +x savenotes.sh

and now we need to go into .zshrc and add the aliases for notesave, blogsave, notes with the correct directory locations by copying from the appropriate lines in the copy given in setup (in Windows it is not necessary to quote the lines referencing iTerm2). They should be something like:

alias blog="tiddlywiki ~/blog-precursor --listen"
alias blogsave="~/save.sh"
alias notesave="~/savenotes.sh"
alias notes="tiddlywiki ~/notes --listen"

Now, if you are in Windows type which vim which should give you a file path to the vim editor. Then whatever path it gives you, probably /usr/bin/vim and then append at the bottom of your .zshrc the lines: export EDITOR=(the path given to vim) export VISUAL=(the path given to vim) No quotes are necessary. Finally, try running notesave as a test and if it works you should be done!

TO DO

  • Add operating specific advice about remapping caps-lock to ESC.

setup's People

Contributors

n-simplex avatar klaus-f-roth avatar

Stargazers

K C Tse avatar

Watchers

 avatar

setup's Issues

Hi

Have you considered keybinding the save functionality in vim? -- Johnny

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.