summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--c++.html.markdown349
-rw-r--r--compojure.html.markdown69
-rw-r--r--erlang.html.markdown14
-rw-r--r--markdown.html.markdown8
-rw-r--r--ocaml.html.markdown55
-rw-r--r--python.html.markdown14
-rw-r--r--python3.html.markdown32
-rw-r--r--tmux.html.markdown81
8 files changed, 545 insertions, 77 deletions
diff --git a/c++.html.markdown b/c++.html.markdown
new file mode 100644
index 00000000..8cf72e47
--- /dev/null
+++ b/c++.html.markdown
@@ -0,0 +1,349 @@
+---
+language: c++
+filename: learncpp.cpp
+contributors:
+ - ["Steven Basart", "http://github.com/xksteven"]
+lang: en
+---
+
+I am writing this to highlight the differences and
+additions that C++ has with respect to C. My
+suggestion would be to follow the C tutorial first
+then look here for the additions and differences.
+
+```c++
+///////////////////////////////////////
+// C++ differences
+///////////////////////////////////////
+
+
+//In C++
+//cannot use void main()
+int main() { //or int main(int argc, char **argv)
+ //cannot end with return;
+ return 0;
+ //Can also end without return statement
+}
+
+//In C++
+/*
+ //This could lead to compiler errors and is discouraged
+ //#if 0 #endif pairs are encouraged instead
+*/
+
+//In C++
+sizeof(10) //Typically 4
+sizeof('c') == 1
+
+//In C
+sizeof('c') == sizeof(10) //true chars are passed as ints
+
+
+//In C++ strict prototyping
+void func(); //function which accepts no arguments
+
+//In C
+void func(); //function which may accept arguments
+
+
+//In C++
+for(int i = 0; i < 10; i++) {;}
+//In C must int i must be declared before
+
+
+//C++ Supports Function overloading
+//Provided each function takes different
+//parameters
+
+void printing(char const *myString)
+{printf("String %s\n",myString);} //Hello
+
+void printing(int myInt)
+{printf("My int is %d",myInt);} //15
+
+int main ()
+{
+ printing("Hello");
+ printing(15);
+}
+
+
+
+//C++ Default Function Arguments
+void two_ints(int a = 1, int b = 4);
+
+int main()
+{
+ two_ints(); // arguments: 1, 4
+ two_ints(20); // arguments: 20, 4
+ two_ints(20, 5); // arguments: 20, 5
+}
+
+
+//C++ added the nullptr which is different from 0
+int *ip = nullptr; // OK
+int value = nullptr; // error: value is no pointer
+
+
+///////////////////////////////////////
+// C++ Additions ontop of C
+///////////////////////////////////////
+
+
+///////////////////////////////////////
+// C++ Namespace
+///////////////////////////////////////
+
+//Namespaces allow you to define your own
+//functions and variables for use
+
+// Use '::' to change variable (or function) scope
+// Putting '::' before a function or variable will
+// reference a global scope
+
+// This allows you to make normal c library calls
+// std is for standard library
+using namespace std;
+
+#include <stdio.h>
+
+int counter = 50; // global variable
+
+int main()
+{
+ for (int counter = 1; // this refers to the
+ counter < 2; // local variable
+ counter++)
+ {
+ printf("Global var %d local var %d\n",
+ ::counter, // global variable
+ counter); // local variable
+ // => Global var 50 local var 1
+ }
+}
+
+// Namespaces can be nested
+
+
+namespace myFirstNameSpace
+{
+ namespace myInnerSoul
+ {
+ cos(int x)
+ {
+ printf("My inner soul was made to program.");
+ }
+ }
+}
+
+namespace anotherNameSpace
+{
+ cos(int x) {;} //does nothing
+}
+
+int main()
+{
+ //Specify the full path because main is outside of both namespaces.
+ //Will print out My inner soul was made to program.
+ myFirstNameSpace::myInnerSoul::cos(60);
+}
+
+
+///////////////////////////////////////
+// C++ Strings
+///////////////////////////////////////
+
+//Strings in C++ are Objects and have many functions
+myString = "Hello";
+myOtherString = " World";
+
+myString + myOtherString; // => "Hello World"
+
+myString + ' You'; // => "Hello You"
+
+myString != myOtherString; //True
+
+//An example of a string method
+myString.append(" Dog"); // => "Hello Dog"
+
+
+///////////////////////////////////////
+// C++ Input Output
+///////////////////////////////////////
+
+//C++ input and output streams
+//cin, cout, cerr, << is insertion and >> is extraction operator
+#include <iostream>
+
+using namespace std;
+
+int main()
+{
+
+ int myInt;
+
+ //Prints to stdout (or terminal/screen)
+ cout << "Enter your fav number:\n"
+ //Takes in input
+ cin >> myInt;
+
+ //cout can also be formatted
+ cout << "Your fav number is " << myInt << "\n"
+ //Your fav number is ##
+
+ cerr << "Used for error messages"
+}
+
+
+///////////////////////////////////////
+// C++ Classes
+///////////////////////////////////////
+
+
+//First example of classes
+#include <iostream>
+
+//define a class
+class Doggie
+{
+ std::string name;
+ int weight;
+
+ // These are only the declarations
+ //Can also have private and protected
+ public:
+ //The public methods (can also include variables)
+
+ // Default constructor
+ Doggie();
+
+ void setName(std::string dogsName);
+ void setWeight(int dogsWeight);
+ void printDog();
+
+ //Can define functions within class declaration too
+ void dogBark() {std::cout << "Bark Bark\n"}
+
+ //Destructors are methods that free the allocated space
+ ~doggieDestructor();
+ //if no destructor compiler defines the trivial destructor
+
+//Classes are similar to structs and must close the } with ;
+};
+
+// This is the implementation of the class methods
+// Also called the definition
+void Doggie::Doggie () {
+ std::cout << "A doggie is born. Woof!\n";
+}
+
+void Doggie::setName (std::string doggie_name) {
+ name = doggie_name;
+}
+
+void Doggie::setWeight (int doggie_weight) {
+ weight = doggie_weight;
+}
+
+void Doggie::printDog () {
+ std::cout << "Dog is " << name << " weighs" << weight << "\n";
+}
+
+void Doggie::~doggieDestructor () {
+ delete[] name;
+ delete weight;
+}
+
+int main () {
+ Doggie deedee; // prints out a doggie is born. Woof!
+ deedee.setName ("Barkley");
+ deedee.setWeight(1000000);
+ deedee.printDog;
+ //prints => Dog is Barkley weighs 1000000
+ return 0;
+}
+
+
+//C++ Class inheritance
+
+class German_Sheperd
+{
+ //This class now inherits everything public and protected from Doggie class
+ Doggie d_dog;
+
+ //Good practice to put d_ in front of datatypes in classes
+ std::string d_type;
+
+ public:
+ void dogType() {d_type = "German Sheperd";}
+};
+
+
+
+///////////////////////////////////////
+// C++ Exception Handling
+///////////////////////////////////////
+
+try {
+ throw 12.25; // throws a double no handler declared
+} catch (int errorNum)
+{
+ std::cout << "I caught an int " << errorNum << "\n";
+//default catcher
+} catch (...)
+{
+ std::cout << "I got an error. Not sure what but I can pass it up.";
+ throw;
+}
+
+
+///////////////////////////////////////
+// C++ Operator Overloading
+///////////////////////////////////////
+
+// In C++ you can overload operators such as +, -, new, etc.
+
+#include <iostream>
+using namespace std;
+
+class Vector {
+ public:
+ double x,y;
+ Vector () {};
+ Vector (double a, double b) : x(a), y(b) {}
+ Vector operator + (const CVector&);
+ Vector operator += (const CVector&);
+};
+
+Vector Vector::operator+ (const Vector& rhs)
+{
+ Vector temp;
+ temp.x = x + rhs.x;
+ temp.y = y + rhs.y;
+ return temp;
+}
+
+Vector Vector::operator+= (const Vector& rhs)
+{
+ x += rhs.x;
+ y += rhs.y;
+ return *this;
+}
+
+int main () {
+ Vector up (0,1);
+ Vector right (1,0);
+ Vector result;
+ // This calls the Vector + operator
+ // Vector up calls the + (function) with right as its paramater
+ result = up + right;
+ // prints out => Result is upright (1,1)
+ cout << "Result is upright (" << result.x << ',' << result.y << ")\n";
+ return 0;
+}
+
+```
+Futher Reading
+
+for more resources see: http://www.icce.rug.nl/documents/cplusplus/
+for other reference material: http://www.cplusplus.com/doc/tutorial/
diff --git a/compojure.html.markdown b/compojure.html.markdown
index 96555273..444c8c58 100644
--- a/compojure.html.markdown
+++ b/compojure.html.markdown
@@ -102,29 +102,72 @@ You can adjust what each parameter matches by supplying a regex:
```clojure
(defroutes myapp
(GET ["/file/:name.:ext" :name #".*", :ext #".*"] [name ext]
- (str "File: " name ext))
+ (str "File: " name ext)))
```
-Handlers may utilize query parameters:
+### Middleware
+
+Clojure uses [Ring](https://github.com/ring-clojure/ring) for routing.
+Handlers are just functions that accept a request map and return a
+response map (Compojure will turn strings into 200 responses for you).
+
+You can easily write middleware that wraps all or part of your
+application to modify requests or responses:
+
+```clojure
+(defroutes myapp
+ (GET "/" req (str "Hello World v" (:app-version req))))
+
+(defn wrap-version [handler]
+ (fn [request]
+ (handler (assoc request :app-version "1.0.1"))))
+
+(defn -main []
+ (run-server (wrap-version myapp) {:port 5000}))
+```
+
+[Ring-Defaults](https://github.com/ring-clojure/ring-defaults) provides some handy
+middlewares for sites and apis, so add it to your dependencies:
+
+```
+[ring/ring-defaults "0.1.1"]
+```
+
+Then, you can import it in your ns:
+
+```
+(ns myapp.core
+ (:require [compojure.core :refer :all]
+ [ring.middleware.defaults :refer :all]
+ [org.httpkit.server :refer [run-server]]))
+```
+
+And use `wrap-defaults` to add the `site-defaults` middleware to your
+app:
+
+```
+(defn -main []
+ (run-server (wrap-defaults myapp site-defaults) {:port 5000}))
+```
+
+Now, your handlers may utilize query parameters:
```clojure
(defroutes myapp
- (GET "/posts" []
- (fn [req]
- (let [title (get (:params req) "title")
- author (get (:params req) "title")]
- " Do something with title and author"))))
+ (GET "/posts" req
+ (let [title (get (:params req) "title")
+ author (get (:params req) "title")]
+ (str "Title: " title ", Author: " author))))
```
-Or, for POST and PUT requests, form parameters
+Or, for POST and PUT requests, form parameters as well
```clojure
(defroutes myapp
- (POST "/posts" []
- (fn [req]
- (let [title (get (:params req) "title")
- author (get (:params req) "title")]
- "Do something with title and author"))))
+ (POST "/posts" req
+ (let [title (get (:params req) "title")
+ author (get (:params req) "title")]
+ (str "Title: " title ", Author: " author))))
```
diff --git a/erlang.html.markdown b/erlang.html.markdown
index 64b62f05..04086aeb 100644
--- a/erlang.html.markdown
+++ b/erlang.html.markdown
@@ -260,22 +260,22 @@ spawn(F). % <0.44.0>
% For all of this to be useful we need to be able to receive messages. This is
% achieved with the `receive` mechanism:
--module(caculateGeometry).
+-module(calculateGeometry).
-compile(export_all).
-caculateAera() ->
+calculateArea() ->
receive
{rectangle, W, H} ->
W * H;
{circle, R} ->
3.14 * R * R;
_ ->
- io:format("We can only caculate area of rectangles or circles.")
+ io:format("We can only calculate area of rectangles or circles.")
end.
-% Compile the module and create a process that evaluates `caculateAera` in the shell
-c(caculateGeometry).
-CaculateAera = spawn(caculateGeometry, caculateAera, []).
-CaculateAera ! {circle, 2}. % 12.56000000000000049738
+% Compile the module and create a process that evaluates `calculateArea` in the shell
+c(calculateGeometry).
+CalculateArea = spawn(calculateGeometry, calculateArea, []).
+CalculateArea ! {circle, 2}. % 12.56000000000000049738
% The shell is also a process, you can use `self` to get the current pid
self(). % <0.41.0>
diff --git a/markdown.html.markdown b/markdown.html.markdown
index 805255b8..3d4d0af6 100644
--- a/markdown.html.markdown
+++ b/markdown.html.markdown
@@ -39,7 +39,7 @@ This is an h2
-------------
<!-- Simple text styles -->
-<!-- Text can be easily styled as italic, bold, or strikethrough using markdown -->
+<!-- Text can be easily styled as italic or bold using markdown -->
*This text is in italics.*
_And so is this text._
@@ -52,7 +52,7 @@ __And so is this text.__
*__And this!__*
<!-- In Github Flavored Markdown, which is used to render markdown files on
-Github, we also have: -->
+Github, we also have strikethrough: -->
~~This text is rendered with strikethrough.~~
@@ -201,11 +201,11 @@ can be anything so long as they are unique. -->
<!-- Images -->
<!-- Images are done the same way as links but with an exclamation point in front! -->
-![This is hover-text (alt text) for my image](http://imgur.com/myimage.jpg "An optional title")
+![This is the alt-attribute for my image](http://imgur.com/myimage.jpg "An optional title")
<!-- And reference style works as expected -->
-![This is the hover-text.][myimage]
+![This is the alt-attribute.][myimage]
[myimage]: relative/urls/cool/image.jpg "if you need a title, it's here"
diff --git a/ocaml.html.markdown b/ocaml.html.markdown
index fd7ca36e..7f4e0a9d 100644
--- a/ocaml.html.markdown
+++ b/ocaml.html.markdown
@@ -1,5 +1,5 @@
---
-language: "OCaml"
+language: OCaml
contributors:
- ["Daniil Baturin", "http://baturin.org/"]
---
@@ -10,7 +10,7 @@ features.
Along with StandardML and its dialects it belongs to ML language family.
Just like StandardML, there are both a compiler and an interpreter
for OCaml. The interpreter binary is normally called "ocaml" and
-the compiler is "ocamlc.opt". There is also a bytecode compiler, "ocamlc",
+the compiler is "ocamlopt". There is also a bytecode compiler, "ocamlc",
but there are few reasons to use it.
It is strongly and statically typed, but instead of using manually written
@@ -20,6 +20,7 @@ source of confusion for beginners.
When you are in the top level loop, OCaml will print the inferred type
after you enter an expression.
+
```
# let inc x = x + 1 ;;
val inc : int -> int = <fun>
@@ -42,6 +43,7 @@ val inc : int -> int
val add : int -> int -> int
val a : int
```
+
Note that type signatures of functions of multiple arguments are
written in curried form.
@@ -57,11 +59,19 @@ written in curried form.
(* Expressions can be separated by a double semicolon symbol, ";;".
In many cases it's redundant, but in this tutorial we use it after
- every expression for easy pasting into the interpreter shell. *)
+ every expression for easy pasting into the interpreter shell.
+ Unnecessary use of expression separators in source code files
+ is often considered to be a bad style. *)
(* Variable and function declarations use "let" keyword. *)
let x = 10 ;;
+(* OCaml allows single quote characters in identifiers.
+ Single quote doesn't have a special meaning in this case, it's often used
+ in cases when in other languages one would use names like "foo_tmp". *)
+let foo = 1 ;;
+let foo' = foo * 2 ;;
+
(* Since OCaml compiler infers types automatically, you normally don't need to
specify argument types explicitly. However, you can do it if you want or need to. *)
let inc_int (x: int) = x + 1 ;;
@@ -194,6 +204,39 @@ let my_array = [| 1; 2; 3 |] ;;
my_array.(0) ;;
+(*** Strings and characters ***)
+
+(* Use double quotes for string literals. *)
+let my_str = "Hello world" ;;
+
+(* Use single quotes for character literals. *)
+let my_char = 'a' ;;
+
+(* Single and double quotes are not interchangeable. *)
+let bad_str = 'syntax error' ;; (* Syntax error. *)
+
+(* This will give you a single character string, not a character. *)
+let single_char_str = "w" ;;
+
+(* Strings can be concatenated with the "^" operator. *)
+let some_str = "hello" ^ "world" ;;
+
+(* Strings are not arrays of characters.
+ You can't mix characters and strings in expressions.
+ You can convert a character to a string with "String.make 1 my_char".
+ There are more convenient functions for this purpose in additional
+ libraries such as Core.Std that may not be installed and/or loaded
+ by default. *)
+let ocaml = (String.make 1 'O') ^ "Caml" ;;
+
+(* There is a printf function. *)
+Printf.printf "%d %s" 99 "bottles of beer" ;;
+
+(* Unformatted read and write functions are there too. *)
+print_string "hello world\n" ;;
+print_endline "hello world" ;;
+let line = read_line () ;;
+
(*** User-defined data types ***)
@@ -304,6 +347,6 @@ sum_int_list t ;;
## Further reading
-* Visit the official website to get the compiler and read the docs: http://ocaml.org/
-* Try interactive tutorials and a web-based interpreter by OCaml Pro: http://try.ocamlpro.com/
-* Read "OCaml for the skeptical" course: http://www2.lib.uchicago.edu/keith/ocaml-class/home.html
+* Visit the official website to get the compiler and read the docs: <http://ocaml.org/>
+* Try interactive tutorials and a web-based interpreter by OCaml Pro: <http://try.ocamlpro.com/>
+* Read "OCaml for the skeptical" course: <http://www2.lib.uchicago.edu/keith/ocaml-class/home.html>
diff --git a/python.html.markdown b/python.html.markdown
index 9057dde2..390c7b76 100644
--- a/python.html.markdown
+++ b/python.html.markdown
@@ -57,9 +57,17 @@ to Python 2.x. Look for another tour of Python 3 soon!
# Enforce precedence with parentheses
(1 + 3) * 2 # => 8
-# Boolean values are primitives
-True
-False
+# Boolean Operators
++# Note "and" and "or" are case-sensitive
++True and False #=> False
++False or True #=> True
++
++# Note using Bool operators with ints
++0 and 2 #=> 0
++-5 or 0 #=> -5
++0 == False #=> True
++2 == True #=> False
+1 == True #=> True
# negate with not
not True # => False
diff --git a/python3.html.markdown b/python3.html.markdown
index f6babaff..a94f4eae 100644
--- a/python3.html.markdown
+++ b/python3.html.markdown
@@ -61,6 +61,18 @@ False
not True # => False
not False # => True
+# Boolean Operators
+# Note "and" and "or" are case-sensitive
+True and False #=> False
+False or True #=> True
+
+# Note using Bool operators with ints
+0 and 2 #=> 0
+-5 or 0 #=> -5
+0 == False #=> True
+2 == True #=> False
+1 == True #=> True
+
# Equality is ==
1 == 1 # => True
2 == 1 # => False
@@ -127,7 +139,8 @@ bool({}) #=> False
# Python has a print function
print("I'm Python. Nice to meet you!")
-# No need to declare variables before assigning to them. Convention is to use lower_case_with_underscores
+# No need to declare variables before assigning to them.
+# Convention is to use lower_case_with_underscores
some_var = 5
some_var # => 5
@@ -176,7 +189,8 @@ li[::-1] # => [3, 4, 2, 1]
del li[2] # li is now [1, 2, 3]
# You can add lists
-li + other_li # => [1, 2, 3, 4, 5, 6] - Note: values for li and for other_li are not modified.
+# Note: values for li and for other_li are not modified.
+li + other_li # => [1, 2, 3, 4, 5, 6]
# Concatenate lists with "extend()"
li.extend(other_li) # Now li is [1, 2, 3, 4, 5, 6]
@@ -215,14 +229,17 @@ filled_dict = {"one": 1, "two": 2, "three": 3}
# Look up values with []
filled_dict["one"] # => 1
-# Get all keys as a list with "keys()". We need to wrap the call in list() because we are getting back an iterable. We'll talk about those later.
-list(filled_dict.keys()) # => ["three", "two", "one"]
+# Get all keys as a list with "keys()".
+# We need to wrap the call in list() because we are getting back an iterable. We'll talk about those later.
# Note - Dictionary key ordering is not guaranteed.
# Your results might not match this exactly.
+list(filled_dict.keys()) # => ["three", "two", "one"]
+
# Get all values as a list with "values()". Once again we need to wrap it in list() to get it out of the iterable.
-list(filled_dict.values()) # => [3, 2, 1]
# Note - Same as above regarding key ordering.
+list(filled_dict.values()) # => [3, 2, 1]
+
# Check for existence of keys in a dictionary with "in"
"one" in filled_dict # => True
@@ -242,6 +259,10 @@ filled_dict.get("four", 4) # => 4
filled_dict.setdefault("five", 5) # filled_dict["five"] is set to 5
filled_dict.setdefault("five", 6) # filled_dict["five"] is still 5
+# Adding to a dictionary
+filled_dict.update({"four":4}) #=> {"one": 1, "two": 2, "three": 3, "four": 4}
+#filled_dict["four"] = 4 #another way to add to dict
+
# Remove keys from a dictionary with del
del filled_dict["one"] # Removes the key "one" from filled dict
@@ -458,6 +479,7 @@ map(add_10, [1, 2, 3]) # => [11, 12, 13]
filter(lambda x: x > 5, [3, 4, 5, 6, 7]) # => [6, 7]
# We can use list comprehensions for nice maps and filters
+# List comprehension stores the output as a list which can itself be a nested list
[add_10(i) for i in [1, 2, 3]] # => [11, 12, 13]
[x for x in [3, 4, 5, 6, 7] if x > 5] # => [6, 7]
diff --git a/tmux.html.markdown b/tmux.html.markdown
index 516bee4d..8d7aa752 100644
--- a/tmux.html.markdown
+++ b/tmux.html.markdown
@@ -8,14 +8,16 @@ filename: LearnTmux.txt
<a href="http://tmux.sourceforge.net/">
-tmux</a> is a terminal multiplexer: it enables a number of terminals to be
-created, accessed, and controlled from a single screen. tmux may be detached
-from a screen and continue running in the background, then later reattached.
+tmux</a> is a terminal multiplexer: it enables a number of terminals
+to be created, accessed, and controlled from a single screen. tmux
+may be detached from a screen and continue running in the background
+then later reattached.
```
tmux [command] # Run a command
- # 'tmux' with no commands will create a new session
+ # 'tmux' with no commands will create a new
+ session
new # Create a new session
-s "Session" # Create named session
@@ -52,42 +54,41 @@ from a screen and continue running in the background, then later reattached.
## Key Bindings
-# The method of controlling an attached tmux session is via key combinations
-# called 'Prefix' keys.
-
-------------------------------------------------------------------------------
+# The method of controlling an attached tmux session is via key
+# combinations called 'Prefix' keys.
+----------------------------------------------------------------------
(C-b) = Ctrl + b # 'Prefix' combination required to use keybinds
(M-1) = Meta + 1 -or- Alt + 1
+----------------------------------------------------------------------
-------------------------------------------------------------------------------
-
- ? # List all key bindings.
- : # Enter the tmux command prompt.
- r # Force redraw of the attached client.
- c # Create a new window.
+ ? # List all key bindings
+ : # Enter the tmux command prompt
+ r # Force redraw of the attached client
+ c # Create a new window
! # Break the current pane out of the window.
- % # Split the current pane into two, left and right.
- " # Split the current pane into two, top and bottom.
+ % # Split the current pane into two, left and right
+ " # Split the current pane into two, top and bottom
- n # Change to the next window.
- p # Change to the previous window.
- { # Swap the current pane with the previous pane.
- } # Swap the current pane with the next pane.
+ n # Change to the next window
+ p # Change to the previous window
+ { # Swap the current pane with the previous pane
+ } # Swap the current pane with the next pane
- s # Select a new session for the attached client interactively.
- w # Choose the current window interactively.
- 0 to 9 # Select windows 0 to 9.
+ s # Select a new session for the attached client
+ interactively
+ w # Choose the current window interactively
+ 0 to 9 # Select windows 0 to 9
- d # Detach the current client.
- D # Choose a client to detach.
+ d # Detach the current client
+ D # Choose a client to detach
- & # Kill the current window.
- x # Kill the current pane.
+ & # Kill the current window
+ x # Kill the current pane
- Up, Down # Change to the pane above, below, left, or right.
+ Up, Down # Change to the pane above, below, left, or right
Left, Right
M-1 to M-5 # Arrange panes:
@@ -95,12 +96,12 @@ from a screen and continue running in the background, then later reattached.
# 2) even-vertical
# 3) main-horizontal
# 4) main-vertical
- # 5) tiled.
+ # 5) tiled
- C-Up, C-Down # Resize the current pane in steps of one cell.
+ C-Up, C-Down # Resize the current pane in steps of one cell
C-Left, C-Right
- M-Up, M-Down # Resize the current pane in steps of five cells.
+ M-Up, M-Down # Resize the current pane in steps of five cells
M-Left, M-Right
@@ -115,7 +116,7 @@ like how .vimrc or init.el are used.
### Keybinds
-###########################################################################
+######################################################################
# Unbind C-b as the default prefix
unbind-key C-befix C-a
@@ -155,7 +156,7 @@ bind l select-pane -R
### Theme
-###########################################################################
+#####################################################################
# Statusbar Color Palette
set-option -g status-justify left
@@ -186,7 +187,7 @@ setw -g window-status-activity-fg yellow
### UI
-###########################################################################
+######################################################################
# Statusbar
set-option -g status-utf8 on
@@ -209,22 +210,24 @@ set -g mouse-select-window on
# Automatically set window titles
set-option -g set-titles on
-set-option -g set-titles-string '#H:#S.#I.#P #W #T' # window number,program name,active (or not)
+
+# window number,program name,active (or not)
+set-option -g set-titles-string '#H:#S.#I.#P #W #T'
# Statusbar Adjustments
-set -g status-left '#[fg=red]#H#[fg=green]:#[fg=white]#S #[fg=green]][#[default] '
+set -g status-left '#[fg=red]#H#[fg=green]:#[fg=white]#S #[fg=green]][#[default]'
set -g status-interval 3
# Statusbar with right-aligned Date / Time
-#set -g status-right ' #[fg=green]][#[fg=white] #T #[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default] '
+#set -g status-right '#[fg=green]][#[fg=white] #T #[fg=green]][ #[fg=blue]%Y-%m-%d #[fg=white]%H:%M#[default]'
# Show performance counters in statusbar
# Requires https://github.com/thewtex/tmux-mem-cpu-load/
-#set -g status-right ' #[fg=green]][#[fg=white] #(tmux-mem-cpu-load 5 4) #[fg=green]][ #[fg=yellow]%H:%M#[default] '
+#set -g status-right '#[fg=green]][#[fg=white] #(tmux-mem-cpu-load 5 4) #[fg=green]][ #[fg=yellow]%H:%M#[default]'
### Misc
-###########################################################################
+######################################################################
# Scrollback/History limit
set -g history-limit 4096