\documentclass[10pt,a4paper]{article} % Packages \usepackage{fancyhdr} % For header and footer \usepackage{multicol} % Allows multicols in tables \usepackage{tabularx} % Intelligent column widths \usepackage{tabulary} % Used in header and footer \usepackage{hhline} % Border under tables \usepackage{graphicx} % For images \usepackage{xcolor} % For hex colours %\usepackage[utf8x]{inputenc} % For unicode character support \usepackage[T1]{fontenc} % Without this we get weird character replacements \usepackage{colortbl} % For coloured tables \usepackage{setspace} % For line height \usepackage{lastpage} % Needed for total page number \usepackage{seqsplit} % Splits long words. %\usepackage{opensans} % Can't make this work so far. Shame. Would be lovely. \usepackage[normalem]{ulem} % For underlining links % Most of the following are not required for the majority % of cheat sheets but are needed for some symbol support. \usepackage{amsmath} % Symbols \usepackage{MnSymbol} % Symbols \usepackage{wasysym} % Symbols %\usepackage[english,german,french,spanish,italian]{babel} % Languages % Document Info \author{NorbertoCarlos} \pdfinfo{ /Title (cheat-sheet-vim.pdf) /Creator (Cheatography) /Author (NorbertoCarlos) /Subject (VIM Cheat Sheet) } % Lengths and widths \addtolength{\textwidth}{6cm} \addtolength{\textheight}{-1cm} \addtolength{\hoffset}{-3cm} \addtolength{\voffset}{-2cm} \setlength{\tabcolsep}{0.2cm} % Space between columns \setlength{\headsep}{-12pt} % Reduce space between header and content \setlength{\headheight}{85pt} % If less, LaTeX automatically increases it \renewcommand{\footrulewidth}{0pt} % Remove footer line \renewcommand{\headrulewidth}{0pt} % Remove header line \renewcommand{\seqinsert}{\ifmmode\allowbreak\else\-\fi} % Hyphens in seqsplit % This two commands together give roughly % the right line height in the tables \renewcommand{\arraystretch}{1.3} \onehalfspacing % Commands \newcommand{\SetRowColor}[1]{\noalign{\gdef\RowColorName{#1}}\rowcolor{\RowColorName}} % Shortcut for row colour \newcommand{\mymulticolumn}[3]{\multicolumn{#1}{>{\columncolor{\RowColorName}}#2}{#3}} % For coloured multi-cols \newcolumntype{x}[1]{>{\raggedright}p{#1}} % New column types for ragged-right paragraph columns \newcommand{\tn}{\tabularnewline} % Required as custom column type in use % Font and Colours \definecolor{HeadBackground}{HTML}{333333} \definecolor{FootBackground}{HTML}{666666} \definecolor{TextColor}{HTML}{333333} \definecolor{DarkBackground}{HTML}{000000} \definecolor{LightBackground}{HTML}{F7F7F7} \renewcommand{\familydefault}{\sfdefault} \color{TextColor} % Header and Footer \pagestyle{fancy} \fancyhead{} % Set header to blank \fancyfoot{} % Set footer to blank \fancyhead[L]{ \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{C} \SetRowColor{DarkBackground} \vspace{-7pt} {\parbox{\dimexpr\textwidth-2\fboxsep\relax}{\noindent \hspace*{-6pt}\includegraphics[width=5.8cm]{/web/www.cheatography.com/public/images/cheatography_logo.pdf}} } \end{tabulary} \columnbreak \begin{tabulary}{11cm}{L} \vspace{-2pt}\large{\bf{\textcolor{DarkBackground}{\textrm{VIM Cheat Sheet}}}} \\ \normalsize{by \textcolor{DarkBackground}{NorbertoCarlos} via \textcolor{DarkBackground}{\uline{cheatography.com/33425/cs/10398/}}} \end{tabulary} \end{multicols}} \fancyfoot[L]{ \footnotesize \noindent \begin{multicols}{3} \begin{tabulary}{5.8cm}{LL} \SetRowColor{FootBackground} \mymulticolumn{2}{p{5.377cm}}{\bf\textcolor{white}{Cheatographer}} \\ \vspace{-2pt}NorbertoCarlos \\ \uline{cheatography.com/norbertocarlos} \\ \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Cheat Sheet}} \\ \vspace{-2pt}Not Yet Published.\\ Updated 11th January, 2017.\\ Page {\thepage} of \pageref{LastPage}. \end{tabulary} \vfill \columnbreak \begin{tabulary}{5.8cm}{L} \SetRowColor{FootBackground} \mymulticolumn{1}{p{5.377cm}}{\bf\textcolor{white}{Sponsor}} \\ \SetRowColor{white} \vspace{-5pt} %\includegraphics[width=48px,height=48px]{dave.jpeg} Measure your website readability!\\ www.readability-score.com \end{tabulary} \end{multicols}} \begin{document} \raggedright \raggedcolumns % Set font size to small. Switch to any value % from this page to resize cheat sheet text: % www.emerson.emory.edu/services/latex/latex_169.html \footnotesize % Small font. \begin{multicols*}{4} \begin{tabularx}{3.833cm}{X} \SetRowColor{DarkBackground} \mymulticolumn{1}{x{3.833cm}}{\bf\textcolor{white}{VIM - ściąga}} \tn \SetRowColor{white} \mymulticolumn{1}{x{3.833cm}}{VIm jest edytorem tekstu kompatybilnym z Vi. Może być używany do edycji wszelkiego rodzaju plików tekstowych. Użyteczny zwłaszcza przy edycji programów.% Row Count 4 (+ 4) } \tn \hhline{>{\arrayrulecolor{DarkBackground}}-} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.27021 cm} x{2.16279 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Poruszanie się w edytorze VIM}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{j (↓)}} & Przejście linię w dół \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{k (↑)}} & Przejście linie w góre \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{h (←)}} & Przejście o znak w lewo \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} {\bf{l (→)}} & Przejście o znak w prawo \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{w,W}} & Przejście o jedno słowo w prawo \tn % Row Count 6 (+ 2) % Row 5 \SetRowColor{white} {\bf{b,B}} & Przejście o jedno słowo w lewo \tn % Row Count 8 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{0}} & Przejście na początek linii \tn % Row Count 10 (+ 2) % Row 7 \SetRowColor{white} {\bf{\$}} & Przejście na koniec linii \tn % Row Count 12 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{backspace}} & Początek następnej linii \tn % Row Count 14 (+ 2) % Row 9 \SetRowColor{white} {\bf{-}} & Początek poprzedniej linii \tn % Row Count 16 (+ 2) % Row 10 \SetRowColor{LightBackground} {\bf{(numer linii) G}} & Przejście do konkretnej linii \tn % Row Count 18 (+ 2) % Row 11 \SetRowColor{white} {\bf{(}} & Poprzednie zdanie \tn % Row Count 19 (+ 1) % Row 12 \SetRowColor{LightBackground} {\bf{)}} & Następne zdanie \tn % Row Count 20 (+ 1) % Row 13 \SetRowColor{white} {\bf{)}} & Następne zdanie \tn % Row Count 21 (+ 1) % Row 14 \SetRowColor{LightBackground} {\bf{\{}} & Poprzedni akapit \tn % Row Count 22 (+ 1) % Row 15 \SetRowColor{white} {\bf{\}}} & Następny akapit \tn % Row Count 23 (+ 1) % Row 16 \SetRowColor{LightBackground} {\bf{H}} & Początek ekranu \tn % Row Count 24 (+ 1) % Row 17 \SetRowColor{white} {\bf{M}} & Środek ekranu \tn % Row Count 25 (+ 1) % Row 18 \SetRowColor{LightBackground} {\bf{L}} & Koniec ekranu \tn % Row Count 26 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.0299 cm} x{2.4031 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Tryby pracy Vima}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{normal}} & W tym trybie vi pracuje zaraz po uruchomieniu. Wydawane tutaj różne skróty klawiaturowe pozwalają przejść do innego trybu, kasować tekst, kopiować tekst lub go przenosić. Aby wrócić do trybu poleceń naciskamy klawisz {[}Esc{]} \tn % Row Count 9 (+ 9) % Row 1 \SetRowColor{white} {\bf{command -line}} & Do wprowadzania poleceń, podobnie jak w trybie normal mode \tn % Row Count 12 (+ 3) % Row 2 \SetRowColor{LightBackground} {\bf{visual}} & Do nawigacji i manipulacji wyborów tekstowych, tryb ten pozwala na wykonywanie większości normalnych poleceń i kilka dodatkowych poleceń, na zaznaczonym tekście. \tn % Row Count 18 (+ 6) % Row 3 \SetRowColor{white} {\bf{insert}} & Aby przejść do tego trybu naciskamy klawisz {[}i{]} od tej pory możesz pisać tekst tak jak w każdym innym edytorze. Kończymy klawiszem {[}ESC{]} \tn % Row Count 24 (+ 6) % Row 4 \SetRowColor{LightBackground} {\bf{ex - mode}} & Podobny do trybu wiersza poleceń, ale zoptymalizowany do przetwarzania wsadowego. \tn % Row Count 27 (+ 3) % Row 5 \SetRowColor{white} {\bf{select}} & Podobne do trybu wizualnego ale jest zachowaniem bardziej podobny do MS Windows \tn % Row Count 30 (+ 3) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.57918 cm} x{1.85382 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Dwuznaki}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{:digraphs}} & - Wyświetla listę dostępnych znaków \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{CTRL-Kxy - (Tryb INSERT), x, y}} & - oznaczają znaki, które można odczytać z :digraphs. Dajmy na to przykład, żeby otrzymać znak: Ц (C= Ц 1062, Informacja z :digraphs) musimy nacisnąć CTRL-K i wpisać C= (dwa znaki: C, =) \tn % Row Count 12 (+ 10) % Row 2 \SetRowColor{LightBackground} {\bf{CTRL-KD\%}} & - Analogicznie da inny znak, w tym wypadku ten znak to: Ђ. (Informacje z digraphs: D\% Ђ 1026) \tn % Row Count 17 (+ 5) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.13289 cm} x{2.30011 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Ustawianie opcji}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{:set ic}} & - ic (Ignore Case) po ustawieniu tej opcji, wyrazy będą przeszukiwane bez względu na wielkość ich liter. \tn % Row Count 5 (+ 5) % Row 1 \SetRowColor{white} {\bf{:set noic}} & - Wyłącza opcje ic. \tn % Row Count 6 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{:set hlsearch}} & - Włącza podświetlenie wyszukiwanego tekstu. \tn % Row Count 8 (+ 2) % Row 3 \SetRowColor{white} {\bf{:set nohl}} & - Wyłącza podswietlenie wyszukiwanego tekstu. \tn % Row Count 10 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{:set incsearch}} & - Włącza częściowe dopasowanie tekstu podczas szukania. \tn % Row Count 13 (+ 3) % Row 5 \SetRowColor{white} {\bf{:set noxxx}} & - Wyłącza opcję xxx \tn % Row Count 15 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{:set autowrite}} & - Włącza opcje autozapisywania. \tn % Row Count 17 (+ 2) % Row 7 \SetRowColor{white} {\bf{:set noautowrite}} & - Wyłącza opcję autozapisywania. \tn % Row Count 19 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.51052 cm} x{1.92248 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Obsługa pliku}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{:q!}} lub {\bf{ZQ}} & Wyjście z VIMa bez zapisu \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{:wq}} lub {\bf{ZZ}} & Wyjście i zapis \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{:e {[}nazwa pliku{]} }} & Otwarcie pliku \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{:r}} & Wklejenie zawartości pliku \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{:w}} & Zapisanie pliku \tn % Row Count 9 (+ 1) % Row 5 \SetRowColor{white} {\bf{:f}} & Wyświetla info o pliku \tn % Row Count 11 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{:f {[}nazwa{]}}} & Zmienia nazwe pliku \tn % Row Count 12 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{0.89258 cm} x{2.54042 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Operowanie tekstem (cz.1)}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{d {[}obiekt{]}}} & Usuwa obiekt \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{D}} & Usuwa tekst do końca linii \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{dd}} & Usuwa linię \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\bf{x}} & Usuwa znak, po dodaniu liczby przed "x" usunie daną liczbę liter \tn % Row Count 7 (+ 3) % Row 4 \SetRowColor{LightBackground} {\bf{X}} & Usuwa poprzedzający znak \tn % Row Count 8 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{{\bf{↑}} {\emph{Usuwanie tekstu}} {\bf{↑}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{0.99557 cm} x{2.43743 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Operowanie tekstem (cz.2)}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{v}} & Zaznaczanie tekstu \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{V}} & Zaznaczanie tekstu od początku linii \tn % Row Count 3 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{C-v}} & Zaznaczanie tekstu kolumnami \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\bf{y {[}obiekt{]} }} & Kopiuje obiekt do schowka \tn % Row Count 6 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{Y}} & Kopiuje linię do schowka \tn % Row Count 7 (+ 1) % Row 5 \SetRowColor{white} {\bf{yy}} & Kopiuje tekst do końca linii \tn % Row Count 9 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{p}} lub {\bf{P}} & Wkleja zawartość schowka \tn % Row Count 11 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{{\bf{↑}} {\emph{Zaznaczanie tekstu / kopiowanie i wklejanie}} {\bf{↑}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{0.89258 cm} x{2.54042 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Operowanie tekstem (cz.3)}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{c {[}obiekt{]}}} & Zamienia obiekt, np {\emph{c2w}} - zmieni 2 kolejne słowa \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{cc}} & Zamiana linii \tn % Row Count 3 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{C}} & Zamiana do końca linii \tn % Row Count 4 (+ 1) % Row 3 \SetRowColor{white} {\bf{s}} & Zamiana znaku \tn % Row Count 5 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{r}} & Zamiana litery pod kursorem \tn % Row Count 6 (+ 1) % Row 5 \SetRowColor{white} {\bf{R}} & Uruchomienie trybu zamiany \tn % Row Count 7 (+ 1) % Row 6 \SetRowColor{LightBackground} {\bf{u}} & Cofanie ostatnich operacji \tn % Row Count 8 (+ 1) % Row 7 \SetRowColor{white} {\bf{U}} & Cofanie ostatnich operacji w linii \tn % Row Count 10 (+ 2) % Row 8 \SetRowColor{LightBackground} {\bf{Ctrl-r}} & Cofanie ostatnich cofań ({\bf{u}},{\bf{U}}) \tn % Row Count 12 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \SetRowColor{LightBackground} \mymulticolumn{2}{x{3.833cm}}{{\bf{↑}} {\emph{Zamiana tekstu i cofanie zmian}} {\bf{↑}}} \tn \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{x{1.20155 cm} x{2.23145 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Pomoc i Wyszukiwanie}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{/wyrażenie}} & Szuka wyrażenia od kursora do przodu \tn % Row Count 2 (+ 2) % Row 1 \SetRowColor{white} {\bf{?wyrażenie}} & Szuka wyrażenia od kursora do tyłu \tn % Row Count 4 (+ 2) % Row 2 \SetRowColor{LightBackground} {\bf{n}} & Następny wynik wyszukiwania \tn % Row Count 6 (+ 2) % Row 3 \SetRowColor{white} {\bf{N}} & Poprzedni wynik wyszukiwania \tn % Row Count 8 (+ 2) % Row 4 \SetRowColor{LightBackground} {\bf{:help}} lub{\bf{ F1}} & Przejście do pomocy \tn % Row Count 10 (+ 2) % Row 5 \SetRowColor{white} {\bf{:help {[}komenda{]}}} & Opis danej komendy \tn % Row Count 12 (+ 2) % Row 6 \SetRowColor{LightBackground} {\bf{Ctrl+W Ctrl+W}} & Przejście z jednego okna do drugiego \tn % Row Count 14 (+ 2) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} \begin{tabularx}{3.833cm}{p{0.58361 cm} x{2.84939 cm} } \SetRowColor{DarkBackground} \mymulticolumn{2}{x{3.833cm}}{\bf\textcolor{white}{Edycja tekstu}} \tn % Row 0 \SetRowColor{LightBackground} {\bf{i}} & edycja przed kursorem \tn % Row Count 1 (+ 1) % Row 1 \SetRowColor{white} {\bf{I}} & e. od początku linii \tn % Row Count 2 (+ 1) % Row 2 \SetRowColor{LightBackground} {\bf{a}} & e. za kursorem \tn % Row Count 3 (+ 1) % Row 3 \SetRowColor{white} {\bf{A}} & e. od końca linii \tn % Row Count 4 (+ 1) % Row 4 \SetRowColor{LightBackground} {\bf{o}} & e. w nowej linii poniżej \tn % Row Count 5 (+ 1) % Row 5 \SetRowColor{white} {\bf{O}} & e. w nowej linii powyżej \tn % Row Count 6 (+ 1) \hhline{>{\arrayrulecolor{DarkBackground}}--} \end{tabularx} \par\addvspace{1.3em} % That's all folks \end{multicols*} \end{document}