diff --git a/.cirrus.yml b/.cirrus.yml index 8b44a156b3..7a800207f6 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -5,9 +5,9 @@ env: freebsd_task: name: FreeBSD matrix: - - name: FreeBSD 14.2 + - name: FreeBSD 14.3 freebsd_instance: - image_family: freebsd-14-2 + image_family: freebsd-14-3 timeout_in: 20m install_script: - pkg install -y gettext diff --git a/.editorconfig b/.editorconfig index 93dd8dadb3..7b09a2cae1 100644 --- a/.editorconfig +++ b/.editorconfig @@ -39,3 +39,12 @@ trim_trailing_whitespace = false [src/testdir/test*.vim] # Some tests need trailing whitespaces, for example `set showbreak=>>\ ` trim_trailing_whitespace = false + +# +# Some custom files do not use tabs +# +[src/sign.c] +indent_style = space + +[src/sound.c] +indent_style = space diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs index 4d064077ee..bae6b6c6f5 100644 --- a/.git-blame-ignore-revs +++ b/.git-blame-ignore-revs @@ -13,3 +13,15 @@ # change indentation style of netrw plugin c363ca1ecd1f8db03663ef98dcf41eeacc3c22c7 c673b805ad80d0aef07e745d412a2bf298ba1c07 +# fix indentation style in insexpand.c v9.1.1352 +355db99d12a89f05765948b33eecd6d9733e16bb +# fix indentation styles in various files v9.1.1363 +c2a9000bc1b4a2cbcfeef55450c184b16906d910 +# indentation style in various files v9.1.1364 +562610cfa327c8ebff12a1700525e17a070d5e2c +# Patch v9.1.1371 +19e1dd6b6aeb96d64122332a8c3d17b9d5ca007b +# Patch v9.1.1372 +a4a00a7ad0cfa26685c057c11a09bec2c962346a +# Patch v9.1.1390 +e89aef3f65388a8b627c77f250525f2a264716c5 diff --git a/.gitattributes b/.gitattributes index 9216dbe8db..bad1d9edb2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,31 @@ src/testdir/test42.in diff + +# `vim.pot` is updated every time any of the *.c files are modified. And as it +# contains line numbers for strings from *.c files, inserting a line into a +# single .c file may cause many lines in the `vim.pot` file to be updated. +# +# This generates a lot of "noise" in the diffs. And especially considering that +# `vim.pot` is a generated file, looking at changes in this file is not useful. +# +# By marking it as binary we tell the git machinery that it should not be +# presented to the user in patches, use "git diff --text" to override +src/po/vim.pot -diff + +# Although vim.pot has been marked as binary, you may want to check the textual differences +# using git --text but still want to ignore some noisy output like: +# - POT-Creation Date +# - comments pointing to the message source location in +# *.c/*.h/*.vim/*.cpp/*.in/*.xs files followed by line numbers +# Note: location comments should be no longer part of vim.pot, since commit 2844765e903214490e1 +# which add the --no-location argument for xgettext to no longer ouput such comments +# +# To ignore certain changes, setup a custom textconv filter using: +# git config diff.ignore_vim_pot.textconv "grep -Ev '^.(POT-Creation-Date:|.*\\.([ch]|vim|in|xs|cpp):).*$'" +src/po/vim.pot diff=ignore_vim_pot + +# GitHub reacts to the `linguist-generated` attribute, by ignoring marked files +# for the repository's language statistics and hiddning changes in these files +# by default in diffs. +# +# https://docs.github.com/en/repositories/working-with-files/managing-files/customizing-how-changed-files-appear-on-github +src/po/vim.pot linguist-generated=true diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index d41773721a..27fd0b69f9 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -10,6 +10,8 @@ body: Thanks for reporting issues of MacVim! If you want to report a security issue, instead of reporting it here publicly, please disclose it using the steps listed at https://github.com/macvim-dev/macvim/security/policy. + + For general Vim issues that are not specific to MacVim, please file them at https://github.com/vim/vim. To make it easier for us to help you please enter detailed information below. - type: textarea @@ -30,56 +32,48 @@ body: required: true - type: input attributes: - label: Version of Vim and architecture + label: Version of MacVim description: > - Including patch level, use ":version" to see it [e.g. 8.2.1234, GUI, arm64] + MacVim release number (e.g. r181). Use "About MacVim" to find out which one you are using. If building manually from source, provide the Git commit hash instead (e.g. a4466fe3b695). validations: required: true + - type: input + attributes: + label: MacVim installation method + description: > + Was MacVim downloaded from GitHub release, installed via Homebrew / Homebrew Cask / MacPorts, or built from source manually? - type: textarea attributes: label: Environment description: > - OS and architecture [e.g. Big Sur, arm64], terminal [e.g. Apple Terminal/iTerm], value of $TERM, shell [e.g. zsh 5.8]; anything that might matter + macOS version (e.g. macOS 15.3.2 Sequoia), Mac type (e.g. MacBook Air M2), terminal (e.g. Apple Terminal/iTerm); anything that might matter placeholder: | - Operating system: + macOS version: + Mac: Terminal: - Value of $TERM: - Shell: validations: required: true - - type: input - attributes: - label: How MacVim was installed - description: > - MacVim has been downloaded from GitHub, installed via Homebrew, MacPorts or builed from git - type: textarea attributes: label: Logs and stack traces placeholder: Insert log or other text here (if necessary) render: shell - - type: input + - type: textarea attributes: - label: Vim configuration where issue is reproducable - description: 'e.g. link to your vimrc configuration: url to file/gist/repo..' + label: Vim and MacVim configuration where issue is reproducable + description: Provide a link to vimrc and/or MacVim settings (see https://github.com/macvim-dev/macvim/wiki/Reporting-an-Issue for how to obtain it). - type: checkboxes attributes: - label: Issue has been tested with given configuration - description: This will help us to narrow down the problem more quickly + label: How was MacVim launched? + description: Different ways of opening MacVim can have an impact on the behavior. options: - - label: by running MacVim.app from GUI macOS interface - - label: by running vim/gvim/etc installed by MacVim - - label: by running other versions of vim (e.g. /usr/bin/vim) + - label: by launching MacVim.app in macOS (by using the Dock, Spotlight, or the `open` command) + - label: by running mvim/gvim in the terminal - type: checkboxes attributes: - label: Issue has been tested with no configuration - description: This will help us to narrow down the problem more quickly + label: Issue has been tested with clean configuration + description: Running MacVim and Vim with clean configurations allow us to narrow down whether this is a configuration issue. options: - - label: by running `mvim --clean` (or `gvim`, supplied by MacVim distribution) + - label: by running `mvim --clean` (or `gvim`, supplied by MacVim distribution). You can also use the File → "New Clean Window" menu item within MacVim. - label: by running `vim --clean` (in terminal, supplied by MacVim distribution) - label: by running `vim --clean` (in terminal, other suppliers, e.g. /usr/bin/vim) - - type: checkboxes - attributes: - label: Other conditions - description: This will help us to narrow down the problem more quickly - options: - - label: The both Homebrew packages "vim" and "macvim" are installed diff --git a/.github/MAINTAINERS b/.github/MAINTAINERS index f0d11a38fe..09376d5078 100644 --- a/.github/MAINTAINERS +++ b/.github/MAINTAINERS @@ -9,674 +9,682 @@ # So if a pull request only touches javascript files, only these owners # will be requested to review. -nsis/lang/russian.nsi @RestorerZ -runtime/autoload/freebasic.vim @dkearns -runtime/autoload/hare.vim @selenebun -runtime/autoload/haskell.vim @alx741 -runtime/autoload/hcl.vim @gpanders -runtime/autoload/javascript.vim @jsit -runtime/autoload/modula2.vim @dkearns -runtime/autoload/php.vim @david-szabo97 -runtime/autoload/rubycomplete.vim @segfault @dkearns -runtime/autoload/rust.vim @lilyball -runtime/autoload/typst.vim @saccarosium -runtime/autoload/xmlformat.vim @chrisbra -runtime/autoload/dist/json.vim @habamax -runtime/colors/blue.vim @habamax @romainl @neutaaaaan -runtime/colors/darkblue.vim @habamax @romainl @neutaaaaan -runtime/colors/default.vim @habamax @romainl @neutaaaaan -runtime/colors/delek.vim @habamax @romainl @neutaaaaan -runtime/colors/desert.vim @habamax @romainl @neutaaaaan -runtime/colors/elflord.vim @habamax @romainl @neutaaaaan -runtime/colors/evening.vim @habamax @romainl @neutaaaaan -runtime/colors/habamax.vim @habamax @romainl @neutaaaaan -runtime/colors/industry.vim @habamax @romainl @neutaaaaan -runtime/colors/koehler.vim @habamax @romainl @neutaaaaan -runtime/colors/lunaperche.vim @habamax @romainl @neutaaaaan -runtime/colors/morning.vim @habamax @romainl @neutaaaaan -runtime/colors/murphy.vim @habamax @romainl @neutaaaaan -runtime/colors/pablo.vim @habamax @romainl @neutaaaaan -runtime/colors/peachpuff.vim @habamax @romainl @neutaaaaan -runtime/colors/quiet.vim @habamax @romainl @neutaaaaan -runtime/colors/retrobox.vim @habamax @romainl @neutaaaaan -runtime/colors/ron.vim @habamax @romainl @neutaaaaan -runtime/colors/shine.vim @habamax @romainl @neutaaaaan -runtime/colors/slate.vim @habamax @romainl @neutaaaaan -runtime/colors/sorbet.vim @habamax @romainl @neutaaaaan -runtime/colors/tools @habamax @romainl @neutaaaaan -runtime/colors/torte.vim @habamax @romainl @neutaaaaan -runtime/colors/wildcharm.vim @habamax @romainl @neutaaaaan -runtime/colors/zaibatsu.vim @habamax @romainl @neutaaaaan -runtime/colors/zellner.vim @habamax @romainl @neutaaaaan -runtime/compiler/checkstyle.vim @dkearns -runtime/compiler/cm3.vim @dkearns -runtime/compiler/cucumber.vim @tpope -runtime/compiler/dart.vim @dkearns -runtime/compiler/dart2js.vim @dkearns -runtime/compiler/dart2native.vim @dkearns -runtime/compiler/dartanalyser.vim @dkearns -runtime/compiler/dartdevc.vim @dkearns -runtime/compiler/dartdoc.vim @dkearns -runtime/compiler/dartfmt.vim @dkearns -runtime/compiler/dotnet.vim @nickspoons -runtime/compiler/eruby.vim @dkearns -runtime/compiler/fbc.vim @dkearns -runtime/compiler/gawk.vim @dkearns -runtime/compiler/gjs.vim @dkearns -runtime/compiler/gm2.vim @dkearns -runtime/compiler/go.vim @dbarnett -runtime/compiler/groff.vim @Konfekt -runtime/compiler/haml.vim @tpope -runtime/compiler/hare.vim @selenebun -runtime/compiler/icon.vim @dkearns -runtime/compiler/javac.vim @dkearns -runtime/compiler/jest.vim @dkearns -runtime/compiler/jjs.vim @dkearns -runtime/compiler/jshint.vim @dkearns -runtime/compiler/jsonlint.vim @dkearns -runtime/compiler/jq.vim @vito-c -runtime/compiler/lazbuild.vim @dkearns -runtime/compiler/pandoc.vim @Konfekt -runtime/compiler/perl.vim @petdance @heptite -runtime/compiler/perlcritic.vim @petdance @dkearns -runtime/compiler/php.vim @dkearns -runtime/compiler/podchecker.vim @petdance @dkearns -runtime/compiler/powershell.vim @heaths -runtime/compiler/raco.vim @benknoble -runtime/compiler/racomake.vim @benknoble -runtime/compiler/racosetup.vim @benknoble -runtime/compiler/racotest.vim @benknoble -runtime/compiler/rake.vim @tpope @dkearns -runtime/compiler/rhino.vim @dkearns -runtime/compiler/rspec.vim @tpope @dkearns -runtime/compiler/rubocop.vim @dkearns -runtime/compiler/ruby.vim @tpope @dkearns -runtime/compiler/rubyunit.vim @dkearns -runtime/compiler/sass.vim @tpope -runtime/compiler/sdoc.vim @gpanders -runtime/compiler/se.vim @dkearns -runtime/compiler/shellcheck.vim @dkearns -runtime/compiler/sml.vim @dkearns -runtime/compiler/spectral.vim @romainl -runtime/compiler/svelte-check.vim @Konfekt -runtime/compiler/stylelint.vim @dkearns -runtime/compiler/tcl.vim @dkearns -runtime/compiler/tidy.vim @dkearns -runtime/compiler/ts-node.vim @dkearns -runtime/compiler/tsc.vim @dkearns -runtime/compiler/typedoc.vim @dkearns -runtime/compiler/typst.vim @saccarosium -runtime/compiler/xmllint.vim @dkearns -runtime/compiler/xo.vim @dkearns -runtime/compiler/yamllint.vim @romainl -runtime/compiler/zsh.vim @dkearns -runtime/doc/ft_hare.txt @selenebun -runtime/doc/ps1.txt @heaths -runtime/doc/evim-ru.1 @RestorerZ -runtime/doc/evim-ru.UTF-8.1 @RestorerZ -runtime/doc/vim-ru.1 @RestorerZ -runtime/doc/vim-ru.UTF-8.1 @RestorerZ -runtime/doc/vimdiff-ru.1 @RestorerZ -runtime/doc/vimdiff-ru.UTF-8.1 @RestorerZ -runtime/doc/vimtutor-ru.1 @RestorerZ -runtime/doc/vimtutor-ru.UTF-8.1 @RestorerZ -runtime/doc/xxd-ru.1 @RestorerZ -runtime/doc/xxd-ru.UTF-8.1 @RestorerZ -runtime/ftplugin/abaqus.vim @costerwi -runtime/ftplugin/antlr4.vim @jiangyinzuo -runtime/ftplugin/apache.vim @dubgeiser -runtime/ftplugin/arduino.vim @k-takata -runtime/ftplugin/asciidoc.vim @saccarosium -runtime/ftplugin/astro.vim @romainl -runtime/ftplugin/asy.vim @avidseeker -runtime/ftplugin/autohotkey.vim @telemachus -runtime/ftplugin/awk.vim @dkearns -runtime/ftplugin/basic.vim @dkearns -runtime/ftplugin/bst.vim @tpope -runtime/ftplugin/c3.vim @ttytm -runtime/ftplugin/cabal.vim @ribru17 -runtime/ftplugin/cedar.vim @ribru17 -runtime/ftplugin/cfg.vim @chrisbra -runtime/ftplugin/chatito.vim @ObserverOfTime -runtime/ftplugin/chicken.vim @evhan -runtime/ftplugin/clojure.vim @axvr -runtime/ftplugin/cmakecache.vim @ribru17 -runtime/ftplugin/cook.vim @ribru17 -runtime/ftplugin/cs.vim @nickspoons -runtime/ftplugin/csh.vim @dkearns -runtime/ftplugin/css.vim @dkearns -runtime/ftplugin/csv.vim @habamax -runtime/ftplugin/cucumber.vim @tpope -runtime/ftplugin/cuda.vim @ribru17 -runtime/ftplugin/dart.vim @ribru17 -runtime/ftplugin/deb822sources.vim @jamessan -runtime/ftplugin/debchangelog.vim @jamessan -runtime/ftplugin/debcontrol.vim @jamessan -runtime/ftplugin/debsources.vim @jamessan -runtime/ftplugin/desktop.vim @e-kwsm -runtime/ftplugin/dnsmasq.vim @dringsim -runtime/ftplugin/dosbatch.vim @mrdubya -runtime/ftplugin/editorconfig.vim @ribru17 -runtime/ftplugin/eiffel.vim @dkearns -runtime/ftplugin/elixir.vim @mhanberg -runtime/ftplugin/erlang.vim @hcs42 -runtime/ftplugin/eruby.vim @tpope @dkearns -runtime/ftplugin/expect.vim @dkearns -runtime/ftplugin/exports.vim @mperry2 -runtime/ftplugin/fennel.vim @gpanders -runtime/ftplugin/fetchmail.vim @dkearns -runtime/ftplugin/forth.vim @jkotlinski -runtime/ftplugin/fpcmake.vim @dkearns -runtime/ftplugin/freebasic.vim @dkearns -runtime/ftplugin/fstab.vim @rid9 -runtime/ftplugin/gdb.vim @xeyownt -runtime/ftplugin/gdscript.vim @habamax -runtime/ftplugin/gdshader.vim @habamax -runtime/ftplugin/git.vim @tpope -runtime/ftplugin/gitattributes.vim @ObserverOfTime -runtime/ftplugin/gitcommit.vim @tpope -runtime/ftplugin/gitconfig.vim @tpope -runtime/ftplugin/gitignore.vim @ObserverOfTime -runtime/ftplugin/gitrebase.vim @tpope -runtime/ftplugin/gitsendemail.vim @tpope -runtime/ftplugin/gleam.vim @trilowy -runtime/ftplugin/go.vim @dbarnett -runtime/ftplugin/goaccess.vim @meonkeys -runtime/ftplugin/gomod.vim @yu-yk -runtime/ftplugin/gprof.vim @dpelle -runtime/ftplugin/graphql.vim @jparise -runtime/ftplugin/gyp.vim @ObserverOfTime -runtime/ftplugin/haml.vim @tpope -runtime/ftplugin/hare.vim @selenebun -runtime/ftplugin/haredoc.vim @selenebun -runtime/ftplugin/heex.vim @cvincent -runtime/ftplugin/hcl.vim @gpanders -runtime/ftplugin/hgcommit.vim @k-takata -runtime/ftplugin/hlsplaylist.vim @avidseeker -runtime/ftplugin/hog.vim @wtfbbqhax -runtime/ftplugin/html.vim @dkearns -runtime/ftplugin/http.vim @ribru17 -runtime/ftplugin/hyprlang.vim @ribru17 -runtime/ftplugin/i3config.vim @hiqua -runtime/ftplugin/icon.vim @dkearns -runtime/ftplugin/indent.vim @dkearns -runtime/ftplugin/ishd.vim @dkearns -runtime/ftplugin/j.vim @glts -runtime/ftplugin/java.vim @zzzyxwvut -runtime/ftplugin/javacc.vim @ribru17 -runtime/ftplugin/javascript.vim @dkearns -runtime/ftplugin/javascriptreact.vim @dkearns -runtime/ftplugin/jjdescription.vim @gpanders -runtime/ftplugin/json.vim @dbarnett -runtime/ftplugin/json5.vim @dkearns -runtime/ftplugin/jsonc.vim @izhakjakov -runtime/ftplugin/julia.vim @carlobaldassi -runtime/ftplugin/just.vim @pbnj -runtime/ftplugin/jq.vim @vito-c -runtime/ftplugin/kconfig.vim @chrisbra -runtime/ftplugin/kdl.vim @imsnif @jiangyinzuo -runtime/ftplugin/kivy.vim @ribru17 -runtime/ftplugin/kotlin.vim @udalov -runtime/ftplugin/ldapconf.vim @ribru17 -runtime/ftplugin/leo.vim @ribru17 -runtime/ftplugin/less.vim @genoma -runtime/ftplugin/lex.vim @ribru17 -runtime/ftplugin/liquid.vim @tpope -runtime/ftplugin/lua.vim @dkearns -runtime/ftplugin/lc.vim @ribru17 -runtime/ftplugin/lynx.vim @dkearns -runtime/ftplugin/m17ndb.vim @dseomn -runtime/ftplugin/m3build.vim @dkearns -runtime/ftplugin/m3quake.vim @dkearns -runtime/ftplugin/markdown.vim @tpope -runtime/ftplugin/mediawiki.vim @avidseeker -runtime/ftplugin/meson.vim @Liambeguin -runtime/ftplugin/modula2.vim @dkearns -runtime/ftplugin/modula3.vim @dkearns -runtime/ftplugin/mojo.vim @ribru17 -runtime/ftplugin/mss.vim @Freed-Wu -runtime/ftplugin/nginx.vim @chr4 -runtime/ftplugin/nim.vim @ribru17 -runtime/ftplugin/nroff.vim @a-vrma -runtime/ftplugin/nsis.vim @k-takata -runtime/ftplugin/nu.vim @mrcjkb -runtime/ftplugin/octave.vim @dkearns -runtime/ftplugin/ondir.vim @jparise -runtime/ftplugin/opencl.vim @Freed-Wu -runtime/ftplugin/openvpn.vim @ObserverOfTime -runtime/ftplugin/org.vim @saccarosium -runtime/ftplugin/pascal.vim @dkearns -runtime/ftplugin/pbtxt.vim @lakshayg -runtime/ftplugin/pdf.vim @tpope -runtime/ftplugin/perl.vim @petdance @dkearns -runtime/ftplugin/php.vim @dkearns -runtime/ftplugin/plsql.vim @lee-lindley -runtime/ftplugin/pod.vim @petdance @dkearns -runtime/ftplugin/poefilter.vim @ObserverOfTime -runtime/ftplugin/postscr.vim @mrdubya -runtime/ftplugin/prisma.vim @ribru17 -runtime/ftplugin/proto.vim @Limero -runtime/ftplugin/ps1.vim @heaths -runtime/ftplugin/ps1xml.vim @heaths -runtime/ftplugin/ptx.vim @jiangyinzuo -runtime/ftplugin/purescript.vim @ribru17 -runtime/ftplugin/pymanifest.vim @ObserverOfTime -runtime/ftplugin/python.vim @tpict -runtime/ftplugin/qb64.vim @dkearns -runtime/ftplugin/qml.vim @ChaseKnowlden -runtime/ftplugin/racket.vim @benknoble -runtime/ftplugin/rasi.vim @fymyte -runtime/ftplugin/readline.vim @dkearns -runtime/ftplugin/rescript.vim @ribru17 -runtime/ftplugin/routeros.vim @zainin -runtime/ftplugin/rst.vim @marshallward -runtime/ftplugin/ruby.vim @tpope @dkearns -runtime/ftplugin/rust.vim @lilyball -runtime/ftplugin/samba.vim @mperry2 -runtime/ftplugin/sass.vim @tpope -runtime/ftplugin/scala.vim @derekwyatt -runtime/ftplugin/scheme.vim @evhan -runtime/ftplugin/scss.vim @tpope -runtime/ftplugin/sdoc.vim @gpanders -runtime/ftplugin/sed.vim @dkearns -runtime/ftplugin/sh.vim @dkearns -runtime/ftplugin/shaderslang.vim @mTvare6 -runtime/ftplugin/slint.vim @ribru17 -runtime/ftplugin/snakemake.vim @ribru17 -runtime/ftplugin/solidity.vim @cothi -runtime/ftplugin/solution.vim @dkearns -runtime/ftplugin/spajson.vim @dseomn -runtime/ftplugin/spec.vim @ignatenkobrain -runtime/ftplugin/squirrel.vim @ribru17 -runtime/ftplugin/ssa.vim @ObserverOfTime -runtime/ftplugin/sshdconfig.vim @jiangyinzuo -runtime/ftplugin/svelte.vim @igorlfs -runtime/ftplugin/sway.vim @ribru17 -runtime/ftplugin/swayconfig.vim @jamespeapen -runtime/ftplugin/systemverilog.vim @Kocha -runtime/ftplugin/swig.vim @jmarrec -runtime/ftplugin/tap.vim @petdance -runtime/ftplugin/tcsh.vim @dkearns -runtime/ftplugin/tera.vim @MuntasirSZN -runtime/ftplugin/terraform.vim @JannoTjarks -runtime/ftplugin/tf.vim @ribru17 -runtime/ftplugin/thrift.vim @jiangyinzuo -runtime/ftplugin/tiasm.vim @Freed-Wu -runtime/ftplugin/tidy.vim @dkearns -runtime/ftplugin/tmux.vim @ericpruitt -runtime/ftplugin/toml.vim @averms -runtime/ftplugin/tt2html.vim @petdance -runtime/ftplugin/typescript.vim @dkearns -runtime/ftplugin/typescriptreact.vim @dkearns -runtime/ftplugin/typst.vim @saccarosium -runtime/ftplugin/unison.vim @chuwy -runtime/ftplugin/v.vim @ribru17 -runtime/ftplugin/vdf.vim @ObserverOfTime -runtime/ftplugin/vim.vim @dkearns -runtime/ftplugin/wast.vim @rhysd -runtime/ftplugin/wget.vim @dkearns -runtime/ftplugin/wget2.vim @dkearns -runtime/ftplugin/xcompose.vim @ObserverOfTime -runtime/ftplugin/xml.vim @chrisbra -runtime/ftplugin/xs.vim @petdance -runtime/ftplugin/yacc.vim @ribru17 -runtime/ftplugin/zsh.vim @chrisbra -runtime/import/dist/vimhighlight.vim @lacygoill -runtime/indent/arduino.vim @k-takata -runtime/indent/astro.vim @wuelnerdotexe -runtime/indent/basic.vim @dkearns -runtime/indent/bst.vim @tpope -runtime/indent/cdl.vim @dkearns -runtime/indent/chatito.vim @ObserverOfTime -runtime/indent/clojure.vim @axvr -runtime/indent/config.vim @dkearns -runtime/indent/cs.vim @nickspoons -runtime/indent/css.vim @dkearns -runtime/indent/cucumber.vim @tpope -runtime/indent/d.vim @dkearns -runtime/indent/dosbatch.vim @k-takata -runtime/indent/dtd.vim @dkearns -runtime/indent/dylan.vim @dkearns -runtime/indent/eiffel.vim @jocelyn -runtime/indent/elm.vim @andys8 -runtime/indent/erlang.vim @hcs42 -runtime/indent/eruby.vim @tpope @dkearns -runtime/indent/eterm.vim @dkearns -runtime/indent/falcon.vim @steveno -runtime/indent/framescript.vim @dkearns -runtime/indent/freebasic.vim @dkearns -runtime/indent/gdscript.vim @habamax -runtime/indent/gitconfig.vim @tpope -runtime/indent/gitolite.vim @sitaramc -runtime/indent/glsl.vim @gpanders -runtime/indent/go.vim @dbarnett -runtime/indent/graphql.vim @jparise -runtime/indent/gyp.vim @ObserverOfTime -runtime/indent/haml.vim @tpope -runtime/indent/hare.vim @selenebun -runtime/indent/hcl.vim @gpanders -runtime/indent/hog.vim @wtfbbqhax -runtime/indent/idlang.vim @dkearns -runtime/indent/j.vim @glts -runtime/indent/java.vim @xuhdev -runtime/indent/javascript.vim @bounceme -runtime/indent/json.vim @elzr -runtime/indent/jsonc.vim @izhakjakov -runtime/indent/julia.vim @carlobaldassi -runtime/indent/just.vim @pbnj -runtime/indent/kdl.vim @imsnif @jiangyinzuo -runtime/indent/kotlin.vim @udalov -runtime/indent/krl.vim @KnoP-01 -runtime/indent/ld.vim @dkearns -runtime/indent/less.vim @genoma -runtime/indent/liquid.vim @tpope -runtime/indent/lua.vim @marcuscf -runtime/indent/m17ndb.vim @dseomn -runtime/indent/make.vim @dkearns -runtime/indent/meson.vim @Liambeguin -runtime/indent/mma.vim @dkearns -runtime/indent/mojo.vim @ribru17 -runtime/indent/nginx.vim @chr4 -runtime/indent/nsis.vim @k-takata -runtime/indent/occam.vim @dkearns -runtime/indent/perl.vim @petdance -runtime/indent/php.vim @2072 -runtime/indent/postscr.vim @mrdubya -runtime/indent/prolog.vim @dkearns -runtime/indent/proto.vim @Limero -runtime/indent/ps1.vim @heaths -runtime/indent/qb64.vim @dkearns -runtime/indent/qml.vim @ChaseKnowlden -runtime/indent/racket.vim @benknoble -runtime/indent/rapid.vim @KnoP-01 -runtime/indent/readline.vim @dkearns -runtime/indent/ruby.vim @AndrewRadev @dkearns -runtime/indent/sass.vim @tpope -runtime/indent/scala.vim @derekwyatt -runtime/indent/scheme.vim @evhan -runtime/indent/scss.vim @tpope -runtime/indent/sh.vim @chrisbra -runtime/indent/solidity.vim @cothi -runtime/indent/spajson.vim @dseomn -runtime/indent/systemverilog.vim @Kocha -runtime/indent/tcl.vim @dkearns -runtime/indent/tcsh.vim @dkearns -runtime/indent/teraterm.vim @k-takata -runtime/indent/terraform.vim @gpanders -runtime/indent/thrift.vim @jiangyinzuo -runtime/indent/typescript.vim @HerringtonDarkholme -runtime/indent/typst.vim @saccarosium -runtime/indent/vroom.vim @dbarnett -runtime/indent/wast.vim @rhysd -runtime/indent/xml.vim @chrisbra -runtime/indent/zsh.vim @chrisbra -runtime/keymap/armenian-eastern_utf-8.vim @blinskey -runtime/keymap/armenian-western_utf-8.vim @blinskey -runtime/keymap/russian-typograph.vim @RestorerZ -runtime/keymap/tamil_tscii.vim @yegappan -runtime/keymap/ukrainian-enhanced.vim @Dolfost -runtime/lang/menu_en_gb.latin1.vim @mrdubya -runtime/lang/menu_ru_ru.cp1251.vim @RestorerZ -runtime/lang/menu_ru_ru.koi8-r.vim @RestorerZ -runtime/lang/menu_ru_ru.utf-8.vim @RestorerZ +nsis/lang/russian.nsi @RestorerZ +runtime/autoload/freebasic.vim @dkearns +runtime/autoload/hare.vim @selenebun +runtime/autoload/hcl.vim @gpanders +runtime/autoload/modula2.vim @dkearns +runtime/autoload/rubycomplete.vim @segfault @dkearns +runtime/autoload/rust.vim @lilyball +runtime/autoload/typst.vim @saccarosium +runtime/autoload/xmlformat.vim @chrisbra +runtime/autoload/dist/json.vim @habamax +runtime/colors/blue.vim @habamax @romainl @neutaaaaan +runtime/colors/darkblue.vim @habamax @romainl @neutaaaaan +runtime/colors/default.vim @habamax @romainl @neutaaaaan +runtime/colors/delek.vim @habamax @romainl @neutaaaaan +runtime/colors/desert.vim @habamax @romainl @neutaaaaan +runtime/colors/elflord.vim @habamax @romainl @neutaaaaan +runtime/colors/evening.vim @habamax @romainl @neutaaaaan +runtime/colors/habamax.vim @habamax @romainl @neutaaaaan +runtime/colors/industry.vim @habamax @romainl @neutaaaaan +runtime/colors/koehler.vim @habamax @romainl @neutaaaaan +runtime/colors/lunaperche.vim @habamax @romainl @neutaaaaan +runtime/colors/morning.vim @habamax @romainl @neutaaaaan +runtime/colors/murphy.vim @habamax @romainl @neutaaaaan +runtime/colors/pablo.vim @habamax @romainl @neutaaaaan +runtime/colors/peachpuff.vim @habamax @romainl @neutaaaaan +runtime/colors/quiet.vim @habamax @romainl @neutaaaaan +runtime/colors/retrobox.vim @habamax @romainl @neutaaaaan +runtime/colors/ron.vim @habamax @romainl @neutaaaaan +runtime/colors/shine.vim @habamax @romainl @neutaaaaan +runtime/colors/slate.vim @habamax @romainl @neutaaaaan +runtime/colors/sorbet.vim @habamax @romainl @neutaaaaan +runtime/colors/tools @habamax @romainl @neutaaaaan +runtime/colors/torte.vim @habamax @romainl @neutaaaaan +runtime/colors/wildcharm.vim @habamax @romainl @neutaaaaan +runtime/colors/zaibatsu.vim @habamax @romainl @neutaaaaan +runtime/colors/zellner.vim @habamax @romainl @neutaaaaan +runtime/compiler/checkstyle.vim @dkearns +runtime/compiler/cm3.vim @dkearns +runtime/compiler/cucumber.vim @tpope +runtime/compiler/dart.vim @dkearns +runtime/compiler/dart2js.vim @dkearns +runtime/compiler/dart2native.vim @dkearns +runtime/compiler/dartanalyser.vim @dkearns +runtime/compiler/dartdevc.vim @dkearns +runtime/compiler/dartdoc.vim @dkearns +runtime/compiler/dartfmt.vim @dkearns +runtime/compiler/dotnet.vim @nickspoons +runtime/compiler/eruby.vim @dkearns +runtime/compiler/fbc.vim @dkearns +runtime/compiler/gawk.vim @dkearns +runtime/compiler/gjs.vim @dkearns +runtime/compiler/gm2.vim @dkearns +runtime/compiler/go.vim @dbarnett +runtime/compiler/groff.vim @Konfekt +runtime/compiler/haml.vim @tpope +runtime/compiler/hare.vim @selenebun +runtime/compiler/icon.vim @dkearns +runtime/compiler/javac.vim @dkearns +runtime/compiler/jest.vim @dkearns +runtime/compiler/jjs.vim @dkearns +runtime/compiler/jshint.vim @dkearns +runtime/compiler/jsonlint.vim @dkearns +runtime/compiler/jq.vim @vito-c +runtime/compiler/pandoc.vim @Konfekt +runtime/compiler/perl.vim @petdance @heptite +runtime/compiler/perlcritic.vim @petdance @dkearns +runtime/compiler/php.vim @dkearns +runtime/compiler/phpstan.vim @dietrichm +runtime/compiler/podchecker.vim @petdance @dkearns +runtime/compiler/powershell.vim @heaths +runtime/compiler/raco.vim @benknoble +runtime/compiler/racomake.vim @benknoble +runtime/compiler/racosetup.vim @benknoble +runtime/compiler/racotest.vim @benknoble +runtime/compiler/rake.vim @tpope @dkearns +runtime/compiler/rhino.vim @dkearns +runtime/compiler/rspec.vim @tpope @dkearns +runtime/compiler/rubocop.vim @dkearns +runtime/compiler/ruby.vim @tpope @dkearns +runtime/compiler/rubyunit.vim @dkearns +runtime/compiler/sass.vim @tpope +runtime/compiler/se.vim @dkearns +runtime/compiler/shellcheck.vim @dkearns +runtime/compiler/sml.vim @dkearns +runtime/compiler/spectral.vim @romainl +runtime/compiler/svelte-check.vim @Konfekt +runtime/compiler/stylelint.vim @dkearns +runtime/compiler/tcl.vim @dkearns +runtime/compiler/tidy.vim @dkearns +runtime/compiler/ts-node.vim @dkearns +runtime/compiler/tsc.vim @dkearns +runtime/compiler/typedoc.vim @dkearns +runtime/compiler/typst.vim @saccarosium +runtime/compiler/xmllint.vim @dkearns +runtime/compiler/xo.vim @dkearns +runtime/compiler/yamllint.vim @romainl +runtime/compiler/zsh.vim @dkearns +runtime/doc/ft_hare.txt @selenebun +runtime/doc/evim-ru.1 @RestorerZ +runtime/doc/evim-ru.UTF-8.1 @RestorerZ +runtime/doc/vim-ru.1 @RestorerZ +runtime/doc/vim-ru.UTF-8.1 @RestorerZ +runtime/doc/vimdiff-ru.1 @RestorerZ +runtime/doc/vimdiff-ru.UTF-8.1 @RestorerZ +runtime/doc/vimtutor-ru.1 @RestorerZ +runtime/doc/vimtutor-ru.UTF-8.1 @RestorerZ +runtime/doc/xxd-ru.1 @RestorerZ +runtime/doc/xxd-ru.UTF-8.1 @RestorerZ +runtime/ftplugin/abaqus.vim @costerwi +runtime/ftplugin/abnf.vim @A4-Tacks +runtime/ftplugin/antlr4.vim @jiangyinzuo +runtime/ftplugin/apache.vim @dubgeiser +runtime/ftplugin/arduino.vim @k-takata +runtime/ftplugin/asciidoc.vim @saccarosium +runtime/ftplugin/astro.vim @romainl +runtime/ftplugin/asy.vim @avidseeker +runtime/ftplugin/autohotkey.vim @telemachus +runtime/ftplugin/awk.vim @dkearns +runtime/ftplugin/basic.vim @dkearns +runtime/ftplugin/brighterscript.vim @ribru17 +runtime/ftplugin/brightscript.vim @ribru17 +runtime/ftplugin/bst.vim @tpope +runtime/ftplugin/c3.vim @ttytm +runtime/ftplugin/cabal.vim @ribru17 +runtime/ftplugin/cedar.vim @ribru17 +runtime/ftplugin/cfg.vim @chrisbra +runtime/ftplugin/chatito.vim @ObserverOfTime +runtime/ftplugin/chicken.vim @evhan +runtime/ftplugin/clojure.vim @axvr +runtime/ftplugin/cmakecache.vim @ribru17 +runtime/ftplugin/cook.vim @ribru17 +runtime/ftplugin/cs.vim @nickspoons +runtime/ftplugin/csh.vim @dkearns +runtime/ftplugin/css.vim @dkearns +runtime/ftplugin/csv.vim @habamax +runtime/ftplugin/cucumber.vim @tpope +runtime/ftplugin/cuda.vim @ribru17 +runtime/ftplugin/dart.vim @ribru17 +runtime/ftplugin/dax.vim @anarion80 +runtime/ftplugin/deb822sources.vim @jamessan +runtime/ftplugin/debchangelog.vim @jamessan +runtime/ftplugin/debcontrol.vim @jamessan +runtime/ftplugin/debsources.vim @jamessan +runtime/ftplugin/desktop.vim @e-kwsm +runtime/ftplugin/dnsmasq.vim @dringsim +runtime/ftplugin/dosbatch.vim @mrdubya +runtime/ftplugin/editorconfig.vim @ribru17 +runtime/ftplugin/eiffel.vim @dkearns +runtime/ftplugin/elixir.vim @mhanberg +runtime/ftplugin/erlang.vim @hcs42 +runtime/ftplugin/eruby.vim @tpope @dkearns +runtime/ftplugin/expect.vim @dkearns +runtime/ftplugin/exports.vim @mperry2 +runtime/ftplugin/fennel.vim @gpanders +runtime/ftplugin/fetchmail.vim @dkearns +runtime/ftplugin/fga.vim @ribru17 +runtime/ftplugin/forth.vim @jkotlinski +runtime/ftplugin/fpcmake.vim @dkearns +runtime/ftplugin/freebasic.vim @dkearns +runtime/ftplugin/fstab.vim @rid9 +runtime/ftplugin/gdb.vim @xeyownt +runtime/ftplugin/gdscript.vim @habamax +runtime/ftplugin/gdshader.vim @habamax +runtime/ftplugin/git.vim @tpope +runtime/ftplugin/gitattributes.vim @ObserverOfTime +runtime/ftplugin/gitcommit.vim @tpope +runtime/ftplugin/gitconfig.vim @tpope +runtime/ftplugin/gitignore.vim @ObserverOfTime +runtime/ftplugin/gitrebase.vim @tpope +runtime/ftplugin/gitsendemail.vim @tpope +runtime/ftplugin/gleam.vim @kirillmorozov +runtime/ftplugin/go.vim @dbarnett +runtime/ftplugin/goaccess.vim @meonkeys +runtime/ftplugin/gomod.vim @yu-yk +runtime/ftplugin/gprof.vim @dpelle +runtime/ftplugin/graphql.vim @jparise +runtime/ftplugin/groff.vim @e-kwsm +runtime/ftplugin/gyp.vim @ObserverOfTime +runtime/ftplugin/haml.vim @tpope +runtime/ftplugin/hare.vim @selenebun +runtime/ftplugin/haredoc.vim @selenebun +runtime/ftplugin/heex.vim @cvincent +runtime/ftplugin/hcl.vim @gpanders +runtime/ftplugin/hgcommit.vim @k-takata +runtime/ftplugin/hlsplaylist.vim @avidseeker +runtime/ftplugin/hog.vim @wtfbbqhax +runtime/ftplugin/html.vim @dkearns +runtime/ftplugin/http.vim @ribru17 +runtime/ftplugin/hyprlang.vim @ribru17 +runtime/ftplugin/i3config.vim @hiqua +runtime/ftplugin/icon.vim @dkearns +runtime/ftplugin/indent.vim @dkearns +runtime/ftplugin/ishd.vim @dkearns +runtime/ftplugin/j.vim @glts +runtime/ftplugin/java.vim @zzzyxwvut +runtime/ftplugin/javacc.vim @ribru17 +runtime/ftplugin/javascript.vim @dkearns +runtime/ftplugin/javascriptreact.vim @dkearns +runtime/ftplugin/jjdescription.vim @gpanders +runtime/ftplugin/json.vim @dbarnett +runtime/ftplugin/json5.vim @dkearns +runtime/ftplugin/jsonc.vim @izhakjakov +runtime/ftplugin/julia.vim @carlobaldassi +runtime/ftplugin/just.vim @pbnj +runtime/ftplugin/jq.vim @vito-c +runtime/ftplugin/kconfig.vim @chrisbra +runtime/ftplugin/kdl.vim @imsnif @jiangyinzuo +runtime/ftplugin/kivy.vim @ribru17 +runtime/ftplugin/kotlin.vim @udalov +runtime/ftplugin/ldapconf.vim @ribru17 +runtime/ftplugin/leo.vim @ribru17 +runtime/ftplugin/less.vim @genoma +runtime/ftplugin/lex.vim @ribru17 +runtime/ftplugin/lf.vim @andis-sprinkis +runtime/ftplugin/liquid.vim @tpope +runtime/ftplugin/lua.vim @dkearns +runtime/ftplugin/lc.vim @ribru17 +runtime/ftplugin/lynx.vim @dkearns +runtime/ftplugin/m17ndb.vim @dseomn +runtime/ftplugin/m3build.vim @dkearns +runtime/ftplugin/m3quake.vim @dkearns +runtime/ftplugin/markdown.vim @tpope +runtime/ftplugin/mbsync.vim @fymyte +runtime/ftplugin/mediawiki.vim @avidseeker +runtime/ftplugin/meson.vim @Liambeguin +runtime/ftplugin/modula2.vim @dkearns +runtime/ftplugin/modula3.vim @dkearns +runtime/ftplugin/mojo.vim @ribru17 +runtime/ftplugin/mss.vim @Freed-Wu +runtime/ftplugin/nginx.vim @chr4 +runtime/ftplugin/nim.vim @ribru17 +runtime/ftplugin/nroff.vim @averms +runtime/ftplugin/nsis.vim @k-takata +runtime/ftplugin/nu.vim @mrcjkb +runtime/ftplugin/octave.vim @dkearns +runtime/ftplugin/ondir.vim @jparise +runtime/ftplugin/opencl.vim @Freed-Wu +runtime/ftplugin/openvpn.vim @ObserverOfTime +runtime/ftplugin/org.vim @saccarosium +runtime/ftplugin/pascal.vim @dkearns +runtime/ftplugin/pbtxt.vim @lakshayg +runtime/ftplugin/pdf.vim @tpope +runtime/ftplugin/perl.vim @petdance @dkearns +runtime/ftplugin/php.vim @dkearns +runtime/ftplugin/pkl.vim @ribru17 +runtime/ftplugin/plsql.vim @lee-lindley +runtime/ftplugin/pod.vim @petdance @dkearns +runtime/ftplugin/poefilter.vim @ObserverOfTime +runtime/ftplugin/postscr.vim @mrdubya +runtime/ftplugin/pq.vim @anarion80 +runtime/ftplugin/prisma.vim @ribru17 +runtime/ftplugin/proto.vim @Limero +runtime/ftplugin/ps1.vim @heaths +runtime/ftplugin/ps1xml.vim @heaths +runtime/ftplugin/ptx.vim @jiangyinzuo +runtime/ftplugin/purescript.vim @ribru17 +runtime/ftplugin/pymanifest.vim @ObserverOfTime +runtime/ftplugin/python.vim @tpict +runtime/ftplugin/qb64.vim @dkearns +runtime/ftplugin/qml.vim @ChaseKnowlden +runtime/ftplugin/racket.vim @benknoble +runtime/ftplugin/rasi.vim @fymyte +runtime/ftplugin/readline.vim @dkearns +runtime/ftplugin/remind.vim @joereynolds +runtime/ftplugin/rescript.vim @ribru17 +runtime/ftplugin/routeros.vim @zainin +runtime/ftplugin/rst.vim @marshallward +runtime/ftplugin/ruby.vim @tpope @dkearns +runtime/ftplugin/rust.vim @lilyball +runtime/ftplugin/samba.vim @mperry2 +runtime/ftplugin/sass.vim @tpope +runtime/ftplugin/scala.vim @derekwyatt +runtime/ftplugin/scheme.vim @evhan +runtime/ftplugin/scss.vim @tpope +runtime/ftplugin/sed.vim @dkearns +runtime/ftplugin/sh.vim @dkearns +runtime/ftplugin/shaderslang.vim @mTvare6 +runtime/ftplugin/slint.vim @ribru17 +runtime/ftplugin/snakemake.vim @ribru17 +runtime/ftplugin/solidity.vim @coti-z +runtime/ftplugin/solution.vim @dkearns +runtime/ftplugin/spajson.vim @dseomn +runtime/ftplugin/spec.vim @ignatenkobrain +runtime/ftplugin/squirrel.vim @ribru17 +runtime/ftplugin/ssa.vim @ObserverOfTime +runtime/ftplugin/sshdconfig.vim @jiangyinzuo +runtime/ftplugin/svelte.vim @igorlfs +runtime/ftplugin/sway.vim @ribru17 +runtime/ftplugin/swayconfig.vim @jamespeapen +runtime/ftplugin/systemverilog.vim @Kocha +runtime/ftplugin/swig.vim @jmarrec +runtime/ftplugin/tap.vim @petdance +runtime/ftplugin/tcsh.vim @dkearns +runtime/ftplugin/tera.vim @MuntasirSZN +runtime/ftplugin/terraform.vim @JannoTjarks +runtime/ftplugin/tf.vim @ribru17 +runtime/ftplugin/thrift.vim @jiangyinzuo +runtime/ftplugin/tiasm.vim @Freed-Wu +runtime/ftplugin/tidy.vim @dkearns +runtime/ftplugin/tmux.vim @ericpruitt +runtime/ftplugin/toml.vim @averms +runtime/ftplugin/tt2html.vim @petdance +runtime/ftplugin/twig.vim @ribru17 +runtime/ftplugin/typescript.vim @dkearns +runtime/ftplugin/typescriptreact.vim @dkearns +runtime/ftplugin/typst.vim @saccarosium +runtime/ftplugin/uc.vim @ribru17 +runtime/ftplugin/unison.vim @chuwy +runtime/ftplugin/v.vim @ribru17 +runtime/ftplugin/vdf.vim @ObserverOfTime +runtime/ftplugin/vim.vim @dkearns +runtime/ftplugin/wget.vim @dkearns +runtime/ftplugin/wget2.vim @dkearns +runtime/ftplugin/xcompose.vim @ObserverOfTime +runtime/ftplugin/xml.vim @chrisbra +runtime/ftplugin/xs.vim @petdance +runtime/ftplugin/yacc.vim @ribru17 +runtime/ftplugin/zsh.vim @chrisbra +runtime/import/dist/vimhighlight.vim @lacygoill +runtime/indent/arduino.vim @k-takata +runtime/indent/astro.vim @wuelnerdotexe +runtime/indent/basic.vim @dkearns +runtime/indent/bst.vim @tpope +runtime/indent/cdl.vim @dkearns +runtime/indent/chatito.vim @ObserverOfTime +runtime/indent/clojure.vim @axvr +runtime/indent/config.vim @dkearns +runtime/indent/cs.vim @nickspoons +runtime/indent/css.vim @dkearns +runtime/indent/cucumber.vim @tpope +runtime/indent/d.vim @dkearns +runtime/indent/dosbatch.vim @k-takata +runtime/indent/dtd.vim @dkearns +runtime/indent/dylan.vim @dkearns +runtime/indent/eiffel.vim @jocelyn +runtime/indent/elm.vim @andys8 +runtime/indent/erlang.vim @hcs42 +runtime/indent/eruby.vim @tpope @dkearns +runtime/indent/eterm.vim @dkearns +runtime/indent/falcon.vim @steveno +runtime/indent/framescript.vim @dkearns +runtime/indent/freebasic.vim @dkearns +runtime/indent/gdscript.vim @habamax +runtime/indent/gitconfig.vim @tpope +runtime/indent/gitolite.vim @sitaramc +runtime/indent/glsl.vim @gpanders +runtime/indent/go.vim @dbarnett +runtime/indent/graphql.vim @jparise +runtime/indent/gyp.vim @ObserverOfTime +runtime/indent/haml.vim @tpope +runtime/indent/hare.vim @selenebun +runtime/indent/hcl.vim @gpanders +runtime/indent/hog.vim @wtfbbqhax +runtime/indent/idlang.vim @dkearns +runtime/indent/j.vim @glts +runtime/indent/java.vim @xuhdev +runtime/indent/javascript.vim @bounceme +runtime/indent/json.vim @elzr +runtime/indent/jsonc.vim @izhakjakov +runtime/indent/julia.vim @carlobaldassi +runtime/indent/just.vim @pbnj +runtime/indent/kdl.vim @imsnif @jiangyinzuo +runtime/indent/kotlin.vim @udalov +runtime/indent/krl.vim @KnoP-01 +runtime/indent/ld.vim @dkearns +runtime/indent/less.vim @genoma +runtime/indent/liquid.vim @tpope +runtime/indent/lua.vim @marcuscf +runtime/indent/m17ndb.vim @dseomn +runtime/indent/make.vim @dkearns +runtime/indent/meson.vim @Liambeguin +runtime/indent/mma.vim @dkearns +runtime/indent/mojo.vim @ribru17 +runtime/indent/nginx.vim @chr4 +runtime/indent/nsis.vim @k-takata +runtime/indent/occam.vim @dkearns +runtime/indent/perl.vim @petdance +runtime/indent/php.vim @2072 +runtime/indent/postscr.vim @mrdubya +runtime/indent/prolog.vim @dkearns +runtime/indent/proto.vim @Limero +runtime/indent/ps1.vim @heaths +runtime/indent/qb64.vim @dkearns +runtime/indent/qml.vim @ChaseKnowlden +runtime/indent/racket.vim @benknoble +runtime/indent/rapid.vim @KnoP-01 +runtime/indent/readline.vim @dkearns +runtime/indent/ruby.vim @AndrewRadev @dkearns +runtime/indent/sass.vim @tpope +runtime/indent/scala.vim @derekwyatt +runtime/indent/scheme.vim @evhan +runtime/indent/scss.vim @tpope +runtime/indent/sh.vim @chrisbra +runtime/indent/solidity.vim @coti-z +runtime/indent/spajson.vim @dseomn +runtime/indent/systemverilog.vim @Kocha +runtime/indent/tcl.vim @dkearns +runtime/indent/tcsh.vim @dkearns +runtime/indent/teraterm.vim @k-takata +runtime/indent/terraform.vim @gpanders +runtime/indent/thrift.vim @jiangyinzuo +runtime/indent/typescript.vim @HerringtonDarkholme +runtime/indent/typst.vim @saccarosium +runtime/indent/vroom.vim @dbarnett +runtime/indent/xml.vim @chrisbra +runtime/indent/zsh.vim @chrisbra +runtime/keymap/armenian-eastern_utf-8.vim @blinskey +runtime/keymap/armenian-western_utf-8.vim @blinskey +runtime/keymap/brazilian_portuguese-abnt.vim @LuMarquesIlva +runtime/keymap/brazilian_portuguese-compact.vim @LuMarquesIlva +runtime/keymap/russian-typograph.vim @RestorerZ +runtime/keymap/tamil_tscii.vim @yegappan +runtime/keymap/ukrainian-enhanced.vim @Dolfost +runtime/lang/menu_en_gb.latin1.vim @mrdubya +runtime/lang/menu_ru_ru.cp1251.vim @RestorerZ +runtime/lang/menu_ru_ru.koi8-r.vim @RestorerZ +runtime/lang/menu_ru_ru.utf-8.vim @RestorerZ runtime/pack/dist/opt/cfilter/plugin/cfilter.vim @yegappan -runtime/pack/dist/opt/comment/ @habamax -runtime/pack/dist/opt/matchit/ @chrisbra -runtime/pack/dist/opt/nohlsearch/ @habamax -runtime/plugin/manpager.vim @Konfekt -runtime/syntax/shared/hgcommitDiff.vim @vegerot -runtime/syntax/abaqus.vim @costerwi -runtime/syntax/abnf.vim @A4-Tacks -runtime/syntax/aidl.vim @dpelle -runtime/syntax/ant.vim @dkearns -runtime/syntax/antlr4.vim @jiangyinzuo -runtime/syntax/arduino.vim @johshoff -runtime/syntax/asciidoc.vim @aerostitch -runtime/syntax/asm.vim @dkearns -runtime/syntax/asmh8300.vim @dkearns -runtime/syntax/asterisk.vim @jaunis -runtime/syntax/astro.vim @wuelnerdotexe -runtime/syntax/asy.vim @avidseeker -runtime/syntax/autohotkey.vim @mmikeww -runtime/syntax/awk.vim @dkearns -runtime/syntax/basic.vim @dkearns -runtime/syntax/bst.vim @tpope -runtime/syntax/bzl.vim @dbarnett -runtime/syntax/bzr.vim @hdima -runtime/syntax/cabal.vim @coot -runtime/syntax/cabalconfig.vim @coot -runtime/syntax/cabalproject.vim @coot -runtime/syntax/cf.vim @ernstvanderlinden -runtime/syntax/chatito.vim @ObserverOfTime -runtime/syntax/chicken.vim @evhan -runtime/syntax/chuck.vim @gacallea -runtime/syntax/clojure.vim @axvr -runtime/syntax/cs.vim @nickspoons -runtime/syntax/csv.vim @habamax -runtime/syntax/cucumber.vim @tpope -runtime/syntax/d.vim @JesseKPhillips -runtime/syntax/dart.vim @pr3d4t0r -runtime/syntax/datascript.vim @dpelle -runtime/syntax/deb822sources.vim @jamessan -runtime/syntax/debchangelog.vim @jamessan -runtime/syntax/debcontrol.vim @jamessan -runtime/syntax/debcopyright.vim @jamessan -runtime/syntax/debsources.vim @jamessan -runtime/syntax/dep3patch.vim @jamessan -runtime/syntax/desktop.vim @e-kwsm -runtime/syntax/dosbatch.vim @mrdubya -runtime/syntax/dosini.vim @xuhdev -runtime/syntax/dot.vim @mmottl -runtime/syntax/doxygen.vim @frogonwheels -runtime/syntax/dtd.vim @chrisbra -runtime/syntax/dts.vim @zonque -runtime/syntax/editorconfig.vim @gpanders -runtime/syntax/eiffel.vim @jocelyn -runtime/syntax/erlang.vim @hcs42 -runtime/syntax/eruby.vim @tpope @dkearns -runtime/syntax/expect.vim @dkearns -runtime/syntax/falcon.vim @steveno -runtime/syntax/fennel.vim @gpanders -runtime/syntax/fetchmail.vim @dkearns -runtime/syntax/forth.vim @jkotlinski -runtime/syntax/fpcmake.vim @dkearns -runtime/syntax/freebasic.vim @dkearns -runtime/syntax/fstab.vim @rid9 -runtime/syntax/gdresource.vim @habamax -runtime/syntax/gdscript.vim @habamax -runtime/syntax/gdshader.vim @habamax -runtime/syntax/git.vim @tpope -runtime/syntax/gitattributes.vim @ObserverOfTime -runtime/syntax/gitcommit.vim @tpope -runtime/syntax/gitconfig.vim @tpope -runtime/syntax/gitignore.vim @ObserverOfTime -runtime/syntax/gitolite.vim @sitaramc -runtime/syntax/gitrebase.vim @tpope -runtime/syntax/glsl.vim @gpanders -runtime/syntax/go.vim @bhcleek -runtime/syntax/goaccess.vim @meonkeys -runtime/syntax/godoc.vim @dbarnett -runtime/syntax/gp.vim @KBelabas -runtime/syntax/gprof.vim @dpelle -runtime/syntax/graphql.vim @jparise -runtime/syntax/groff.vim @jmarshall -runtime/syntax/gyp.vim @ObserverOfTime -runtime/syntax/haml.vim @tpope -runtime/syntax/hare.vim @selenebun -runtime/syntax/haredoc.vim @selenebun -runtime/syntax/haskell.vim @coot -runtime/syntax/hcl.vim @gpanders -runtime/syntax/help_ru.vim @RestorerZ -runtime/syntax/hgcommit.vim @k-takata -runtime/syntax/hitest.vim @lacygoill -runtime/syntax/hog.vim @wtfbbqhax -runtime/syntax/hollywood.vim @sodero -runtime/syntax/html.vim @dkearns -runtime/syntax/htmlangular.vim @dlvandenberg -runtime/syntax/hyprlang.vim @saccarosium -runtime/syntax/i3config.vim @hiqua -runtime/syntax/icon.vim @dkearns -runtime/syntax/indent.vim @dkearns -runtime/syntax/j.vim @glts -runtime/syntax/jargon.vim @h3xx -runtime/syntax/java.vim @zzzyxwvut -runtime/syntax/javascript.vim @fleiner -runtime/syntax/jinja.vim @gpanders -runtime/syntax/jjdescription.vim @gpanders -runtime/syntax/json.vim @vito-c -runtime/syntax/jsonc.vim @izhakjakov -runtime/syntax/julia.vim @carlobaldassi -runtime/syntax/just.vim @pbnj -runtime/syntax/jq.vim @vito-c -runtime/syntax/karel.vim @kirillmorozov -runtime/syntax/kconfig.vim @chrisbra -runtime/syntax/kivy.vim @prophittcorey -runtime/syntax/kotlin.vim @udalov -runtime/syntax/kdl.vim @imsnif @jiangyinzuo -runtime/syntax/krl.vim @KnoP-01 -runtime/syntax/less.vim @genoma -runtime/syntax/lf.vim @andis-sprinkis -runtime/syntax/liquid.vim @tpope -runtime/syntax/lua.vim @marcuscf -runtime/syntax/lyrics.vim @ObserverOfTime -runtime/syntax/lynx.vim @dkearns -runtime/syntax/m17ndb.vim @dseomn -runtime/syntax/m3build.vim @dkearns -runtime/syntax/m3quake.vim @dkearns -runtime/syntax/mailcap.vim @dkearns -runtime/syntax/make.vim @rohieb -runtime/syntax/mallard.vim @jhradilek -runtime/syntax/markdown.vim @tpope -runtime/syntax/mason.vim @petdance -runtime/syntax/mediawiki.vim @avidseeker -runtime/syntax/meson.vim @Liambeguin -runtime/syntax/modula2.vim @dkearns -runtime/syntax/modula2/opt/iso.vim @trijezdci -runtime/syntax/modula2/opt/pim.vim @trijezdci -runtime/syntax/modula2/opt/r10.vim @trijezdci -runtime/syntax/modula3.vim @dkearns -runtime/syntax/mss.vim @Freed-Wu -runtime/syntax/n1ql.vim @pr3d4t0r -runtime/syntax/nginx.vim @chr4 -runtime/syntax/ninja.vim @nico -runtime/syntax/nix.vim @equill -runtime/syntax/nroff.vim @jmarshall -runtime/syntax/nsis.vim @k-takata -runtime/syntax/omnimark.vim @kennypete -runtime/syntax/ondir.vim @jparise -runtime/syntax/opencl.vim @Freed-Wu -runtime/syntax/openvpn.vim @ObserverOfTime -runtime/syntax/org.vim @saccarosium -runtime/syntax/pacmanlog.vim @rpigott -runtime/syntax/pascal.vim @dkearns -runtime/syntax/pbtxt.vim @lakshayg -runtime/syntax/pdf.vim @tpope -runtime/syntax/perl.vim @petdance -runtime/syntax/php.vim @TysonAndre -runtime/syntax/plsql.vim @lee-lindley -runtime/syntax/pod.vim @petdance -runtime/syntax/poefilter.vim @ObserverOfTime -runtime/syntax/postscr.vim @mrdubya -runtime/syntax/privoxy.vim @dkearns -runtime/syntax/progress.vim @rdnlsmith -runtime/syntax/prolog.vim @XVilka -runtime/syntax/prql.vim @vanillajonathan -runtime/syntax/ps1.vim @heaths -runtime/syntax/ps1xml.vim @heaths -runtime/syntax/psl.vim @danielkho -runtime/syntax/ptx.vim @jiangyinzuo -runtime/syntax/pymanifest.vim @ObserverOfTime -runtime/syntax/qb64.vim @dkearns -runtime/syntax/qml.vim @ChaseKnowlden -runtime/syntax/racket.vim @benknoble -runtime/syntax/raml.vim @in3d -runtime/syntax/rapid.vim @KnoP-01 -runtime/syntax/ratpoison.vim @trapd00r -runtime/syntax/rasi.vim @fymyte -runtime/syntax/rc.vim @chrisbra -runtime/syntax/rcs.vim @hdima -runtime/syntax/rebol.vim @mrdubya -runtime/syntax/rego.vim @zenmatic -runtime/syntax/resolv.vim @rid9 -runtime/syntax/rng.vim @jhradilek -runtime/syntax/routeros.vim @zainin -runtime/syntax/rst.vim @marshallward -runtime/syntax/ruby.vim @dkearns -runtime/syntax/salt.vim @gpanders -runtime/syntax/sass.vim @tpope -runtime/syntax/scala.vim @derekwyatt -runtime/syntax/scheme.vim @evhan -runtime/syntax/scss.vim @tpope -runtime/syntax/sdoc.vim @gpanders -runtime/syntax/sed.vim @dkearns -runtime/syntax/shared/debversions.vim @jamessan -runtime/syntax/shaderslang.vim @mTvare6 -runtime/syntax/solidity.vim @cothi -runtime/syntax/spajson.vim @dseomn -runtime/syntax/spec.vim @ignatenkobrain -runtime/syntax/sqloracle.vim @chrisbra -runtime/syntax/squirrel.vim @zenmatic -runtime/syntax/srt.vim @ObserverOfTime -runtime/syntax/ssa.vim @ObserverOfTime -runtime/syntax/sshconfig.vim @Jakuje -runtime/syntax/sshdconfig.vim @Jakuje -runtime/syntax/sudoers.vim @e-kwsm -runtime/syntax/svn.vim @hdima -runtime/syntax/swayconfig.vim @jamespeapen -runtime/syntax/swig.vim @jmarrec -runtime/syntax/systemverilog.vim @Kocha -runtime/syntax/tap.vim @petdance -runtime/syntax/tcsh.vim @dkearns -runtime/syntax/tera.vim @MuntasirSZN -runtime/syntax/teraterm.vim @k-takata -runtime/syntax/terraform.vim @gpanders -runtime/syntax/thrift.vim @jiangyinzuo -runtime/syntax/tiasm.vim @Freed-Wu -runtime/syntax/tidy.vim @dkearns -runtime/syntax/tmux.vim @ericpruitt -runtime/syntax/toml.vim @averms -runtime/syntax/tt2.vim @petdance -runtime/syntax/tt2html.vim @petdance -runtime/syntax/tt2js.vim @petdance -runtime/syntax/typescript.vim @HerringtonDarkholme @rhysd -runtime/syntax/typescriptreact.vim @HerringtonDarkholme @rhysd -runtime/syntax/typst.vim @gpanders -runtime/syntax/shared/typescriptcommon.vim @HerringtonDarkholme @rhysd -runtime/syntax/unison.vim @chuwy -runtime/syntax/vdf.vim @ObserverOfTime -runtime/syntax/vroom.vim @dbarnett -runtime/syntax/wast.vim @rhysd -runtime/syntax/wdl.vim @zenmatic -runtime/syntax/wget.vim @dkearns -runtime/syntax/wget2.vim @dkearns -runtime/syntax/xbl.vim @dkearns -runtime/syntax/xcompose.vim @ObserverOfTime -runtime/syntax/xml.vim @chrisbra -runtime/syntax/xs.vim @petdance -runtime/syntax/xslt.vim @Boobies -runtime/syntax/zserio.vim @dpelle -runtime/syntax/zsh.vim @chrisbra -runtime/tutor/tutor.eo @dpelle -runtime/tutor/tutor.eo.utf-8 @dpelle -runtime/tutor/tutor.fr @dpelle -runtime/tutor/tutor.fr.utf-8 @dpelle -runtime/tutor/tutor.ru @RestorerZ -runtime/tutor/tutor.ru.cp1251 @RestorerZ -runtime/tutor/tutor.ru.utf-8 @RestorerZ -src/iscygpty.* @k-takata -src/libvterm/ @leonerd -src/po/am.po @gagikh -src/po/ca.po @nfdisco -src/po/de.po @chrisbra -src/po/eo.po @dpelle -src/po/es.po @victorhck -src/po/fi.po @flammie -src/po/fr.po @dpelle -src/po/ga.po @kscanne -src/po/it.po @azc100 -src/po/ja.po @k-takata -src/po/ru.po @RestorerZ -src/po/sr.po @eevan78 -src/po/tr.po @bitigchi -src/po/uk.po @sakhnik -src/xxd/ @jnweiger +runtime/pack/dist/opt/comment/ @habamax +runtime/pack/dist/opt/helptoc/ @kennypete +runtime/pack/dist/opt/matchit/ @chrisbra +runtime/pack/dist/opt/nohlsearch/ @habamax +runtime/plugin/manpager.vim @Konfekt +runtime/syntax/shared/hgcommitDiff.vim @vegerot +runtime/syntax/abaqus.vim @costerwi +runtime/syntax/abnf.vim @A4-Tacks +runtime/syntax/aidl.vim @dpelle +runtime/syntax/ant.vim @dkearns +runtime/syntax/antlr4.vim @jiangyinzuo +runtime/syntax/arduino.vim @johshoff +runtime/syntax/asciidoc.vim @aerostitch +runtime/syntax/asm.vim @dkearns +runtime/syntax/asmh8300.vim @dkearns +runtime/syntax/asterisk.vim @jaunis +runtime/syntax/astro.vim @wuelnerdotexe +runtime/syntax/asy.vim @avidseeker +runtime/syntax/autohotkey.vim @mmikeww +runtime/syntax/awk.vim @dkearns +runtime/syntax/basic.vim @dkearns +runtime/syntax/bst.vim @tpope +runtime/syntax/bzl.vim @dbarnett +runtime/syntax/bzr.vim @hdima +runtime/syntax/cabal.vim @coot +runtime/syntax/cabalconfig.vim @coot +runtime/syntax/cabalproject.vim @coot +runtime/syntax/cf.vim @ernstvanderlinden +runtime/syntax/chatito.vim @ObserverOfTime +runtime/syntax/chicken.vim @evhan +runtime/syntax/chuck.vim @andreacfromtheapp +runtime/syntax/clojure.vim @axvr +runtime/syntax/cs.vim @nickspoons +runtime/syntax/csv.vim @habamax +runtime/syntax/cucumber.vim @tpope +runtime/syntax/d.vim @JesseKPhillips +runtime/syntax/dart.vim @pr3d4t0r +runtime/syntax/datascript.vim @dpelle +runtime/syntax/dax.vim @anarion80 +runtime/syntax/deb822sources.vim @jamessan +runtime/syntax/debchangelog.vim @jamessan +runtime/syntax/debcontrol.vim @jamessan +runtime/syntax/debcopyright.vim @jamessan +runtime/syntax/debsources.vim @jamessan +runtime/syntax/dep3patch.vim @jamessan +runtime/syntax/desktop.vim @e-kwsm +runtime/syntax/dosbatch.vim @mrdubya +runtime/syntax/dosini.vim @xuhdev +runtime/syntax/dot.vim @mmottl +runtime/syntax/doxygen.vim @frogonwheels +runtime/syntax/dtd.vim @chrisbra +runtime/syntax/dts.vim @zonque +runtime/syntax/editorconfig.vim @gpanders +runtime/syntax/eiffel.vim @jocelyn +runtime/syntax/erlang.vim @hcs42 +runtime/syntax/eruby.vim @tpope @dkearns +runtime/syntax/expect.vim @dkearns +runtime/syntax/falcon.vim @steveno +runtime/syntax/fetchmail.vim @dkearns +runtime/syntax/forth.vim @jkotlinski +runtime/syntax/fpcmake.vim @dkearns +runtime/syntax/freebasic.vim @dkearns +runtime/syntax/fstab.vim @rid9 +runtime/syntax/gdresource.vim @habamax +runtime/syntax/gdscript.vim @habamax +runtime/syntax/gdshader.vim @habamax +runtime/syntax/git.vim @tpope +runtime/syntax/gitattributes.vim @ObserverOfTime +runtime/syntax/gitcommit.vim @tpope +runtime/syntax/gitconfig.vim @tpope +runtime/syntax/gitignore.vim @ObserverOfTime +runtime/syntax/gitolite.vim @sitaramc +runtime/syntax/gitrebase.vim @tpope +runtime/syntax/gleam.vim @kirillmorozov +runtime/syntax/glsl.vim @gpanders +runtime/syntax/go.vim @bhcleek +runtime/syntax/goaccess.vim @meonkeys +runtime/syntax/godoc.vim @dbarnett +runtime/syntax/gp.vim @KBelabas +runtime/syntax/gprof.vim @dpelle +runtime/syntax/graphql.vim @jparise +runtime/syntax/groff.vim @jmarshall +runtime/syntax/gyp.vim @ObserverOfTime +runtime/syntax/haml.vim @tpope +runtime/syntax/hare.vim @selenebun +runtime/syntax/haredoc.vim @selenebun +runtime/syntax/haskell.vim @coot +runtime/syntax/hcl.vim @gpanders +runtime/syntax/help.vim @dkearns +runtime/syntax/help_ru.vim @RestorerZ +runtime/syntax/hgcommit.vim @k-takata +runtime/syntax/hitest.vim @lacygoill +runtime/syntax/hog.vim @wtfbbqhax +runtime/syntax/hollywood.vim @sodero +runtime/syntax/html.vim @dkearns +runtime/syntax/htmlangular.vim @dlvandenberg +runtime/syntax/hyprlang.vim @saccarosium +runtime/syntax/i3config.vim @hiqua +runtime/syntax/icon.vim @dkearns +runtime/syntax/indent.vim @dkearns +runtime/syntax/j.vim @glts +runtime/syntax/jargon.vim @h3xx +runtime/syntax/java.vim @zzzyxwvut +runtime/syntax/javascript.vim @fleiner +runtime/syntax/jinja.vim @gpanders +runtime/syntax/jjdescription.vim @gpanders +runtime/syntax/json.vim @vito-c +runtime/syntax/jsonc.vim @izhakjakov +runtime/syntax/julia.vim @carlobaldassi +runtime/syntax/just.vim @pbnj +runtime/syntax/jq.vim @vito-c +runtime/syntax/karel.vim @kirillmorozov +runtime/syntax/kconfig.vim @chrisbra +runtime/syntax/kivy.vim @prophittcorey +runtime/syntax/kotlin.vim @udalov +runtime/syntax/kdl.vim @imsnif @jiangyinzuo +runtime/syntax/krl.vim @KnoP-01 +runtime/syntax/less.vim @genoma +runtime/syntax/lf.vim @andis-sprinkis +runtime/syntax/liquid.vim @tpope +runtime/syntax/lua.vim @marcuscf +runtime/syntax/lyrics.vim @ObserverOfTime +runtime/syntax/lynx.vim @dkearns +runtime/syntax/m17ndb.vim @dseomn +runtime/syntax/m3build.vim @dkearns +runtime/syntax/m3quake.vim @dkearns +runtime/syntax/mailcap.vim @dkearns +runtime/syntax/make.vim @rohieb +runtime/syntax/mallard.vim @jhradilek +runtime/syntax/markdown.vim @tpope +runtime/syntax/mbsync.vim @fymyte +runtime/syntax/mason.vim @petdance +runtime/syntax/mediawiki.vim @avidseeker +runtime/syntax/meson.vim @Liambeguin +runtime/syntax/modula2.vim @dkearns +runtime/syntax/modula2/opt/iso.vim @trijezdci +runtime/syntax/modula2/opt/pim.vim @trijezdci +runtime/syntax/modula2/opt/r10.vim @trijezdci +runtime/syntax/modula3.vim @dkearns +runtime/syntax/mss.vim @Freed-Wu +runtime/syntax/n1ql.vim @pr3d4t0r +runtime/syntax/nginx.vim @chr4 +runtime/syntax/ninja.vim @nico +runtime/syntax/nix.vim @equill +runtime/syntax/nroff.vim @jmarshall +runtime/syntax/nsis.vim @k-takata +runtime/syntax/odin.vim @habamax +runtime/syntax/omnimark.vim @kennypete +runtime/syntax/ondir.vim @jparise +runtime/syntax/opencl.vim @Freed-Wu +runtime/syntax/openvpn.vim @ObserverOfTime +runtime/syntax/org.vim @saccarosium +runtime/syntax/pacmanlog.vim @rpigott +runtime/syntax/pascal.vim @dkearns +runtime/syntax/pbtxt.vim @lakshayg +runtime/syntax/pdf.vim @tpope +runtime/syntax/perl.vim @petdance +runtime/syntax/php.vim @TysonAndre +runtime/syntax/plsql.vim @lee-lindley +runtime/syntax/pod.vim @petdance +runtime/syntax/poefilter.vim @ObserverOfTime +runtime/syntax/postscr.vim @mrdubya +runtime/syntax/pq.vim @anarion80 +runtime/syntax/privoxy.vim @dkearns +runtime/syntax/progress.vim @rdnlsmith +runtime/syntax/prolog.vim @XVilka +runtime/syntax/prql.vim @vanillajonathan +runtime/syntax/ps1.vim @heaths +runtime/syntax/ps1xml.vim @heaths +runtime/syntax/psl.vim @danielkho +runtime/syntax/ptx.vim @jiangyinzuo +runtime/syntax/pymanifest.vim @ObserverOfTime +runtime/syntax/qb64.vim @dkearns +runtime/syntax/qml.vim @ChaseKnowlden +runtime/syntax/racket.vim @benknoble +runtime/syntax/raml.vim @in3d +runtime/syntax/rapid.vim @KnoP-01 +runtime/syntax/ratpoison.vim @trapd00r +runtime/syntax/rasi.vim @fymyte +runtime/syntax/rc.vim @chrisbra +runtime/syntax/rcs.vim @hdima +runtime/syntax/rebol.vim @mrdubya +runtime/syntax/rego.vim @zenmatic +runtime/syntax/resolv.vim @rid9 +runtime/syntax/rng.vim @jhradilek +runtime/syntax/routeros.vim @zainin +runtime/syntax/rst.vim @marshallward +runtime/syntax/ruby.vim @dkearns +runtime/syntax/salt.vim @gpanders +runtime/syntax/sass.vim @tpope +runtime/syntax/scala.vim @derekwyatt +runtime/syntax/scheme.vim @evhan +runtime/syntax/scss.vim @tpope +runtime/syntax/sed.vim @dkearns +runtime/syntax/shared/debversions.vim @jamessan +runtime/syntax/shaderslang.vim @mTvare6 +runtime/syntax/solidity.vim @coti-z +runtime/syntax/spajson.vim @dseomn +runtime/syntax/spec.vim @ignatenkobrain +runtime/syntax/sqloracle.vim @chrisbra +runtime/syntax/squirrel.vim @zenmatic +runtime/syntax/srt.vim @ObserverOfTime +runtime/syntax/ssa.vim @ObserverOfTime +runtime/syntax/sshconfig.vim @Jakuje +runtime/syntax/sshdconfig.vim @Jakuje +runtime/syntax/sudoers.vim @e-kwsm +runtime/syntax/svn.vim @hdima +runtime/syntax/swayconfig.vim @jamespeapen +runtime/syntax/swig.vim @jmarrec +runtime/syntax/systemverilog.vim @Kocha +runtime/syntax/tap.vim @petdance +runtime/syntax/tcsh.vim @dkearns +runtime/syntax/tera.vim @MuntasirSZN +runtime/syntax/teraterm.vim @k-takata +runtime/syntax/terraform.vim @gpanders +runtime/syntax/thrift.vim @jiangyinzuo +runtime/syntax/tiasm.vim @Freed-Wu +runtime/syntax/tidy.vim @dkearns +runtime/syntax/tmux.vim @ericpruitt +runtime/syntax/toml.vim @averms +runtime/syntax/tt2.vim @petdance +runtime/syntax/tt2html.vim @petdance +runtime/syntax/tt2js.vim @petdance +runtime/syntax/typescript.vim @HerringtonDarkholme @rhysd +runtime/syntax/typescriptreact.vim @HerringtonDarkholme @rhysd +runtime/syntax/typst.vim @gpanders +runtime/syntax/shared/typescriptcommon.vim @HerringtonDarkholme @rhysd +runtime/syntax/unison.vim @chuwy +runtime/syntax/vdf.vim @ObserverOfTime +runtime/syntax/vroom.vim @dbarnett +runtime/syntax/wdl.vim @zenmatic +runtime/syntax/wget.vim @dkearns +runtime/syntax/wget2.vim @dkearns +runtime/syntax/xbl.vim @dkearns +runtime/syntax/xcompose.vim @ObserverOfTime +runtime/syntax/xml.vim @chrisbra +runtime/syntax/xs.vim @petdance +runtime/syntax/xslt.vim @Boobies +runtime/syntax/zserio.vim @dpelle +runtime/syntax/zsh.vim @chrisbra +runtime/tutor/tutor1.eo @dpelle +runtime/tutor/tutor1.fr @dpelle +runtime/tutor/tutor1.ru @RestorerZ +runtime/tutor/tutor2.fr @dlejay +src/iscygpty.* @k-takata +src/libvterm/ @leonerd +src/po/ca.po @nfdisco +src/po/de.po @chrisbra +src/po/eo.po @dpelle +src/po/es.po @victorhck +src/po/fi.po @flammie +src/po/fr.po @dpelle +src/po/ga.po @kscanne +src/po/hy.po @gagikh +src/po/it.po @azc100 +src/po/ja.po @k-takata +src/po/ru.po @RestorerZ +src/po/sr.po @eevan78 +src/po/tr.po @bitigchi +src/po/uk.po @sakhnik +src/xxd/ @jnweiger diff --git a/.github/workflows/ci-macvim.yaml b/.github/workflows/ci-macvim.yaml index c0018e8b3b..7bd4fedcc8 100644 --- a/.github/workflows/ci-macvim.yaml +++ b/.github/workflows/ci-macvim.yaml @@ -41,7 +41,7 @@ jobs: # Most up to date OS and Xcode. Used to publish release for the main build. - os: macos-15 - xcode: '16.2' + xcode: '16.4' testgui: true publish: true optimized: true diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 90a6e9ff0c..fb2832172e 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -9,7 +9,7 @@ permissions: jobs: scan: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 env: CC: gcc @@ -36,7 +36,6 @@ jobs: gettext \ libcanberra-dev \ libperl-dev \ - python2-dev \ python3-dev \ liblua5.4-dev \ lua5.4 \ @@ -53,7 +52,7 @@ jobs: echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH ( echo "NPROC=$(getconf _NPROCESSORS_ONLN)" - echo "CONFOPT=--enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" + echo "CONFOPT=--enable-perlinterp --enable-python3interp --enable-rubyinterp --enable-luainterp --enable-tclinterp" ) >> $GITHUB_ENV - name: Configure diff --git a/.gitignore b/.gitignore index 1d0d3d644e..7767e598e5 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,8 @@ src/auto/osdef.h src/auto/link.log src/auto/link.sed src/auto/pathdef.c +src/auto/wayland/*.c +src/auto/wayland/*.h # Windows *.exe @@ -64,7 +66,6 @@ src/xxd/xxd.dSYM *~ *.pyc *.log -src/po/vim.pot src/tags /tags /GPATH diff --git a/.hgignore b/.hgignore index 38388a5309..80e59634db 100644 --- a/.hgignore +++ b/.hgignore @@ -24,6 +24,8 @@ src/auto/osdef.h src/auto/link.log src/auto/link.sed src/auto/pathdef.c +src/auto/wayland/*.c +src/auto/wayland/*.h # Windows *.exe @@ -66,7 +68,6 @@ src/xxd/xxd.dSYM *~ *.pyc *.log -src/po/vim.pot src/tags /tags /GPATH diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c766d71d51..8f0947acf7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,7 +3,7 @@ Patches are welcome in whatever form. Discussions about patches happen on the [vim-dev][0] mailing list. If you create a pull request on GitHub it will be -forwarded to the vim-dev mailing list. You can also send your patch there +forwarded to the vim-dev mailing list. You can also send your patch there directly (but please note, the initial posting is subject to moderation). In that case an attachment with a unified diff format is preferred. Information about the mailing list can be found [on the Vim website][0] @@ -12,14 +12,14 @@ A pull request has the advantage that it will trigger the Continuous Integration tests, you will be warned of problems (you can ignore the coverage warning, it's noisy). -Please consider adding a test. All new functionality should be tested and bug +Please consider adding a test. All new functionality should be tested and bug fixes should be tested for regressions: the test should fail before the fix and -pass after the fix. Look through recent patches for examples and find help -with ":help testing". The tests are located under "src/testdir". +pass after the fix. Look through recent patches for examples and find help +with ":help testing". The tests are located under "src/testdir". -Contributions will be distributed with Vim under the Vim license. Providing a +Contributions will be distributed with Vim under the Vim license. Providing a change to be included implies that you agree with this and your contribution -does not cause us trouble with trademarks or patents. There is no CLA to sign. +does not cause us trouble with trademarks or patents. There is no CLA to sign. ## Signing-off commits @@ -27,19 +27,19 @@ While not required, it's recommended to use **Signed-off commits** to ensure transparency, accountability, and compliance with open-source best practices. Signed-off commits follow the [Developer Certificate of Origin (DCO)][15], which confirms that contributors have the right to submit their changes under -the project's license. This process adds a `Signed-off-by` line to commit +the project's license. This process adds a `Signed-off-by` line to commit messages, verifying that the contributor agrees to the project's licensing -terms. To sign off a commit, simply use the -s flag when committing: +terms. To sign off a commit, simply use the -s flag when committing: ```sh git commit -s -``` +``` This ensures that every contribution is properly documented and traceable, aligning with industry standards used in projects like the Linux Kernel or -the git project. By making Signed-off commits a standard practice, we help +the git project. By making Signed-off commits a standard practice, we help maintain a legally compliant and well-governed codebase while fostering trust -within our contributor community. +within our contributor community. When merging PRs into Vim, the current maintainer @chrisbra usually adds missing `Signed-off-by` trailers for the author user name and email address as well for @@ -48,12 +48,12 @@ approvers are happy with that particular change. # Reporting issues -We use GitHub issues, but that is not a requirement. Writing to the Vim +We use GitHub issues, but that is not a requirement. Writing to the Vim mailing list is also fine. Please use the GitHub issues only for actual issues. If you are not 100% sure that your problem is a Vim issue, please first discuss this on the Vim user -mailing list. Try reproducing the problem without any of your plugins or settings: +mailing list. Try reproducing the problem without any of your plugins or settings: vim --clean @@ -71,13 +71,13 @@ Or open [the todo file][todo list] on GitHub to see the latest version. # Syntax, indent and other runtime files The latest version of these files can be obtained from the repository. -They are usually not updated with numbered patches. However, they may +They are usually not updated with numbered patches. However, they may or may not work with older Vim releases (since they may contain new features). If you find a problem with one of these files or have a suggestion for improvement, please first try to contact the maintainer directly. Look in the header of the file for the name, email address, github handle and/or -upstream repository. You may also check the [MAINTAINERS][11] file. +upstream repository. You may also check the [MAINTAINERS][11] file. The maintainer will take care of issues and send updates to the Vim project for distribution with Vim. @@ -88,23 +88,25 @@ If the maintainer does not respond, contact the [vim-dev][0] mailing list. If you want to contribute new runtime files for Vim or Neovim, please create a PR with your changes against this repository here. For new filetypes, do not forget: -* to add a new [filetype test][12] (keep it similar to the other filetype tests). -* all configuration switches should be documented + +- to add a new [filetype test][12] (keep it similar to the other filetype tests). +- all configuration switches should be documented (check [filetype.txt][13] and/or [syntax.txt][14] for filetype and syntax plugins) -* add yourself as Maintainer to the top of file (again, keep the header similar to +- add yourself as Maintainer to the top of file (again, keep the header similar to other runtime files) -* add yourself to the [MAINTAINERS][11] file. +- add yourself to the [MAINTAINERS][11] file. # Translations -Translating messages and runtime files is very much appreciated! These things +Translating messages and runtime files is very much appreciated! These things can be translated: -* Messages in Vim, see [src/po/README.txt][1] - Also used for the desktop icons. -* Menus, see [runtime/lang/README.txt][2] -* Vim tutor, see [runtime/tutor/README.txt][3] -* Manual pages, see [runtime/doc/\*.1][4] for examples -* Installer, see [nsis/lang/README.txt][5] + +- Messages in Vim, see [src/po/README.txt][1] + Also used for the desktop icons. +- Menus, see [runtime/lang/README.txt][2] +- Vim tutor, see [runtime/tutor/README.txt][3] +- Manual pages, see [runtime/doc/\*.1][4] for examples +- Installer, see [nsis/lang/README.txt][5] The help files can be translated and made available separately. See https://www.vim.org/translations.php for examples. @@ -113,9 +115,11 @@ See https://www.vim.org/translations.php for examples. Please have a look at the following [discussion][6], which should give you some ideas. Please also check the [develop.txt][7] helpfile for the recommended -style. Often it's also beneficial to check the surrounding code for the style +coding style. Often it's also beneficial to check the surrounding code for the style being used. +For the recommended documentation style, please check [helphelp.txt][16]. + # I have a question If you have some question on the style guide, please contact the [vim-dev][0] @@ -139,3 +143,4 @@ mailing list. For other questions please use the [Vi Stack Exchange][8] website, [13]: https://github.com/vim/vim/blob/master/runtime/doc/filetype.txt [14]: https://github.com/vim/vim/blob/master/runtime/doc/syntax.txt [15]: https://en.wikipedia.org/wiki/Developer_Certificate_of_Origin +[16]: https://github.com/vim/vim/blob/master/runtime/doc/helphelp.txt diff --git a/Filelist b/Filelist index 7302788fea..5153ded57d 100644 --- a/Filelist +++ b/Filelist @@ -23,8 +23,12 @@ SRC_ALL = \ ci/appveyor.bat \ ci/config.mk*.sed \ ci/if_ver*.vim \ + ci/if_feat_check.vim \ ci/setup-xvfb.sh \ + ci/setup-sway.sh \ ci/remove_snap.sh \ + ci/ddebs.list \ + ci/pinned-pkgs \ src/Make_all.mak \ src/README.md \ src/alloc.c \ @@ -147,6 +151,7 @@ SRC_ALL = \ src/strings.c \ src/structs.h \ src/syntax.c \ + src/tabpanel.c \ src/tag.c \ src/term.c \ src/terminal.c \ @@ -172,6 +177,7 @@ SRC_ALL = \ src/vim9compile.c \ src/vim9execute.c \ src/vim9expr.c \ + src/vim9generics.c \ src/vim9instr.c \ src/vim9script.c \ src/vim9type.c \ @@ -179,63 +185,67 @@ SRC_ALL = \ src/winclip.c \ src/window.c \ src/xxd/xxd.c \ - src/testdir/gen_opt_test.vim \ - src/testdir/README.txt \ - src/testdir/Make_all.mak \ src/testdir/*.in \ src/testdir/*.py \ - src/testdir/keycode_check.vim \ + src/testdir/Make_all.mak \ + src/testdir/README.txt \ + src/testdir/commondumps.vim \ + src/testdir/crash/* \ + src/testdir/dumps/*.dump \ + src/testdir/dumps/*.vim \ src/testdir/keycode_check.json \ + src/testdir/keycode_check.vim \ src/testdir/lsan-suppress.txt \ - src/testdir/sautest/autoload/*.vim \ - src/testdir/testluaplugin/lua/testluaplugin/*.lua \ - src/testdir/check.vim \ - src/testdir/commondumps.vim \ - src/testdir/gui_init.vim \ - src/testdir/gui_preinit.vim \ - src/testdir/mouse.vim \ - src/testdir/runtest.vim \ - src/testdir/screendump.vim \ - src/testdir/setup.vim \ - src/testdir/setup_gui.vim \ - src/testdir/shared.vim \ - src/testdir/vim9.vim \ - src/testdir/script_util.vim \ - src/testdir/summarize.vim \ - src/testdir/term_util.vim \ - src/testdir/view_util.vim \ - src/testdir/viewdumps.vim \ - src/testdir/test[0-9]*.ok \ - src/testdir/test77a.ok \ - src/testdir/test77a.com \ - src/testdir/test_*.vim \ src/testdir/python2/*.py \ src/testdir/python3/*.py \ + src/testdir/python_after/*.py \ + src/testdir/python_before/*.py \ src/testdir/pythonx/*.py \ src/testdir/pythonx/topmodule/__init__.py \ src/testdir/pythonx/topmodule/submodule/__init__.py \ src/testdir/pythonx/topmodule/submodule/subsubmodule/__init__.py \ src/testdir/pythonx/topmodule/submodule/subsubmodule/subsubsubmodule.py \ - src/testdir/python_after/*.py \ - src/testdir/python_before/*.py \ src/testdir/pyxfile/*.py \ - src/testdir/dumps/*.dump \ - src/testdir/dumps/*.vim \ + src/testdir/ru_RU/LC_MESSAGES/Makefile \ + src/testdir/ru_RU/LC_MESSAGES/__PACKAGE__.mo \ + src/testdir/ru_RU/LC_MESSAGES/__PACKAGE__.po \ + src/testdir/runtest.vim \ src/testdir/samples/*.html \ src/testdir/samples/*.txt \ src/testdir/samples/*.vim \ + src/testdir/samples/evil.zip \ + src/testdir/samples/evil.tar \ src/testdir/samples/poc.zip \ - src/testdir/samples/test000 \ + src/testdir/samples/sample.tar \ src/testdir/samples/test.zip \ + src/testdir/samples/test000 \ src/testdir/samples/test_undo.txt.undo \ src/testdir/samples/testa.zip \ - src/testdir/color_ramp.vim \ + src/testdir/sautest/autoload/*.vim \ src/testdir/silent.wav \ - src/testdir/popupbounce.vim \ - src/testdir/crash/* \ - src/testdir/ru_RU/LC_MESSAGES/Makefile \ - src/testdir/ru_RU/LC_MESSAGES/__PACKAGE__.po \ - src/testdir/ru_RU/LC_MESSAGES/__PACKAGE__.mo \ + src/testdir/test77a.com \ + src/testdir/test77a.ok \ + src/testdir/test[0-9]*.ok \ + src/testdir/test_*.vim \ + src/testdir/testluaplugin/lua/testluaplugin/*.lua \ + src/testdir/util/check.vim \ + src/testdir/util/color_ramp.vim \ + src/testdir/util/gen_opt_test.vim \ + src/testdir/util/gui_init.vim \ + src/testdir/util/gui_preinit.vim \ + src/testdir/util/mouse.vim \ + src/testdir/util/popupbounce.vim \ + src/testdir/util/screendump.vim \ + src/testdir/util/script_util.vim \ + src/testdir/util/setup.vim \ + src/testdir/util/setup_gui.vim \ + src/testdir/util/shared.vim \ + src/testdir/util/summarize.vim \ + src/testdir/util/term_util.vim \ + src/testdir/util/view_util.vim \ + src/testdir/util/vim9.vim \ + src/testdir/util/window_manager.vim \ + src/testdir/viewdumps.vim \ src/proto.h \ src/protodef.h \ src/proto/alloc.pro \ @@ -331,6 +341,7 @@ SRC_ALL = \ src/proto/spellsuggest.pro \ src/proto/strings.pro \ src/proto/syntax.pro \ + src/proto/tabpanel.pro \ src/proto/tag.pro \ src/proto/term.pro \ src/proto/terminal.pro \ @@ -352,6 +363,7 @@ SRC_ALL = \ src/proto/vim9compile.pro \ src/proto/vim9execute.pro \ src/proto/vim9expr.pro \ + src/proto/vim9generics.pro \ src/proto/vim9instr.pro \ src/proto/vim9script.pro \ src/proto/vim9type.pro \ @@ -484,6 +496,12 @@ SRC_UNIX = \ src/gui_xmebwp.h \ src/gui_x11.c \ src/gui_x11_pm.h \ + src/auto/wayland/README.txt \ + src/auto/wayland/Makefile \ + src/auto/wayland/protocols/ext-data-control-v1.xml \ + src/auto/wayland/protocols/wlr-data-control-unstable-v1.xml \ + src/auto/wayland/protocols/xdg-shell.xml \ + src/auto/wayland/protocols/primary-selection-unstable-v1.xml \ src/if_xcmdsrv.c \ src/link.sh \ src/installman.sh \ @@ -502,18 +520,21 @@ SRC_UNIX = \ src/proto/gui_motif.pro \ src/proto/gui_xmdlg.pro \ src/proto/gui_x11.pro \ + src/proto/wayland.pro \ src/proto/if_xcmdsrv.pro \ src/proto/os_unix.pro \ src/proto/pty.pro \ src/pty.c \ src/testdir/Makefile \ - src/testdir/unix.vim \ + src/testdir/util/unix.vim \ src/toolcheck \ src/vim_icon.xbm \ src/vim_mask.xbm \ src/vimtutor \ src/gvimtutor \ + src/wayland.c \ src/which.sh \ + src/gen-wayland-protocols.sh \ src/xxd/Makefile \ # Source files for both MS Windows and Unix-like. @@ -599,7 +620,7 @@ SRC_DOS = \ src/testdir/Make_dos.mak \ src/testdir/Make_mvc.mak \ src/testdir/Make_ming.mak \ - src/testdir/dos.vim \ + src/testdir/util/dos.vim \ src/uninstall.c \ src/vim.rc \ src/vim.manifest \ @@ -652,7 +673,7 @@ SRC_AMI = \ src/os_amiga.h \ src/proto/os_amiga.pro \ src/testdir/Make_amiga.mak \ - src/testdir/amiga.vim \ + src/testdir/util/amiga.vim \ src/xxd/Make_amiga.mak \ # Source files for Haiku (also in the extra archive). @@ -683,7 +704,7 @@ SRC_VMS = \ src/os_vms_mms.c \ src/proto/os_vms.pro \ src/testdir/Make_vms.mms \ - src/testdir/vms.vim \ + src/testdir/util/vms.vim \ src/xxd/Make_vms.mms \ vimtutor.com \ @@ -774,7 +795,6 @@ RT_ALL = \ runtime/tools/[a-z]*[a-z0-9] \ runtime/tutor/README.txt \ runtime/tutor/tutor1 \ - runtime/tutor/tutor1.utf-8 \ runtime/tutor/en/vim-01-beginner.tutor \ runtime/tutor/en/vim-01-beginner.tutor.json \ runtime/tutor/en/vim-02-beginner.tutor \ @@ -783,7 +803,6 @@ RT_ALL = \ runtime/tutor/tutor.tutor.json \ runtime/tutor/tutor.vim \ runtime/tutor/tutor2 \ - runtime/tutor/tutor2.utf-8 \ runtime/vimrc_example.vim \ runtime/pack/dist/opt/cfilter/plugin/cfilter.vim \ runtime/pack/dist/opt/comment/plugin/comment.vim \ @@ -806,6 +825,8 @@ RT_ALL = \ runtime/pack/dist/opt/editorconfig/ftdetect/editorconfig.vim \ runtime/pack/dist/opt/editorconfig/plugin/editorconfig.vim \ runtime/pack/dist/opt/helptoc/autoload/helptoc.vim \ + runtime/pack/dist/opt/helptoc/doc/helptoc.txt \ + runtime/pack/dist/opt/helptoc/doc/tags \ runtime/pack/dist/opt/helptoc/plugin/helptoc.vim \ runtime/pack/dist/opt/hlyank/plugin/hlyank.vim \ runtime/pack/dist/opt/justify/plugin/justify.vim \ @@ -823,7 +844,6 @@ RT_ALL = \ runtime/pack/dist/opt/netrw/autoload/netrw/fs.vim \ runtime/pack/dist/opt/netrw/autoload/netrw/os.vim \ runtime/pack/dist/opt/netrw/autoload/netrw/msg.vim \ - runtime/pack/dist/opt/netrw/autoload/netrwSettings.vim \ runtime/pack/dist/opt/netrw/autoload/netrw_gitignore.vim \ runtime/pack/dist/opt/netrw/doc/netrw.txt \ runtime/pack/dist/opt/netrw/plugin/netrwPlugin.vim \ @@ -862,6 +882,7 @@ RT_SCRIPTS = \ runtime/indent/testdir/*.vim \ runtime/indent/testdir/*.in \ runtime/indent/testdir/*.ok \ + runtime/indent/testdir/tools/* \ runtime/ftplugin/*.vim \ runtime/ftplugin/logtalk.dict \ runtime/ftplugin/README.txt \ @@ -925,7 +946,6 @@ RT_DOS = \ README_dos.txt \ runtime/doc/Make_mvc.mak \ runtime/indent/Make_mvc.mak \ - runtime/tutor/Make_mvc.mak \ runtime/lang/Make_mvc.mak \ vimtutor.bat \ @@ -1079,8 +1099,6 @@ LANG_GEN = \ runtime/keymap/README.txt \ runtime/keymap/*.vim \ runtime/tutor/README.*.txt \ - runtime/tutor/Makefile \ - runtime/tutor/Make_all.mak \ runtime/tutor/it/vim-01-beginner.tutor \ runtime/tutor/it/vim-01-beginner.tutor.json \ runtime/tutor/ru/vim-01-beginner.tutor \ @@ -1092,19 +1110,9 @@ LANG_GEN = \ runtime/tutor/sr/vim-02-beginner.tutor \ runtime/tutor/sr/vim-02-beginner.tutor.json \ runtime/tutor/tutor1.?? \ - runtime/tutor/tutor1.??.utf-8 \ - runtime/tutor/tutor1.??.euc \ - runtime/tutor/tutor1.??.sjis \ - runtime/tutor/tutor1.??.iso9 \ - runtime/tutor/tutor1.??.big5 \ - runtime/tutor/tutor1.??.cp1250 \ - runtime/tutor/tutor1.??.cp1251 \ - runtime/tutor/tutor1.??.cp737 \ - runtime/tutor/tutor1.??_??.utf-8 \ + runtime/tutor/tutor1.??_?? \ runtime/tutor/tutor1.bar \ - runtime/tutor/tutor1.bar.utf-8 \ runtime/tutor/tutor2.?? \ - runtime/tutor/tutor2.??.utf-8 \ runtime/spell/README.txt \ runtime/spell/??/*.diff \ runtime/spell/??/main.aap \ @@ -1148,6 +1156,7 @@ LANG_SRC = \ src/po/sjiscorr.c \ src/po/big5corr.c \ src/po/*.po \ + src/po/vim.pot \ # The language files for the Win32 lang archive. LANG_DOS = \ diff --git a/Makefile b/Makefile index 4d726991d3..9de75e3464 100644 --- a/Makefile +++ b/Makefile @@ -115,6 +115,7 @@ MINOR = 1 # - With these features: "make depend" (works best with gcc). # - If you have a lint program: "make lint" and check the output (ignore GTK # warnings). +# - compile release versions using -DNDEBUG to disable assert()s # - If you have valgrind, enable it in src/testdir/Makefile and run "make # test". Enable EXITFREE, disable GUI, scheme and tcl to avoid false alarms. # Check the valgrind output. diff --git a/README.md b/README.md index 980b8be3c2..f11c5643ec 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,78 @@ -Vim - the text editor - for macOS +

+MacVim logo
+MacVim +

+

+Website · Documentation +

+

+MacVim GitHub CI +GitHub release +Packaging status +

-- MacVim homepage: -- Download the latest version from [Releases](https://github.com/macvim-dev/macvim/releases/latest) +MacVim is a macOS version of the [Vim](https://github.com/vim/vim) text editor, providing a graphical user interface for Vim, while tightly integrating with macOS and providing features specific to the platform. -- How to [build MacVim from source](https://github.com/macvim-dev/macvim/wiki/Building) +
-- Vim README: [README_vim.md](README_vim.md) +

+ + + + macvim-screenshot-light + +

-- [![MacVim GitHub CI](https://github.com/macvim-dev/macvim/actions/workflows/ci-macvim.yaml/badge.svg)](https://github.com/macvim-dev/macvim/actions/workflows/ci-macvim.yaml) +## Features -- Packaged in [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/macvim.svg)](https://repology.org/metapackage/macvim/versions) [![MacPorts package](https://repology.org/badge/version-for-repo/macports/macvim.svg)](https://repology.org/metapackage/macvim/versions) +- Smooth native GUI that supports menus, dialog boxes, toolbars, and scroll bars. +- Native and non-native full-screen modes. +- Trackpad gestures, Touch Bar, and Command key shortcuts can be mapped to Vim actions. +- Integrates with system services, dictionary lookup, and Apple Intelligence Writing Tools. +- Vim GUI tabs with customizable colors. +- Font ligatures and accurate text rendering. + +## Getting Started + +See [installation documentation](https://github.com/macvim-dev/macvim/wiki/Installing) for more details and alternative methods to install. + +### Download + +You can download the latest version of MacVim from the [Releases](https://github.com/macvim-dev/macvim/releases/latest) page. + +### Install via Package Manager + +If you would like to install using a package manager, MacVim can be installed via Homebrew: + + ```zsh + brew install macvim + ``` + +MacVim is also available as a Homebrew cask. It will install the same pre-built binary as the one available from GitHub release: + + ```zsh + brew install --cask macvim-app + ``` + +After installation, MacVim can be launched using the Dock or in the terminal using the `mvim` command. + +### Building from Source + +If you prefer to build MacVim from source, detailed instructions are provided in the [Building MacVim](https://github.com/macvim-dev/macvim/wiki/Building) guide. + +## Relationship with Vim + +MacVim is a downstream fork of Vim, and routinely [merges from upstream](https://github.com/macvim-dev/macvim/wiki/Merging-from-upstream-Vim). The original Vim README can be found at [README_vim.md](README_vim.md). Vim itself is also available for macOS, but it does not have a GUI. + +In Homebrew, there are both a `macvim` and `vim` package. Both packages will provide a terminal version of Vim with similar features. The `vim` package is from the upstream Vim project and is usually a bit more up-to-date in core Vim features, while the `macvim` package will provide the additional GUI version bundled as an app. + +## License + +MacVim is released under the [Vim License](https://github.com/macvim-dev/macvim/blob/master/LICENSE). + +## Support + +If you encounter any issues or have questions, feel free to [open an issue](https://github.com/macvim-dev/macvim/issues) or visit the [discussions](https://github.com/macvim-dev/macvim/discussions) page. diff --git a/README.txt b/README.txt index d90ebbc1fa..80ec9e3c43 100644 --- a/README.txt +++ b/README.txt @@ -15,6 +15,10 @@ All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be mapped to commands by the user, and the mouse can be used. +Vim also aims to provide a (mostly) POSIX-compatible vi implementation, when +compiled with a minimal feature set (typically called vim.tiny), which is used +by many Linux distributions as the default vi editor. + Vim runs under MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS and almost all flavours of UNIX. Porting to other systems should not be very difficult. Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista, diff --git a/README_vim.md b/README_vim.md index cfee68e8a2..66a1e6cb8b 100644 --- a/README_vim.md +++ b/README_vim.md @@ -32,6 +32,10 @@ All commands are given with normal keyboard characters, so those who can type with ten fingers can work very fast. Additionally, function keys can be mapped to commands by the user, and the mouse can be used. +Vim also aims to provide a (mostly) POSIX-compatible vi implementation, when +compiled with a minimal feature set (typically called vim.tiny), which is used +by many Linux distributions as the default vi editor. + Vim runs under MS-Windows (7, 8, 10, 11), macOS, Haiku, VMS and almost all flavours of UNIX. Porting to other systems should not be very difficult. Older versions of Vim run on MS-DOS, MS-Windows 95/98/Me/NT/2000/XP/Vista, diff --git a/ci/appveyor.bat b/ci/appveyor.bat index c77cee19d2..17d95ff691 100644 --- a/ci/appveyor.bat +++ b/ci/appveyor.bat @@ -71,7 +71,7 @@ cd src echo "Building MSVC 64bit console Version" nmake -f Make_mvc.mak CPU=AMD64 ^ OLE=no GUI=no IME=yes ICONV=yes DEBUG=no ^ - FEATURES=%FEATURE% + FEATURES=%FEATURE% CI_CFLAGS=/we4267 if not exist vim.exe ( echo Build failure. exit 1 @@ -85,11 +85,11 @@ if "%FEATURE%" == "HUGE" ( OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no POSTSCRIPT=yes ^ PYTHON_VER=27 DYNAMIC_PYTHON=yes PYTHON=C:\Python27-x64 ^ PYTHON3_VER=%PYTHON3_VER% DYNAMIC_PYTHON3=yes PYTHON3=%PYTHON3_DIR% ^ - FEATURES=%FEATURE% + FEATURES=%FEATURE% CI_CFLAGS=/we4267 ) ELSE ( nmake -f Make_mvc.mak CPU=AMD64 ^ OLE=no GUI=yes IME=yes ICONV=yes DEBUG=no ^ - FEATURES=%FEATURE% + FEATURES=%FEATURE% CI_CFLAGS=/we4267 ) if not exist gvim.exe ( echo Build failure. diff --git a/ci/ddebs.list b/ci/ddebs.list new file mode 100644 index 0000000000..e4491a6042 --- /dev/null +++ b/ci/ddebs.list @@ -0,0 +1,3 @@ +deb http://ddebs.ubuntu.com noble main restricted universe multiverse +deb http://ddebs.ubuntu.com noble-updates main restricted universe multiverse +deb http://ddebs.ubuntu.com noble-proposed main restricted universe multiverse diff --git a/ci/if_feat_check.vim b/ci/if_feat_check.vim new file mode 100644 index 0000000000..f846f7cbf8 --- /dev/null +++ b/ci/if_feat_check.vim @@ -0,0 +1,15 @@ +if 1 " This prevents it from being run in tiny versions + " Check for required features + if exists("g:required") + for feature in g:required + if !has(feature) + echo "Error: Feature '" .. feature .. "' not found" + echo '' + cquit + endif + endfor + echo "\nChecked features: " .. string(g:required) + echo '' + endif +endif +" vim: sts=2 sw=2 et diff --git a/ci/if_ver-1.vim b/ci/if_ver-1.vim index adc40a7cb0..397c05a456 100644 --- a/ci/if_ver-1.vim +++ b/ci/if_ver-1.vim @@ -1,6 +1,6 @@ -" Print all interface versions for Ubuntu. Part 1. +" Print all interface versions. Part 1. -if 1 +if 1 " This prevents it from being run in tiny versions execute 'source' expand(':h') .. '/if_ver-cmd.vim' echo "*** Interface versions ***\n" diff --git a/ci/if_ver-2.vim b/ci/if_ver-2.vim index 83e80e48ff..f717ec1e56 100644 --- a/ci/if_ver-2.vim +++ b/ci/if_ver-2.vim @@ -1,6 +1,8 @@ -" Print py3 interface versions for Ubuntu. Part 2. +" Print py3 interface versions. Part 2. +" This is done separately from part 1 because Vim cannot concurrently load +" Python 2 and 3 together. -if 1 +if 1 " This prevents it from being run in tiny versions execute 'source' expand(':h') .. '/if_ver-cmd.vim' echo 'Python 3:' diff --git a/ci/pinned-pkgs b/ci/pinned-pkgs new file mode 100644 index 0000000000..0603e141ab --- /dev/null +++ b/ci/pinned-pkgs @@ -0,0 +1,69 @@ +# Unfortunately ubtunu does not keep the debug packages strictly up-to-date +# with the main packages. So this file needs to pin the main packages back to +# the version for which debug packages are available. + +Package: libwayland-client0 +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-client0 +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-cursor0 +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-cursor0 +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-egl1 +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-egl1 +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-dev +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-dev +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-server0 +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-server0 +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +Package: libwayland-bin +Pin: version 1.20.0-1 +Pin-Priority: 1000 + +Package: libwayland-bin +Pin: version 1.20.0-1ubuntu0.1 +Pin-Priority: 100 + +# As of 2025-04-27 the base library package libgtk-3-0t64 is still at 3.24.41-4ubuntu1.2 +Package: libgtk-3-0t64-dbgsym +Pin: version 3.24.41-4ubuntu1.2 +Pin-Priority: 1000 + +Package: libgtk-3-0t64-dbgsym +Pin: version 3.24.41-4ubuntu1.3 +Pin-Priority: 100 + +# As of 2025-04-27 the base binary package libgtk-3-bin is still at 3.24.41-4ubuntu1.2 +Package: libgtk-3-bin-dbgsym +Pin: version 3.24.41-4ubuntu1.2 +Pin-Priority: 1000 + +Package: libgtk-3-bin-dbgsym +Pin: version 3.24.41-4ubuntu1.3 +Pin-Priority: 100 diff --git a/lang/README.ru.txt b/lang/README.ru.txt index a2a29db45b..5a58e1ef87 100644 --- a/lang/README.ru.txt +++ b/lang/README.ru.txt @@ -20,6 +20,11 @@ README.ru.txt для версии 9.1 программы Vim — Vi IMproved. функциональные клавиши клавиатуры необходимые команды, и использовать манипулятор «мышь». +В редакторе Vim также обеспечивается (насколько это возможно) совместимость +с POSIX-реализацией редактора vi, если он скомпилирован с минимальным набором +функционала (обычно называемый vim.tiny). Данная сборка чаще всего используется +во многих дистрибутивах Linux в качестве предустановленного редактора vi. + Редактор Vim работает в ОС MS Windows (7, 8, 10, 11), macOS, Haiku, VMS и практически во всех UNIX-подобных системах. А перенос на другие платформы не должен представлять особой сложности. @@ -36,7 +41,7 @@ MS Windows 95/98/Me/NT/2000/XP/Vista, AmigaDOS, Atari MiNT, BeOS и RISC OS. возможностей. Существуют отдельные версии для Unix, PC, Amiga и некоторых других систем. -Данный файл README.rux.txt поставляется вместе с архивом рабочих файлов +Данный файл README.ru.txt поставляется вместе с архивом рабочих файлов программы. Этот архив включает в себя документацию, файлы подсветки синтаксиса и другие файлы, которые используются редактором во время работы. Чтобы запустить программу Vim, вы должны получить либо архив с исполняемыми файлами, @@ -96,7 +101,7 @@ README_vms.txt VMS Редактор Vim является благотворительным программным обеспечением. Использование и копирование программы Vim не ограничено, однако рекомендуется сделать добровольное пожертвование для нуждающихся детей в Уганде. Чтобы узнать -подробности, прочитайте, пожалуйста, файл "runtime/doc/uganda.rux" (введите +подробности, прочитайте, пожалуйста, файл "runtime/doc/uganda.txt" (введите команду ":help uganda" в редакторе Vim). Краткое описание лицензии. @@ -116,7 +121,7 @@ README_vms.txt VMS над редактором Vim можно с помощью оказания финансовой поддержки. Пожертвованные вами деньги будут в основном направлены на оказание помощи детям -Уганды, см. "runtime/doc/uganda.rux". Однако в любом случае финансирование +Уганды, см. "runtime/doc/uganda.txt". Однако в любом случае финансирование будет способствовать повышению заинтересованности команды разработчиков в продолжении работы над редактором Vim! diff --git a/nsis/Make_mvc.mak b/nsis/Make_mvc.mak index c5aff151b9..8350082b26 100644 --- a/nsis/Make_mvc.mak +++ b/nsis/Make_mvc.mak @@ -46,6 +46,10 @@ MKNSISFLAGS = $(MKNSISFLAGS) /DHAVE_MULTI_LANG=$(HAVE_MULTI_LANG) MKNSISFLAGS = $(MKNSISFLAGS) /DWIN64=$(WIN64) !ENDIF +!IFDEF ARM64 +MKNSISFLAGS = $(MKNSISFLAGS) /DARM64=$(ARM64) +!ENDIF + !IFDEF INCLUDE_LIBGCC MKNSISFLAGS = $(MKNSISFLAGS) /DINCLUDE_LIBGCC=$(INCLUDE_LIBGCC) !ENDIF diff --git a/nsis/Makefile b/nsis/Makefile index fdbc12012f..890ace4ff1 100644 --- a/nsis/Makefile +++ b/nsis/Makefile @@ -39,6 +39,10 @@ ifdef WIN64 MKNSISFLAGS := $(MKNSISFLAGS) -DWIN64=$(WIN64) endif +ifdef ARM64 +MKNSISFLAGS := $(MKNSISFLAGS) -DARM64=$(ARM64) +endif + ifdef INCLUDE_LIBGCC MKNSISFLAGS := $(MKNSISFLAGS) -DINCLUDE_LIBGCC=$(INCLUDE_LIBGCC) endif diff --git a/nsis/README.txt b/nsis/README.txt index 4b4b7a0fbc..3bb32d423a 100644 --- a/nsis/README.txt +++ b/nsis/README.txt @@ -101,6 +101,8 @@ Variables and their values available for building the installer (not mandatory): "HAVE_NLS=0" — do not add native language support. "HAVE_MULTI_LANG=0" — to create an English-only the installer. "WIN64=1" — to create a 64-bit the installer. + "ARM64=1" — to create the installer for ARM64. The WIN64 variable + must be set to 1. "X=" — executes scriptcmd in script. If multiple scriptcmd are specified, they are separated by a semicolon. Example "X=OutFile MyVim.exe;XPMode on" diff --git a/nsis/gvim.nsi b/nsis/gvim.nsi index 8842dac639..04040b4d25 100644 --- a/nsis/gvim.nsi +++ b/nsis/gvim.nsi @@ -53,6 +53,18 @@ Unicode true !define WIN64 0 !endif +# if you want to create the installer for ARM64, use the /DARM64=1 on +# the command line makensis.exe. This property will be set to 1. +!ifndef ARM64 + !define ARM64 0 +!else + !if ${ARM64} > 0 + !if ${WIN64} < 1 + !define /redef WIN64 1 + !endif + !endif +!endif + # if you don't want to include libgcc_s_sjlj-1.dll in the package, use the # switch /DINCLUDE_LIBGCC=0 on the command line makensis.exe. !ifndef INCLUDE_LIBGCC @@ -113,9 +125,13 @@ ${StrRep} !define UNINST_REG_KEY_VIM "${UNINST_REG_KEY}\${PRODUCT}" !if ${WIN64} -Name "${PRODUCT} (x64)" + !if ${ARM64} + Name "${PRODUCT} (ARM64)" + !else + Name "${PRODUCT} (x64)" + !endif !else -Name "${PRODUCT}" + Name "${PRODUCT}" !endif OutFile gvim${VER_MAJOR}${VER_MINOR}.exe CRCCheck force @@ -498,7 +514,7 @@ Section "$(str_section_exe)" id_section_exe File ${VIMRT}\tools\*.* SetOutPath $0\tutor - File /x Makefile /x *.info ${VIMRT}\tutor\*.* + File /r /x *.info ${VIMRT}\tutor\*.* SectionEnd ########################################################## diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim index a740305226..380b97bf41 100644 --- a/runtime/autoload/dist/ft.vim +++ b/runtime/autoload/dist/ft.vim @@ -3,7 +3,7 @@ vim9script # Vim functions for file type detection # # Maintainer: The Vim Project -# Last Change: 2025 Jan 25 +# Last Change: 2025 Jul 09 # Former Maintainer: Bram Moolenaar # These functions are moved here from runtime/filetype.vim to make startup @@ -30,12 +30,8 @@ export def Check_inp() enddef # This function checks for the kind of assembly that is wanted by the user, or -# can be detected from the first five lines of the file. +# can be detected from the beginning of the file. export def FTasm() - # tiasm uses `* commment` - if join(getline(1, 10), "\n") =~ '\%(\%(^\|\n\)\*\|Texas Instruments Incorporated\)' - setf tiasm - endif # make sure b:asmsyntax exists if !exists("b:asmsyntax") b:asmsyntax = "" @@ -65,9 +61,30 @@ export def FTasmsyntax() var match = matchstr(head, '\sasmsyntax=\zs[a-zA-Z0-9]\+\ze\s') if match != '' b:asmsyntax = match - elseif ((head =~? '\.title') || (head =~? '\.ident') || (head =~? '\.macro') || (head =~? '\.subtitle') || (head =~? '\.library')) - b:asmsyntax = "vmasm" + return endif + # Use heuristics + var is_slash_star_encountered = false + var i = 1 + const n = min([50, line("$")]) + while i <= n + const line = getline(i) + if line =~ '^/\*' + is_slash_star_encountered = true + endif + if line =~# '^; Listing generated by Microsoft' || line =~? '^\%(\%(CONST\|_BSS\|_DATA\|_TEXT\)\s\+SEGMENT\>\)\|\s*\.[2-6]86P\?\>\|\s*\.XMM\>' + b:asmsyntax = "masm" + return + elseif line =~ 'Texas Instruments Incorporated' || (line =~ '^\*' && !is_slash_star_encountered) + # tiasm uses `* commment`, but detection is unreliable if '/*' is seen + b:asmsyntax = "tiasm" + return + elseif ((line =~? '\.title\>\|\.ident\>\|\.macro\>\|\.subtitle\>\|\.library\>')) + b:asmsyntax = "vmasm" + return + endif + i += 1 + endwhile enddef var ft_visual_basic_content = '\c^\s*\%(Attribute\s\+VB_Name\|Begin\s\+\%(VB\.\|{\%(\x\+-\)\+\x\+}\)\)' @@ -184,9 +201,18 @@ enddef export def FTll() if getline(1) =~ ';\|\\|\' setf llvm - else - setf lifelines + return endif + var n = 1 + while n < 100 && n <= line("$") + var line = getline(n) + if line =~ '^\s*%' + setf lex + return + endif + n += 1 + endwhile + setf lifelines enddef export def FTlpc() @@ -203,19 +229,36 @@ export def FTlpc() setf c enddef +# Searches within the first `maxlines` lines of the file for distinctive +# Objective-C or C++ syntax and returns the appropriate filetype. Returns a +# null_string if the search was inconclusive. +def CheckObjCOrCpp(maxlines = 100): string + var n = 1 + while n < maxlines && n <= line('$') + const line = getline(n) + if line =~ '\v^\s*\@%(class|interface|end)>' + return 'objcpp' + elseif line =~ '\v^\s*%(class|namespace|template|using)>' + return 'cpp' + endif + ++n + endwhile + return null_string +enddef + +# Determines whether a *.h file is C, C++, Ch, or Objective-C/Objective-C++. export def FTheader() - if match(getline(1, min([line("$"), 200])), '^@\(interface\|end\|class\)') > -1 - if exists("g:c_syntax_for_h") - setf objc - else - setf objcpp - endif - elseif exists("g:c_syntax_for_h") + if exists('g:filetype_h') + execute $'setf {g:filetype_h}' + elseif exists('g:c_syntax_for_h') setf c - elseif exists("g:ch_syntax_for_h") + elseif exists('g:ch_syntax_for_h') setf ch else - setf cpp + # Search the first 100 lines of the file for distinctive Objective-C or C++ + # syntax and set the filetype accordingly. Otherwise, use C as the default + # filetype. + execute $'setf {CheckObjCOrCpp() ?? 'c'}' endif enddef @@ -557,17 +600,47 @@ export def FTm() enddef export def FTmake() - # Check if it is a Microsoft Makefile - unlet! b:make_microsoft + # Check if it is a BSD, GNU, or Microsoft Makefile + unlet! b:make_flavor + + # 1. filename + if expand('%:t') == 'BSDmakefile' + b:make_flavor = 'bsd' + setf make + return + elseif expand('%:t') == 'GNUmakefile' + b:make_flavor = 'gnu' + setf make + return + endif + + # 2. user's setting + if exists('g:make_flavor') + b:make_flavor = g:make_flavor + setf make + return + elseif get(g:, 'make_microsoft') + echom "make_microsoft is deprecated; try g:make_flavor = 'microsoft' instead" + b:make_flavor = 'microsoft' + setf make + return + endif + + # 3. try to detect a flavor from file content var n = 1 while n < 1000 && n <= line('$') var line = getline(n) if line =~? '^\s*!\s*\(ifn\=\(def\)\=\|include\|message\|error\)\>' - b:make_microsoft = 1 + b:make_flavor = 'microsoft' + break + elseif line =~ '^\.\%(export\|error\|for\|if\%(n\=\%(def\|make\)\)\=\|info\|warning\)\>' + b:make_flavor = 'bsd' break - elseif line =~ '^ *ifn\=\(eq\|def\)\>' || line =~ '^ *[-s]\=include\s' + elseif line =~ '^ *\%(ifn\=\%(eq\|def\)\|define\|override\)\>' + b:make_flavor = 'gnu' break - elseif line =~ '^ *\w\+\s*[!?:+]=' + elseif line =~ '\$[({][a-z-]\+\s\+\S\+' # a function call, e.g. $(shell pwd) + b:make_flavor = 'gnu' break endif n += 1 @@ -592,14 +665,19 @@ export def FTmms() setf mmix enddef -# This function checks if one of the first five lines start with a dot. In -# that case it is probably an nroff file: 'filetype' is set and 1 is returned. +# This function checks if one of the first five lines start with a typical +# nroff pattern in man files. In that case it is probably an nroff file: +# 'filetype' is set and 1 is returned. export def FTnroff(): number - if getline(1)[0] .. getline(2)[0] .. getline(3)[0] - .. getline(4)[0] .. getline(5)[0] =~ '\.' - setf nroff - return 1 - endif + var n = 1 + while n <= 5 + var line = getline(n) + if line =~ '^\%([.'']\s*\%(TH\|D[dt]\|S[Hh]\|d[es]1\?\|so\)\s\+\S\|[.'']\s*ig\>\|\%([.'']\s*\)\?\\"\)' + setf nroff + return 1 + endif + n += 1 + endwhile return 0 enddef @@ -875,16 +953,16 @@ export def SetFileTypeSH(name: string, setft = true): string if setft && expand("") =~ g:ft_ignore_pat return '' endif - if name =~ '\' + if name =~ '^csh$' || name =~ '^#!.\{-2,}\' # Some .sh scripts contain #!/bin/csh. return SetFileTypeShell("csh", setft) - elseif name =~ '\' + elseif name =~ '^tcsh$' || name =~ '^#!.\{-2,}\' # Some .sh scripts contain #!/bin/tcsh. return SetFileTypeShell("tcsh", setft) - elseif name =~ '\' + elseif name =~ '^zsh$' || name =~ '^#!.\{-2,}\' # Some .sh scripts contain #!/bin/zsh. return SetFileTypeShell("zsh", setft) - elseif name =~ '\' + elseif name =~ '^ksh$' || name =~ '^#!.\{-2,}\' b:is_kornshell = 1 if exists("b:is_bash") unlet b:is_bash @@ -892,7 +970,8 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif - elseif exists("g:bash_is_sh") || name =~ '\' || name =~ '\' + elseif exists("g:bash_is_sh") || name =~ '^bash2\=$' || + \ name =~ '^#!.\{-2,}\' b:is_bash = 1 if exists("b:is_kornshell") unlet b:is_kornshell @@ -900,7 +979,7 @@ export def SetFileTypeSH(name: string, setft = true): string if exists("b:is_sh") unlet b:is_sh endif - elseif name =~ '\' || name =~ '\' + elseif name =~ '^\%(da\)\=sh$' || name =~ '^#!.\{-2,}\<\%(da\)\=sh\>' # Ubuntu links "sh" to "dash", thus it is expected to work the same way b:is_sh = 1 if exists("b:is_kornshell") diff --git a/runtime/autoload/dist/script.vim b/runtime/autoload/dist/script.vim index 859126f0f6..c184bd032d 100644 --- a/runtime/autoload/dist/script.vim +++ b/runtime/autoload/dist/script.vim @@ -4,7 +4,7 @@ vim9script # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: The Vim Project -# Last Change: 2025 Jan 20 +# Last Change: 2025 Apr 24 # Former Maintainer: Bram Moolenaar export def DetectFiletype() @@ -26,8 +26,9 @@ def DetectFromHashBang(firstline: string) # "#!/usr/bin/bash" to make matching easier. # Recognize only a few {options} that are commonly used. if line1 =~ '^#!\s*\S*\ -" Last Change: 2023 Nov 04 +" Last Change: 2025 Apr 27 " enable the zip and gzip plugin by default, if not set diff --git a/runtime/autoload/dist/vimindent.vim b/runtime/autoload/dist/vimindent.vim index 0681496ae9..37f2ee5e18 100644 --- a/runtime/autoload/dist/vimindent.vim +++ b/runtime/autoload/dist/vimindent.vim @@ -2,7 +2,7 @@ vim9script # Language: Vim script # Maintainer: github user lacygoill -# Last Change: 2024 Dec 26 +# Last Change: 2025 Apr 13 # # Includes changes from The Vim Project: # - 2024 Feb 09: Fix indent after literal Dict (A. Radev via #13966) @@ -981,8 +981,10 @@ def SearchPair( # {{{3 if end == '[' || end == ']' e = e->escape('[]') endif + # VIM_INDENT_TEST_TRACE_START return searchpair('\C' .. s, (middle == '' ? '' : '\C' .. middle), '\C' .. e, flags, (): bool => InCommentOrString(), stopline, TIMEOUT) + # VIM_INDENT_TEST_TRACE_END dist#vimindent#SearchPair enddef def SearchPairStart( # {{{3 @@ -1268,7 +1270,9 @@ def NonCommentedMatch(line: dict, pat: string): bool # {{{3 var pos: list = getcurpos() cursor(line.lnum, 1) + # VIM_INDENT_TEST_TRACE_START var match_lnum: number = search(pat, 'cnW', line.lnum, TIMEOUT, (): bool => InCommentOrString()) + # VIM_INDENT_TEST_TRACE_END dist#vimindent#NonCommentedMatch setpos('.', pos) return match_lnum > 0 enddef diff --git a/runtime/autoload/getscript.vim b/runtime/autoload/getscript.vim index e599d1ed95..1e3b5b39d6 100644 --- a/runtime/autoload/getscript.vim +++ b/runtime/autoload/getscript.vim @@ -13,6 +13,7 @@ " substitution of hardcoded commands with global variables " 2024 Nov 12 by Vim Project: fix problems on Windows (#16036) " 2025 Feb 28 by Vim Project: add support for bzip3 (#16755) +" 2025 May 11 by Vim Project: check network connectivity (#17249) " }}} " " GetLatestVimScripts: 642 1 :AutoInstall: getscript.vim @@ -147,9 +148,6 @@ if g:GetLatestVimScripts_allowautoinstall elseif exists('$HOME') && isdirectory(expand("$HOME")."/".s:dotvim) let s:autoinstall= $HOME."/".s:dotvim endif -" call Decho("s:autoinstall<".s:autoinstall.">") -"else "Decho -" call Decho("g:GetLatestVimScripts_allowautoinstall=".g:GetLatestVimScripts_allowautoinstall.": :AutoInstall: disabled") endif " --------------------------------------------------------------------- @@ -163,24 +161,19 @@ silent! com -nargs=0 GLVS call getscript#GetLatestVimScripts() " scripts based on the list in " (first dir in runtimepath)/GetLatest/GetLatestVimScripts.dat fun! getscript#GetLatestVimScripts() -" call Dfunc("GetLatestVimScripts() autoinstall<".s:autoinstall.">") -" insure that wget is executable if executable(g:GetLatestVimScripts_wget) != 1 echoerr "GetLatestVimScripts needs ".g:GetLatestVimScripts_wget." which apparently is not available on your system" -" call Dret("GetLatestVimScripts : wget not executable/available") return endif " Find the .../GetLatest subdirectory under the runtimepath for datadir in split(&rtp,',') + [''] if isdirectory(datadir."/GetLatest") -" call Decho("found directory<".datadir.">") let datadir= datadir . "/GetLatest" break endif if filereadable(datadir."GetLatestVimScripts.dat") -" call Decho("found ".datadir."/GetLatestVimScripts.dat") break endif endfor @@ -188,32 +181,25 @@ fun! getscript#GetLatestVimScripts() " Sanity checks: readability and writability if datadir == "" echoerr 'Missing "GetLatest/" on your runtimepath - see :help glvs-dist-install' -" call Dret("GetLatestVimScripts : unable to find a GetLatest subdirectory") return endif if filewritable(datadir) != 2 echoerr "(getLatestVimScripts) Your ".datadir." isn't writable" -" call Dret("GetLatestVimScripts : non-writable directory<".datadir.">") return endif let datafile= datadir."/GetLatestVimScripts.dat" if !filereadable(datafile) echoerr "Your data file<".datafile."> isn't readable" -" call Dret("GetLatestVimScripts : non-readable datafile<".datafile.">") return endif if !filewritable(datafile) echoerr "Your data file<".datafile."> isn't writable" -" call Dret("GetLatestVimScripts : non-writable datafile<".datafile.">") return endif " -------------------- " Passed sanity checks " -------------------- -" call Decho("datadir <".datadir.">") -" call Decho("datafile <".datafile.">") - " don't let any event handlers interfere (like winmanager's, taglist's, etc) let eikeep = &ei let hlskeep = &hls @@ -226,25 +212,20 @@ fun! getscript#GetLatestVimScripts() " 3. split window " 4. edit datafile let origdir= getcwd() -" call Decho("exe cd ".fnameescape(substitute(datadir,'\','/','ge'))) exe "cd ".fnameescape(substitute(datadir,'\','/','ge')) split -" call Decho("exe e ".fnameescape(substitute(datafile,'\','/','ge'))) exe "e ".fnameescape(substitute(datafile,'\','/','ge')) res 1000 let s:downloads = 0 let s:downerrors= 0 + let s:message = [] " Check on dependencies mentioned in plugins -" call Decho(" ") -" call Decho("searching plugins for GetLatestVimScripts dependencies") let lastline = line("$") -" call Decho("lastline#".lastline) let firstdir = substitute(&rtp,',.*$','','') let plugins = split(globpath(firstdir,"plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"ftplugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"AsNeeded/**/*.vim"),'\n') -" extend the search to the packages too (this script predates the feature) let plugins += split(globpath(firstdir,"pack/*/start/*/plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"pack/*/opt/*/plugin/**/*.vim"),'\n') let plugins += split(globpath(firstdir,"pack/*/start/*/ftplugin/**/*.vim"),'\n') @@ -257,14 +238,10 @@ fun! getscript#GetLatestVimScripts() " It reads the plugin script at the end of the GetLatestVimScripts.dat " file, examines it, and then removes it. for plugin in plugins -" call Decho(" ") -" call Decho("plugin<".plugin.">") " read plugin in " evidently a :r creates a new buffer (the "#" buffer) that is subsequently unused -- bwiping it $ -" call Decho(".dependency checking<".plugin."> line$=".line("$")) -" call Decho("..exe silent r ".fnameescape(plugin)) exe "silent r ".fnameescape(plugin) exe "silent bwipe ".bufnr("#") @@ -272,7 +249,6 @@ fun! getscript#GetLatestVimScripts() let depscript = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\d\+\s\+\d\+\s\+\(.*\)$','\1','e') let depscriptid = substitute(getline("."),'^"\s\+GetLatestVimScripts:\s\+\(\d\+\)\s\+.*$','\1','') let llp1 = lastline+1 -" call Decho("..depscript<".depscript.">") " found a "GetLatestVimScripts: # #" line in the script; " check if it's already in the datafile by searching backwards from llp1, @@ -286,21 +262,17 @@ fun! getscript#GetLatestVimScripts() " this second search is taken when, for example, a 0 0 scriptname is to be skipped over let srchline= search('\<'.noai_script.'\>','bW') endif -" call Decho("..noai_script<".noai_script."> depscriptid#".depscriptid." srchline#".srchline." curline#".line(".")." lastline#".lastline) if srchline == 0 " found a new script to permanently include in the datafile let keep_rega = @a let @a = substitute(getline(curline),'^"\s\+GetLatestVimScripts:\s\+','','') echomsg "Appending <".@a."> to ".datafile." for ".depscript -" call Decho("..Appending <".@a."> to ".datafile." for ".depscript) exe lastline."put a" let @a = keep_rega let lastline = llp1 let curline = curline + 1 let foundscript = foundscript + 1 -" else " Decho -" call Decho("..found <".noai_script."> (already in datafile at line#".srchline.")") endif let curline = curline + 1 @@ -309,12 +281,8 @@ fun! getscript#GetLatestVimScripts() " llp1: last line plus one let llp1= lastline + 1 -" call Decho(".deleting lines: ".llp1.",$d") exe "silent! ".llp1.",$d" endfor -" call Decho("--- end dependency checking loop --- foundscript=".foundscript) -" call Decho(" ") -" call Dredir("BUFFER TEST (GetLatestVimScripts 1)","ls!") if foundscript == 0 setlocal nomod @@ -323,32 +291,32 @@ fun! getscript#GetLatestVimScripts() " -------------------------------------------------------------------- " Check on out-of-date scripts using GetLatest/GetLatestVimScripts.dat " -------------------------------------------------------------------- -" call Decho("begin: checking out-of-date scripts using datafile<".datafile.">") setlocal lz 1 -" /^-----/,$g/^\s*\d/call Decho(getline(".")) - 1 /^-----/,$g/^\s*\d/call s:GetOneScript() -" call Decho("--- end out-of-date checking --- ") " Final report (an echomsg) try silent! ?^-------? catch /^Vim\%((\a\+)\)\=:E114/ -" call Dret("GetLatestVimScripts : nothing done!") return endtry exe "norm! kz\" redraw! + if !empty(s:message) + echohl WarningMsg + for mess in s:message + echom mess + endfor + let s:downerrors += len(s:message) + endif let s:msg = "" if s:downloads == 1 let s:msg = "Downloaded one updated script to <".datadir.">" - elseif s:downloads == 2 - let s:msg= "Downloaded two updated scripts to <".datadir.">" elseif s:downloads > 1 let s:msg= "Downloaded ".s:downloads." updated scripts to <".datadir.">" else - let s:msg= "Everything was already current" + let s:msg= empty(s:message) ? "Everything was already current" : "There were some errors" endif if s:downerrors > 0 let s:msg= s:msg." (".s:downerrors." downloading errors)" @@ -366,8 +334,6 @@ fun! getscript#GetLatestVimScripts() let &hls = hlskeep let &acd = acdkeep setlocal nolz -" call Dredir("BUFFER TEST (GetLatestVimScripts 2)","ls!") -" call Dret("GetLatestVimScripts : did ".s:downloads." downloads") endfun " --------------------------------------------------------------------- @@ -376,8 +342,6 @@ endfun " ScriptID, SourceID, and Filename. " It downloads any scripts that have newer versions from vim.sourceforge.net. fun! s:GetOneScript(...) -" call Dfunc("GetOneScript()") - " set options to allow progress to be shown on screen let rega= @a let t_ti= &t_ti @@ -403,13 +367,9 @@ fun! s:GetOneScript(...) let srcid = a:2 let fname = a:3 let cmmnt = "" -" call Decho("scriptid<".scriptid.">") -" call Decho("srcid <".srcid.">") -" call Decho("fname <".fname.">") else let curline = getline(".") if curline =~ '^\s*#' -" call Dret("GetOneScript : skipping a pure comment line") return endif let parsepat = '^\s*\(\d\+\)\s\+\(\d\+\)\s\+\(.\{-}\)\(\s*#.*\)\=$' @@ -433,36 +393,26 @@ fun! s:GetOneScript(...) catch /^Vim\%((\a\+)\)\=:E486/ let cmmnt= "" endtry -" call Decho("curline <".curline.">") -" call Decho("parsepat<".parsepat.">") -" call Decho("scriptid<".scriptid.">") -" call Decho("srcid <".srcid.">") -" call Decho("fname <".fname.">") endif " plugin author protection from downloading his/her own scripts atop their latest work + " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname if scriptid == 0 || srcid == 0 - " When looking for :AutoInstall: lines, skip scripts that have 0 0 scriptname -" call Dret("GetOneScript : skipping a scriptid==srcid==0 line") return endif let doautoinstall= 0 if fname =~ ":AutoInstall:" -" call Decho("case AutoInstall: fname<".fname.">") let aicmmnt= substitute(fname,'\s\+:AutoInstall:\s\+',' ','') -" call Decho("aicmmnt<".aicmmnt."> s:autoinstall=".s:autoinstall) if s:autoinstall != "" let doautoinstall = g:GetLatestVimScripts_allowautoinstall endif else let aicmmnt= fname endif -" call Decho("aicmmnt<".aicmmnt.">: doautoinstall=".doautoinstall) exe "norm z\" redraw! -" call Decho('considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid) echo 'considering <'.aicmmnt.'> scriptid='.scriptid.' srcid='.srcid " grab a copy of the plugin's vim.sourceforge.net webpage @@ -470,15 +420,17 @@ fun! s:GetOneScript(...) let tmpfile = tempname() let v:errmsg = "" + " Check if URLs are reachable + if !CheckVimScriptURL(scriptid, srcid) + return + endif + " make up to three tries at downloading the description let itry= 1 while itry <= 3 -" call Decho(".try#".itry." to download description of <".aicmmnt."> with addr=".scriptaddr) if has("win32") || has("win16") || has("win95") -" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)."|bw!") new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile).' '.shellescape(scriptaddr)|bw! else -" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr)) exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(tmpfile)." ".shellescape(scriptaddr) endif if itry == 1 @@ -496,7 +448,6 @@ fun! s:GetOneScript(...) endif let itry= itry + 1 endwhile -" call Decho(" --- end downloading tries while loop --- itry=".itry) " testing: did finding "Click on the package..." fail? if findpkg == 0 || itry >= 4 @@ -507,12 +458,9 @@ fun! s:GetOneScript(...) let &t_te = t_te let &rs = rs let s:downerrors = s:downerrors + 1 -" call Decho("***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "Click on the package..." in description page for <'.aicmmnt.">" -" call Dret("GetOneScript : srch for /Click on the package/ failed") return endif -" call Decho('found "Click on the package to download"') let findsrcid= search('src_id=','W') if findsrcid == 0 @@ -523,28 +471,22 @@ fun! s:GetOneScript(...) let &t_te = t_te let &rs = rs let s:downerrors = s:downerrors + 1 -" call Decho("***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">") echomsg "***warning*** couldn'".'t find "src_id=" in description page for <'.aicmmnt.">" -" call Dret("GetOneScript : srch for /src_id/ failed") return endif -" call Decho('found "src_id=" in description page') let srcidpat = '^\s*\([^<]\+\)<.*$' let latestsrcid= substitute(getline("."),srcidpat,'\1','') let sname = substitute(getline("."),srcidpat,'\2','') " script name actually downloaded -" call Decho("srcidpat<".srcidpat."> latestsrcid<".latestsrcid."> sname<".sname.">") silent q! call delete(tmpfile) " convert the strings-of-numbers into numbers let srcid = srcid + 0 let latestsrcid = latestsrcid + 0 -" call Decho("srcid=".srcid." latestsrcid=".latestsrcid." sname<".sname.">") " has the plugin's most-recent srcid increased, which indicates that it has been updated if latestsrcid > srcid -" call Decho("[latestsrcid=".latestsrcid."] <= [srcid=".srcid."]: need to update <".sname.">") let s:downloads= s:downloads + 1 if sname == bufname("%") @@ -555,20 +497,16 @@ fun! s:GetOneScript(...) " ----------------------------------------------------------------------------- " the plugin has been updated since we last obtained it, so download a new copy " ----------------------------------------------------------------------------- -" call Decho(".downloading new <".sname.">") echomsg ".downloading new <".sname.">" if has("win32") || has("win16") || has("win95") -" call Decho(".new|exe silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)."|bw!") new|exe "silent r!".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid)|bw! else -" call Decho(".exe silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid) exe "silent !".g:GetLatestVimScripts_wget." ".g:GetLatestVimScripts_options." ".shellescape(sname)." ".shellescape(g:GetLatestVimScripts_downloadaddr.latestsrcid) endif " -------------------------------------------------------------------------- " AutoInstall: only if doautoinstall has been requested by the plugin itself " -------------------------------------------------------------------------- -" call Decho("checking if plugin requested autoinstall: doautoinstall=".doautoinstall) if doautoinstall if filereadable(sname) exe "silent !".g:GetLatestVimScripts_mv." ".shellescape(sname)." ".shellescape(s:autoinstall) @@ -602,7 +540,6 @@ fun! s:GetOneScript(...) exe "sil !".g:GetLatestVimScripts_unxz." ".shellescape(sname) let sname= substitute(sname,'\.xz$','','') else -" call Decho("no decompression needed") endif " distribute archive(.zip, .tar, .vba, .vmb, ...) contents @@ -632,8 +569,6 @@ fun! s:GetOneScript(...) else unlet g:vimball_home endif - else -" call Decho("no dearchiving needed") endif " --------------------------------------------- @@ -665,7 +600,41 @@ fun! s:GetOneScript(...) " update the data in the file call setline(line("."),modline) endif +endfun +" CheckVimScriptURL: Check Network Connection {{{1 +" Check status code of scriptaddr and downloadaddr +" return v:true if the script is downloadable or v:false in case of errors +fun CheckVimScriptURL(script_id, src_id) + " doesn't work with powershell + if !executable('curl') || &shell =~? 'pwsh\|powershell' + return v:true + endif + let output = has("win32") ? ' -o NUL ' : ' -o /dev/null ' + + let temp = tempname() + defer delete(temp) + let script_url = g:GetLatestVimScripts_scriptaddr . a:script_id + let download_url = g:GetLatestVimScripts_downloadaddr . a:src_id + + let script_cmd = 'curl -s -I -w "%{http_code}"' . output . shellescape(script_url) . ' >' . shellescape(temp) + call system(script_cmd) + let script_status = readfile(temp, 'b')[0] + + let download_cmd = 'curl -s -I -w "%{http_code}"' . output . shellescape(download_url) . ' >' . shellescape(temp) + call system(download_cmd) + let download_status = readfile(temp, 'b')[0] + + if script_status !=# '200' + let s:message += [ printf('Error: Failed to reach script: %s', a:script_id) ] + return v:false + endif + + if download_status !=# '200' + let s:message += [ printf('Error: Failed to download script %s', a:script_id) ] + return v:false + endif + return v:true endfun " --------------------------------------------------------------------- diff --git a/runtime/autoload/hcl.vim b/runtime/autoload/hcl.vim index 2215fc8f27..e45a4e31ba 100644 --- a/runtime/autoload/hcl.vim +++ b/runtime/autoload/hcl.vim @@ -2,6 +2,21 @@ " Maintainer: Gregory Anders " Last Change: 2024-09-03 " Based on: https://github.com/hashivim/vim-terraform +" License: ISC +" +" Copyright (c) 2014-2016 Mark Cornick +" +" Permission to use, copy, modify, and/or distribute this software for any purpose +" with or without fee is hereby granted, provided that the above copyright notice +" and this permission notice appear in all copies. +" +" THE SOFTWARE IS PROVIDED 'AS IS' AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +" REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +" FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +" INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS +" OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +" TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF +" THIS SOFTWARE. function! hcl#indentexpr(lnum) " Beginning of the file should have no indent diff --git a/runtime/autoload/htmlfold.vim b/runtime/autoload/htmlfold.vim new file mode 100644 index 0000000000..76ccaefaf4 --- /dev/null +++ b/runtime/autoload/htmlfold.vim @@ -0,0 +1,192 @@ +" HTML folding script, :h ft-html-plugin +" Latest Change: 2025 May 10 +" Original Author: Aliaksei Budavei <0x000c70@gmail.com> + +function! htmlfold#MapBalancedTags() abort + " Describe only _a capturable-name prefix_ for start and end patterns of + " a tag so that start tags with attributes spanning across lines can also be + " matched with a single call of "getline()". + let tag = '\m\c 0 + let name_attr = synIDattr(synID(lnum, cnum, 0), 'name') + + if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag' + let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') + + if !empty(name) + call insert(names, tolower(name), 0) + call insert(pairs, [lnum, -1], 0) + endif + elseif name_attr ==# 'htmlEndTag' + let name = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') + + if !empty(name) + let idx = index(names, tolower(name)) + + if idx >= 0 + " Dismiss inlined balanced tags and opened-only tags. + if pairs[idx][0] != lnum + let pairs[idx][1] = lnum + call add(ends, lnum) + endif + + " Claim a pair. + let names[: idx] = repeat([''], (idx + 1)) + endif + endif + endif + + " Advance the cursor, at "<", past "", etc. + call cursor(lnum, (cnum + 3)) + let [lnum, cnum] = searchpos(tag, 'cnW') + endwhile + finally + call setpos('.', pos) + endtry + + if empty(ends) + return {} + endif + + let folds = {} + let pending_end = ends[0] + let level = 0 + + while !empty(pairs) + let [start, end] = remove(pairs, -1) + + if end < 0 + continue + endif + + if start >= pending_end + " Mark a sibling tag. + call remove(ends, 0) + + while start >= ends[0] + " Mark a parent tag. + call remove(ends, 0) + let level -= 1 + endwhile + + let pending_end = ends[0] + else + " Mark a child tag. + let level += 1 + endif + + " Flatten the innermost inlined folds. + let folds[start] = get(folds, start, ('>' . level)) + let folds[end] = get(folds, end, ('<' . level)) + endwhile + + return folds +endfunction + +" See ":help vim9-mix". +if !has("vim9script") + finish +endif + +def! g:htmlfold#MapBalancedTags(): dict + # Describe only _a capturable-name prefix_ for start and end patterns of + # a tag so that start tags with attributes spanning across lines can also be + # matched with a single call of "getline()". + const tag: string = '\m\c = [] + var pairs: list> = [] + var ends: list = [] + const pos: list = getpos('.') + + try + cursor(1, 1) + var [lnum: number, cnum: number] = searchpos(tag, 'cnW') + + # Pair up nearest non-inlined tags in scope. + while lnum > 0 + const name_attr: string = synIDattr(synID(lnum, cnum, 0), 'name') + + if name_attr ==# 'htmlTag' || name_attr ==# 'htmlScriptTag' + const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') + + if !empty(name) + insert(names, tolower(name), 0) + insert(pairs, [lnum, -1], 0) + endif + elseif name_attr ==# 'htmlEndTag' + const name: string = get(matchlist(getline(lnum), tag, (cnum - 1)), 1, '') + + if !empty(name) + const idx: number = index(names, tolower(name)) + + if idx >= 0 + # Dismiss inlined balanced tags and opened-only tags. + if pairs[idx][0] != lnum + pairs[idx][1] = lnum + add(ends, lnum) + endif + + # Claim a pair. + names[: idx] = repeat([''], (idx + 1)) + endif + endif + endif + + # Advance the cursor, at "<", past "", etc. + cursor(lnum, (cnum + 3)) + [lnum, cnum] = searchpos(tag, 'cnW') + endwhile + finally + setpos('.', pos) + endtry + + if empty(ends) + return {} + endif + + var folds: dict = {} + var pending_end: number = ends[0] + var level: number = 0 + + while !empty(pairs) + const [start: number, end: number] = remove(pairs, -1) + + if end < 0 + continue + endif + + if start >= pending_end + # Mark a sibling tag. + remove(ends, 0) + + while start >= ends[0] + # Mark a parent tag. + remove(ends, 0) + level -= 1 + endwhile + + pending_end = ends[0] + else + # Mark a child tag. + level += 1 + endif + + # Flatten the innermost inlined folds. + folds[start] = get(folds, start, ('>' .. level)) + folds[end] = get(folds, end, ('<' .. level)) + endwhile + + return folds +enddef + +" vim: fdm=syntax sw=2 ts=8 noet diff --git a/runtime/autoload/python.vim b/runtime/autoload/python.vim index d5f4862363..cf01198d73 100644 --- a/runtime/autoload/python.vim +++ b/runtime/autoload/python.vim @@ -20,10 +20,12 @@ let g:python_indent = extend(get(g:, 'python_indent', {}), #{ let s:maxoff = 50 " maximum number of lines to look backwards for () function s:SearchBracket(fromlnum, flags) + " VIM_INDENT_TEST_TRACE_START return searchpairpos('[[({]', '', '[])}]', a:flags, \ {-> synstack('.', col('.')) \ ->indexof({_, id -> synIDattr(id, 'name') =~ '\%(Comment\|Todo\|String\)$'}) >= 0}, \ [0, a:fromlnum - s:maxoff]->max(), g:python_indent.searchpair_timeout) + " VIM_INDENT_TEST_TRACE_END python#s:SearchBracket endfunction " See if the specified line is already user-dedented from the expected value. diff --git a/runtime/autoload/rustfmt.vim b/runtime/autoload/rustfmt.vim index 8fd3858178..847b698b79 100644 --- a/runtime/autoload/rustfmt.vim +++ b/runtime/autoload/rustfmt.vim @@ -1,5 +1,8 @@ " Author: Stephen Sugden " Last Modified: 2023-09-11 +" Last Change: +" 2025 Mar 31 by Vim project (rename s:RustfmtConfigOptions()) +" 2025 Jul 14 by Vim project (don't parse rustfmt version automatically #17745) " " Adapted from https://github.com/fatih/vim-go " For bugs, patches and license go to https://github.com/rust-lang/rust.vim @@ -21,6 +24,12 @@ if !exists("g:rustfmt_fail_silently") endif function! rustfmt#DetectVersion() + let s:rustfmt_version = "0" + let s:rustfmt_help = "" + let s:rustfmt_unstable_features = "" + if !get(g:, 'rustfmt_detect_version', 0) + return s:rustfmt_version + endif " Save rustfmt '--help' for feature inspection silent let s:rustfmt_help = system(g:rustfmt_command . " --help") let s:rustfmt_unstable_features = s:rustfmt_help =~# "--unstable-features" @@ -29,9 +38,7 @@ function! rustfmt#DetectVersion() silent let l:rustfmt_version_full = system(g:rustfmt_command . " --version") let l:rustfmt_version_list = matchlist(l:rustfmt_version_full, \ '\vrustfmt ([0-9]+[.][0-9]+[.][0-9]+)') - if len(l:rustfmt_version_list) < 3 - let s:rustfmt_version = "0" - else + if len(l:rustfmt_version_list) >= 3 let s:rustfmt_version = l:rustfmt_version_list[1] endif return s:rustfmt_version @@ -61,7 +68,13 @@ function! s:RustfmtWriteMode() endif endfunction -function! s:RustfmtConfigOptions() +function! rustfmt#RustfmtConfigOptions() + let default = '--edition 2018' + + if !get(g:, 'rustfmt_find_toml', 0) + return default + endif + let l:rustfmt_toml = findfile('rustfmt.toml', expand('%:p:h') . ';') if l:rustfmt_toml !=# '' return '--config-path '.shellescape(fnamemodify(l:rustfmt_toml, ":p")) @@ -73,7 +86,7 @@ function! s:RustfmtConfigOptions() endif " Default to edition 2018 in case no rustfmt.toml was found. - return '--edition 2018' + return default endfunction function! s:RustfmtCommandRange(filename, line1, line2) @@ -84,7 +97,7 @@ function! s:RustfmtCommandRange(filename, line1, line2) let l:arg = {"file": shellescape(a:filename), "range": [a:line1, a:line2]} let l:write_mode = s:RustfmtWriteMode() - let l:rustfmt_config = s:RustfmtConfigOptions() + let l:rustfmt_config = rustfmt#RustfmtConfigOptions() " FIXME: When --file-lines gets to be stable, add version range checking " accordingly. @@ -99,7 +112,7 @@ endfunction function! s:RustfmtCommand() let write_mode = g:rustfmt_emit_files ? '--emit=stdout' : '--write-mode=display' - let config = s:RustfmtConfigOptions() + let config = rustfmt#RustfmtConfigOptions() return join([g:rustfmt_command, write_mode, config, g:rustfmt_options]) endfunction diff --git a/runtime/autoload/tar.vim b/runtime/autoload/tar.vim index 4aab915661..74a5b38f78 100644 --- a/runtime/autoload/tar.vim +++ b/runtime/autoload/tar.vim @@ -14,6 +14,10 @@ " 2025 Mar 02 by Vim Project: escape the filename before using :read " 2025 Mar 02 by Vim Project: determine the compression using readblob() " instead of shelling out to file(1) +" 2025 Apr 16 by Vim Project: decouple from netrw by adding s:WinPath() +" 2025 May 19 by Vim Project: restore working directory after read/write +" 2025 Jul 13 by Vim Project: warn with path traversal attacks +" 2025 Jul 16 by Vim Project: update minimum vim version " " Contains many ideas from Michael Toren's " @@ -32,9 +36,9 @@ if &cp || exists("g:loaded_tar") finish endif let g:loaded_tar= "v32b" -if v:version < 702 +if v:versionlong < 9011024 echohl WarningMsg - echo "***warning*** this version of tar needs vim 7.2" + echo "***warning*** this version of tar needs vim 9.1.1024" echohl Normal finish endif @@ -44,10 +48,10 @@ set cpo&vim " --------------------------------------------------------------------- " Default Settings: {{{1 if !exists("g:tar_browseoptions") - let g:tar_browseoptions= "Ptf" + let g:tar_browseoptions= "tf" endif if !exists("g:tar_readoptions") - let g:tar_readoptions= "pPxf" + let g:tar_readoptions= "pxf" endif if !exists("g:tar_cmd") let g:tar_cmd= "tar" @@ -56,6 +60,7 @@ if !exists("g:tar_writeoptions") let g:tar_writeoptions= "uf" endif if !exists("g:tar_delfile") + " Note: not supported on BSD let g:tar_delfile="--delete -f" endif if !exists("g:netrw_cygwin") @@ -104,10 +109,26 @@ if !exists("g:tar_shq") endif endif +let g:tar_secure=' -- ' +let g:tar_leading_pat='^\%([.]\{,2\}/\)\+' + " ---------------- " Functions: {{{1 " ---------------- +" --------------------------------------------------------------------- +" s:Msg: {{{2 +fun! s:Msg(func, severity, msg) + redraw! + if a:severity =~? 'error' + echohl Error + else + echohl WarningMsg + endif + echo $"***{a:severity}*** ({a:func}) {a:msg}" + echohl None +endfunc + " --------------------------------------------------------------------- " tar#Browse: {{{2 fun! tar#Browse(tarfile) @@ -116,16 +137,14 @@ fun! tar#Browse(tarfile) " sanity checks if !executable(g:tar_cmd) - redraw! - echohl Error | echo '***error*** (tar#Browse) "'.g:tar_cmd.'" not available on your system' + call s:Msg('tar#Browse', 'error', $"{g:tar_cmd} not available on your system") let &report= repkeep return endif if !filereadable(a:tarfile) if a:tarfile !~# '^\a\+://' " if it's an url, don't complain, let url-handlers such as vim do its thing - redraw! - echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None + call s:Msg('tar#Browse', 'error', $"File not readable<{a:tarfile}>") endif let &report= repkeep return @@ -146,7 +165,7 @@ fun! tar#Browse(tarfile) let lastline= line("$") call setline(lastline+1,'" tar.vim version '.g:loaded_tar) call setline(lastline+2,'" Browsing tarfile '.a:tarfile) - call setline(lastline+3,'" Select a file with cursor and press ENTER') + call setline(lastline+3,'" Select a file with cursor and press ENTER, "x" to extract a file') keepj $put ='' keepj sil! 0d keepj $ @@ -201,28 +220,18 @@ fun! tar#Browse(tarfile) exe "sil! r! ".g:tar_cmd." -".g:tar_browseoptions." ".shellescape(tarfile,1) endif if v:shell_error != 0 - redraw! - echohl WarningMsg | echo "***warning*** (tar#Browse) please check your g:tar_browseoptions<".g:tar_browseoptions.">" + call s:Msg('tar#Browse', 'warning', $"please check your g:tar_browseoptions '<{g:tar_browseoptions}>'") return endif - " - " The following should not be neccessary, since in case of errors the - " previous if statement should have caught the problem (because tar exited - " with a non-zero exit code). - " if line("$") == curlast || ( line("$") == (curlast + 1) && - " \ getline("$") =~# '\c\<\%(warning\|error\|inappropriate\|unrecognized\)\>' && - " \ getline("$") =~ '\s' ) - " redraw! - " echohl WarningMsg | echo "***warning*** (tar#Browse) ".a:tarfile." doesn't appear to be a tar file" | echohl None - " keepj sil! %d - " let eikeep= &ei - " set ei=BufReadCmd,FileReadCmd - " exe "r ".fnameescape(a:tarfile) - " let &ei= eikeep - " keepj sil! 1d - " call Dret("tar#Browse : a:tarfile<".a:tarfile.">") - " return - " endif + + " remove tar: Removing leading '/' from member names + " Note: the message could be localized + if search('^tar: ') > 0 || search(g:tar_leading_pat) > 0 + call append(3,'" Note: Path Traversal Attack detected!') + let b:leading_slash = 1 + " remove the message output + sil g/^tar: /d + endif " set up maps supported for tar setlocal noma nomod ro @@ -241,12 +250,7 @@ fun! s:TarBrowseSelect() let repkeep= &report set report=10 let fname= getline(".") - - if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-' - redraw! - echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"' - return - endif + let ls= get(b:, 'leading_slash', 0) " sanity check if fname =~ '^"' @@ -268,7 +272,8 @@ fun! s:TarBrowseSelect() wincmd _ endif let s:tblfile_{winnr()}= curfile - call tar#Read("tarfile:".tarfile.'::'.fname,1) + let b:leading_slash= ls + call tar#Read("tarfile:".tarfile.'::'.fname) filetype detect set nomod exe 'com! -buffer -nargs=? -complete=file TarDiff :call tar#Diff(,"'.fnameescape(fname).'")' @@ -278,26 +283,18 @@ endfun " --------------------------------------------------------------------- " tar#Read: {{{2 -fun! tar#Read(fname,mode) +fun! tar#Read(fname) let repkeep= &report set report=10 let tarfile = substitute(a:fname,'tarfile:\(.\{-}\)::.*$','\1','') let fname = substitute(a:fname,'tarfile:.\{-}::\(.*\)$','\1','') " be careful not to execute special crafted files - let escape_file = fname->fnameescape() - - " changing the directory to the temporary earlier to allow tar to extract the file with permissions intact - if !exists("*mkdir") - redraw! - echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None - let &report= repkeep - return - endif + let escape_file = fname->substitute(g:tar_leading_pat, '', '')->fnameescape() let curdir= getcwd() + let b:curdir= curdir let tmpdir= tempname() - let b:curdir= tmpdir - let b:tmpdir= curdir + let b:tmpdir= tmpdir if tmpdir =~ '\.' let tmpdir= substitute(tmpdir,'\.[^.]*$','','e') endif @@ -305,10 +302,9 @@ fun! tar#Read(fname,mode) " attempt to change to the indicated directory try - exe "cd ".fnameescape(tmpdir) + exe "lcd ".fnameescape(tmpdir) catch /^Vim\%((\a\+)\)\=:E344/ - redraw! - echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None + call s:Msg('tar#Read', 'error', "cannot lcd to temporary directory") let &report= repkeep return endtry @@ -318,7 +314,7 @@ fun! tar#Read(fname,mode) call s:Rmdir("_ZIPVIM_") endif call mkdir("_ZIPVIM_") - cd _ZIPVIM_ + lcd _ZIPVIM_ if has("win32unix") && executable("cygpath") " assuming cygwin @@ -331,7 +327,7 @@ fun! tar#Read(fname,mode) elseif fname =~ '\.bz3$' && executable("bz3cat") let decmp= "|bz3cat" let doro = 1 - elseif fname =~ '\.t\=gz$' && executable("zcat") + elseif fname =~ '\.t\=gz$' && executable("zcat") let decmp= "|zcat" let doro = 1 elseif fname =~ '\.lzma$' && executable("lzcat") @@ -354,68 +350,66 @@ fun! tar#Read(fname,mode) endif endif - if exists("g:tar_secure") - let tar_secure= " -- " - else - let tar_secure= " " - endif if tarfile =~# '\.bz2$' - exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif tarfile =~# '\.bz3$' - exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif tarfile =~# '\.\(gz\)$' - exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif tarfile =~# '\(\.tgz\|\.tbz\|\.txz\)' let filekind= s:Header(tarfile) if filekind =~? "bzip2" - exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! bzip2 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif filekind =~ "bzip3" - exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! bzip3 -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif filekind =~? "xz" - exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! xz -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif filekind =~? "zstd" - exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! zstd --decompress --stdout -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif filekind =~? "gzip" - exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! gzip -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file endif elseif tarfile =~# '\.lrp$' - exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! cat -- ".shellescape(tarfile,1)." | gzip -d -c - | ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif tarfile =~# '\.lzma$' - exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! lzma -d -c -- ".shellescape(tarfile,1)."| ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif tarfile =~# '\.\(xz\|txz\)$' - exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! xz --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file elseif tarfile =~# '\.\(lz4\|tlz4\)$' - exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".tar_secure.shellescape(fname,1).decmp + exe "sil! r! lz4 --decompress --stdout -- ".shellescape(tarfile,1)." | ".g:tar_cmd." -".g:tar_readoptions." - ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file else if tarfile =~ '^\s*-' " A file name starting with a dash is taken as an option. Prepend ./ to avoid that. let tarfile = substitute(tarfile, '-', './-', '') endif - exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".tar_secure.shellescape(fname,1).decmp + exe "silent r! ".g:tar_cmd." -".g:tar_readoptions.shellescape(tarfile,1)." ".g:tar_secure.shellescape(fname,1).decmp exe "read ".escape_file endif + if get(b:, 'leading_slash', 0) + sil g/^tar: /d + endif redraw! -if v:shell_error != 0 - cd .. + if v:shell_error != 0 + lcd .. call s:Rmdir("_ZIPVIM_") - exe "cd ".fnameescape(curdir) - echohl Error | echo "***error*** (tar#Read) sorry, unable to open or extract ".tarfile." with ".fname | echohl None + exe "lcd ".fnameescape(curdir) + call s:Msg('tar#Read', 'error', $"sorry, unable to open or extract {tarfile} with {fname}") endif if doro @@ -424,40 +418,54 @@ if v:shell_error != 0 endif let b:tarfile= a:fname - exe "file tarfile::".fnameescape(fname) " cleanup keepj sil! 0d set nomod let &report= repkeep + exe "lcd ".fnameescape(curdir) + silent exe "file tarfile::". fname->fnameescape() endfun " --------------------------------------------------------------------- " tar#Write: {{{2 fun! tar#Write(fname) + let pwdkeep= getcwd() let repkeep= &report set report=10 - " temporary buffer variable workaround because too fucking tired. but it works now let curdir= b:curdir let tmpdir= b:tmpdir - if !exists("g:tar_secure") && a:fname =~ '^\s*-\|\s\+-' - redraw! - echohl WarningMsg | echo '***warning*** (tar#Write) rejecting tarfile member<'.a:fname.'> because of embedded "-"' - return - endif - " sanity checks if !executable(g:tar_cmd) redraw! let &report= repkeep return endif - let tarfile = substitute(b:tarfile,'tarfile:\(.\{-}\)::.*$','\1','') let fname = substitute(b:tarfile,'tarfile:.\{-}::\(.*\)$','\1','') + if get(b:, 'leading_slash', 0) + call s:Msg('tar#Write', 'error', $"sorry, not attempting to update {tarfile} with {fname}") + let &report= repkeep + return + endif + + if !isdirectory(fnameescape(tmpdir)) + call mkdir(fnameescape(tmpdir), 'p') + endif + exe $"lcd {fnameescape(tmpdir)}" + if isdirectory("_ZIPVIM_") + call s:Rmdir("_ZIPVIM_") + endif + call mkdir("_ZIPVIM_") + lcd _ZIPVIM_ + let dir = fnamemodify(fname, ':p:h') + if dir !~# '_ZIPVIM_$' + call mkdir(dir) + endif + " handle compressed archives if tarfile =~# '\.bz2' call system("bzip2 -d -- ".shellescape(tarfile,0)) @@ -496,8 +504,7 @@ fun! tar#Write(fname) " Note: no support for name.tar.tbz/.txz/.tgz/.tlz4/.tzst if v:shell_error != 0 - redraw! - echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None + call s:Msg('tar#Write', 'error', $"sorry, unable to update {tarfile} with {fname}") else if fname =~ '/' @@ -515,28 +522,22 @@ fun! tar#Write(fname) let tarfile = substitute(tarfile, '-', './-', '') endif - if exists("g:tar_secure") - let tar_secure= " -- " - else - let tar_secure= " " - endif - exe "w! ".fnameescape(fname) + " don't overwrite a file forcefully + exe "w ".fnameescape(fname) if has("win32unix") && executable("cygpath") let tarfile = substitute(system("cygpath ".shellescape(tarfile,0)),'\n','','e') endif " delete old file from tarfile - call system(g:tar_cmd." ".g:tar_delfile." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0)) + " Note: BSD tar does not support --delete flag + call system(g:tar_cmd." ".g:tar_delfile." ".shellescape(tarfile,0).g:tar_secure.shellescape(fname,0)) if v:shell_error != 0 - redraw! - echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None + call s:Msg('tar#Write', 'error', $"sorry, unable to update {fnameescape(tarfile)} with {fnameescape(fname)} --delete not supported?") else - " update tarfile with new file - call system(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).tar_secure.shellescape(fname,0)) + call system(g:tar_cmd." -".g:tar_writeoptions." ".shellescape(tarfile,0).g:tar_secure.shellescape(fname,0)) if v:shell_error != 0 - redraw! - echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".fnameescape(tarfile)." with ".fnameescape(fname) | echohl None + call s:Msg('tar#Write', 'error', $"sorry, unable to update {fnameescape(tarfile)} with {fnameescape(fname)}") elseif exists("compress") call system(compress) if exists("tgz") @@ -562,9 +563,9 @@ fun! tar#Write(fname) endif " cleanup and restore current directory - cd .. + lcd .. call s:Rmdir("_ZIPVIM_") - exe "cd ".fnameescape(curdir) + exe "lcd ".fnameescape(pwdkeep) setlocal nomod let &report= repkeep @@ -577,6 +578,7 @@ fun! tar#Diff(userfname,fname) if a:userfname != "" let fname= a:userfname endif + exe "lcd ".fnameescape(b:tmpdir). '/_ZIPVIM_' if filereadable(fname) " sets current file (from tarball) for diff'ing " splits window vertically @@ -600,12 +602,6 @@ fun! tar#Extract() set report=10 let fname= getline(".") - if !exists("g:tar_secure") && fname =~ '^\s*-\|\s\+-' - redraw! - echohl WarningMsg | echo '***warning*** (tar#BrowseSelect) rejecting tarfile member<'.fname.'> because of embedded "-"' - return - endif - " sanity check if fname =~ '^"' let &report= repkeep @@ -615,20 +611,20 @@ fun! tar#Extract() let tarball = expand("%") let tarbase = substitute(tarball,'\..*$','','') - let extractcmd= netrw#WinPath(g:tar_extractcmd) + let extractcmd= s:WinPath(g:tar_extractcmd) if filereadable(tarbase.".tar") call system(extractcmd." ".shellescape(tarbase).".tar ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar {fname}: failed!") else - echo "***note*** successfully extracted ".fname + echo "***note*** successfully extracted ". fname endif elseif filereadable(tarbase.".tgz") let extractcmd= substitute(extractcmd,"-","-z","") call system(extractcmd." ".shellescape(tarbase).".tgz ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tgz ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tgz {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -637,7 +633,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","-z","") call system(extractcmd." ".shellescape(tarbase).".tar.gz ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.gz ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.gz {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -646,7 +642,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","-j","") call system(extractcmd." ".shellescape(tarbase).".tbz ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tbz ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tbz {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -655,7 +651,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","-j","") call system(extractcmd." ".shellescape(tarbase).".tar.bz2 ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tar.bz2 ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.bz2 {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -664,7 +660,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","-j","") call system(extractcmd." ".shellescape(tarbase).".tar.bz3 ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd."j ".tarbase.".tar.bz3 ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.bz3 {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -673,7 +669,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","-J","") call system(extractcmd." ".shellescape(tarbase).".txz ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".txz ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.txz {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -682,7 +678,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","-J","") call system(extractcmd." ".shellescape(tarbase).".tar.xz ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.xz ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.xz {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -691,7 +687,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","--zstd","") call system(extractcmd." ".shellescape(tarbase).".tzst ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tzst ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tzst {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -700,7 +696,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","--zstd","") call system(extractcmd." ".shellescape(tarbase).".tar.zst ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.zst ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.zst {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -709,7 +705,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","-I lz4","") call system(extractcmd." ".shellescape(tarbase).".tlz4 ".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tlz4 ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tlz4 {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -718,7 +714,7 @@ fun! tar#Extract() let extractcmd= substitute(extractcmd,"-","-I lz4","") call system(extractcmd." ".shellescape(tarbase).".tar.lz4".shellescape(fname)) if v:shell_error != 0 - echohl Error | echo "***error*** ".extractcmd." ".tarbase.".tar.lz4 ".fname.": failed!" | echohl NONE + call s:Msg('tar#Extract', 'error', $"{extractcmd} {tarbase}.tar.lz4 {fname}: failed!") else echo "***note*** successfully extracted ".fname endif @@ -731,15 +727,7 @@ endfun " --------------------------------------------------------------------- " s:Rmdir: {{{2 fun! s:Rmdir(fname) - if has("unix") - call system("/bin/rm -rf -- ".shellescape(a:fname,0)) - elseif has("win32") || has("win95") || has("win64") || has("win16") - if &shell =~? "sh$" - call system("/bin/rm -rf -- ".shellescape(a:fname,0)) - else - call system("del /S ".shellescape(a:fname,0)) - endif - endif + call delete(a:fname, 'rf') endfun " s:FileHeader: {{{2 @@ -765,6 +753,25 @@ fun! s:Header(fname) return "unknown" endfun +" --------------------------------------------------------------------- +" s:WinPath: {{{2 +fun! s:WinPath(path) + if (!g:netrw_cygwin || &shell !~ '\%(\\|\\)\%(\.exe\)\=$') && has("win32") + " remove cygdrive prefix, if present + let path = substitute(a:path, '/cygdrive/\(.\)', '\1:', '') + " remove trailing slash (Win95) + let path = substitute(path, '\(\\\|/\)$', '', 'g') + " remove escaped spaces + let path = substitute(path, '\ ', ' ', 'g') + " convert slashes to backslashes + let path = substitute(path, '/', '\', 'g') + else + let path = a:path + endif + + return path +endfun + " --------------------------------------------------------------------- " tar#Vimuntar: installs a tarball in the user's .vim / vimfiles directory {{{2 fun! tar#Vimuntar(...) @@ -786,8 +793,8 @@ fun! tar#Vimuntar(...) if simplify(curdir) != simplify(vimhome) " copy (possibly compressed) tarball to .vim/vimfiles - call system(netrw#WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome)) - exe "cd ".fnameescape(vimhome) + call system(s:WinPath(g:tar_copycmd)." ".shellescape(tartail)." ".shellescape(vimhome)) + exe "lcd ".fnameescape(vimhome) endif " if necessary, decompress the tarball; then, extract it @@ -801,14 +808,14 @@ fun! tar#Vimuntar(...) if simplify(curdir) != simplify(tarhome) " remove decompressed tarball, restore directory call delete(tartail.".tar") - exe "cd ".fnameescape(curdir) + exe "lcd ".fnameescape(curdir) endif return endif else call vimball#Decompress(tartail,0) endif - let extractcmd= netrw#WinPath(g:tar_extractcmd) + let extractcmd= s:WinPath(g:tar_extractcmd) call system(extractcmd." ".shellescape(tarbase.".tar")) " set up help @@ -819,7 +826,7 @@ fun! tar#Vimuntar(...) if simplify(tarhome) != simplify(vimhome) " remove decompressed tarball, restore directory call delete(vimhome."/".tarbase.".tar") - exe "cd ".fnameescape(curdir) + exe "lcd ".fnameescape(curdir) endif endfun diff --git a/runtime/autoload/tutor.vim b/runtime/autoload/tutor.vim index 3265fdde36..b21e20f814 100644 --- a/runtime/autoload/tutor.vim +++ b/runtime/autoload/tutor.vim @@ -157,12 +157,14 @@ function! s:Sort(a, b) return retval endfunction -function! s:GlobTutorials(name) +" returns a list of all tutor files matching the given name +function! tutor#GlobTutorials(name, locale) + let locale = a:locale " search for tutorials: " 1. non-localized let l:tutors = s:GlobPath(&rtp, 'tutor/'.a:name.'.tutor') " 2. localized for current locale - let l:locale_tutors = s:GlobPath(&rtp, 'tutor/'.s:Locale()[0].'/'.a:name.'.tutor') + let l:locale_tutors = s:GlobPath(&rtp, 'tutor/'.locale.'/'.a:name.'.tutor') " 3. fallback to 'en' if len(l:locale_tutors) == 0 let l:locale_tutors = s:GlobPath(&rtp, 'tutor/en/'.a:name.'.tutor') @@ -187,7 +189,7 @@ function! tutor#TutorCmd(tutor_name) let l:tutor_name = fnamemodify(l:tutor_name, ':r') endif - let l:tutors = s:GlobTutorials(l:tutor_name) + let l:tutors = tutor#GlobTutorials(l:tutor_name, s:Locale()[0]) if len(l:tutors) == 0 echom "No tutorial with that name found" @@ -210,10 +212,32 @@ function! tutor#TutorCmd(tutor_name) call tutor#SetupVim() exe "edit ".l:to_open + call tutor#EnableInteractive(v:true) endfunction function! tutor#TutorCmdComplete(lead,line,pos) - let l:tutors = s:GlobTutorials('*') + let l:tutors = tutor#GlobTutorials('*', s:Locale()[0]) let l:names = uniq(sort(map(l:tutors, 'fnamemodify(v:val, ":t:r")'), 's:Sort')) return join(l:names, "\n") endfunction + +" Enables/disables interactive mode. +function! tutor#EnableInteractive(enable) + let enable = a:enable + if enable + setlocal buftype=nofile + setlocal concealcursor+=inv + setlocal conceallevel=2 + call tutor#ApplyMarks() + augroup tutor_interactive + autocmd! TextChanged,TextChangedI call tutor#ApplyMarksOnChanged() + augroup END + else + setlocal buftype< + setlocal concealcursor< + setlocal conceallevel< + if exists('#tutor_interactive') + autocmd! tutor_interactive * + endif + endif +endfunction diff --git a/runtime/autoload/zip.vim b/runtime/autoload/zip.vim index dae4ddeb99..c46ec44708 100644 --- a/runtime/autoload/zip.vim +++ b/runtime/autoload/zip.vim @@ -15,6 +15,7 @@ " 2024 Aug 18 by Vim Project: correctly handle special globbing chars " 2024 Aug 21 by Vim Project: simplify condition to detect MS-Windows " 2025 Mar 11 by Vim Project: handle filenames with leading '-' correctly +" 2025 Jul 12 by Vim Project: drop ../ on write to prevent path traversal attacks " License: Vim License (see vim's :help license) " Copyright: Copyright (C) 2005-2019 Charles E. Campbell {{{1 " Permission is hereby granted to use and distribute this code, @@ -236,59 +237,62 @@ endfun " zip#Write: {{{2 fun! zip#Write(fname) let dict = s:SetSaneOpts() + let need_rename = 0 defer s:RestoreOpts(dict) " sanity checks if !executable(substitute(g:zip_zipcmd,'\s\+.*$','','')) - call s:Mess('Error', "***error*** (zip#Write) sorry, your system doesn't appear to have the ".g:zip_zipcmd." program") - return - endif - if !exists("*mkdir") - call s:Mess('Error', "***error*** (zip#Write) sorry, mkdir() doesn't work on your system") - return + call s:Mess('Error', "***error*** (zip#Write) sorry, your system doesn't appear to have the ".g:zip_zipcmd." program") + return endif let curdir= getcwd() let tmpdir= tempname() if tmpdir =~ '\.' - let tmpdir= substitute(tmpdir,'\.[^.]*$','','e') + let tmpdir= substitute(tmpdir,'\.[^.]*$','','e') endif call mkdir(tmpdir,"p") " attempt to change to the indicated directory if s:ChgDir(tmpdir,s:ERROR,"(zip#Write) cannot cd to temporary directory") - return + return endif " place temporary files under .../_ZIPVIM_/ if isdirectory("_ZIPVIM_") - call delete("_ZIPVIM_", "rf") + call delete("_ZIPVIM_", "rf") endif call mkdir("_ZIPVIM_") cd _ZIPVIM_ if has("unix") - let zipfile = substitute(a:fname,'zipfile://\(.\{-}\)::[^\\].*$','\1','') - let fname = substitute(a:fname,'zipfile://.\{-}::\([^\\].*\)$','\1','') + let zipfile = substitute(a:fname,'zipfile://\(.\{-}\)::[^\\].*$','\1','') + let fname = substitute(a:fname,'zipfile://.\{-}::\([^\\].*\)$','\1','') else - let zipfile = substitute(a:fname,'^.\{-}zipfile://\(.\{-}\)::[^\\].*$','\1','') - let fname = substitute(a:fname,'^.\{-}zipfile://.\{-}::\([^\\].*\)$','\1','') + let zipfile = substitute(a:fname,'^.\{-}zipfile://\(.\{-}\)::[^\\].*$','\1','') + let fname = substitute(a:fname,'^.\{-}zipfile://.\{-}::\([^\\].*\)$','\1','') + endif + if fname =~ '^[.]\{1,2}/' + call system(g:zip_zipcmd." -d ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0)) + let fname = fname->substitute('^\([.]\{1,2}/\)\+', '', 'g') + let need_rename = 1 endif if fname =~ '/' - let dirpath = substitute(fname,'/[^/]\+$','','e') - if has("win32unix") && executable("cygpath") + let dirpath = substitute(fname,'/[^/]\+$','','e') + if has("win32unix") && executable("cygpath") let dirpath = substitute(system("cygpath ".s:Escape(dirpath,0)),'\n','','e') - endif - call mkdir(dirpath,"p") + endif + call mkdir(dirpath,"p") endif if zipfile !~ '/' - let zipfile= curdir.'/'.zipfile + let zipfile= curdir.'/'.zipfile endif - exe "w! ".fnameescape(fname) + " don't overwrite files forcefully + exe "w ".fnameescape(fname) if has("win32unix") && executable("cygpath") - let zipfile = substitute(system("cygpath ".s:Escape(zipfile,0)),'\n','','e') + let zipfile = substitute(system("cygpath ".s:Escape(zipfile,0)),'\n','','e') endif if (has("win32") || has("win95") || has("win64") || has("win16")) && &shell !~? 'sh$' @@ -297,21 +301,24 @@ fun! zip#Write(fname) call system(g:zip_zipcmd." -u ".s:Escape(fnamemodify(zipfile,":p"),0)." ".s:Escape(fname,0)) if v:shell_error != 0 - call s:Mess('Error', "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname) + call s:Mess('Error', "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname) elseif s:zipfile_{winnr()} =~ '^\a\+://' - " support writing zipfiles across a network - let netzipfile= s:zipfile_{winnr()} - 1split|enew - let binkeep= &binary - let eikeep = &ei - set binary ei=all - exe "noswapfile e! ".fnameescape(zipfile) - call netrw#NetWrite(netzipfile) - let &ei = eikeep - let &binary = binkeep - q! - unlet s:zipfile_{winnr()} + " support writing zipfiles across a network + let netzipfile= s:zipfile_{winnr()} + 1split|enew + let binkeep= &binary + let eikeep = &ei + set binary ei=all + exe "noswapfile e! ".fnameescape(zipfile) + call netrw#NetWrite(netzipfile) + let &ei = eikeep + let &binary = binkeep + q! + unlet s:zipfile_{winnr()} + elseif need_rename + exe $"sil keepalt file {fnameescape($"zipfile://{zipfile}::{fname}")}" + call s:Mess('Warning', "***error*** (zip#Browse) Path Traversal Attack detected, dropping relative path") endif " cleanup and restore current directory @@ -320,7 +327,6 @@ fun! zip#Write(fname) call s:ChgDir(curdir,s:WARNING,"(zip#Write) unable to return to ".curdir."!") call delete(tmpdir, "rf") setlocal nomod - endfun " --------------------------------------------------------------------- @@ -333,15 +339,18 @@ fun! zip#Extract() " sanity check if fname =~ '^"' - return + return endif if fname =~ '/$' - call s:Mess('Error', "***error*** (zip#Extract) Please specify a file, not a directory") - return + call s:Mess('Error', "***error*** (zip#Extract) Please specify a file, not a directory") + return + elseif fname =~ '^[.]\?[.]/' + call s:Mess('Error', "***error*** (zip#Browse) Path Traversal Attack detected, not extracting!") + return endif if filereadable(fname) - call s:Mess('Error', "***error*** (zip#Extract) <" .. fname .."> already exists in directory, not overwriting!") - return + call s:Mess('Error', "***error*** (zip#Extract) <" .. fname .."> already exists in directory, not overwriting!") + return endif let target = fname->substitute('\[', '[[]', 'g') " unzip 6.0 does not support -- to denote end-of-arguments @@ -363,13 +372,12 @@ fun! zip#Extract() " extract the file mentioned under the cursor call system($"{g:zip_extractcmd} -o {shellescape(b:zipfile)} {target}") if v:shell_error != 0 - call s:Mess('Error', "***error*** ".g:zip_extractcmd." ".b:zipfile." ".fname.": failed!") + call s:Mess('Error', "***error*** ".g:zip_extractcmd." ".b:zipfile." ".fname.": failed!") elseif !filereadable(fname) - call s:Mess('Error', "***error*** attempted to extract ".fname." but it doesn't appear to be present!") + call s:Mess('Error', "***error*** attempted to extract ".fname." but it doesn't appear to be present!") else - echomsg "***note*** successfully extracted ".fname + echomsg "***note*** successfully extracted ".fname endif - endfun " --------------------------------------------------------------------- diff --git a/runtime/compiler/gleam_build.vim b/runtime/compiler/gleam_build.vim new file mode 100644 index 0000000000..c2b1679b3c --- /dev/null +++ b/runtime/compiler/gleam_build.vim @@ -0,0 +1,25 @@ +" Vim compiler file +" Language: Gleam +" Maintainer: Kirill Morozov +" Based On: https://github.com/gleam-lang/gleam.vim +" Last Change: 2025 Apr 21 + +if exists('current_compiler') + finish +endif +let current_compiler = "gleam_build" + +CompilerSet makeprg=gleam\ build + +" Example error message: +" +" error: Unknown variable +" ┌─ /home/michael/root/projects/tutorials/gleam/try/code/src/main.gleam:19:18 +" │ +" 19 │ Ok(tuple(name, spot)) +" │ ^^^^ did you mean `sport`? +" +" The name `spot` is not in scope here. +CompilerSet errorformat=%Eerror:\ %m,%Wwarning:\ %m,%C\ %#┌─%#\ %f:%l:%c\ %#-%# + +" vim: sw=2 sts=2 et diff --git a/runtime/compiler/pandoc.vim b/runtime/compiler/pandoc.vim index 5d90a518c9..40d2d02633 100644 --- a/runtime/compiler/pandoc.vim +++ b/runtime/compiler/pandoc.vim @@ -2,6 +2,7 @@ " Compiler: Pandoc " Maintainer: Konfekt " Last Change: 2024 Nov 19 +" 2025 May 15 Update the title regex for CompilerSet #17321 " " Expects output file extension, say `:make html` or `:make pdf`. " Passes additional arguments to pandoc, say `:make html --self-contained`. @@ -51,7 +52,7 @@ endfunction execute 'CompilerSet makeprg=pandoc'..escape( \ ' --standalone'.. - \ (s:PandocFiletype(&filetype) ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s+\S+', 'cnw') > 0)) ? + \ (s:PandocFiletype(&filetype) ==# 'markdown' && (getline(1) =~# '^%\s\+\S\+' || (search('^title:\s\+\S\+', 'cnw') > 0)) ? \ '' : ' --metadata title=%:t:r:S').. \ ' '..s:PandocLang().. \ ' --from='..s:PandocFiletype(&filetype).. diff --git a/runtime/compiler/phpstan.vim b/runtime/compiler/phpstan.vim new file mode 100644 index 0000000000..7d1592be8f --- /dev/null +++ b/runtime/compiler/phpstan.vim @@ -0,0 +1,12 @@ +" Vim compiler file +" Compiler: PHPStan +" Maintainer: Dietrich Moerman +" Last Change: 2025 Jul 17 + +if exists("current_compiler") + finish +endif +let current_compiler = "phpstan" + +CompilerSet makeprg=composer\ exec\ --\ phpstan\ analyse\ -v\ --no-progress\ --error-format=raw +CompilerSet errorformat=%f:%l:%m,%-G%.%# diff --git a/runtime/defaults.vim b/runtime/defaults.vim index 38b03da11d..d51eeee030 100644 --- a/runtime/defaults.vim +++ b/runtime/defaults.vim @@ -1,7 +1,7 @@ " The default vimrc file. " " Maintainer: The Vim Project -" Last Change: 2024 Dec 01 +" Last Change: 2025 Jul 13 " Former Maintainer: Bram Moolenaar " " This is loaded if no vimrc file was found. @@ -34,7 +34,6 @@ silent! while 0 silent! endwhile set ruler " show the cursor position all the time -set showcmd " display incomplete commands set ttimeout " time out for key codes set ttimeoutlen=100 " wait up to 100ms after Esc for special key @@ -107,6 +106,7 @@ if 1 \ let line = line("'\"") \ | if line >= 1 && line <= line("$") && &filetype !~# 'commit' \ && index(['xxd', 'gitrebase', 'tutor'], &filetype) == -1 + \ && !&diff \ | execute "normal! g`\"" \ | endif diff --git a/runtime/doc/Make_all.mak b/runtime/doc/Make_all.mak index 8f86099fb3..b146ead5e9 100644 --- a/runtime/doc/Make_all.mak +++ b/runtime/doc/Make_all.mak @@ -154,6 +154,7 @@ DOCS = \ vim9class.txt \ visual.txt \ vietnamese.txt \ + wayland.txt \ windows.txt \ workshop.txt @@ -311,6 +312,7 @@ HTMLS = \ vim9.html \ vim9class.html \ visual.html \ + wayland.html \ windows.html \ workshop.html diff --git a/runtime/doc/Makefile b/runtime/doc/Makefile index 41fdb17f5f..01b2c3e83f 100644 --- a/runtime/doc/Makefile +++ b/runtime/doc/Makefile @@ -143,7 +143,7 @@ os_win32.txt: pi_netrw.txt: ../pack/dist/opt/netrw/doc/netrw.txt cp ../pack/dist/opt/netrw/doc/netrw.txt $@.tmp - sed -e '1s/\(.*\)/\1 *pi_netrw.txt*/' $@.tmp > $@ && \ + sed -e '1s/$$/ *pi_netrw.txt*/' $@.tmp > $@ && \ rm -f $@.tmp vietnamese.txt: diff --git a/runtime/doc/autocmd.txt b/runtime/doc/autocmd.txt index 60f5f2db69..772a5a785c 100644 --- a/runtime/doc/autocmd.txt +++ b/runtime/doc/autocmd.txt @@ -1,4 +1,4 @@ -*autocmd.txt* For Vim version 9.1. Last change: 2025 Mar 12 +*autocmd.txt* For Vim version 9.1. Last change: 2025 Jun 19 VIM REFERENCE MANUAL by Bram Moolenaar @@ -130,6 +130,10 @@ exception is that "" is expanded when the autocmd is defined. Example: :au BufNewFile,BufRead *.html so :h/html.vim Here Vim expands to the name of the file containing this line. +However, works differently in a function, in which case it's better to +use `:execute` with +

An H2 header

+



+
+ +

Paragraph #1. +

+ +

Paragraph #2. + +

+ + +

Paragraph #1. +

    +
  • Item a.
  • Item b.
  • +
  • Item c. +
+

Paragraph #2. +

+
+ +
+
A quick brown fox jumps over the lazy dog +
Woof! +
+
A quick brown fox jumps over the lazy dog +
Woof! +
+
+ +
Thread #1 +
Thread #2 +
+
+ +

+ + +

+ + + ++ + +
Some Caption
Header #1Header #2Header #3 +
Column #1Column #2Column #3 +
Column #1Column #2Column #3 +
Column #1Column #2Column #3 +
Column #1Column #2Column #3 +
+ +
+
	
+<div class="block">
+<blockquote><pre><code>
+</code></pre></blockquote></div>
+
+ +

Paragraph #3.

Paragraph #4.

Paragraph #5. + +

Paragraph #6.

Paragraph #7.

Paragraph #8.

Paragraph #9.

+ +

Paragraph #10. +

+ +

Paragraph #11.

Paragraph #12.

Paragraph #13.

Paragraph #14.

+ +

Paragraph #15. +

Paragraph #16. + + diff --git a/runtime/syntax/testdir/input/html_fold_syntax.html b/runtime/syntax/testdir/input/html_fold_syntax.html new file mode 100644 index 0000000000..73579aa9a9 --- /dev/null +++ b/runtime/syntax/testdir/input/html_fold_syntax.html @@ -0,0 +1,105 @@ + + + + + +A folding syntax test + + + +



+

An H2 header

+



+
+ +

Paragraph #1. +

+ +

Paragraph #2.

+ +
+ + +

Paragraph #1.

+
    +
  • Item a.
  • Item b.
  • +
  • Item c.
  • +
+

Paragraph #2. +

+
+ +
+
A quick brown fox jumps over the lazy dog
+
Woof! +
+
A quick brown fox jumps over the lazy dog
+
Woof!
+
+
+ +
Thread #1 +
Thread #2 +
+
+ +

+ + +

+ + + + + + + + + + + +
Some Caption
Header #1Header #2Header #3
Column #1Column #2Column #3
Column #1Column #2Column #3
Column #1Column #2Column #3
Column #1Column #2Column #3
+ +
+
	
+<div class="block">
+<blockquote><pre><code>
+</code></pre></blockquote></div>
+
+ +

Paragraph #3.

Paragraph #4.

Paragraph #5.

+ +

Paragraph #6.

Paragraph #7.

Paragraph #8.

Paragraph #9.

+ +

Paragraph #10. +

+ +

Paragraph #11.

Paragraph #12.

Paragraph #13.

Paragraph #14.

+ +

Paragraph #15. +

Paragraph #16. + + diff --git a/runtime/syntax/testdir/input/java_comments_html.java b/runtime/syntax/testdir/input/java_comments_html.java index eeffef5b79..15d4a2fad9 100644 --- a/runtime/syntax/testdir/input/java_comments_html.java +++ b/runtime/syntax/testdir/input/java_comments_html.java @@ -1,8 +1,8 @@ // VIM_TEST_SETUP unlet! g:java_no_tab_space_error g:java_ignore_javadoc // VIM_TEST_SETUP unlet! g:java_no_trail_space_error -// VIM_TEST_SETUP let [g:java_space_errors,g:java_comment_strings]=[1,1] -// VIM_TEST_SETUP let g:java_ignore_markdown = 1 - +// VIM_TEST_SETUP unlet! g:java_consent_to_html_syntax_folding +// VIM_TEST_SETUP let[g:java_space_errors,g:java_comment_strings]=[1,1] +// VIM_TEST_SETUP let[g:java_ignore_markdown,g:html_syntax_folding]=[1,1] diff --git a/runtime/syntax/testdir/input/java_comments_markdown.java b/runtime/syntax/testdir/input/java_comments_markdown.java index fa369719d8..a34af8f399 100644 --- a/runtime/syntax/testdir/input/java_comments_markdown.java +++ b/runtime/syntax/testdir/input/java_comments_markdown.java @@ -2,8 +2,8 @@ // VIM_TEST_SETUP unlet! g:java_no_trail_space_error // VIM_TEST_SETUP let[g:java_space_errors,g:java_comment_strings]=[1,1] // VIM_TEST_SETUP let[g:java_ignore_html,g:markdown_syntax_conceal]=[1,1] - - +// VIM_TEST_SETUP let g:html_syntax_folding = 1 +// VIM_TEST_SETUP let g:java_consent_to_html_syntax_folding = 1 diff --git a/runtime/syntax/testdir/input/java_generics.java b/runtime/syntax/testdir/input/java_generics.java index c9b001a406..35f978e0ae 100644 --- a/runtime/syntax/testdir/input/java_generics.java +++ b/runtime/syntax/testdir/input/java_generics.java @@ -1,7 +1,12 @@ // VIM_TEST_SETUP let g:java_highlight_functions = 'style' // VIM_TEST_SETUP let g:java_highlight_generics = 1 +// VIM_TEST_SETUP let g:java_highlight_java_lang = 1 + + // VIM_TEST_SETUP hi link javaGenericsC1 Todo // VIM_TEST_SETUP hi link javaGenericsC2 Error +// VIM_TEST_SETUP hi link javaWildcardBound Error + import java.math.BigInteger; import java.util.function.Consumer; @@ -109,6 +114,23 @@ static long toDecimal(Num x) }, x.radix()); } + static Class eitherComparableOrIterable(Object o) + { + final boolean comparable; + return ((comparable = o instanceof Comparable) ^ + o instanceof Iterable) + ? (comparable) + ? Comparable.class + : Iterable.class + : java.lang.Class.class; + } + + , + B, U extends java.util.function.Supplier> U convert(T o) + { + throw new UnsupportedOperationException("TODO"); + } + @java.lang.annotation.Target( java.lang.annotation.ElementType.TYPE_USE) @interface Taggable diff --git a/runtime/syntax/testdir/input/java_generics_signature.java b/runtime/syntax/testdir/input/java_generics_signature.java index 505e70e06d..37617143a4 100644 --- a/runtime/syntax/testdir/input/java_generics_signature.java +++ b/runtime/syntax/testdir/input/java_generics_signature.java @@ -1,8 +1,13 @@ // VIM_TEST_SETUP let g:java_highlight_functions = 'style' // VIM_TEST_SETUP let g:java_highlight_signature = 1 // VIM_TEST_SETUP let g:java_highlight_generics = 1 +// VIM_TEST_SETUP let g:java_highlight_java_lang = 1 + // VIM_TEST_SETUP hi link javaGenericsC1 Todo // VIM_TEST_SETUP hi link javaGenericsC2 Error +// VIM_TEST_SETUP hi link javaWildcardBound Error + + import java.math.BigInteger; import java.util.function.Consumer; import java.util.function.Function; @@ -109,6 +114,23 @@ static long toDecimal(Num x) }, x.radix()); } + static Class eitherComparableOrIterable(Object o) + { + final boolean comparable; + return ((comparable = o instanceof Comparable) ^ + o instanceof Iterable) + ? (comparable) + ? Comparable.class + : Iterable.class + : java.lang.Class.class; + } + + , + B, U extends java.util.function.Supplier> U convert(T o) + { + throw new UnsupportedOperationException("TODO"); + } + @java.lang.annotation.Target( java.lang.annotation.ElementType.TYPE_USE) @interface Taggable diff --git a/runtime/syntax/testdir/input/java_method_references.java b/runtime/syntax/testdir/input/java_method_references.java index d9cdf42248..640ab1edb0 100644 --- a/runtime/syntax/testdir/input/java_method_references.java +++ b/runtime/syntax/testdir/input/java_method_references.java @@ -183,4 +183,10 @@ static Function stringer() return T::toString; /* "e" */ } } + + static { + ((Supplier>)((Supplier)()->new + C2().new C21(new + C1< Object >((C1)null)))::getClass).get(); + } } diff --git a/runtime/syntax/testdir/input/java_method_references_signature.java b/runtime/syntax/testdir/input/java_method_references_signature.java index a154b12c9a..61e4c0da3a 100644 --- a/runtime/syntax/testdir/input/java_method_references_signature.java +++ b/runtime/syntax/testdir/input/java_method_references_signature.java @@ -183,4 +183,10 @@ static Function stringer() return T::toString; /* "e" */ } } + + static { + ((Supplier>)((Supplier)()->new + C2().new C21(new + C1< Object >((C1)null)))::getClass).get(); + } } diff --git a/runtime/syntax/testdir/input/java_methods_indent2.java b/runtime/syntax/testdir/input/java_methods_indent2.java index 3754cc4d5e..5ab06635f8 100644 --- a/runtime/syntax/testdir/input/java_methods_indent2.java +++ b/runtime/syntax/testdir/input/java_methods_indent2.java @@ -1,6 +1,6 @@ // VIM_TEST_SETUP let g:java_highlight_functions = 'indent2' +// VIM_TEST_SETUP let g:java_highlight_generics = 1 // VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8 - import java.lang.annotation.ElementType; import java.lang.annotation.Target; @@ -77,6 +77,14 @@ private > Indent2MethodsTests(T t) { } public static Class classLock() { return Indent2MethodsTests.class; } + public > java.util.List filter( + java.util.function.Predicate filter, + java.util.List cs) + { + return cs.stream().filter(filter) + .collect(java.util.stream.Collectors.toUnmodifiableList()); + } + @Override @SuppressWarnings("cast") public String toString() { return (String) "Indent2MethodsTests"; } } diff --git a/runtime/syntax/testdir/input/java_methods_indent4.java b/runtime/syntax/testdir/input/java_methods_indent4.java index 8fc05c04be..092ded79cc 100644 --- a/runtime/syntax/testdir/input/java_methods_indent4.java +++ b/runtime/syntax/testdir/input/java_methods_indent4.java @@ -1,6 +1,6 @@ // VIM_TEST_SETUP let g:java_highlight_functions = 'indent4' +// VIM_TEST_SETUP let g:java_highlight_generics = 1 // VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8 - import java.lang.annotation.ElementType; import java.lang.annotation.Target; @@ -77,6 +77,14 @@ private > Indent4MethodsTests(T t) { } public static Class classLock() { return Indent4MethodsTests.class; } + public > java.util.List filter( + java.util.function.Predicate filter, + java.util.List cs) + { + return cs.stream().filter(filter) + .collect(java.util.stream.Collectors.toUnmodifiableList()); + } + @Override @SuppressWarnings("cast") public String toString() { return (String) "Indent4MethodsTests"; } } diff --git a/runtime/syntax/testdir/input/java_methods_indent8.java b/runtime/syntax/testdir/input/java_methods_indent8.java index d27830c878..ec17f5116b 100644 --- a/runtime/syntax/testdir/input/java_methods_indent8.java +++ b/runtime/syntax/testdir/input/java_methods_indent8.java @@ -1,6 +1,6 @@ // VIM_TEST_SETUP let g:java_highlight_functions = 'indent8' +// VIM_TEST_SETUP let g:java_highlight_generics = 1 // VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8 - import java.lang.annotation.ElementType; import java.lang.annotation.Target; @@ -77,6 +77,14 @@ private > Indent8MethodsTests(T t) { } public static Class classLock() { return Indent8MethodsTests.class; } + public > java.util.List filter( + java.util.function.Predicate filter, + java.util.List cs) + { + return cs.stream().filter(filter) + .collect(java.util.stream.Collectors.toUnmodifiableList()); + } + @Override @SuppressWarnings("cast") public String toString() { return (String) "Indent8MethodsTests"; } } diff --git a/runtime/syntax/testdir/input/java_methods_style.java b/runtime/syntax/testdir/input/java_methods_style.java index e2e7d3877d..af0c7af624 100644 --- a/runtime/syntax/testdir/input/java_methods_style.java +++ b/runtime/syntax/testdir/input/java_methods_style.java @@ -1,6 +1,6 @@ // VIM_TEST_SETUP let g:java_highlight_functions = 'style' +// VIM_TEST_SETUP let g:java_highlight_generics = 1 // VIM_TEST_SETUP set encoding=utf-8 termencoding=utf-8 - import java.lang.annotation.ElementType; import java.lang.annotation.Target; @@ -77,6 +77,14 @@ private > StyleMethodsTests(T t) { } public static Class classLock() { return StyleMethodsTests.class; } + public > java.util.List filter( + java.util.function.Predicate filter, + java.util.List cs) + { + return cs.stream().filter(filter) + .collect(java.util.stream.Collectors.toUnmodifiableList()); + } + @Override @SuppressWarnings("cast") public String toString() { return (String) "StyleMethodsTests"; } } diff --git a/runtime/syntax/testdir/input/java_previews_455.java b/runtime/syntax/testdir/input/java_previews_455.java index b9c2070e1c..ed6430f573 100644 --- a/runtime/syntax/testdir/input/java_previews_455.java +++ b/runtime/syntax/testdir/input/java_previews_455.java @@ -1,4 +1,4 @@ -// VIM_TEST_SETUP let g:java_syntax_previews = [455] +// VIM_TEST_SETUP let g:java_syntax_previews = [455, 488] diff --git a/runtime/syntax/testdir/input/python2_strings.py b/runtime/syntax/testdir/input/python2_strings.py new file mode 100644 index 0000000000..a5625b7d65 --- /dev/null +++ b/runtime/syntax/testdir/input/python2_strings.py @@ -0,0 +1,82 @@ +# String literals +# https://docs.python.org/2/reference/lexical_analysis.html#string-literals + +# Strings: Source encoding, no Unicode escape sequences +test = 'String with escapes \' and \" and \t' +test = "String with escapes \040 and \xFF" +test = 'String with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = "String with escaped \\ backslash and ignored \ +newline" +test = '''String with quotes ' and " +and escapes \t and \040 and \xFF +and literal \u00A1 and \U00010605''' +test = """String with quotes ' and " +and escapes \t and \040 and \xFF +and literal \u00A1 and \U00010605""" + +# Raw strings +test = r'Raw string with literal \' and \" and \t' +test = R"Raw string with literal \040 and \xFF" +test = r'Raw string with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = R"Raw string with literal \\ backslashes and literal \ +newline" +test = r'''Raw string with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605''' +test = R"""Raw string with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605""" + +# B-strings: Prefix is allowed but ignored (https://peps.python.org/pep-3112) +test = b'String with escapes \' and \" and \t' +test = B"String with escapes \040 and \xFF" +test = b'String with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = B"String with escaped \\ backslash and ignored \ +newline" +test = b'''String with quotes ' and " +and escapes \t and \040 and \xFF +and literal \u00A1 and \U00010605''' +test = B"""String with quotes ' and " +and escapes \t and \040 and \xFF +and literal \u00A1 and \U00010605""" + +# Raw b-strings +test = br'Raw string with literal \' and \" and \t' +test = bR"Raw string with literal \040 and \xFF" +test = Br'Raw string with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = BR"Raw string with literal \\ backslashes and literal \ +newline" +test = br'''Raw string with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605''' +test = BR"""Raw string with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605""" + +# Unicode strings +test = u'String with escapes \' and \" and \t' +test = U"String with escapes \040 and \xFF" +test = u'String with escapes \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = U"String with escaped \\ backslash and ignored \ +newline" +test = u'''String with quotes ' and " +and escapes \t and \040 and \xFF +and escapes \u00A1 and \U00010605''' +test = U"""String with quotes ' and " +and escapes \t and \040 and \xFF +and escapes \u00A1 and \U00010605""" + +# Raw Unicode strings: Only Unicode escape sequences +test = ur'Raw Unicode string with literal \' and \" and \t' +test = uR"Raw Unicode string with literal \040 and \xFF" +test = Ur'Raw Unicode string with escapes \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = UR"Raw Unicode string with literal \\ backslashes and literal \ +newline" +test = ur'''Raw Unicode string with quotes ' and " +and literal \t and \040 and \xFF +and escapes \u00A1 and \U00010605''' +test = UR"""Raw Unicode string with quotes ' and " +and literal \t and \040 and \xFF +and escapes \u00A1 and \U00010605""" + +# vim: syntax=python2 diff --git a/runtime/syntax/testdir/input/python_strings_bytes.py b/runtime/syntax/testdir/input/python_strings_bytes.py new file mode 100644 index 0000000000..02eb1b00e7 --- /dev/null +++ b/runtime/syntax/testdir/input/python_strings_bytes.py @@ -0,0 +1,131 @@ +# String and Bytes literals +# https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals + +# Strings +test = 'String with escapes \' and \" and \t' +test = "String with escapes \040 and \xFF" +test = 'String with escapes \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = "String with escaped \\ backslash and ignored \ +newline" +test = '''String with quotes ' and " +and escapes \t and \040 and \xFF +and escapes \u00A1 and \U00010605''' +test = """String with quotes ' and " +and escapes \t and \040 and \xFF +and escapes \u00A1 and \U00010605""" + +# Raw strings +test = r'Raw string with literal \' and \" and \t' +test = R"Raw string with literal \040 and \xFF" +test = r'Raw string with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = R"Raw string with literal \\ backslashes and literal \ +newline" +test = r'''Raw string with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605''' +test = R"""Raw string with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605""" + +# Unicode literals: Prefix is allowed but ignored (https://peps.python.org/pep-0414) +test = u'String with escapes \' and \" and \t' +test = U"String with escapes \040 and \xFF" +test = u'String with escapes \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = U"String with escaped \\ backslash and ignored \ +newline" +test = u'''String with quotes ' and " +and escapes \t and \040 and \xFF +and escapes \u00A1 and \U00010605''' +test = U"""String with quotes ' and " +and escapes \t and \040 and \xFF +and escapes \u00A1 and \U00010605""" + +# Raw Unicode literals are not allowed +test = ur'Invalid string with \' and \" and \t' +test = uR"Invalid string with \040 and \xFF" +test = Ur'Invalid string with \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = UR"Invalid string with \\ backslashes and literal \ +newline" +test = ru'Invalid string with \' and \" and \t' +test = rU"Invalid string with \040 and \xFF" +test = Ru'Invalid string with \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = RU"Invalid string with \\ backslashes and literal \ +newline" +test = ur'''Invalid string with ' and " +and \t and \040 and \xFF +and \u00A1 and \U00010605''' +test = RU"""Invalid string with ' and " +and \t and \040 and \xFF +and \u00A1 and \U00010605""" + +# Formatted string literals (f-strings) +# https://docs.python.org/3/reference/lexical_analysis.html#f-strings +test = f'F-string with escapes \' and \" and \t and fields {foo} and {bar}' +test = F"F-string with escapes \040 and \xFF and fields {foo} and {bar}" +test = f'F-string with escapes \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK} and fields {foo} and {bar}' +test = F"F-string with literal {{field}} and fields {foo} and {bar}" +test = f'''F-string with quotes ' and " +and escapes \t and \040 and \xFF +and escapes \u00A1 and \U00010605 +and fields {1}, {2} and {1 + + + 2}''' +test = F"""F-string with quotes ' and " +and escapes \t and \040 and \xFF +and escapes \u00A1 and \U00010605 +and fields {1}, {2} and {1 + + + 2}""" + +# Raw formatted string literals +test = fr'Raw f-string with literal \' and \" and \t and fields {foo} and {bar}' +test = fR"Raw f-string with literal \040 and \xFF and fields {foo} and {bar}" +test = Fr'Raw f-string with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK} and fields {foo} and {bar}' +test = FR"Raw f-string with literal {{field}} and fields {foo} and {bar}" +test = rf'Raw f-string with literal \' and \" and \t and fields {foo} and {bar}' +test = rF"Raw f-string with literal \040 and \xFF and fields {foo} and {bar}" +test = Rf'Raw f-string with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK} and fields {foo} and {bar}' +test = RF"Raw f-string with literal {{field}} and fields {foo} and {bar}" +test = fr'''Raw f-string with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605 +and fields {1}, {2} and {1 + + + 2}''' +test = RF"""Raw f-string with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605 +and fields {1}, {2} and {1 + + + 2}""" + +# Bytes +test = b'Bytes with escapes \' and \" and \t' +test = B"Bytes with escapes \040 and \xFF" +test = b'Bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = B"Bytes with escaped \\ backslash and ignored \ +newline" +test = b'''Bytes with quotes ' and " +and escapes \t and \040 and \xFF +and literal \u00A1 and \U00010605''' +test = B"""Bytes with quotes ' and " +and escapes \t and \040 and \xFF +and literal \u00A1 and \U00010605""" + +# Raw bytes +test = br'Raw bytes with literal \' and \" and \t' +test = bR"Raw bytes with literal \040 and \xFF" +test = Br'Raw bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = BR"Raw bytes with literal \\ backslashes and literal \ +newline" +test = rb'Raw bytes with literal \' and \" and \t' +test = rB"Raw bytes with literal \040 and \xFF" +test = Rb'Raw bytes with literal \u00A1 and \U00010605 and \N{INVERTED EXCLAMATION MARK}' +test = RB"Raw bytes with literal \\ backslashes and literal \ +newline" +test = br'''Raw bytes with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605''' +test = RB"""Raw bytes with quotes ' and " +and literal \t and \040 and \xFF +and literal \u00A1 and \U00010605""" diff --git a/runtime/syntax/testdir/input/setup/html_fold_expr.vim b/runtime/syntax/testdir/input/setup/html_fold_expr.vim new file mode 100644 index 0000000000..e8daae0e74 --- /dev/null +++ b/runtime/syntax/testdir/input/setup/html_fold_expr.vim @@ -0,0 +1,2 @@ +let g:html_expr_folding = 1 +filetype plugin on diff --git a/runtime/syntax/testdir/input/setup/java_module_info.vim b/runtime/syntax/testdir/input/setup/java_module_info.vim index b7b818f822..15dbdc80ab 100644 --- a/runtime/syntax/testdir/input/setup/java_module_info.vim +++ b/runtime/syntax/testdir/input/setup/java_module_info.vim @@ -29,4 +29,4 @@ autocmd_add([{ once: true, }]) -g:java_syntax_previews = [476] +g:java_syntax_previews = [476, 494] diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim b/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim new file mode 100644 index 0000000000..ebd90ede92 --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim9_ex_enum.vim @@ -0,0 +1 @@ +hi link vimVar Identifier diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim b/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim new file mode 100644 index 0000000000..ebd90ede92 --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim9_ex_enum2.vim @@ -0,0 +1 @@ +hi link vimVar Identifier diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_function_def_tail_comment_errors.vim b/runtime/syntax/testdir/input/setup/vim9_ex_function_def_tail_comment_errors.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim9_ex_function_def_tail_comment_errors.vim +++ b/runtime/syntax/testdir/input/setup/vim9_ex_function_def_tail_comment_errors.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_function_def_tail_comments.vim b/runtime/syntax/testdir/input/setup/vim9_ex_function_def_tail_comments.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim9_ex_function_def_tail_comments.vim +++ b/runtime/syntax/testdir/input/setup/vim9_ex_function_def_tail_comments.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_import.vim b/runtime/syntax/testdir/input/setup/vim9_ex_import.vim new file mode 100644 index 0000000000..ebd90ede92 --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim9_ex_import.vim @@ -0,0 +1 @@ +hi link vimVar Identifier diff --git a/runtime/syntax/testdir/input/setup/vim9_ex_let_heredoc.vim b/runtime/syntax/testdir/input/setup/vim9_ex_let_heredoc.vim new file mode 100644 index 0000000000..3a0ec2dae5 --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim9_ex_let_heredoc.vim @@ -0,0 +1,2 @@ +highlight link vimVar Identifier + diff --git a/runtime/syntax/testdir/input/setup/vim_ex_def.vim b/runtime/syntax/testdir/input/setup/vim_ex_def.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim_ex_def.vim +++ b/runtime/syntax/testdir/input/setup/vim_ex_def.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/setup/vim_ex_def_fold.vim b/runtime/syntax/testdir/input/setup/vim_ex_def_fold.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim_ex_def_fold.vim +++ b/runtime/syntax/testdir/input/setup/vim_ex_def_fold.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/setup/vim_ex_function.vim b/runtime/syntax/testdir/input/setup/vim_ex_function.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim_ex_function.vim +++ b/runtime/syntax/testdir/input/setup/vim_ex_function.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/setup/vim_ex_function_def_tail_comment_errors.vim b/runtime/syntax/testdir/input/setup/vim_ex_function_def_tail_comment_errors.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim_ex_function_def_tail_comment_errors.vim +++ b/runtime/syntax/testdir/input/setup/vim_ex_function_def_tail_comment_errors.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/setup/vim_ex_function_def_tail_comments.vim b/runtime/syntax/testdir/input/setup/vim_ex_function_def_tail_comments.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim_ex_function_def_tail_comments.vim +++ b/runtime/syntax/testdir/input/setup/vim_ex_function_def_tail_comments.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/setup/vim_ex_function_fold.vim b/runtime/syntax/testdir/input/setup/vim_ex_function_fold.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim_ex_function_fold.vim +++ b/runtime/syntax/testdir/input/setup/vim_ex_function_fold.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/setup/vim_ex_import.vim b/runtime/syntax/testdir/input/setup/vim_ex_import.vim new file mode 100644 index 0000000000..ebd90ede92 --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim_ex_import.vim @@ -0,0 +1 @@ +hi link vimVar Identifier diff --git a/runtime/syntax/testdir/input/setup/vim_ex_redir.vim b/runtime/syntax/testdir/input/setup/vim_ex_redir.vim new file mode 100644 index 0000000000..6193cc4e58 --- /dev/null +++ b/runtime/syntax/testdir/input/setup/vim_ex_redir.vim @@ -0,0 +1,2 @@ +highlight link vimVar Identifier +highlight link vimRedirFile String diff --git a/runtime/syntax/testdir/input/setup/vim_ex_syntax.vim b/runtime/syntax/testdir/input/setup/vim_ex_syntax.vim index c039651170..9dee81d648 100644 --- a/runtime/syntax/testdir/input/setup/vim_ex_syntax.vim +++ b/runtime/syntax/testdir/input/setup/vim_ex_syntax.vim @@ -1,2 +1,2 @@ highlight link vimVar Identifier -highlight link vimFuncScope Special +highlight link vimFunctionScope Special diff --git a/runtime/syntax/testdir/input/sh_10.sh b/runtime/syntax/testdir/input/sh_10.sh deleted file mode 100644 index be463c3da0..0000000000 --- a/runtime/syntax/testdir/input/sh_10.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/ksh - -# This script is a test file for ksh93 shared-state -# command substitutions (subshares) and mksh value -# substitutions (valsubs). - -# ====== -# Below is subshare syntax supported by both ksh93 and mksh. -print ${ echo one } -print ${ echo two -} -print ${ -echo three } -print ${ echo 'four'; } -print ${ echo 'five' ;} -print ${ echo 'six' -} -print ${ echo 'seven' } -echo ${ print 'eight' } -typeset nine=${ pwd; } - -# ====== -# Value substitutions of the form ${|command} are only -# supported by mksh, not ksh93. -if ! command eval '((.sh.version >= 20070703))' 2>/dev/null; then - valsubfunc() { - REPLY=$1 - } - echo ${|valsubfunc ten} - print "${|valsubfunc eleven;}" - printf '%s' "${|valsubfunc twelve }" - unlucky=${|valsubfunc thirteen -} - typeset notafloat=${|valsubfunc notanumber } - print $unlucky $notanumber - ${|echo foo} - ${|echo bar -} -fi - -# ====== -# Shared-state command substitutions using the syntax ${ /tmp/strfile -echo ${= 20070703))' 2>/dev/null; then + valsubfunc() { + REPLY=$1 + } + echo ${|valsubfunc ten} + print "${|valsubfunc eleven;}" + printf '%s' "${|valsubfunc twelve }" + unlucky=${|valsubfunc thirteen +} + typeset notafloat=${|valsubfunc notanumber } + print $unlucky $notanumber + ${|echo foo} + ${|echo bar +} +fi + +# ====== +# Shared-state command substitutions using the syntax ${ /tmp/strfile +echo ${= 20070703))' 2>/dev/null; then + valsubfunc() { + REPLY=$1 + } + echo ${|valsubfunc ten} + print "${|valsubfunc eleven;}" + printf '%s' "${|valsubfunc twelve }" + unlucky=${|valsubfunc thirteen +} + typeset notafloat=${|valsubfunc notanumber } + print $unlucky $notanumber + ${|echo foo} + ${|echo bar +} +fi + +# ====== +# Shared-state command substitutions using the syntax ${ /tmp/strfile +echo ${= 20070703))' 2>/dev/null; then + valsubfunc() { + REPLY=$1 + } + echo ${|valsubfunc ten} + print "${|valsubfunc eleven;}" + printf '%s' "${|valsubfunc twelve }" + unlucky=${|valsubfunc thirteen +} + typeset notafloat=${|valsubfunc notanumber } + print $unlucky $notanumber + ${|echo foo} + ${|echo bar +} +fi + +# ====== +# Shared-state command substitutions using the syntax ${ /tmp/strfile +echo ${= 20070703))' 2>/dev/null; then + valsubfunc() { + REPLY=$1 + } + echo ${|valsubfunc ten} + print "${|valsubfunc eleven;}" + printf '%s' "${|valsubfunc twelve }" + unlucky=${|valsubfunc thirteen +} + typeset notafloat=${|valsubfunc notanumber } + print $unlucky $notanumber + ${|echo foo} + ${|echo bar +} +fi + +# ====== +# Shared-state command substitutions using the syntax ${ /tmp/strfile +echo ${= 20070703))' 2>/dev/null; then + valsubfunc() { + REPLY=$1 + } + echo ${|valsubfunc ten} + print "${|valsubfunc eleven;}" + printf '%s' "${|valsubfunc twelve }" + unlucky=${|valsubfunc thirteen +} + typeset notafloat=${|valsubfunc notanumber } + print $unlucky $notanumber + ${|echo foo} + ${|echo bar +} +fi + +# ====== +# Shared-state command substitutions using the syntax ${ /tmp/strfile +echo ${= 20070703))' 2>/dev/null; then + valsubfunc() { + REPLY=$1 + } + echo ${|valsubfunc ten} + print "${|valsubfunc eleven;}" + printf '%s' "${|valsubfunc twelve }" + unlucky=${|valsubfunc thirteen +} + typeset notafloat=${|valsubfunc notanumber } + print $unlucky $notanumber + ${|echo foo} + ${|echo bar +} +fi + +# ====== +# Shared-state command substitutions using the syntax ${ /tmp/strfile +echo ${ 11 +echo ${bar[1][1]} # => 11 diff --git a/runtime/syntax/testdir/input/sh_mksh.ksh b/runtime/syntax/testdir/input/sh_mksh.ksh new file mode 100644 index 0000000000..c346ceed1e --- /dev/null +++ b/runtime/syntax/testdir/input/sh_mksh.ksh @@ -0,0 +1,146 @@ +#!/bin/mksh + +# Rendering namespace variables +echo ${.foo.bar[adsf]} ${foo.bar[1][2]} ${foo.bar[1][az]} ${.foo.bar[1][2]} +echo ${.foo[var]} ${.foo.bar[1]} ${.foo.bar[*]} ${foo.bar##baz} ${.foo.bar##baz} +echo ${.foo.bar[3]##baz} ${.foo.bar[z]##baz} ${sh.version/V/b} ${.sh.version/V/b} +echo ${foo/%bar/foo} ${foo/#bar/foo} ${foo.bar/%bar/foo} ${foo.bar[d]/#bar/foo} +echo ${.foo/%barfoo} ${.foo.bar/#bar/foo} ${.bar.foo/%bar/foo} ${.bar/#bar/foo} +echo ${foo/%barfoo} ${foo/bar/foo} ${barfoo//bar/foo} ${bar/#bar/foo} +echo ${.sh.version^^} ${.sh.version,,} ${KSH_VERSION^} ${KSH_VERSION,} + +# 'alarm' builtin (present in ksh93u+, ksh93v- and the 93u+m dev branch). +alarm --man +# The fds and pids builtins. These ksh93 builtins have existed since 2005-05-22 +# and 2008-06-02, respectively. However, these were not readily enabled; in +# 93u+m these can be enabled with the builtin command if libcmd.so is present, +# either via 'builtin -f' or (in more recent commits) with a regular invocation +# of the 'builtin' built-in. +# cf. https://github.com/ksh93/ksh/commit/f15e2c41 +builtin fds pids +fds; pids + +# Unix commands which are provided by ksh as builtins via libcmd.so +basename +cat +chgrp +chmod +chown +cksum +cmp +comm +cp +cut +date +dirname +egrep # Obsolescent +expr +fgrep # Obsolescent +fmt +fold +getconf +grep +head +iconv # 93v- +id +join +ln +logname +ls # 93v- +md5sum +mkdir +mkfifo +mktemp +mv +od # 93v- +paste +pathchk +readlink # 93v- +realpath # 93v- +rev +rm +rmdir +sha1sum # 93v- +sha256sum # 93v- +sha2sum # 93v- +sha384sum # 93v- +sha512sum # 93v- +stty +sum +sync +tail +tee +tr # 93v- +tty +uname +uniq +vmstate # Obsolescent; only available in 93v- and older +wc +xargs # 93v- +xgrep # 93v- + +# SHA command not provided as a builtin but included here for completeness +sha224sum + +# poll builtin (93v-) +poll --man + +# mkservice and eloop (rarely provided; requires SHOPT_MKSERVICE) +mkservice --man; eloop --help + +# some mksh builtins +bind; rename + +# ;& and ;;& in case statements +case x in + bar) false ${baz:1} ;& + foo) true ${foo:0:0} ;;& + *) print ${$bar} ;; # 93v- +esac + +# Below is subshare syntax supported by both ksh93 and mksh. +print ${ echo one } +print ${ echo two +} +print ${ +echo three } +print ${ echo 'four'; } +print ${ echo 'five' ;} +print ${ echo 'six' +} +print ${ echo 'seven' } +echo ${ print 'eight' } +typeset nine=${ pwd; } + +# Value substitutions of the form ${|command} are only +# supported by mksh, not ksh93. +if ! command eval '((.sh.version >= 20070703))' 2>/dev/null; then + valsubfunc() { + REPLY=$1 + } + echo ${|valsubfunc ten} + print "${|valsubfunc eleven;}" + printf '%s' "${|valsubfunc twelve }" + unlucky=${|valsubfunc thirteen +} + typeset notafloat=${|valsubfunc notanumber } + print $unlucky $notanumber + ${|echo foo} + ${|echo bar +} +fi + +# ====== +# Shared-state command substitutions using the syntax ${ /tmp/strfile +echo ${ ,trail:-,extends:>,precedes:<,nbsp:+ { var foo = 42 } + { { { { - var foo = 42 + var foo = 42 } var foo = 42 } @@ -20,6 +21,7 @@ vim9script var foo = 42 } + def Foo() { var foo = 42 @@ -27,7 +29,21 @@ def Foo() } enddef -echo "foo" | { + +# start/end patterns + +{ var foo = 42 -} +} + +{ # comment + var foo = 42 +} # comment + +echo "Foo" | { | echo "Bar" + var foo = 42 +} | echo "Baz" + +# dictionary +{}->items() diff --git a/runtime/syntax/testdir/input/vim9_comment.vim b/runtime/syntax/testdir/input/vim9_comment.vim index fd6a5d2a2a..590ddd869b 100644 --- a/runtime/syntax/testdir/input/vim9_comment.vim +++ b/runtime/syntax/testdir/input/vim9_comment.vim @@ -34,6 +34,10 @@ autocmd BufNewFile * { \ continuing comment \ continuing comment +var foo = 42 # commment + \ continuing comment + \ continuing comment + # :Foo \ arg1 #\ comment @@ -51,6 +55,18 @@ echo "TOP" \ arg2 +# Expression comments + +var foo = { # comment + # comment + bar: 42, # comment + # comment + # comment + baz: 42 # comment + # comment +} # comment + + # Issue: #13047 if !exists(":DiffOrig") @@ -62,3 +78,15 @@ endif # Issue: #11307 and #11560 # This is what we call " blah + + +# PR: #14975 +# https://github.com/vim/vim/pull/14975#issuecomment-2832643115 + +var d = { + a: 0, +# a ' quote {{{ +#}}} +b: 0, +} + diff --git a/runtime/syntax/testdir/input/vim9_ex_commands.vim b/runtime/syntax/testdir/input/vim9_ex_commands.vim index 1773e21b7e..86e063eed4 100644 --- a/runtime/syntax/testdir/input/vim9_ex_commands.vim +++ b/runtime/syntax/testdir/input/vim9_ex_commands.vim @@ -14,8 +14,6 @@ vim9script : help : help # FIXME -:2match -:3match :abbreviate :abclear :aboveleft @@ -540,6 +538,7 @@ vim9script :undojoin :undolist :unhide +:uniq :unlockvar :unmap :unmenu @@ -597,8 +596,6 @@ Foo() | help Foo() |help Foo()| help -Foo() | 2match -Foo() | 3match Foo() | abbreviate Foo() | abclear Foo() | aboveleft @@ -1121,6 +1118,7 @@ Foo() | undo Foo() | undojoin Foo() | undolist Foo() | unhide +Foo() | uniq Foo() | unlockvar Foo() | unmap Foo() | unmenu diff --git a/runtime/syntax/testdir/input/vim9_ex_enum.vim b/runtime/syntax/testdir/input/vim9_ex_enum.vim new file mode 100644 index 0000000000..8529deda24 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_ex_enum.vim @@ -0,0 +1,111 @@ +vim9script +# Vim :enum command +# VIM_TEST_SETUP hi link vim9EnumValue Todo + + +interface Interface1 + def Def1() +endinterface +interface Interface2 +endinterface + +# enum-implements clause with interspersed comments + +enum Enum1 implements Interface1, Interface2 + Value1 + def Def1() + enddef +endenum + +enum Enum2 + \ implements Interface1, Interface2 + Value1 + def Def1() + enddef +endenum + +enum Enum3 # comment + \ implements Interface1, Interface2 + Value1 +endenum + +enum Enum4 + # comment + \ implements Interface1, Interface2 + Value1 +endenum + +enum Enum5 + \ implements Interface1, Interface2 # comment + Value1 + def Def1() + enddef +endenum + +enum Enum6 + #\ comment + \ implements Interface1, Interface2 + Value1 + def Def1() + enddef +endenum + +# [enum Enum7.Value1 {name: 'Value1', ordinal: 0, val1: 0, val2: 0}, enum Enum7.Value2 {name: 'Value2', ordinal: 1, val1: 1, val2: 0}, enum Enum7.Value3 {name: 'Value3', ordinal: 2, val1: 2, val2: 0}] +# comment +enum Enum7 + \ + #\ comment + \ + #\ comment + \ implements Interface1, Interface2 # comment + # comment + # comment + Value1, # comment + # comment + # comment + Value2(1 + 0), # comment + # comment + # comment + Value3( # comment + # comment + 1 # comment + # comment + + # comment + # comment + 1 # comment + ) # comment + # comment + var val1: number # comment + # comment + def Def1() + enddef + # comment + static def Def2() # comment + # comment + enddef # comment + # comment + public var val2: number # comment +endenum + +# [enum Enum8.implements {name: 'implements', ordinal: 0}] +enum Enum8 implements Interface1, Interface2 + implements + def Def1() + enddef +endenum + +# [enum Enum9.Value1 {name: 'Value1', ordinal: 0, implements: 0}] +enum Enum9 implements Interface1, Interface2 + Value1 + var implements: number + def Def1() + enddef +endenum + +# [enum Enum10.implements {name: 'implements', ordinal: 0}] +enum Enum10 implements Interface1, Interface2 + implements + def Def1() + enddef +endenum + diff --git a/runtime/syntax/testdir/input/vim9_ex_enum2.vim b/runtime/syntax/testdir/input/vim9_ex_enum2.vim new file mode 100644 index 0000000000..e3b3d2dc0a --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_ex_enum2.vim @@ -0,0 +1,32 @@ +vim9script +# Vim :enum command +# VIM_TEST_SETUP hi link vim9EnumValue Todo + + +# See: https://github.com/vim/vim/pull/16365#issuecomment-2571420551 + +enum Letter + # + ######################################### + A("(\" # not a comment NOR_ANOTHER_VALUE, + \ "), B(")\""), C($"'') + \('"), D($'""(),"'), E, + F( + ")" .. # FA, + "(" # FB, + ), G + #enum NotSupported + #endenum + + def new(this.value = v:none) + return + enddef + const value: string +endenum + +for letter in Letter.values + echo letter +endfor + +echo Letter.D + diff --git a/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim b/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim index 0656907eb7..b6dfc4ea4f 100644 --- a/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim +++ b/runtime/syntax/testdir/input/vim9_ex_enum_fold.vim @@ -2,6 +2,8 @@ vim9script # Vim :enum command # VIM_TEST_SETUP let g:vimsyn_folding = 'ef' # VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax +# VIM_TEST_SETUP hi link vim9EnumValue Todo + interface Interface1 endinterface @@ -29,11 +31,20 @@ enum Enum4 endenum enum Enum5 implements Interface1, Interface2 - Value1, - Value2, - Value3 - def Method1() - def Nested() - enddef + Value1, + Value2, + Value3 + def Method1() + def Nested() enddef + enddef endenum + +enum Enum6 + #\ comment + \ implements Interface1, Interface2 + Value1, + Value2, + Value3 +endenum + diff --git a/runtime/syntax/testdir/input/vim9_ex_import.vim b/runtime/syntax/testdir/input/vim9_ex_import.vim new file mode 100644 index 0000000000..bedd5bbda7 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_ex_import.vim @@ -0,0 +1,120 @@ +vim9script +# Vim9 :import command +# VIM_TEST_SETUP hi link vimImportName Todo + + +import "foo.vim" +import true ? "foo.vim" : "bar.vim" + +import true ? + "foo.vim" : + "bar.vim" + +import true + ? "foo.vim" + : "bar.vim" + +import true ? # comment + # comment + "foo.vim" : + # comment + "bar.vim" + +import true # comment + # comment + ? "foo.vim" + # comment + : "bar.vim" + +import "foo.vim" as bar +import true ? "foo.vim" : "bar.vim" as baz + +import true ? + "foo.vim" : + "bar.vim" + as baz + +import true + ? "foo.vim" + : "bar.vim" + as baz + +import true ? # comment + # comment + "foo.vim" : + # comment + "bar.vim" + # comment + as baz + +import true # comment + # comment + ? "foo.vim" + # comment + : "bar.vim" + # comment + as baz + +echo "Foo" | import "foo.vim" + + +# autoload + +import autoload "foo.vim" +import autoload true ? "foo.vim" : "bar.vim" + +import autoload true ? + "foo.vim" : + "bar.vim" + +import autoload true + ? "foo.vim" + : "bar.vim" + +import autoload true ? # comment + # comment + "foo.vim" : + # comment + "bar.vim" + +import autoload true # comment + # comment + ? "foo.vim" + # comment + : "bar.vim" + +import autoload "foo.vim" as bar +import autoload true ? "foo.vim" : "bar.vim" as baz + +import autoload true ? + "foo.vim" : + "bar.vim" + as baz + +import autoload true + ? "foo.vim" + : "bar.vim" + as baz + +import autoload true ? # comment + # comment + "foo.vim" : + # comment + "bar.vim" + # comment + as baz + +import autoload true # comment + # comment + ? "foo.vim" + # comment + : "bar.vim" + # comment + as baz + + +# "as" keyword in expr + +var as = "modules/" +import true ? as .. "foo.vim" : as .. "bar.vim" as other + diff --git a/runtime/syntax/testdir/input/vim9_ex_let_heredoc.vim b/runtime/syntax/testdir/input/vim9_ex_let_heredoc.vim new file mode 100644 index 0000000000..f20d4b9421 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_ex_let_heredoc.vim @@ -0,0 +1,298 @@ +vim9script +# VIM_TEST_SETUP let g:vimsyn_folding = "h" +# VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax + + +var foo =<< END +line1 +line2 +END + + var foo =<< END +line1 +line2 +END + +var [foo, bar] =<< EOS +line1 +line2 +EOS + + var [foo, bar] =<< EOS +line1 +line2 +EOS + +var [foo, + \ bar] =<< EOS +line1 +line2 +EOS + + var [foo, + \ bar] =<< EOS +line1 +line2 +EOS + +# assignment + +foo =<< END +line1 +line2 +END + + foo =<< END +line1 +line2 +END + +g:foo =<< END +line1 +line2 +END + + g:foo =<< END +line1 +line2 +END + +[foo, bar] =<< EOS +line1 +line2 +EOS + + [foo, bar] =<< EOS +line1 +line2 +EOS + +[foo, + \ bar] =<< EOS +line1 +line2 +EOS + + [foo, + \ bar] =<< EOS +line1 +line2 +EOS + +[g:foo, g:bar] =<< EOS +line1 +line2 +EOS + + [g:foo, g:bar] =<< EOS +line1 +line2 +EOS + +[g:foo, + \ g:bar] =<< EOS +line1 +line2 +EOS + + [g:foo, + \ g:bar] =<< EOS +line1 +line2 +EOS + + +# typed + +var foo: list =<< END +line1 +line2 +END + +var [foo: string, bar: string] =<< END +line1 +line2 +END + +# assignment + +# trim + +var foo =<< trim END + line1 + line2 +END + + var foo =<< trim END + line1 + line2 + END + + +# interpolation + +var foo =<< eval END +line{1 + 0} +line{1 + 1} +END + + var foo =<< eval END +line{1 + 0} +line{1 + 1} +END + +var foo =<< trim eval END + line{1 + 0} + line{1 + 1} +END + + var foo =<< trim eval END + line{1 + 0} + line{1 + 1} + END + +# no interpolation (escaped { and }) + +var foo =<< eval END +line{{1 + 0}} +line{{1 + 1}} +END + + var foo =<< eval END +line{{1 + 0}} +line{{1 + 1}} +END + +var foo =<< trim eval END + line{{1 + 0}} + line{{1 + 1}} +END + + var foo =<< trim eval END + line{{1 + 0}} + line{{1 + 1}} + END + + +# no interpolation + +var foo =<< END +line{1 + 0} +line{1 + 1} +END + + var foo =<< END +line{1 + 0} +line{1 + 1} +END + +var foo =<< trim END + line{1 + 0} + line{1 + 1} +END + + var foo =<< trim END + line{1 + 0} + line{1 + 1} + END + + +# end marker must not be followed by whitespace + +# assert_equal(foo, ["END "]) +var foo =<< END +END +END + +# assert_equal(foo, [" END "]) +var foo =<< END + END +END + +# assert_equal(foo, ["END "]) +var foo =<< trim END + END +END + +# assert_equal(foo, ["END "]) + var foo =<< trim END + END + END + + +# end marker must be vertically aligned with :var (if preceded by whitespace) + +# assert_equal(foo, ["END"]) +var foo =<< trim END + END +END + + # assert_equal(foo, ["END"]) + var foo =<< trim END + END + END + +# assert_equal(foo, ["END "]) +var foo =<< trim END +END +END + + # assert_equal(foo, ["END"]) + var foo =<< trim END + END + END + + # assert_equal(foo, ["END "]) + var foo =<< trim END + END + END + + # assert_equal(foo, ["END"]) + var foo =<< trim END + END + END + + # assert_equal(foo, ["END "]) + var foo =<< trim END + END + END + + # assert_equal(foo, ["END "]) + var foo =<< trim END +END +END + + # assert_equal(foo, ["END"]) + var foo =<< trim END + END +END + + # assert_equal(foo, ["END"]) + var foo =<< trim END + END +END + + +# end markers + +var foo =<< !@#$%^&*()_+ +line1 +line2 +!@#$%^&*()_+ + +var foo =<< 0!@#$%^&*()_+ +line1 +line2 +0!@#$%^&*()_+ + +var foo =<< A!@#$%^&*()_+ +line1 +line2 +A!@#$%^&*()_+ + +# error - leading lowercase character +var foo =<< a!@#$%^&*()_+ +line1 +line2 +a!@#$%^&*()_+ + diff --git a/runtime/syntax/testdir/input/vim9_expr.vim b/runtime/syntax/testdir/input/vim9_expr.vim index fc94abd522..f42392c2d7 100644 --- a/runtime/syntax/testdir/input/vim9_expr.vim +++ b/runtime/syntax/testdir/input/vim9_expr.vim @@ -2,6 +2,22 @@ vim9script # Vim9-script expressions +# Number + +# ' separated + +echo 1'000'000 +echo 1'000'000.00 +echo -1'000'000 +echo -1'000'000.00 + +echo 0b1000'0000 +echo 0o1000'0000 +echo 0x1000'0000 +echo -0b1000'0000 +echo -0o1000'0000 +echo -0x1000'0000 + # Dictionary echo {} @@ -51,6 +67,33 @@ echo { # match as keys not scope dictionaries echo { b: 42, w: 42, t: 42, g: 42, l: 42, s: 42, a: 42, v: 42 } +" Register + +echo @" @@ +echo @0 @1 @2 @3 @4 @5 @6 @7 @8 @9 +echo @a @b @c @d @e @f @g @h @i @j @k @l @m @n @o @p @q @r @s @t @u @v @w @x @y @z +echo @A @B @C @D @E @F @G @H @I @J @K @L @M @N @O @P @Q @R @S @T @U @V @W @X @Y @Z +echo @- @: @. @% @# @= @* @+ @~ @_ @/ + +# read-only @:, @., @%, @~ +@" = "foo" +@0 = "foo" +@1 = "foo" +@9 = "foo" +@a = "foo" +@k = "foo" +@z = "foo" +@A = "foo" +@K = "foo" +@Z = "foo" +@- = "foo" +@# = "foo" +@= = "foo" +@* = "foo" +@+ = "foo" +@_ = "foo" +@/ = "foo" + # Operators # Ternary @@ -149,7 +192,7 @@ def Foo() enddef -# Issue #16227 (Vimscript ternary expression highlighting) +# Issue #16227 (Vim script ternary expression highlighting) var foo = 'foo' # comment var bar = foo == 'foo' ? 'bar' : 'baz' diff --git a/runtime/syntax/testdir/input/vim9_function_call.vim b/runtime/syntax/testdir/input/vim9_function_call.vim new file mode 100644 index 0000000000..7512950255 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_function_call.vim @@ -0,0 +1,317 @@ +vim9script +# Vim function calls +# VIM_TEST_SETUP highlight link vimUserFunc Todo +# VIM_TEST_SETUP highlight link vim9UserFunc Todo + + +call abs(42) +abs(42) + + +# command/function distinction + +# append browse call chdir confirm copy delete eval execute filter function +# insert join map match mode sort split substitute swapname type + +var append = append(42) +call append(42) +# function +append(42) +# Legacy command +# append (42) + +var browse = browse(42) +call browse(42) +# function +browse(42) +# command +browse (42) + +var call = call(42) +call call(42) +# function +call(42) +# command +call (42) + +var chdir = chdir(42) +call chdir(42) +# function +chdir(42) +# command +chdir (42) + +var confirm = confirm(42) +call confirm(42) +# function +confirm(42) +# command +confirm (42) + +var copy = copy(42) +call copy(42) +# function +copy(42) +# command +copy (42) + +var delete = delete(42) +call delete(42) +# function +delete(42) +# command +delete (42) + +var eval = eval(42) +call eval(42) +# function +eval(42) +# command +eval (42) + +var execute = execute(42) +call execute(42) +# function +execute(42) +# command +execute (42) + +var filter = filter(42) +call filter(42) +# function +filter(42) +# command +filter (42) + +var function = function(42) +call function(42) +# function +function(42) +# command +function (42) + +var insert = insert(42) +call insert(42) +# function +insert(42) +# Legacy command +# insert (42) + +var join = join(42) +call join(42) +# function +join(42) +# command +join (42) + +var map = map(42) +call map(42) +# function +map(42) +# command +map (42) + +var match = match(42) +call match(42) +# function +match(42) +# command +match (42) + +var sort = sort(42) +call sort(42) +# function +sort(42) +# command +sort (42) + +var split = split(42) +call split(42) +# function +split(42) +# command +split (42) + +var substitute = substitute(42) +call substitute(42) +# function +substitute(42) +# command +substitute (42) + +var swapname = swapname(42) +call swapname(42) +# function +swapname(42) +# command +swapname (42) + +var type = type(42) +call type(42) +# function +type(42) +# command +type (42) + +var uniq = uniq(42) +call uniq(42) +# function +uniq(42) +# command +uniq (42) + + +# errors + +var foo = foo(42) +call foo(42) +foo(42) + +var if = if(42) +call if(42) +# function +if(42) | .. | endif +# command +if (42) | .. | endif + +var echo = echo(42) +call echo(42) +# function +echo(42) +# command +echo (42) + + +# expressions + +var foo = abs(42) + +abs(42) +call abs(42) +echo "Foo" | abs(42) + +echo abs(42) +echo (abs(42)) +echo abs(42) + foo +echo foo + abs(42) + +Foo() +call Foo() +echo "Foo" | Foo() + +echo Foo() +echo (Foo()) +echo Foo() + bar +echo bar + Foo() + + +# scope modifiers and qualified names + +var foo = g:foo(42) +call g:foo(42) + +var foo = b:foo(42) +call b:foo(42) + +var foo = w:foo(42) +call w:foo(42) + +var foo = t:foo(42) +call t:foo(42) + +var foo = v:foo(42) +call v:foo(42) + + +var foo = module.foo(42) +call module.foo(42) +module.foo(42) + +var foo = g:module.foo(42) +call g:module.foo(42) +g:module.foo(42) + +var foo = b:module.foo(42) +call b:module.foo(42) +b:module.foo(42) + +var foo = w:module.foo(42) +call w:module.foo(42) +w:module.foo(42) + +var foo = t:module.foo(42) +call t:module.foo(42) +t:module.foo(42) + +var foo = v:module.foo(42) +call v:module.foo(42) +v:module.foo(42) + + +var foo = module#foo(42) +call module#foo(42) +module#foo(42) + +var foo = g:module#foo(42) +call g:module#foo(42) +g:module#foo(42) + + +# not builtin functions + +call g:substitute() +call b:substitute() +call w:substitute() +call t:substitute() +call v:substitute() + +call substitute() + +call g:substitute.substitute() +call b:substitute.substitute() +call w:substitute.substitute() +call t:substitute.substitute() +call v:substitute.substitute() + +call substitute#substitute() +call g:substitute#substitute() + +g:substitute() +b:substitute() +w:substitute() +t:substitute() +v:substitute() + +substitute() + +g:substitute.substitute() +b:substitute.substitute() +w:substitute.substitute() +t:substitute.substitute() +v:substitute.substitute() + +substitute#substitute() +g:substitute#substitute() + + +# chained function calls + +module.foo().bar() +module.foo().substitute() + + +# Issue 16721 (Vim script highlight of builtin function after |) + +&directory = $'{$MYVIMDIR}/.data/swap/' +&backupdir = $'{$MYVIMDIR}/.data/backup//' +&undodir = $'{$MYVIMDIR}/.data/undo//' +if !isdirectory(&undodir) | mkdir(&undodir, "p") | endif +if !isdirectory(&backupdir) | mkdir(&backupdir, "p") | endif +if !isdirectory(&directory) | mkdir(&directory, "p") | endif + + +# Issue #17766 (valid function call highlighted as error) + +module[0].foo() +module[0].substitute() + diff --git a/runtime/syntax/testdir/input/vim9_function_calls.vim b/runtime/syntax/testdir/input/vim9_function_calls.vim deleted file mode 100644 index aecfc11427..0000000000 --- a/runtime/syntax/testdir/input/vim9_function_calls.vim +++ /dev/null @@ -1,18 +0,0 @@ -vim9script - -# Vim9 function calls - -clearmatches() -:call clearmatches() -echo "Foo" | clearmatches() - - -# Issue 16721 (vimscript highlight of builtin function after |) - -&directory = $'{$MYVIMDIR}/.data/swap/' -&backupdir = $'{$MYVIMDIR}/.data/backup//' -&undodir = $'{$MYVIMDIR}/.data/undo//' -if !isdirectory(&undodir) | mkdir(&undodir, "p") | endif -if !isdirectory(&backupdir) | mkdir(&backupdir, "p") | endif -if !isdirectory(&directory) | mkdir(&directory, "p") | endif - diff --git a/runtime/syntax/testdir/input/vim9_lambda.vim b/runtime/syntax/testdir/input/vim9_lambda.vim index 4340eb0990..81d9dc27b1 100644 --- a/runtime/syntax/testdir/input/vim9_lambda.vim +++ b/runtime/syntax/testdir/input/vim9_lambda.vim @@ -1,4 +1,7 @@ vim9script +# VIM_TEST_SETUP hi link vim9LambdaOperator Todo +# VIM_TEST_SETUP hi link vim9LambdaParen Todo + # Vim 9 lambda expressions @@ -6,6 +9,7 @@ var Foo: func var expr = 0 # without return type + Foo = () => expr Foo = (_) => expr Foo = (x) => expr @@ -26,6 +30,7 @@ Foo = (x: number, ...y: list) => expr Foo = (x: number, y: number) => expr # with return type + Foo = (): number => expr Foo = (_): number => expr Foo = (x): number => expr @@ -45,6 +50,27 @@ Foo = (x: number, ...y: list): number => expr Foo = (x: number, y: number): number => expr +# with compound return type + +Foo = (): list => expr +Foo = (_): list => expr +Foo = (x): list => expr + +Foo = (...y): list => expr +Foo = (_, ...y): list => expr +Foo = (x, ...y): list => expr + +Foo = (x, y): list => expr + +Foo = (_: number): list => expr +Foo = (x: number): list => expr + +Foo = (...y: list): list => expr +Foo = (_: number, ...y: list): list => expr +Foo = (x: number, ...y: list): list => expr + +Foo = (x: number, y: number): list => expr + # post operator comments @@ -62,15 +88,29 @@ Foo = () => # line continuations +Foo = (x: string, + \ y: number, + \ z: bool) => expr + +Foo = (x: string, + \ y: number, + \ z: bool) + \ => expr + Foo = (x: string, \ y: number, \ z: bool): number => expr -# FIXME + Foo = (x: string, \ y: number, \ z: bool): number \ => expr +Foo = (x: string, + \ y: number, + \ z: bool): + \ number => expr + # funcref call @@ -114,3 +154,9 @@ def Op(): func(func(number, number): number): func(number, Digit): number (x: number, y: Digit): number => F(x, y.value) enddef ####################### ^ vimCommand? + +# Issue #16965 (vim syntax: wrong highlight with lambda, autoload, and false keyword) + +autocmd BufRead * timer_start(0, (_) => f#a(false, false)) +autocmd + diff --git a/runtime/syntax/testdir/input/vim9_shebang.vim b/runtime/syntax/testdir/input/vim9_shebang.vim old mode 100755 new mode 100644 diff --git a/runtime/syntax/testdir/input/vim9_tuple.vim b/runtime/syntax/testdir/input/vim9_tuple.vim new file mode 100644 index 0000000000..99370a55d4 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_tuple.vim @@ -0,0 +1,26 @@ +vim9script + +# Vim9 tuples + + +# https://github.com/vim/vim/pull/16935#issuecomment-2738310273 + +function LegacyMakeEntry(key, value) abort + return (a:key, a:value) +endfunction + +def MakeEntry(key: string, value: any): tuple + return (key, value) +enddef + +function LegacyMakeLazyList(e1, e2) abort + return ({e1_, e2_ -> {-> [e1_, e2_]}}(a:e1, a:e2)) +endfunction + +def MakeLazyList(e1: any, e2: any): func(): list + return (((e1_: any, e2_: any) => () => [e1_, e2_])(e1, e2)) +enddef + +echo MakeEntry('key', 'value') == list2tuple(MakeLazyList('key', 'value')()) +echo LegacyMakeEntry('key', 'value') == list2tuple(LegacyMakeLazyList('key', 'value')()) + diff --git a/runtime/syntax/testdir/input/vim9_types.vim b/runtime/syntax/testdir/input/vim9_types.vim new file mode 100644 index 0000000000..81e76efd46 --- /dev/null +++ b/runtime/syntax/testdir/input/vim9_types.vim @@ -0,0 +1,17 @@ +vim9script +# Vim9 types +# VIM_TEST_SETUP hi link vimTypeAny Todo +# VIM_TEST_SETUP hi link vimVariableTypeAny Todo + + +# builtin types (distinct any highlighting) + +var foo: bool +var bar: any + +def Foo(arg: bool): bool +enddef + +def Bar(arg: any): any +enddef + diff --git a/runtime/syntax/testdir/input/vim9_variables.vim b/runtime/syntax/testdir/input/vim9_variables.vim index 14b1d1dd3b..3521045290 100644 --- a/runtime/syntax/testdir/input/vim9_variables.vim +++ b/runtime/syntax/testdir/input/vim9_variables.vim @@ -47,6 +47,24 @@ var foo =<< eval trim END ... END +# Typed declarations + +var foo: tuple = expr +var foo: tuple = expr +var foo: tuple = expr +var foo: tuple<...list> = expr +var foo: tuple<...list> = expr +var foo: tuple> = expr + +var foo: tuple< + #\ comment + \number, + #\ comment + \string, + #\ comment + \bool + \> + # Assignments foo = expr diff --git a/runtime/syntax/testdir/input/vim_comment.vim b/runtime/syntax/testdir/input/vim_comment.vim index f382f8df79..2ca67875bb 100644 --- a/runtime/syntax/testdir/input/vim_comment.vim +++ b/runtime/syntax/testdir/input/vim_comment.vim @@ -31,6 +31,10 @@ autocmd BufNewFile * { \ continuing comment \ continuing comment +let foo = 42 " commment + \ continuing comment + \ continuing comment + " :Foo \ arg1 "\ comment diff --git a/runtime/syntax/testdir/input/vim_ex_augroup.vim b/runtime/syntax/testdir/input/vim_ex_augroup.vim index 2dae59dda5..7f7f3463c3 100644 --- a/runtime/syntax/testdir/input/vim_ex_augroup.vim +++ b/runtime/syntax/testdir/input/vim_ex_augroup.vim @@ -1,19 +1,62 @@ " Vim :augroup command +" VIM_TEST_SETUP let g:vimsyn_folding = "a" +" VIM_TEST_SETUP setl fdc=2 fdl=999 fdm=syntax +" VIM_TEST_SETUP highlight link vimAugroupName Todo + augroup foo - autocmd BufRead * echomsg "Foo" + autocmd! + autocmd BufRead * echo "Foo" augroup END -augroup foo | autocmd! | augroup END +augroup foo | autocmd! | augroup END augroup! foo augroup !@#$%^&*()_+ autocmd BufRead * echomsg "Foo" augroup END -augroup !@#$%^&*()_+ | autocmd! | augroup END +augroup !@#$%^&*()_+ | autocmd! | augroup END +augroup! !@#$%^&*()_+ + +augroup !@#$%^&*()_+ | autocmd! | augroup END augroup! !@#$%^&*()_+ +augroup no\|echo | autocmd! | augroup END +augroup! no\|echo + +augroup no\"echo | autocmd! | augroup END +augroup! no\"echo + +augroup \|echo\| | autocmd! | augroup END +augroup! \|echo\| + +augroup \"echo\" | autocmd! | augroup END +augroup! \"echo\" + +augroup \|\" | autocmd! | augroup END +augroup! \|\" + +augroup \"\| | autocmd! | augroup END +augroup! \"\| + + +augroup foo"comment + au! + au BufRead * echo "Foo" +augroup END"comment + +augroup foo|echo "Foo" + au! + au BufRead * echo "Foo" +augroup END|echo "Foo" + +augroup! foo"comment +augroup! foo|echo "Foo" + + " list groups augroup +augroup | echo "Foo" +augroup " comment diff --git a/runtime/syntax/testdir/input/vim_ex_autocmd.vim b/runtime/syntax/testdir/input/vim_ex_autocmd.vim new file mode 100644 index 0000000000..8b5b53e0b4 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_autocmd.vim @@ -0,0 +1,257 @@ +" Vim :autocmd command +" VIM_TEST_SETUP highlight vimAutoCmdGroup Todo +" VIM_TEST_SETUP highlight vimUserAutoEvent Title + + +" Define + +autocmd foogroup BufRead *.txt echo "Foo" | echo "Bar" +autocmd BufRead *.txt echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile *.txt echo "Foo" | echo "Bar" +autocmd User FooEvent echo "Foo" | echo "Bar" + +autocmd foogroup BufRead *.txt ++once echo "Foo" | echo "Bar" +autocmd BufRead *.txt ++once echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile *.txt ++once echo "Foo" | echo "Bar" +autocmd User FooEvent ++once echo "Foo" | echo "Bar" + +autocmd foogroup BufRead *.txt ++nested echo "Foo" | echo "Bar" +autocmd BufRead *.txt ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile *.txt ++nested echo "Foo" | echo "Bar" +autocmd User FooEvent ++nested echo "Foo" | echo "Bar" + +autocmd foogroup BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd User FooEvent ++once ++nested echo "Foo" | echo "Bar" + +autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd foogroup BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" +autocmd BufRead,BufNewFile ++once ++nested echo "Foo" | echo "Bar" +autocmd User FooEvent,BarEvent ++once ++nested echo "Foo" | echo "Bar" + +autocmd foogroup BufRead foo ++once ++nested echo "Foo" | echo "Bar" + +autocmd BufRead *.txt { + echo "Foo" + echo "Bar" +} +autocmd BufRead,BufNewFile *.txt { + echo "Foo" + echo "Bar" +} +autocmd User FooEvent { + echo "Foo" + echo "Bar" +} +autocmd foogroup BufRead *.txt { + echo "Foo" + echo "Bar" +} + + +" Multiline {cmd} arg + +autocmd BufRead *.txt echo "Foo" + \| echo "Bar" + \| echo "Baz" + +autocmd BufRead *.txt echo "Foo" | + \ echo "Bar" | + \ echo "Baz" + +autocmd BufRead *.txt + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + "\ comment + \| echo "Baz" + +autocmd BufRead,BufNewFile *.txt + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + "\ comment + \| echo "Baz" +autocmd User FooEvent + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + "\ comment + \| echo "Baz" +autocmd foogroup BufRead *.txt + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + "\ comment + \| echo "Baz" + + +" Multiple patterns + +autocmd BufRead *.txt,*.vim,*.c echo "Foo" | echo "Bar" +autocmd BufRead ,*.vim,*.c echo "Foo" | echo "Bar" +autocmd BufRead *.txt,,*.c echo "Foo" | echo "Bar" +autocmd BufRead *.txt,*.vim, echo "Foo" | echo "Bar" + +autocmd BufRead ,, echo "Foo" | echo "Bar" + + +" FIXME: "BufRead" and "*" are valid group names, however, :help :augroup +" explicitly directs the user NOT to shadow event names with group names +autocmd BufRead BufRead *.txt ++once ++nested echo "Foo" +autocmd * BufRead *.txt ++once ++nested echo "Foo" + + +" Remove + +autocmd! foogroup BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd! BufRead *.txt ++once ++nested echo "Foo" | echo "Bar" +autocmd! foogroup User FooEvent ++once ++nested echo "Foo" | echo "Bar" +autocmd! User FooEvent ++once ++nested echo "Foo" | echo "Bar" + +autocmd! foogroup BufRead *.txt +autocmd! BufRead *.txt +autocmd! foogroup User FooEvent +autocmd! User FooEvent + +autocmd! foogroup * *.txt +autocmd! * *.txt + +autocmd! foogroup BufRead +autocmd! BufRead +autocmd! foogroup User FooEvent +autocmd! User FooEvent + +autocmd! foogroup +autocmd! + +" command -> bang -> group "!foogroup!" +autocmd!!foogroup! +" command -> bang -> group "foogroup" +autocmd!foogroup +" command -> bang -> event +autocmd!BufRead +" command -> bang -> user event +autocmd!User FooEvent + +" FIXME: "*" and "BufRead" are valid group names, however, :help :augroup +" explicitly directs the user NOT to shadow event names +" command -> group "*" -> event glob -> pattern +autocmd!* * *.txt +" command -> group "BufRead" -> event "BufRead" -> pattern +autocmd!BufRead BufRead *.txt + + +" List + +autocmd foogroup BufRead *.txt +autocmd BufRead *.txt + +autocmd foogroup * *.txt +autocmd * *.txt + +autocmd foogroup BufRead +autocmd BufRead +autocmd foogroup User FooEvent +autocmd User FooEvent + +autocmd foogroup +autocmd + + +" :doautoall + +doautoall BufRead + +doautoall BufRead *.txt +doautoall foogroup BufRead +doautoall BufRead + +doautoall foogroup BufRead *.txt + +doautoall User FooEvent +doautoall foogroup User FooEvent +doautoall User FooEvent + +doautoall foogroup User FooEvent + +doautoall foogroup BufRead *.txt | echo "Foo" +doautoall foogroup BufRead *.txt " comment + + +" :doautocmd + +doautocmd BufRead + +doautocmd BufRead *.txt +doautocmd foogroup BufRead +doautocmd BufRead + +doautocmd foogroup BufRead *.txt + +doautocmd User FooEvent +doautocmd User FooEvent,BarEvent +doautocmd foogroup User FooEvent +doautocmd User FooEvent + +doautocmd foogroup User FooEvent + +doautocmd foogroup BufRead *.txt | echo "Foo" +doautocmd foogroup BufRead *.txt | " comment + + +" patterns + +au BufRead */*.txt + +au BufRead */*.* +au BufRead */*.??? +au BufRead */*.[t][x]t + +au BufRead */*.[a-z][a-z]t +au BufRead */*.[[:alpha:][:alpha:]]t + +au BufRead */*.[tx]\\\{2\}t +au BufRead */*.[a-z]\\\{2\}t +au BufRead */*.[[:alpha:]]\\\{2\}t +au BufRead */*.[^[:punct:]]\\\{2\}t + +au BufRead */*.[]]xt +au BufRead */*.[^]]xt + +au BufRead */*.[t\]]xt +au BufRead */*.[^t\]]xt + +au BufRead */*.[[]xt +au BufRead */*.[^[]xt + +au BufRead */*.[-]xt +au BufRead */*.[^-]xt + +au BufRead */*.[-t-]xt +au BufRead */*.[^-t-]xt + +au BufRead */*.[\^]xt +au BufRead */*.[^^]xt + +au BufRead */*.txt,*/*.vim +au BufRead */*.{txt,vim} +au BufRead */*.{t{x,t},v{i,m}} + +" literal +au BufRead */*.[]xt +au BufRead */*.[\]xt +au BufRead */*.[^]xt +au BufRead */*.[^\]xt + diff --git a/runtime/syntax/testdir/input/vim_ex_command.vim b/runtime/syntax/testdir/input/vim_ex_command.vim index 0873648cb6..8342b68de2 100644 --- a/runtime/syntax/testdir/input/vim_ex_command.vim +++ b/runtime/syntax/testdir/input/vim_ex_command.vim @@ -1,4 +1,6 @@ " Vim :command, :delcommand and :comclear commands +" VIM_TEST_SETUP highlight link vimUserCmdName Todo +" VIM_TEST_SETUP highlight link vimDelcommandName Todo " list @@ -6,10 +8,12 @@ command command F + " define command Foo echo "Foo" command! Foo echo "Foo" + command! Foo echo "Foo" | echo "Bar" command! Foo { @@ -18,11 +22,27 @@ command! Foo { echo "Baz" } +command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo echo "Foo" + command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo \ echo "Foo" -command! -complete=custom,Completer1 Foo echo "Foo" -command! -complete=customlist,Completer2 Foo echo "Foo" +command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register + \ Foo + \ echo "Foo" + +command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register Foo + "\ comment + \ echo "Foo" + +command! -addr=arguments -bang -bar -buffer -complete=arglist -count=1 -keepscript -nargs=* -range=% -register + "\ comment + \ Foo + "\ comment + \ echo "Foo" + +command! -complete=custom,s:Completer1 Foo echo "Foo" +command! -complete=customlist,s:Completer2 Foo echo "Foo" function Foo() command! Foo echo "Foo (defined in :function)" @@ -32,43 +52,112 @@ def Foo2() command! Foo echo "Foo (defined in :def)" enddef + " multiline define -" command! -" \ -addr=lines -" \ -bang -" \ -bar -" \ -buffer -" \ -complete=buffer -" \ -count -" \ -nargs=* -" \ -range -" \ -register -" \ -keepscript -" \ Foo -" \ echo "FOO" +command! -addr=lines + \ -bang + \ -bar + \ -buffer + \ -complete=buffer + \ -count + \ -nargs=* + \ -range + \ -register + \ -keepscript + \ Foo + \ echo "Foo" | + \ echo "Bar" + +command! + \ -addr=lines + \ -bang + \ -bar + \ -buffer + \ -complete=buffer + \ -count + \ -nargs=* + \ -range + \ -register + \ -keepscript + \ Foo + \ echo "Foo" | + \ echo "Bar" + +command! + "\ comment + \ -addr=lines + \ -bang + "\ comment + "\ comment + \ -bar + \ -buffer + "\ comment + \ -complete=buffer + "\ comment + \ -count + "\ comment + \ -nargs=* + "\ comment + \ -range + "\ comment + \ -register + "\ comment + \ -keepscript + "\ comment + \ Foo + "\ comment + \ echo "Foo" | + "\ comment + \ echo "Bar" + " errors command! -badattr=arguments -bang -badattr -nargs=* Foo echo "Foo" + " delete delcommand Foo delcommand -buffer Foo -delcommand Foo | echo "..." -delcommand -buffer Foo | echo "..." +delcommand Foo | echo "Foo" +delcommand -buffer Foo | echo "Foo" delcommand Foo " comment delcommand -buffer Foo " comment comclear comclear " comment -comclear | echo "..." +comclear | echo "Foo" -" Issue #14135 +" Issue #14135 (vim.vim syntax highlighting broken wrt system()) com Foo call system('ls') + +" Issue #17001 (Wrong vimUserCmdAttrError highlighting in vim.vim) + +command! -bang -nargs=* -complete=file Make AsyncRun -program=make @ + + +" Issue #17326 (syntax highlighting breaks with complex :s comamnd) + +command -range=% -nargs=? -bang Tb { + if "" == "!" + :,s/\v"[^"]*"/\=substitute(submatch(0), " ", "•", "g")/ge + endif + if "" == "" + :,!column -t + else + :,!column -t -s'' + endif + if "" == "!" + :,s/•/ /ge + endif +} + +command -range=% -nargs=? -bang Tb :,s/\v"[^"]*"/\=substitute(submatch(0), " ", "•", "g")/ge + diff --git a/runtime/syntax/testdir/input/vim_ex_command_modifiers.vim b/runtime/syntax/testdir/input/vim_ex_command_modifiers.vim new file mode 100644 index 0000000000..22fafb0db5 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_command_modifiers.vim @@ -0,0 +1,135 @@ +" Vim ex command modifiers + + + aboveleft echo "Foo" + +aboveleft echo "Foo" +belowright echo "Foo" +botright echo "Foo" +browse echo "Foo" +confirm echo "Foo" +filter /pattern/ echo "Foo" +filter! /pattern/ echo "Foo" +hide echo "Foo" +horizontal echo "Foo" +keepalt echo "Foo" +keepjumps echo "Foo" +keepmarks echo "Foo" +keeppatterns echo "Foo" +leftabove echo "Foo" +legacy echo "Foo" +lockmarks echo "Foo" +noautocmd echo "Foo" +noswapfile echo "Foo" +rightbelow echo "Foo" +sandbox echo "Foo" +silent echo "Foo" +silent! echo "Foo" +tab echo "Foo" +topleft echo "Foo" +unsilent echo "Foo" +verbose echo "Foo" +vertical echo "Foo" +vim9cmd echo "Foo" + + +: aboveleft echo "Foo" + " FIXME: not a ternary operator ':' + : aboveleft echo "Foo" + :aboveleft echo "Foo" + +:aboveleft echo "Foo" +:belowright echo "Foo" +:botright echo "Foo" +:browse echo "Foo" +:confirm echo "Foo" +:filter /pattern/ echo "Foo" +:filter! /pattern/ echo "Foo" +:hide echo "Foo" +:horizontal echo "Foo" +:keepalt echo "Foo" +:keepjumps echo "Foo" +:keepmarks echo "Foo" +:keeppatterns echo "Foo" +:leftabove echo "Foo" +:legacy echo "Foo" +:lockmarks echo "Foo" +:noautocmd echo "Foo" +:noswapfile echo "Foo" +:rightbelow echo "Foo" +:sandbox echo "Foo" +:silent echo "Foo" +:silent! echo "Foo" +:tab echo "Foo" +:topleft echo "Foo" +:unsilent echo "Foo" +:verbose echo "Foo" +:vertical echo "Foo" +:vim9cmd echo "Foo" + + +echo|aboveleft echo "Foo" +echo| aboveleft echo "Foo" +echo |aboveleft echo "Foo" + +echo | aboveleft echo "Foo" +echo | belowright echo "Foo" +echo | botright echo "Foo" +echo | browse echo "Foo" +echo | confirm echo "Foo" +echo | filter /pattern/ echo "Foo" +echo | filter! /pattern/ echo "Foo" +echo | hide echo "Foo" +echo | horizontal echo "Foo" +echo | keepalt echo "Foo" +echo | keepjumps echo "Foo" +echo | keepmarks echo "Foo" +echo | keeppatterns echo "Foo" +echo | leftabove echo "Foo" +echo | legacy echo "Foo" +echo | lockmarks echo "Foo" +echo | noautocmd echo "Foo" +echo | noswapfile echo "Foo" +echo | rightbelow echo "Foo" +echo | sandbox echo "Foo" +echo | silent echo "Foo" +echo | silent! echo "Foo" +echo | tab echo "Foo" +echo | topleft echo "Foo" +echo | unsilent echo "Foo" +echo | verbose echo "Foo" +echo | vertical echo "Foo" +echo | vim9cmd echo "Foo" + + +aboveleft belowright botright browse confirm filter /pattern/ filter! /pattern/ hide horizontal keepalt keepjumps keepmarks keeppatterns leftabove legacy lockmarks noautocmd noswapfile rightbelow sandbox silent silent! tab topleft unsilent verbose vertical vim9cmd echo "Foo" +aboveleft + \ belowright + \ botright + \ browse + \ confirm + \ filter /pattern/ + \ filter! /pattern/ + \ hide + \ horizontal + \ keepalt + \ keepjumps + \ keepmarks + \ keeppatterns + \ leftabove + \ legacy + \ lockmarks + \ noautocmd + \ noswapfile + \ rightbelow + \ sandbox + \ silent + \ silent! + \ tab + \ topleft + \ unsilent + \ verbose + \ vertical + \ vim9cmd + \ echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_commands.vim b/runtime/syntax/testdir/input/vim_ex_commands.vim index 9fa1458ccd..3098606b11 100644 --- a/runtime/syntax/testdir/input/vim_ex_commands.vim +++ b/runtime/syntax/testdir/input/vim_ex_commands.vim @@ -13,8 +13,6 @@ : help : help # FIXME -:2match -:3match :append text . @@ -540,6 +538,7 @@ :unabbreviate :unabbreviate :unhide +:uniq :unlet :unlockvar :unmap @@ -597,8 +596,6 @@ call Foo() | help call Foo() |help call Foo()| help -call Foo() | 2match -call Foo() | 3match " FIXME call Foo() | append text @@ -1126,6 +1123,7 @@ call Foo() | undolist call Foo() | unabbreviate call Foo() | unabbreviate call Foo() | unhide +call Foo() | uniq call Foo() | unlet call Foo() | unlockvar call Foo() | unmap diff --git a/runtime/syntax/testdir/input/vim_ex_def.vim b/runtime/syntax/testdir/input/vim_ex_def.vim index d379d8f450..819a1ada2c 100644 --- a/runtime/syntax/testdir/input/vim_ex_def.vim +++ b/runtime/syntax/testdir/input/vim_ex_def.vim @@ -99,7 +99,7 @@ def Foo( z: string = "zed") enddef -" Issue #16243 (vimscript def parameters syntax highlight is wrong) +" Issue #16243 (Vim script def parameters syntax highlight is wrong) def Test(lines: list = [line('.'), line('.')]): void enddef diff --git a/runtime/syntax/testdir/input/vim_ex_delfunction.vim b/runtime/syntax/testdir/input/vim_ex_delfunction.vim new file mode 100644 index 0000000000..18ecd48f40 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_delfunction.vim @@ -0,0 +1,34 @@ +" Vim :delfunction command + + +delfunction Foo +delfunction Foo +delfunction foo.bar +delfunction g:foo.bar +delfunction s:foo.bar +delfunction foo#bar +delfunction g:foo#bar +delfunction foo#bar.baz +delfunction g:foo#bar.baz + + +delfunction! Foo +delfunction! Foo +delfunction! foo.bar +delfunction! g:foo.bar +delfunction! s:foo.bar +delfunction! foo#bar +delfunction! g:foo#bar +delfunction! foo#bar.baz +delfunction! g:foo#bar.baz + + +delfunction Foo | echo "Foo" +delfunction Foo " comment + + +" Issue https://github.com/vim/vim/pull/17420#issuecomment-2927798687 +" (arg named /fu%\[nction]/) + +silent! delfunc! func + diff --git a/runtime/syntax/testdir/input/vim_ex_echo.vim b/runtime/syntax/testdir/input/vim_ex_echo.vim index df2bf5c97d..bebd28229d 100644 --- a/runtime/syntax/testdir/input/vim_ex_echo.vim +++ b/runtime/syntax/testdir/input/vim_ex_echo.vim @@ -1,5 +1,6 @@ " Vim :echo commands + echo "Answer = " 42 echon "Answer = " 42 echomsg "Answer = " 42 @@ -7,10 +8,25 @@ echowindow "Answer = " 42 echoerr "Answer = " 42 echoconsole "Answer = " 42 -echo "following command is :|" | | + +" trailing bar vs OR operator + +" OR operator +echo foo || bar +echo foo || + \ bar + +" following command is :| +echo "Foo" | | + +" invalid expression +echo "Foo" || echohl WarningMsg | echo "Don't panic!" | echohl None + +" line continuations + echo "Answer = " "\ comment \ 42 @@ -20,11 +36,14 @@ echo "\ comment \ 42 + +" trailing bar and comments + " :echo without {expr} echo| echo "Foo" " trailing comment needs | -echo "foo" | " comment +echo "Foo" | " comment " Issue #9987 (parenthesised argument - not a function call) @@ -36,3 +55,4 @@ if 123 else echo 'bar' endif + diff --git a/runtime/syntax/testdir/input/vim_ex_eval.vim b/runtime/syntax/testdir/input/vim_ex_eval.vim new file mode 100644 index 0000000000..ea9d314b49 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_eval.vim @@ -0,0 +1,14 @@ +" Vim :eval command + + +eval "Foo"->append(0) + +eval "Foo" + \ ->append( + \ 0 + \ ) + +eval "Foo"->append(0) | echo "Foo" + +echo "Foo" | eval "Foo"->append(0) + diff --git a/runtime/syntax/testdir/input/vim_ex_execute.vim b/runtime/syntax/testdir/input/vim_ex_execute.vim index 2ec507e1c1..0346781bf3 100644 --- a/runtime/syntax/testdir/input/vim_ex_execute.vim +++ b/runtime/syntax/testdir/input/vim_ex_execute.vim @@ -1,5 +1,6 @@ " Vim :execute command + " :help :execute execute "buffer" nextbuf @@ -15,8 +16,22 @@ if 0 endif execute 'while i < 5 | echo i | let i = i + 1 | endwhile' + +" trailing bar vs OR operator + +" OR operator +execute foo || bar ? "Foo" : "NotFoo" +execute foo || + \ bar ? "Foo" : "NotFoo" + " following command is :|" -execute "call Foo()" | | +execute "Foo" | | + +" invalid expression +execute "Foo" || + + +" line continuations execute "call" "\ comment @@ -27,15 +42,18 @@ execute "\ comment \ "Foo()" + +" trailing bar and comments + " :execute without {expr} execute| echo "Foo" " trailing comment needs | -execute "foo" | " comment +execute "Foo" | " comment " Issue #9987 (parenthesised argument - not a function call) -" FIXME: execute is ex command not builtin function let foo = {'arg': "call Foo()"} execute (foo.arg) + diff --git a/runtime/syntax/testdir/input/vim_ex_filetype.vim b/runtime/syntax/testdir/input/vim_ex_filetype.vim new file mode 100644 index 0000000000..8dd153c522 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_filetype.vim @@ -0,0 +1,30 @@ +" Vim :filetype command + + +filetype +filetype on +filetype off +filetype plugin on +filetype plugin off +filetype indent on +filetype indent off +filetype plugin indent on +filetype plugin indent off + +filetype | echo "Foo" +filetype " comment + +function Foo() + filetype + filetype on + filetype off + filetype plugin on + filetype plugin off + filetype indent on + filetype indent off + filetype plugin indent on + filetype plugin indent off + filetype | echo "Foo" + filetype " comment +endfunction + diff --git a/runtime/syntax/testdir/input/vim_ex_filter.vim b/runtime/syntax/testdir/input/vim_ex_filter.vim new file mode 100644 index 0000000000..0c8947f1d7 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_filter.vim @@ -0,0 +1,16 @@ +" Vim :filter command +" VIM_TEST_SETUP highlight link vimCmdSep Operator + + +filter pa\%(tt\)ern oldfiles +filter! pa\%(tt\)ern oldfiles + +filter /pa\%(tt\)ern/ oldfiles +filter! /pa\%(tt\)ern/ oldfiles + +filter !pa\%(tt\)ern! oldfiles +filter! !pa\%(tt\)ern! oldfiles + +filter /pa\%(t|t\)ern/ oldfiles | echo "Foo" +filter! /pa\%(t|t\)ern/ oldfiles | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_function.vim b/runtime/syntax/testdir/input/vim_ex_function.vim index c09019e087..cf070139d0 100644 --- a/runtime/syntax/testdir/input/vim_ex_function.vim +++ b/runtime/syntax/testdir/input/vim_ex_function.vim @@ -64,10 +64,48 @@ function Foo() return 42 endfunction +function b:dict.Foo() + return 42 +endfunction + +function w:dict.Foo() + return 42 +endfunction + +function t:dict.Foo() + return 42 +endfunction + +function g:dict.Foo() + return 42 +endfunction + +function s:dict.Foo() + return 42 +endfunction + +function v:dict.Foo() + return 42 +endfunction + +function Foo(arg) + let l:dict = {} + function l:dict.BAR() + return 42 + endfunction + function a:arg.BAR() + return 42 + endfunction +endfunction + function foo#bar#Foo() return 42 endfunction +function g:foo#bar#Foo() + return 42 +endfunction + " same name as an Ex command function s:ls() endfunction @@ -152,6 +190,14 @@ function Foo( return 42 endfunction +function Foo( + x, + y, + z, + ...) + return 42 +endfunction + function Foo(x, y = 42, z = "zed") return 42 endfunction @@ -163,6 +209,13 @@ function Foo( return 42 endfunction +function Foo( + x, + y = 42, + z = "zed") + return 42 +endfunction + " arguments @@ -177,7 +230,7 @@ function Foo(...) endfunction -" Issue #16243 (vimscript def parameters syntax highlight is wrong) +" Issue #16243 (Vim script def parameters syntax highlight is wrong) function Test(lines = [line('.'), line('.')]) endfunction @@ -204,10 +257,10 @@ echo "Foo" | function Foo() endfunction -" delete function - -delfunction Foo -delfunction foo.bar -delfunction! Foo -delfunction foo.bar +" Issue https://github.com/vim/vim/pull/17420#issuecomment-2927798687 +" (function named /s:fu%\[nction]/) + +func! s:func(_, func) + return a:func +endfunc diff --git a/runtime/syntax/testdir/input/vim_ex_function_fold.vim b/runtime/syntax/testdir/input/vim_ex_function_fold.vim index 1be9c2582f..37a8fa4439 100644 --- a/runtime/syntax/testdir/input/vim_ex_function_fold.vim +++ b/runtime/syntax/testdir/input/vim_ex_function_fold.vim @@ -66,10 +66,48 @@ function Foo() return 42 endfunction +function b:dict.Foo() + return 42 +endfunction + +function w:dict.Foo() + return 42 +endfunction + +function t:dict.Foo() + return 42 +endfunction + +function g:dict.Foo() + return 42 +endfunction + +function s:dict.Foo() + return 42 +endfunction + +function v:dict.Foo() + return 42 +endfunction + +function Foo(arg) + let l:dict = {} + function l:dict.BAR() + return 42 + endfunction + function a:arg.BAR() + return 42 + endfunction +endfunction + function foo#bar#Foo() return 42 endfunction +function g:foo#bar#Foo() + return 42 +endfunction + " same name as an Ex command function s:ls() endfunction @@ -154,6 +192,14 @@ function Foo( return 42 endfunction +function Foo( + x, + y, + z, + ...) + return 42 +endfunction + function Foo(x, y = 42, z = "zed") return 42 endfunction @@ -165,6 +211,13 @@ function Foo( return 42 endfunction +function Foo( + x, + y = 42, + z = "zed") + return 42 +endfunction + " arguments @@ -179,6 +232,12 @@ function Foo(...) endfunction +" Issue #16243 (Vim script def parameters syntax highlight is wrong) + +function Test(lines = [line('.'), line('.')]) +endfunction + + " comments function Foo() @@ -200,12 +259,12 @@ echo "Foo" | function Foo() endfunction -" delete function - -delfunction Foo -delfunction foo.bar -delfunction! Foo -delfunction foo.bar +" Issue https://github.com/vim/vim/pull/17420#issuecomment-2927798687 +" (function named /s:fu%\[nction]/) + +func! s:func(_, func) + return a:func +endfunc " fold-region ending diff --git a/runtime/syntax/testdir/input/vim_ex_grep.vim b/runtime/syntax/testdir/input/vim_ex_grep.vim new file mode 100644 index 0000000000..234f2d9620 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_grep.vim @@ -0,0 +1,47 @@ +" Vim :*grep and :*grepadd commands +" VIM_TEST_SETUP hi link vimCmdSep Operator +" VIM_TEST_SETUP hi link vimGrepBarEscape Special + + +grep 'pat\|tern' foo.txt +lgrep 'pat\|tern' foo.txt + +grep! 'pat\|tern' foo.txt +lgrep! 'pat\|tern' foo.txt + +grepadd 'pat\|tern' foo.txt +lgrepadd 'pat\|tern' foo.txt + +grepadd! 'pat\|tern' foo.txt +lgrepadd! 'pat\|tern' foo.txt + + +" special filename characters + +grep 'pat\|tern' % +lgrep 'pat\|tern' % + +grep! 'pat\|tern' % +lgrep! 'pat\|tern' % + +grepadd! 'pat\|tern' % +lgrepadd! 'pat\|tern' % + +grepadd! 'pat\|tern' % +lgrepadd! 'pat\|tern' % + + +" trailing bar, no tail comment + +grep 'pat\|tern' foo.txt | echo "Foo" +lgrep 'pat\|tern' foo.txt | echo "Foo" + +grep! 'pat\|tern' foo.txt | echo "Foo" +lgrep! 'pat\|tern' foo.txt | echo "Foo" + +grepadd 'pat\|tern' foo.txt | echo "Foo" +lgrepadd 'pat\|tern' foo.txt | echo "Foo" + +grepadd! 'pat\|tern' foo.txt | echo "Foo" +lgrepadd! 'pat\|tern' foo.txt | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_helpgrep.vim b/runtime/syntax/testdir/input/vim_ex_helpgrep.vim new file mode 100644 index 0000000000..aeef4501d4 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_helpgrep.vim @@ -0,0 +1,11 @@ +" Vim :helpgrep command + + +helpgrep :help +helpgrep :help@en +helpgrep :h\%(elp\)\= + +lhelpgrep :help +lhelpgrep :help@en +lhelpgrep :h\%(elp\)\= + diff --git a/runtime/syntax/testdir/input/vim_ex_highlight.vim b/runtime/syntax/testdir/input/vim_ex_highlight.vim index e23968aa5c..51a618df44 100644 --- a/runtime/syntax/testdir/input/vim_ex_highlight.vim +++ b/runtime/syntax/testdir/input/vim_ex_highlight.vim @@ -1,31 +1,65 @@ " Vim :highlight command +" VIM_TEST_SETUP hi link vimHiGroup Todo + " list + highlight highlight Comment +highlight Conceal +highlight ErrorMsg +highlight Foo + " reset + highlight clear + " disable + highlight clear Comment +highlight clear Conceal +highlight clear ErrorMsg +highlight clear Foo + highlight Comment NONE +highlight Conceal NONE +highlight ErrorMsg NONE +highlight Foo NONE + " add/modify + highlight Comment cterm=underline +highlight Conceal cterm=underline +highlight ErrorMsg cterm=underline +highlight Foo cterm=underline + highlight default Comment term=bold +highlight default Conceal term=bold +highlight default ErrorMsg term=bold +highlight Foo ErrorMsg term=bold + " link + highlight link Foo Comment highlight! link Foo Comment highlight link Foo NONE highlight! link Foo NONE +highlight link Foo ErrorMsg +highlight! link Foo ErrorMsg + " default link + highlight default link Foo Comment highlight! default link Foo Comment highlight default link Foo NONE highlight! default link Foo NONE +highlight default link Foo ErrorMsg +highlight! default link Foo ErrorMsg " line continuation and command separator @@ -53,3 +87,22 @@ hi default link hi default link \ Foo \ Comment | echo "Foo" + + +" 'statusline' user groups + +highlight User1 ctermfg=black +highlight User2 ctermfg=darkblue +highlight User3 ctermfg=darkgreen +highlight User4 ctermfg=darkcyan +highlight User5 ctermfg=darkred +highlight User6 ctermfg=darkmagenta +highlight User7 ctermfg=darkyellow +highlight User8 ctermfg=lightgray +highlight User9 ctermfg=darkgray + + +" :terminal group + +hi Terminal ctermbg=red ctermfg=blue + diff --git a/runtime/syntax/testdir/input/vim_ex_import.vim b/runtime/syntax/testdir/input/vim_ex_import.vim new file mode 100644 index 0000000000..07df827b9e --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_import.vim @@ -0,0 +1,119 @@ +" Vim :import command +" VIM_TEST_SETUP hi link vimImportName Todo + + +import "foo.vim" +impor v:true ? "foo.vim" : "bar.vim" + +import v:true ? + \ "foo.vim" : + \ "bar.vim" + +import v:true + \ ? "foo.vim" + \ : "bar.vim" + +import v:true ? + "\ comment + \ "foo.vim" : + "\ comment + \ "bar.vim" + +import v:true + "\ comment + \ ? "foo.vim" + "\ comment + \ : "bar.vim" + +import "foo.vim" as bar +import v:true ? "foo.vim" : "bar.vim" as baz + +import v:true ? + \ "foo.vim" : + \ "bar.vim" + \ as baz + +import v:true + \ ? "foo.vim" + \ : "bar.vim" + \ as baz + +import v:true ? + "\ comment + \ "foo.vim" : + "\ comment + \ "bar.vim" + "\ comment + \ as baz + +import v:true + "\ comment + \ ? "foo.vim" + "\ comment + \ : "bar.vim" + "\ comment + \ as baz + +echo "Foo" | import "foo.vim" + + +" autoload + +import autoload "foo.vim" +import autoload v:true ? "foo.vim" : "bar.vim" + +import autoload v:true ? + \ "foo.vim" : + \ "bar.vim" + +import autoload v:true + \ ? "foo.vim" + \ : "bar.vim" + +import autoload v:true ? + "\ comment + \"foo.vim" : + "\ comment + \ "bar.vim" + +import autoload v:true + "\ comment + \ ? "foo.vim" + "\ comment + \ : "bar.vim" + +import autoload "foo.vim" as bar +import autoload v:true ? "foo.vim" : "bar.vim" as baz + +import autoload v:true ? + \ "foo.vim" : + \ "bar.vim" + \ as baz + +import autoload v:true + \ ? "foo.vim" + \ : "bar.vim" + \ as baz + +import autoload v:true ? + "\ comment + \ "foo.vim" : + "\ comment + \ "bar.vim" + "\ comment + \ as baz + +import autoload v:true + "\ comment + \ ? "foo.vim" + "\ comment + \ : "bar.vim" + "\ comment + \ as baz + + +" "as" keyword in expr + +let as = "modules/" +import v:true ? as .. "foo.vim" : as .. "bar.vim" as other + diff --git a/runtime/syntax/testdir/input/vim_ex_let_heredoc.vim b/runtime/syntax/testdir/input/vim_ex_let_heredoc.vim index 2f88f938ec..adc59e675f 100644 --- a/runtime/syntax/testdir/input/vim_ex_let_heredoc.vim +++ b/runtime/syntax/testdir/input/vim_ex_let_heredoc.vim @@ -13,6 +13,60 @@ line1 line2 END +let [foo, bar] =<< EOS +line1 +line2 +EOS + + let [foo, bar] =<< EOS +line1 +line2 +EOS + +let [foo, + \ bar] =<< EOS +line1 +line2 +EOS + + let [foo, + \ bar] =<< EOS +line1 +line2 +EOS + +let g:foo =<< END +line1 +line2 +END + + let g:foo =<< END +line1 +line2 +END + +let [g:foo, g:bar] =<< EOS +line1 +line2 +EOS + + let [g:foo, g:bar] =<< EOS +line1 +line2 +EOS + +let [g:foo, + \ g:bar] =<< EOS +line1 +line2 +EOS + + let [g:foo, + \ g:bar] =<< EOS +line1 +line2 +EOS + " trim diff --git a/runtime/syntax/testdir/input/vim_ex_lua.vim b/runtime/syntax/testdir/input/vim_ex_lua.vim new file mode 100644 index 0000000000..55d151e463 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_lua.vim @@ -0,0 +1,157 @@ +" Vim :lua, :luado and :luafile commands +" VIM_TEST_SETUP let g:vimsyn_embed = "l" +" VIM_TEST_SETUP let g:vimsyn_folding = "fl" +" VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax + + +lua << EOF +print("Lua script") +EOF + + lua << trim EOF + print("Lua script") + EOF + +lua << +print("Lua script") +. + + lua << trim + print("Lua script") + . + +function Foo() + lua << trim EOF + print("Lua script in :func") + EOF +endfunction | call Foo() + +def Bar() + lua << trim EOF + print("Lua script in :def") + EOF +enddef | call Bar() + +lua print("Lua statement") + "\ comment + \ print("Lua statement again") + +luado print("Lua statement") + "\ comment + \ print("Lua statement again") + +luafile foo.lua + + +" :mzscheme and :mzfile + +mzscheme << trim EOF + (display "MzScheme script") +EOF + +mzscheme (display "MzScheme statement") + "\ comment + \ (display "MzScheme statement again") + +mzfile foo.rkt + + +" :perl and :perldo + +perl << trim EOF + print("Perl script\n") +EOF + +perl print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + +perldo print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + + +" :python, :pydo and :pyfile + +python << trim EOF + print("Python script") +EOF + +python print("Python statement"); + "\ comment + \ print("Python statement again") + +pydo print("Python statement"); + "\ comment + \ print("Python statement again") + +pyfile foo.py + + +" :python3, :py3do and :py3file + +python3 << trim EOF + print("Python3 script") +EOF + +python3 print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3do print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3file foo.py + + +" :pythonx, :pyxdo and :pyxfile + +pythonx << trim EOF + print("PythonX script") +EOF + +pythonx print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxdo print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxfile foo.py + + +" :ruby, :rubydo and :rubyfile + +ruby << trim EOF + puts "Ruby script" +EOF + +ruby puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubydo puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubyfile foo.rb + + +" :tcl, :tcldo and :tclfile + +tcl << trim EOF + puts "TCL script" +EOF + +tcl puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tcldo puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tclfile foo.tcl + diff --git a/runtime/syntax/testdir/input/vim_ex_make.vim b/runtime/syntax/testdir/input/vim_ex_make.vim new file mode 100644 index 0000000000..7ce87f2e35 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_make.vim @@ -0,0 +1,38 @@ +" Vim :*make commands +" VIM_TEST_SETUP highlight link vimCmdSep Operator +" VIM_TEST_SETUP highlight link vimMakeBarEscape Special + + +make +lmake + +make! +lmake! + +make -options target +lmake -options target + +make! -options target +lmake! -options target + + +" special filename characters + +make % +lmake % + + +" trailing bar, no tail comment + +make tar\|get | echo "Foo" +lmake tar\|get | echo "Foo" + +make! tar\|get | echo "Foo" +lmake! tar\|get | echo "Foo" + +make | echo "Foo" +lmake | echo "Foo" + +make! | echo "Foo" +lmake! | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_mark.vim b/runtime/syntax/testdir/input/vim_ex_mark.vim new file mode 100644 index 0000000000..31df3b2684 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_mark.vim @@ -0,0 +1,215 @@ +" Vim :mark and :k commands +" :k not available in Vim9 +" VIM_TEST_SETUP hi link vimMarkArg Todo + + +mark ` +mark ' +mark a +mark A +mark k +mark K +mark z +mark Z +mark [ +mark ] +mark < +mark > + +:mark ` +:mark ' +:mark a +:mark A +:mark k +:mark K +:mark z +:mark Z +:mark [ +:mark ] +:mark < +:mark > + +call Foo() | mark ` +call Foo() | mark ' +call Foo() | mark a +call Foo() | mark A +call Foo() | mark k +call Foo() | mark K +call Foo() | mark z +call Foo() | mark Z +call Foo() | mark [ +call Foo() | mark ] +call Foo() | mark < +call Foo() | mark > + +call Foo() | :mark ` +call Foo() | :mark ' +call Foo() | :mark a +call Foo() | :mark A +call Foo() | :mark k +call Foo() | :mark K +call Foo() | :mark z +call Foo() | :mark Z +call Foo() | :mark [ +call Foo() | :mark ] +call Foo() | :mark < +call Foo() | :mark > + +k` +k' +ka +kA +kk +kK +kz +kZ +k[ +k] +k< +k> + +:k` +:k' +:ka +:kA +:kk +:kK +:kz +:kZ +:k[ +:k] +:k< +:k> + +call Foo() | k` +call Foo() | k' +call Foo() | ka +call Foo() | kA +call Foo() | kk +call Foo() | kK +call Foo() | kz +call Foo() | kZ +call Foo() | k[ +call Foo() | k] +call Foo() | k< +call Foo() | k> + +call Foo() | :k` +call Foo() | :k' +call Foo() | :ka +call Foo() | :kA +call Foo() | :kk +call Foo() | :kK +call Foo() | :kz +call Foo() | :kZ +call Foo() | :k[ +call Foo() | :k] +call Foo() | :k< +call Foo() | :k> + +k ` +k ' +k a +k A +k k +k K +k z +k Z +k [ +k ] +k < +k > + +:k ` +:k ' +:k a +:k A +:k k +:k K +:k z +:k Z +:k [ +:k ] +:k < +:k > + +call Foo() | k ` +call Foo() | k ' +call Foo() | k a +call Foo() | k A +call Foo() | k k +call Foo() | k K +call Foo() | k z +call Foo() | k Z +call Foo() | k [ +call Foo() | k ] +call Foo() | k < +call Foo() | k > + +call Foo() | :k ` +call Foo() | :k ' +call Foo() | :k a +call Foo() | :k A +call Foo() | :k k +call Foo() | :k K +call Foo() | :k z +call Foo() | :k Z +call Foo() | :k [ +call Foo() | :k ] +call Foo() | :k < +call Foo() | :k > + + +mark a | echo "FOO" +ka | echo "FOO" +k a | echo "FOO" +mark a " comment +ka " comment +k a " comment + + +function Foo() + k a + ka + mark a + :k a + :ka + :mark a +endfunction + + +" Errors + +mark " +mark ^ +mark . +" TODO: matches as vimFunc +" mark ( +mark ) +mark { +mark } +mark 0 +mark 9 + +k" +k^ +k. +" TODO: matches as vimFunc +" k( +k) +k{ +k} +k0 +k9 + +k " +k ^ +k . +" TODO: matches as vimFunc +" k ( +k ) +k { +k } +k 0 +k 9 + diff --git a/runtime/syntax/testdir/input/vim_ex_match.vim b/runtime/syntax/testdir/input/vim_ex_match.vim index 8d1462820c..473cfb366f 100644 --- a/runtime/syntax/testdir/input/vim_ex_match.vim +++ b/runtime/syntax/testdir/input/vim_ex_match.vim @@ -1,9 +1,14 @@ -" Vim :match, :2match and :3match commands +" Vim :match command + match FooGroup /Foo/ match match none +1match FooGroup /Foo/ +1match +1match none + 2match FooGroup /Foo/ 2match 2match none @@ -12,12 +17,24 @@ match none 3match 3match none +1 match FooGroup /Foo/ +2 match FooGroup /Foo/ +3 match FooGroup /Foo/ -" Differentiate map() from :map + +" Differentiate match() from :match call match(haystack, 'needle') call match (haystack, 'needle') +let foo = match(haystack, 'needle') +echo match(haystack, 'needle') +echo (match(haystack, 'needle') + 42) +echo (42 + match(haystack, 'needle')) + + +" Containing functions + function Foo() match FooGroup /Foo/ call match(haystack, 'needle') @@ -25,8 +42,23 @@ function Foo() endfunction def Foo() + # command match FooGroup /Foo/ - match(haystack, 'needle') # Error: bad :match command - trailing characters match (haystack, 'needle') + # function + match(haystack, 'needle') + call match(haystack, 'needle') enddef + + +" Trailing bar and comments + +match FooGroup /Foo/ | echo "Foo" +match | echo "Foo" +match none | echo "Foo" + +match FooGroup /Foo/ " comment +match " comment +match none " comment + diff --git a/runtime/syntax/testdir/input/vim_ex_mzscheme.vim b/runtime/syntax/testdir/input/vim_ex_mzscheme.vim new file mode 100644 index 0000000000..6844c49f76 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_mzscheme.vim @@ -0,0 +1,157 @@ +" Vim :mzscheme and :mzfile commands +" VIM_TEST_SETUP let g:vimsyn_embed = "m" +" VIM_TEST_SETUP let g:vimsyn_folding = "fm" +" VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax + + +lua << EOF +print("Lua script") +EOF + + lua << trim EOF + print("Lua script") + EOF + +lua << +print("Lua script") +. + + lua << trim + print("Lua script") + . + +function Foo() + lua << trim EOF + print("Lua script in :func") + EOF +endfunction | call Foo() + +def Bar() + lua << trim EOF + print("Lua script in :def") + EOF +enddef | call Bar() + +lua print("Lua statement") + "\ comment + \ print("Lua statement again") + +luado print("Lua statement") + "\ comment + \ print("Lua statement again") + +luafile foo.lua + + +" :mzscheme and :mzfile + +mzscheme << trim EOF + (display "MzScheme script") +EOF + +mzscheme (display "MzScheme statement") + "\ comment + \ (display "MzScheme statement again") + +mzfile foo.rkt + + +" :perl and :perldo + +perl << trim EOF + print("Perl script\n") +EOF + +perl print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + +perldo print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + + +" :python, :pydo and :pyfile + +python << trim EOF + print("Python script") +EOF + +python print("Python statement"); + "\ comment + \ print("Python statement again") + +pydo print("Python statement"); + "\ comment + \ print("Python statement again") + +pyfile foo.py + + +" :python3, :py3do and :py3file + +python3 << trim EOF + print("Python3 script") +EOF + +python3 print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3do print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3file foo.py + + +" :pythonx, :pyxdo and :pyxfile + +pythonx << trim EOF + print("PythonX script") +EOF + +pythonx print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxdo print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxfile foo.py + + +" :ruby, :rubydo and :rubyfile + +ruby << trim EOF + puts "Ruby script" +EOF + +ruby puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubydo puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubyfile foo.rb + + +" :tcl, :tcldo and :tclfile + +tcl << trim EOF + puts "TCL script" +EOF + +tcl puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tcldo puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tclfile foo.tcl + diff --git a/runtime/syntax/testdir/input/vim_ex_perl.vim b/runtime/syntax/testdir/input/vim_ex_perl.vim new file mode 100644 index 0000000000..cccab1892b --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_perl.vim @@ -0,0 +1,157 @@ +" Vim :perl and :perldo commands +" VIM_TEST_SETUP let g:vimsyn_embed = "p" +" VIM_TEST_SETUP let g:vimsyn_folding = "fp" +" VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax + + +lua << EOF +print("Lua script") +EOF + + lua << trim EOF + print("Lua script") + EOF + +lua << +print("Lua script") +. + + lua << trim + print("Lua script") + . + +function Foo() + lua << trim EOF + print("Lua script in :func") + EOF +endfunction | call Foo() + +def Bar() + lua << trim EOF + print("Lua script in :def") + EOF +enddef | call Bar() + +lua print("Lua statement") + "\ comment + \ print("Lua statement again") + +luado print("Lua statement") + "\ comment + \ print("Lua statement again") + +luafile foo.lua + + +" :mzscheme and :mzfile + +mzscheme << trim EOF + (display "MzScheme script") +EOF + +mzscheme (display "MzScheme statement") + "\ comment + \ (display "MzScheme statement again") + +mzfile foo.rkt + + +" :perl and :perldo + +perl << trim EOF + print("Perl script\n") +EOF + +perl print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + +perldo print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + + +" :python, :pydo and :pyfile + +python << trim EOF + print("Python script") +EOF + +python print("Python statement"); + "\ comment + \ print("Python statement again") + +pydo print("Python statement"); + "\ comment + \ print("Python statement again") + +pyfile foo.py + + +" :python3, :py3do and :py3file + +python3 << trim EOF + print("Python3 script") +EOF + +python3 print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3do print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3file foo.py + + +" :pythonx, :pyxdo and :pyxfile + +pythonx << trim EOF + print("PythonX script") +EOF + +pythonx print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxdo print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxfile foo.py + + +" :ruby, :rubydo and :rubyfile + +ruby << trim EOF + puts "Ruby script" +EOF + +ruby puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubydo puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubyfile foo.rb + + +" :tcl, :tcldo and :tclfile + +tcl << trim EOF + puts "TCL script" +EOF + +tcl puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tcldo puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tclfile foo.tcl + diff --git a/runtime/syntax/testdir/input/vim_ex_profile.vim b/runtime/syntax/testdir/input/vim_ex_profile.vim new file mode 100644 index 0000000000..b2ff571e27 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_profile.vim @@ -0,0 +1,48 @@ +" Vim :profile and :profdel commands + + +profile start /tmp/myprofile +profile stop +profile pause +profile continue +profile func MyFunc +profile file MyScript.vim +profile! file MyScript.vim +profile dump + +profdel func MyFunc +profdel file MyScript.vim +profdel here + + +" tail comment + +profile start /tmp/myprofile " comment +profile stop " comment +profile pause " comment +profile continue " comment +profile func MyFunc " comment +profile file MyScript.vim " comment +profile! file MyScript.vim " comment +profile dump " comment + +profdel func MyFunc " comment +profdel file MyScript.vim " comment +profdel here " comment + + +" trailing command + +profile start /tmp/myprofile | echo "Foo" +profile stop | echo "Foo" +profile pause | echo "Foo" +profile continue | echo "Foo" +profile func MyFunc | echo "Foo" +profile file MyScript.vim | echo "Foo" +profile! file MyScript.vim | echo "Foo" +profile dump | echo "Foo" + +profdel func MyFunc | echo "Foo" +profdel file MyScript.vim | echo "Foo" +profdel here | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_python.vim b/runtime/syntax/testdir/input/vim_ex_python.vim new file mode 100644 index 0000000000..8adc0e7ea7 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_python.vim @@ -0,0 +1,159 @@ +" Vim :python, :pydo and :pyfile commands +" Vim :python3, :py3do and :py3file commands +" Vim :pythonx, :pyxdo and :pyxfile commands +" VIM_TEST_SETUP let g:vimsyn_embed = "P" +" VIM_TEST_SETUP let g:vimsyn_folding = "fP" +" VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax + + +lua << EOF +print("Lua script") +EOF + + lua << trim EOF + print("Lua script") + EOF + +lua << +print("Lua script") +. + + lua << trim + print("Lua script") + . + +function Foo() + lua << trim EOF + print("Lua script in :func") + EOF +endfunction | call Foo() + +def Bar() + lua << trim EOF + print("Lua script in :def") + EOF +enddef | call Bar() + +lua print("Lua statement") + "\ comment + \ print("Lua statement again") + +luado print("Lua statement") + "\ comment + \ print("Lua statement again") + +luafile foo.lua + + +" :mzscheme and :mzfile + +mzscheme << trim EOF + (display "MzScheme script") +EOF + +mzscheme (display "MzScheme statement") + "\ comment + \ (display "MzScheme statement again") + +mzfile foo.rkt + + +" :perl and :perldo + +perl << trim EOF + print("Perl script\n") +EOF + +perl print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + +perldo print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + + +" :python, :pydo and :pyfile + +python << trim EOF + print("Python script") +EOF + +python print("Python statement"); + "\ comment + \ print("Python statement again") + +pydo print("Python statement"); + "\ comment + \ print("Python statement again") + +pyfile foo.py + + +" :python3, :py3do and :py3file + +python3 << trim EOF + print("Python3 script") +EOF + +python3 print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3do print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3file foo.py + + +" :pythonx, :pyxdo and :pyxfile + +pythonx << trim EOF + print("PythonX script") +EOF + +pythonx print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxdo print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxfile foo.py + + +" :ruby, :rubydo and :rubyfile + +ruby << trim EOF + puts "Ruby script" +EOF + +ruby puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubydo puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubyfile foo.rb + + +" :tcl, :tcldo and :tclfile + +tcl << trim EOF + puts "TCL script" +EOF + +tcl puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tcldo puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tclfile foo.tcl + diff --git a/runtime/syntax/testdir/input/vim_ex_range.vim b/runtime/syntax/testdir/input/vim_ex_range.vim index 3383702c2c..88e7ad4715 100644 --- a/runtime/syntax/testdir/input/vim_ex_range.vim +++ b/runtime/syntax/testdir/input/vim_ex_range.vim @@ -1,6 +1,90 @@ " Ex command ranges + '<,'>print '(,')print '{,'}print '[,']print + +:'<,'>print +:'(,')print +:'{,'}print +:'[,']print + +echo | '<,'>print +echo | '(,')print +echo | '{,'}print +echo | '[,']print + +" bare mark ranges + +'a +'k +'z +'A +'K +'Z +'0 +'9 +'[ +'] +'{ +'} +'( +') +'< +'> +'` +'' +'" +'^ +'. + + :'a +: 'a +:'a +:'k +:'z +:'A +:'K +:'Z +:'0 +:'9 +:'[ +:'] +:'{ +:'} +:'( +:') +:'< +:'> +:'` +:'' +:'" +:'^ +:'. + +echo |'a +echo| 'a +echo | 'a +echo | 'k +echo | 'z +echo | 'A +echo | 'K +echo | 'Z +echo | '0 +echo | '9 +echo | '[ +echo | '] +echo | '{ +echo | '} +echo | '( +echo | ') +echo | '< +echo | '> +echo | '` +echo | '' +echo | '" +echo | '^ +echo | '. + diff --git a/runtime/syntax/testdir/input/vim_ex_redir.vim b/runtime/syntax/testdir/input/vim_ex_redir.vim new file mode 100644 index 0000000000..1deb113fb5 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_redir.vim @@ -0,0 +1,46 @@ +" Vim :redir command + + +redir > filename +redir! > filename +redir > file name +redir! > file name + +redir >> filename +redir! >> filename +redir >> file name +redir! >> file name + +redir > filename " comment +redir > filename | echo "Foo" +redir > file name " comment +redir > file name | echo "Foo" + +redir >> filename " comment +redir >> filename | echo "Foo" +redir >> file name " comment +redir >> file name | echo "Foo" + +redir @a +redir @A + +redir @a> +redir @A> + +redir @a>> +redir @A>> + +redir @*> +redir @+> + +redir @*>> +redir @+>> + +redir @"> +redir @">> + +redir => var +redir =>> var + +redir END + diff --git a/runtime/syntax/testdir/input/vim_ex_ruby.vim b/runtime/syntax/testdir/input/vim_ex_ruby.vim new file mode 100644 index 0000000000..32a39de46b --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_ruby.vim @@ -0,0 +1,157 @@ +" Vim :ruby, :rubydo and :rubyfile commands +" VIM_TEST_SETUP let g:vimsyn_embed = "r" +" VIM_TEST_SETUP let g:vimsyn_folding = "fr" +" VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax + + +lua << EOF +print("Lua script") +EOF + + lua << trim EOF + print("Lua script") + EOF + +lua << +print("Lua script") +. + + lua << trim + print("Lua script") + . + +function Foo() + lua << trim EOF + print("Lua script in :func") + EOF +endfunction | call Foo() + +def Bar() + lua << trim EOF + print("Lua script in :def") + EOF +enddef | call Bar() + +lua print("Lua statement") + "\ comment + \ print("Lua statement again") + +luado print("Lua statement") + "\ comment + \ print("Lua statement again") + +luafile foo.lua + + +" :mzscheme and :mzfile + +mzscheme << trim EOF + (display "MzScheme script") +EOF + +mzscheme (display "MzScheme statement") + "\ comment + \ (display "MzScheme statement again") + +mzfile foo.rkt + + +" :perl and :perldo + +perl << trim EOF + print("Perl script\n") +EOF + +perl print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + +perldo print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + + +" :python, :pydo and :pyfile + +python << trim EOF + print("Python script") +EOF + +python print("Python statement"); + "\ comment + \ print("Python statement again") + +pydo print("Python statement"); + "\ comment + \ print("Python statement again") + +pyfile foo.py + + +" :python3, :py3do and :py3file + +python3 << trim EOF + print("Python3 script") +EOF + +python3 print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3do print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3file foo.py + + +" :pythonx, :pyxdo and :pyxfile + +pythonx << trim EOF + print("PythonX script") +EOF + +pythonx print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxdo print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxfile foo.py + + +" :ruby, :rubydo and :rubyfile + +ruby << trim EOF + puts "Ruby script" +EOF + +ruby puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubydo puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubyfile foo.rb + + +" :tcl, :tcldo and :tclfile + +tcl << trim EOF + puts "TCL script" +EOF + +tcl puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tcldo puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tclfile foo.tcl + diff --git a/runtime/syntax/testdir/input/vim_ex_set.vim b/runtime/syntax/testdir/input/vim_ex_set.vim index 0b1d0101a4..a27a965b4c 100644 --- a/runtime/syntax/testdir/input/vim_ex_set.vim +++ b/runtime/syntax/testdir/input/vim_ex_set.vim @@ -1,5 +1,6 @@ " Vim :set command + set set! set all @@ -37,13 +38,18 @@ set backspace-=nostop set ai nosi sw=3 tw=3 -set =^[Ot " FIXME -set =^[b " FIXME +set =^[Ot +set =^[b setlocal autoread setglobal noautoread set autoread< +set " comment +set | echo "Foo" +set! " comment +set! | echo "Foo" + " :help option-backslash @@ -93,7 +99,7 @@ set path= \abc,def -" CompilerSet +" :CompilerSet CompilerSet makeprg=ant CompilerSet errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m, @@ -111,3 +117,14 @@ echo "Foo" set quoteescape=\ echo "Foo" + +" Issue #16913 (vim syntax: set langmap may have wrong highlight) + +set langmap+=ФЫВАПРОЛДЖЭЁ;ASDFGHJKL\\:\\"\\| +set langmap+=ЯЧСМИТЬБЮ;ZXCVBNM<> + +set langmap+=ФЫВАПРОЛДЖЭЁ;ASDFGHJKL\\:\\"\\| + \ langmap+=ЯЧСМИТЬБЮ;ZXCVBNM<> + +set langmap+=ФЫВАПРОЛДЖЭЁ;ASDFGHJKL\\:\\"\\| langmap+=ЯЧСМИТЬБЮ;ZXCVBNM<> + diff --git a/runtime/syntax/testdir/input/vim_ex_set_backslash.vim b/runtime/syntax/testdir/input/vim_ex_set_backslash.vim new file mode 100644 index 0000000000..53851a7693 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_set_backslash.vim @@ -0,0 +1,79 @@ +" Vim :set command (escaped characters) +" VIM_TEST_SETUP hi link vimSetEscape DiffAdd +" VIM_TEST_SETUP hi link vimSetBarEscape DiffDelete +" VIM_TEST_SETUP hi link vimSetQuoteEscape DiffDelete +" VIM_TEST_SETUP hi link vimSetEqual DiffChange + + +echo "-- 1 --" +set titlestring=\afoo\abar\a " comment +echo &titlestring +set titlestring=\afoo\abar\a +echo &titlestring +set titlestring=\ foo\ bar\ " comment +echo &titlestring +set titlestring=\ foo\ bar\ +echo &titlestring +set titlestring=\|foo\|bar\| " comment +echo &titlestring +set titlestring=\|foo\|bar\| +echo &titlestring +set titlestring=\"foo\"bar\" " comment +echo &titlestring +set titlestring=\"foo\"bar\" +echo &titlestring + +echo "-- 2 --" +set titlestring=\\afoo\\abar\\a " comment +echo &titlestring +set titlestring=\\afoo\\abar\\a +echo &titlestring +set titlestring=\\ foo\\ bar\\ " comment +echo &titlestring +set titlestring=\\ foo\\ bar\\ +echo &titlestring +set titlestring=\\|foo\\|bar\\| " comment +echo &titlestring +set titlestring=\\|foo\\|bar\\| +echo &titlestring +set titlestring=\\"foo\\"bar\\" " comment +echo &titlestring +set titlestring=\\"foo\\"bar\\" +echo &titlestring + +echo "-- 3 --" +set titlestring=\\\afoo\\\abar\\\a " comment +echo &titlestring +set titlestring=\\\afoo\\\abar\\\a +echo &titlestring +set titlestring=\\\ foo\\\ bar\\\ " comment +echo &titlestring +set titlestring=\\\ foo\\\ bar\\\ +echo &titlestring +set titlestring=\\\|foo\\\|bar\\\| " comment +echo &titlestring +set titlestring=\\\|foo\\\|bar\\\| +echo &titlestring +set titlestring=\\\"foo\\\"bar\\\" " comment +echo &titlestring +set titlestring=\\\"foo\\\"bar\\\" +echo &titlestring + +echo "-- 4 --" +set titlestring=\\\\afoo\\\\abar\\\\a " comment +echo &titlestring +set titlestring=\\\\afoo\\\\abar\\\\a +echo &titlestring +set titlestring=\\\\ foo\\\\ bar\\\\ " comment +echo &titlestring +set titlestring=\\\\ foo\\\\ bar\\\\ +echo &titlestring +set titlestring=\\\\|foo\\\\|bar\\\\| " comment +echo &titlestring +set titlestring=\\\\|foo\\\\|bar\\\\| +echo &titlestring +set titlestring=\\\\"foo\\\\"bar\\\\" " comment +echo &titlestring +set titlestring=foo\\\\"\\\\"bar\\\\" +echo &titlestring + diff --git a/runtime/syntax/testdir/input/vim_ex_sort.vim b/runtime/syntax/testdir/input/vim_ex_sort.vim new file mode 100644 index 0000000000..97d030dfd3 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_sort.vim @@ -0,0 +1,64 @@ +" Vim :sort command +" VIM_TEST_SETUP hi link vimCmdSep Operator + + +sort +sort! + +sort ilu +sort! ilu + +sort /pa\%(tt\)ern/ ilu +sort! /pa\%(tt\)ern/ ilu + +sort /pa\%(tt\)ern/ rilu +sort! /pa\%(tt\)ern/ rilu + +sort ilu /pa\%(tt\)ern/ +sort! ilu /pa\%(tt\)ern/ + +sort rilu /pa\%(tt\)ern/ +sort! rilu /pa\%(tt\)ern/ + +sort nilu +sort! nilu +sort filu +sort! filu +sort xilu +sort! xilu +sort oilu +sort! oilu +sort bilu +sort! bilu + +sort /pa\%(tt\)ern/ nilu +sort! /pa\%(tt\)ern/ nilu +sort /pa\%(tt\)ern/ filu +sort! /pa\%(tt\)ern/ filu +sort /pa\%(tt\)ern/ xilu +sort! /pa\%(tt\)ern/ xilu +sort /pa\%(tt\)ern/ oilu +sort! /pa\%(tt\)ern/ oilu +sort /pa\%(tt\)ern/ bilu +sort! /pa\%(tt\)ern/ bilu + +sort /pa\%(tt\)ern/ rnilu +sort! /pa\%(tt\)ern/ rnilu +sort /pa\%(tt\)ern/ rfilu +sort! /pa\%(tt\)ern/ rfilu +sort /pa\%(tt\)ern/ rxilu +sort! /pa\%(tt\)ern/ rxilu +sort /pa\%(tt\)ern/ roilu +sort! /pa\%(tt\)ern/ roilu +sort /pa\%(tt\)ern/ rbilu +sort! /pa\%(tt\)ern/ rbilu + +sort | echo "Foo" +sort! | echo "Foo" + +sort /pa\%(t|t\)ern/ rilu | echo "Foo" +sort! /pa\%(t|t\)ern/ rilu | echo "Foo" + +sort rilu /pa\%(t|t\)ern/ | echo "Foo" +sort! rilu /pa\%(t|t\)ern/ | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_substitute.vim b/runtime/syntax/testdir/input/vim_ex_substitute.vim index 021060a0c8..983b39d044 100644 --- a/runtime/syntax/testdir/input/vim_ex_substitute.vim +++ b/runtime/syntax/testdir/input/vim_ex_substitute.vim @@ -1,3 +1,6 @@ +" Vim :substitute command + + substitute/foo/bar/& substitute/foo/bar/cegiInp#lr @@ -37,6 +40,7 @@ def Foo() let bar = str->substitute(str, pat, sub, flags) enddef + " various delimiters s!/!//! " comment @@ -111,6 +115,67 @@ s//{string}/ s //{string}/ +" Repeat commands + +s +:s +s 42 +:s 42 +s42 +:s42 + +s cegiInp#lr +:s cegiInp#lr +s cegiInp#lr42 +:s cegiInp#lr42 +s cegiInp#lr 42 +:s cegiInp#lr 42 + +sg +:sg +sgi +:sgi +sg 42 +:sg 42 +sgi 42 +:sgi 42 +sg42 +:sg42 +sgi42 +:sgi42 + +" FIXME +& +&& +~ +~& + +" FIXME +&cegiInp#lr +&&cegiInp#lr +~cegiInp#lr +~&cegiInp#lr + +" 2 and 3 letter repeat-previous variants + +:sc | :sce | :scg | :sci | :scI | :scn | :scp | :scl | +:sgc | :sge | :sg | :sgi | :sgI | :sgn | :sgp | :sgl | :sgr +:sic | :sie | | :si | :siI | :sin | :sip | | :sir +:sIc | :sIe | :sIg | :sIi | :sI | :sIn | :sIp | :sIl | :sIr +:src | | :srg | :sri | :srI | :srn | :srp | :srl | :sr + + +" exceptions +:scr " is `:scriptnames` +:se " is `:set` +:sig " is `:sign` +:sil " is `:silent` +:sn " is `:snext` +:sp " is `:split` +:sl " is `:sleep` +:sre " is `:srewind` + + " Vi compatibility s\/{string}/ @@ -124,7 +189,6 @@ s \&{string}& " Trailing comment and bar -" FIXME: trailing comment, no whitespace s" comment s| echo "Foo" diff --git a/runtime/syntax/testdir/input/vim_ex_tcl.vim b/runtime/syntax/testdir/input/vim_ex_tcl.vim new file mode 100644 index 0000000000..2558bb8b97 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_tcl.vim @@ -0,0 +1,157 @@ +" Vim :tcl, :tcldo and :tclfile commands +" VIM_TEST_SETUP let g:vimsyn_embed = "t" +" VIM_TEST_SETUP let g:vimsyn_folding = "ft" +" VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax + + +lua << EOF +print("Lua script") +EOF + + lua << trim EOF + print("Lua script") + EOF + +lua << +print("Lua script") +. + + lua << trim + print("Lua script") + . + +function Foo() + lua << trim EOF + print("Lua script in :func") + EOF +endfunction | call Foo() + +def Bar() + lua << trim EOF + print("Lua script in :def") + EOF +enddef | call Bar() + +lua print("Lua statement") + "\ comment + \ print("Lua statement again") + +luado print("Lua statement") + "\ comment + \ print("Lua statement again") + +luafile foo.lua + + +" :mzscheme and :mzfile + +mzscheme << trim EOF + (display "MzScheme script") +EOF + +mzscheme (display "MzScheme statement") + "\ comment + \ (display "MzScheme statement again") + +mzfile foo.rkt + + +" :perl and :perldo + +perl << trim EOF + print("Perl script\n") +EOF + +perl print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + +perldo print("Perl statement\n"); + "\ comment + \ print("Perl statement again\n") + + +" :python, :pydo and :pyfile + +python << trim EOF + print("Python script") +EOF + +python print("Python statement"); + "\ comment + \ print("Python statement again") + +pydo print("Python statement"); + "\ comment + \ print("Python statement again") + +pyfile foo.py + + +" :python3, :py3do and :py3file + +python3 << trim EOF + print("Python3 script") +EOF + +python3 print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3do print("Python3 statement"); + "\ comment + \ print("Python3 statement") + +py3file foo.py + + +" :pythonx, :pyxdo and :pyxfile + +pythonx << trim EOF + print("PythonX script") +EOF + +pythonx print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxdo print("PythonX statement"); + "\ comment + \ print("PythonX statement") + +pyxfile foo.py + + +" :ruby, :rubydo and :rubyfile + +ruby << trim EOF + puts "Ruby script" +EOF + +ruby puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubydo puts "Ruby statement"; + "\ comment + \ puts "Ruby statement again" + +rubyfile foo.rb + + +" :tcl, :tcldo and :tclfile + +tcl << trim EOF + puts "TCL script" +EOF + +tcl puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tcldo puts "TCL statement"; + "\ comment + \ puts "TCL statement again" + +tclfile foo.tcl + diff --git a/runtime/syntax/testdir/input/vim_ex_uniq.vim b/runtime/syntax/testdir/input/vim_ex_uniq.vim new file mode 100644 index 0000000000..d7aacc2b2e --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_uniq.vim @@ -0,0 +1,31 @@ +" Vim :uniq command +" VIM_TEST_SETUP hi link vimCmdSep Operator + + +uniq +uniq! + +uniq ilu +uniq! ilu + +uniq /pa\%(tt\)ern/ ilu +uniq! /pa\%(tt\)ern/ ilu + +uniq /pa\%(tt\)ern/ rilu +uniq! /pa\%(tt\)ern/ rilu + +uniq ilu /pa\%(tt\)ern/ +uniq! ilu /pa\%(tt\)ern/ + +uniq rilu /pa\%(tt\)ern/ +uniq! rilu /pa\%(tt\)ern/ + +uniq | echo "Foo" +uniq! | echo "Foo" + +uniq /pa\%(t|t\)ern/ rilu | echo "Foo" +uniq! /pa\%(t|t\)ern/ rilu | echo "Foo" + +uniq rilu /pa\%(t|t\)ern/ | echo "Foo" +uniq! rilu /pa\%(t|t\)ern/ | echo "Foo" + diff --git a/runtime/syntax/testdir/input/vim_ex_vimgrep.vim b/runtime/syntax/testdir/input/vim_ex_vimgrep.vim new file mode 100644 index 0000000000..97b9b86f7d --- /dev/null +++ b/runtime/syntax/testdir/input/vim_ex_vimgrep.vim @@ -0,0 +1,69 @@ +" Vim :*vimgrep and :*vimgrepadd commands +" VIM_TEST_SETUP highlight link vimVimgrepFile Todo +" VIM_TEST_SETUP highlight link vimCmdSep Operator +" VIM_TEST_SETUP highlight link vimVimgrepBarEscape Special + + +vimgrep pa\%(tt\)ern foo.txt +vimgrep /pa\%(tt\)ern/ foo.txt + +vimgrep! pa\%(tt\)ern foo.txt +vimgrep! /pa\%(tt\)ern/ foo.txt + +vimgrep /pa\%(tt\)ern/gjf foo.txt + +" trailing bar, no tail comment +vimgrep /pa\%(t|t\)ern/ b\|a\|r.txt | echo "Foo" +vimgrep /pa\%(t"t\)ern/ b"a"r.txt | echo "Foo" + +vimgrepadd pa\%(tt\)ern foo.txt +vimgrepadd /pa\%(tt\)ern/ foo.txt + +vimgrepadd! pa\%(tt\)ern foo.txt +vimgrepadd! /pa\%(tt\)ern/ foo.txt + +vimgrepadd /pa\%(tt\)ern/gjf foo.txt + +" trailing bar, no tail comment +vimgrepadd /pa\%(t|t\)ern/ b\|a\|r.txt | echo "Foo" +vimgrepadd /pa\%(t"t\)ern/ b"a"r.txt | echo "Foo" + +lvimgrep pa\%(tt\)ern foo.txt +lvimgrep /pa\%(tt\)ern/ foo.txt + +lvimgrep! pa\%(tt\)ern foo.txt +lvimgrep! /pa\%(tt\)ern/ foo.txt + +lvimgrep /pa\%(tt\)ern/gjf foo.txt + +" trailing bar, no tail comment +lvimgrep /pa\%(t|t\)ern/ b\|a\|r.txt | echo "Foo" +lvimgrep /pa\%(t"t\)ern/ b"a"r.txt | echo "Foo" + +lvimgrepadd pa\%(tt\)ern foo.txt +lvimgrepadd /pa\%(tt\)ern/ foo.txt + +lvimgrepadd! pa\%(tt\)ern foo.txt +lvimgrepadd! /pa\%(tt\)ern/ foo.txt + +lvimgrepadd /pa\%(tt\)ern/gjf foo.txt + +" trailing bar, no tail comment +lvimgrepadd /pa\%(t|t\)ern/ b\|a\|r.txt | echo "Foo" +lvimgrepadd /pa\%(t"t\)ern/ b"a"r.txt | echo "Foo" + + +" file args + +" multiple files +vimgrep pa\%(tt\)ern foo.txt bar.txt +vimgrep /pa\%(tt\)ern/ foo.txt bar.txt + +" wildcard patterns +vimgrep pa\%(tt\)ern **/*.txt +vimgrep /pa\%(tt\)ern/ **/*.txt + +" special filename characters +vimgrep pa\%(tt\)ern % +vimgrep /pa\%(tt\)ern/ % + diff --git a/runtime/syntax/testdir/input/vim_expr.vim b/runtime/syntax/testdir/input/vim_expr.vim index 9786ff8ca5..e2c0dcbad3 100644 --- a/runtime/syntax/testdir/input/vim_expr.vim +++ b/runtime/syntax/testdir/input/vim_expr.vim @@ -4,6 +4,15 @@ echo 'It''s a string' echo 'tab: \t, new line: \n, backslash: \\' echo "tab: \t, new line: \n, backslash: \\" +" string starts immediately after line continuation character - tests a +" comment/string distinguishing implementation quirk +echo "foo" + \"bar" + \ "baz" +echo 'foo' + \'bar' + \ 'baz' + " String escape sequences echo "\316 - \31 - \3 - \x1f - \xf - \X1F - \XF - \u02a4 - \U000002a4 - \b - \e - \f - \n - \r - \t - \\ - \" - \" @@ -21,6 +30,13 @@ echo "\<*C->>" echo "\>>" echo "\<*C->>>" +echo "" +echo "\"" +echo "foo\"" +echo "\"foo" +echo "foo\"bar" + +echo '' echo '''' echo '''foo' echo 'foo''' @@ -30,6 +46,7 @@ echo 'foo''bar' " https://github.com/tpope/vim-unimpaired/blob/6d44a6dc2ec34607c41ec78acf81657248580bf1/plugin/unimpaired.vim#L232 let cmd = 'put!=repeat(nr2char(10), v:count1)|silent '']+' + " String interpolation echo 'Don''t highlight interpolation: {{ {1 + 2} }}' @@ -39,10 +56,61 @@ echo $'Highlight interpolation:\t{{ { $'nested: {{ {1 + 2} }}' } }}' echo $"Highlight interpolation:\t{{ { string({"foo": "bar"}) } }}" echo $"Highlight interpolation:\t{{ { $"nested: {{ {1 + 2} }}" } }}" -echo $'''' -echo $'''foo' -echo $'foo''' -echo $'foo''bar' + +" Continued string + +let s = " + "\ comment + \ part 1 + "\ comment + \ part 2 + "\ comment + \" " tail comment + +let s = "\" + \\" part 1 \" + "\ escape sequence + \ \"part 2\" + \\"" " tail comment + +let s = ' + "\ comment + \ part 1 + "\ comment + \ part 2 + "\ comment + \' " tail comment + +let s = ''' + \'' part 1 '' + "\ escape sequence + \ ''part 2'' + \''' " tail comment + +let s = $" + "\ comment + \ part 1 + "\ comment + \ part 2 + "\ comment + \" " tail comment + +let s = $' + "\ comment + \ part 1 + "\ comment + \ part 2 + "\ comment + \' " tail comment + +call strlen("part 1 + "\ comment + \ part 2") + +call append(0, "part 1 + "\ comment + \ part 2") + " Number @@ -173,14 +241,47 @@ echo #{ " match as keys not scope dictionaries echo #{ b: 42, w: 42, t: 42, g: 42, l: 42, s: 42, a: 42, v: 42 } +" Tuple + +echo () +echo (42,) +echo ((11, 12), (21, 22), (31, 32)) +echo (1, + \ 2, + \ 3, + \ 4 + \) +echo (1, 'two', 1 + 2, "fo" .. "ur") + +echo foo + (42, 87) +echo (42, 87) + foo + " Register -echo @" +echo @" @@ echo @0 @1 @2 @3 @4 @5 @6 @7 @8 @9 -echo @- echo @a @b @c @d @e @f @g @h @i @j @k @l @m @n @o @p @q @r @s @t @u @v @w @x @y @z echo @A @B @C @D @E @F @G @H @I @J @K @L @M @N @O @P @Q @R @S @T @U @V @W @X @Y @Z -echo @: @. @% @# @= @* @+ @~ @_ @/ +echo @- @: @. @% @# @= @* @+ @~ @_ @/ + +" read-only @:, @., @%, @~ +let @" = "foo" +let @0 = "foo" +let @1 = "foo" +let @9 = "foo" +let @a = "foo" +let @k = "foo" +let @z = "foo" +let @A = "foo" +let @K = "foo" +let @Z = "foo" +let @- = "foo" +let @# = "foo" +let @= = "foo" +let @* = "foo" +let @+ = "foo" +let @_ = "foo" +let @/ = "foo" " Operators @@ -286,12 +387,17 @@ let foo = foo + \ bar + \ "baz" +let foo = foo + + "\ "comment string" + \ bar + " Function calls call Foo(v:true, v:false, v:null) " Issue #16221 (vimString becomes vimVar when preceded by !) + let bar = !'g:bar'->exists() diff --git a/runtime/syntax/testdir/input/vim_function_call.vim b/runtime/syntax/testdir/input/vim_function_call.vim new file mode 100644 index 0000000000..50e4a3bf35 --- /dev/null +++ b/runtime/syntax/testdir/input/vim_function_call.vim @@ -0,0 +1,277 @@ +" Vim function calls +" VIM_TEST_SETUP highlight link vimUserFunc Todo + + +call abs(42) + + +" command/function distinction + +" append browse call chdir confirm copy delete eval execute filter function +" insert join map match mode sort split substitute swapname type + +let append = append(42) +call append(42) +" command +append +. +" bad command +append(42) +append (42) + +let browse = browse(42) +call browse(42) +" command +browse(42) +browse (42) + +let call = call(42) +call call(42) +" command +call(42) +call (42) + +let chdir = chdir(42) +call chdir(42) +" command +chdir(42) +chdir (42) + +let confirm = confirm(42) +call confirm(42) +" command +confirm(42) +confirm (42) + +let copy = copy(42) +call copy(42) +" command +copy(42) +copy (42) + +let delete = delete(42) +call delete(42) +" command +delete(42) +delete (42) + +let eval = eval(42) +call eval(42) +" command +eval(42) +eval (42) + +let execute = execute(42) +call execute(42) +" command +execute(42) +execute (42) + +let filter = filter(42) +call filter(42) +" command +filter(42) +filter (42) + +let function = function(42) +call function(42) +" command +function(42) +function (42) + +let insert = insert(42) +call insert(42) +" command +insert +. +" bad command +insert(42) +insert (42) + +let join = join(42) +call join(42) +" command +join(42) +join (42) + +let map = map(42) +call map(42) +" command +map(42) +map (42) + +let match = match(42) +call match(42) +" command +match(42) +match (42) + +let sort = sort(42) +call sort(42) +" command +sort(42) +sort (42) + +let split = split(42) +call split(42) +" command +split(42) +split (42) + +let substitute = substitute(42) +call substitute(42) +" command +substitute(42) +substitute (42) + +let swapname = swapname(42) +call swapname(42) +" command +swapname(42) +swapname (42) + +let type = type(42) +call type(42) +" Vim9 command +" type(42) +" type (42) + +let uniq = uniq(42) +call uniq(42) +" command +uniq(42) +uniq (42) + + +" errors + +let foo = foo(42) +call foo(42) + +let if = if(42) +call if(42) +" command +if(42) | .. | endif +if (42) | .. | endif + +let echo = echo(42) +call echo(42) +" command +echo(42) +echo (42) + + +" expressions + +let foo = abs(42) + +echo abs(42) +echo (abs(42)) +echo abs(42) + foo +echo foo + abs(42) + +echo Foo() +echo (Foo()) +echo Foo() + bar +echo bar + Foo() + + +" scope modifiers and qualified names + +let foo = s:foo(42) +call s:foo(42) + +let foo = g:foo(42) +call g:foo(42) + +let foo = b:foo(42) +call b:foo(42) + +let foo = w:foo(42) +call w:foo(42) + +let foo = t:foo(42) +call t:foo(42) + +let foo = l:foo(42) +call l:foo(42) + +let foo = a:foo(42) +call a:foo(42) + +let foo = v:foo(42) +call v:foo(42) + + +let foo = module.foo(42) +call module.foo(42) + +let foo = s:module.foo(42) +call module.foo(42) + +let foo = g:module.foo(42) +call g:module.foo(42) + +let foo = b:module.foo(42) +call b:module.foo(42) + +let foo = w:module.foo(42) +call w:module.foo(42) + +let foo = t:module.foo(42) +call t:module.foo(42) + +let foo = l:module.foo(42) +call l:module.foo(42) + +let foo = a:module.foo(42) +call a:module.foo(42) + +let foo = v:module.foo(42) +call v:module.foo(42) + + +let foo = module#foo(42) +call module#foo(42) + +let foo = g:module#foo(42) +call g:module#foo(42) + + +" not builtin functions + +call s:substitute() +call g:substitute() +call b:substitute() +call w:substitute() +call t:substitute() +call l:substitute() +call a:substitute() +call v:substitute() + +call substitute() + +call s:substitute.substitute() +call g:substitute.substitute() +call b:substitute.substitute() +call w:substitute.substitute() +call t:substitute.substitute() +call l:substitute.substitute() +call a:substitute.substitute() +call v:substitute.substitute() + +call substitute#substitute() +call g:substitute#substitute() + + +" chained function calls + +call module.foo().bar() +call module.foo().substitute() + + +" Issue #17766 (valid function call highlighted as error) + +call module[0].foo() +call module[0].substitute() + diff --git a/runtime/syntax/testdir/input/vim_function_calls.vim b/runtime/syntax/testdir/input/vim_function_calls.vim deleted file mode 100644 index 5401f6ec8c..0000000000 --- a/runtime/syntax/testdir/input/vim_function_calls.vim +++ /dev/null @@ -1,6 +0,0 @@ -" Vim function calls - -call clearmatches() -:call clearmatches() -echo "Foo" | call clearmatches() - diff --git a/runtime/syntax/testdir/input/vim_lambda.vim b/runtime/syntax/testdir/input/vim_lambda.vim index 73a221b7df..47c194662e 100644 --- a/runtime/syntax/testdir/input/vim_lambda.vim +++ b/runtime/syntax/testdir/input/vim_lambda.vim @@ -1,4 +1,7 @@ " Vim lambda expressions +" VIM_TEST_SETUP hi link vimLambdaOperator Todo +" VIM_TEST_SETUP hi link vimLambdaBrace Todo +" VIM_TEST_SETUP hi link vimFuncParam Identifier let expr = 42 @@ -56,12 +59,17 @@ let Foo = {x, \ z -> expr} let Foo = { + "\ comment \ x, + "\ comment \ y, + "\ comment \ z + "\ comment \ -> "\ comment \ expr + "\ comment \ } let Foo = {-> [ @@ -94,6 +102,7 @@ let Foo = {-> {-> #{ \ b: 83 \}}} + " :help lambda :let F = {arg1, arg2 -> arg1 - arg2} @@ -118,3 +127,9 @@ let Foo = {-> {-> #{ \ {-> execute("echo 'Handler called'", "")}, \ {'repeat': 3}) + +" Issue https://github.com/vim/vim/pull/17420#issuecomment-2927798687 +" (string immediately after -> operator) + +let [func, _func_] = [{->"func"}(), 'func'] + diff --git a/runtime/syntax/testdir/input/vim_shebang.vim b/runtime/syntax/testdir/input/vim_shebang.vim old mode 100755 new mode 100644 diff --git a/runtime/syntax/testdir/runtest.vim b/runtime/syntax/testdir/runtest.vim index 767510cb1d..3d4b350d02 100644 --- a/runtime/syntax/testdir/runtest.vim +++ b/runtime/syntax/testdir/runtest.vim @@ -69,7 +69,8 @@ endif " Use the script for source code screendump testing. It sources other scripts, " therefore we must "cd" there. cd ../../src/testdir -source screendump.vim +source util/screendump.vim +source util/term_util.vim exe 'cd ' .. fnameescape(syntaxDir) " For these tests we need to be able to run terminal Vim with 256 colors. On diff --git a/runtime/syntax/tutor.vim b/runtime/syntax/tutor.vim index 83ca547fdd..7d0cd31c1d 100644 --- a/runtime/syntax/tutor.vim +++ b/runtime/syntax/tutor.vim @@ -1,7 +1,14 @@ +" Language: Vim Tutor +" Maintainer: Vim Project +" Last Change: 2025 Apr 16 + if exists("b:current_syntax") finish endif +let s:cpo_save = &cpo +set cpo&vim + syn include @VIM syntax/vim.vim unlet b:current_syntax syn include @TUTORSHELL syntax/sh.vim @@ -75,3 +82,5 @@ hi def link tutorInlineX tutorX hi def link tutorShellPrompt Delimiter let b:current_syntax = "tutor" +let &cpo = s:cpo_save +unlet s:cpo_save diff --git a/runtime/syntax/typst.vim b/runtime/syntax/typst.vim index b1f05ec853..686f7c3f31 100644 --- a/runtime/syntax/typst.vim +++ b/runtime/syntax/typst.vim @@ -1,14 +1,18 @@ " Vim syntax file " Language: Typst -" Previous Maintainer: Gregory Anders " Maintainer: Luca Saccarola +" Previous Maintainer: Gregory Anders +" Based On: https://github.com/kaarmu/typst.vim " Last Change: 2024 Dec 09 -" Based on: https://github.com/kaarmu/typst.vim +" 2025 Apr 16 by Vim Project (set 'cpoptions' for line continuation, #17121) if exists('b:current_syntax') finish endif +let s:cpo_save = &cpo +set cpo&vim + syntax sync fromstart syntax spell toplevel @@ -470,4 +474,7 @@ highlight default typstMarkupBoldItalic term=bold,italic let b:current_syntax = 'typst' +let &cpo = s:cpo_save +unlet s:cpo_save + " }}}1 diff --git a/runtime/syntax/vim.vim b/runtime/syntax/vim.vim index fc8e0589ff..4e394d35ab 100644 --- a/runtime/syntax/vim.vim +++ b/runtime/syntax/vim.vim @@ -2,7 +2,7 @@ " Language: Vim script " Maintainer: Hirohito Higashi " Doug Kearns -" Last Change: 2025 Mar 27 +" Last Change: 2025 Jul 21 " Former Maintainer: Charles E. Campbell " DO NOT CHANGE DIRECTLY. @@ -33,12 +33,28 @@ syn cluster vimCommentGroup contains=vimTodo,@Spell " regular vim commands {{{2 " GEN_SYN_VIM: vimCommand normal, START_STR='syn keyword vimCommand contained', END_STR='nextgroup=vimBang' -syn keyword vimCommand contained abo[veleft] al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bel[owright] bf[irst] bl[ast] bm[odified] bn[ext] bo[tright] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] chd[ir] changes che[ckpath] checkt[ime] chi[story] cl[ist] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] co[py] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm] nextgroup=vimBang -syn keyword vimCommand contained cons[t] cope[n] cp[revious] cpf[ile] cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] d[elete] delm[arks] deb[ug] defc[ompile] defe[r] delf[unction] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] el[se] em[enu] en[dif] endfo[r] endt[ry] endw[hile] ene[w] ev[al] ex exi[t] exu[sage] f[ile] files filet[ype] filt[er] fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gr[ep] grepa[dd] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpg[rep] helpt[ags] ha[rdcopy] hi[ghlight] hid[e] his[tory] hor[izontal] ij[ump] il[ist] imp[ort] int[ro] ip[ut] is[earch] nextgroup=vimBang -syn keyword vimCommand contained isp[lit] j[oin] ju[mps] k kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lefta[bove] lex[pr] leg[acy] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lh[elpgrep] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] loc[kmarks] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lua luad[o] luaf[ile] lv[imgrep] lvimgrepa[dd] lw[indow] ls m[ove] ma[rk] mak[e] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] mz[scheme] mzf[ile] n[ext] nb[key] nextgroup=vimBang -syn keyword vimCommand contained nbc[lose] nbs[tart] noa[utocmd] noh[lsearch] nos[wapfile] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] pe[rl] perld[o] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] prof[ile] profd[el] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] py[thon] pyd[o] pyf[ile] py3 py3d[o] python3 py3f[ile] pyx pyxd[o] pythonx pyxf[ile] q[uit] quita[ll] qa[ll] r[ead] rec[over] red[o] redi[r] redr[aw] redraws[tatus] redrawt[abline] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] rightb[elow] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] san[dbox] sav[eas] sb[uffer] sbN[ext] nextgroup=vimBang -syn keyword vimCommand contained sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sil[ent] sla[st] sn[ext] so[urce] sor[t] sp[lit] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] sw[apname] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tab tabc[lose] tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] tcl tcld[o] tclf[ile] te[aroff] ter[minal] tf[irst] tj[ump] nextgroup=vimBang -syn keyword vimCommand contained tl[ast] tn[ext] to[pleft] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] uns[ilent] up[date] v[global] ve[rsion] verb[ose] vert[ical] vi[sual] vie[w] vim[grep] vimgrepa[dd] vim9[cmd] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang +syn keyword vimCommand contained al[l] ar[gs] arga[dd] argd[elete] argdo argded[upe] arge[dit] argg[lobal] argl[ocal] argu[ment] as[cii] b[uffer] bN[ext] ba[ll] bad[d] balt bd[elete] bf[irst] bl[ast] bm[odified] bn[ext] bp[revious] br[ewind] brea[k] breaka[dd] breakd[el] breakl[ist] bro[wse] buffers bufd[o] bun[load] bw[ipeout] c[hange] cN[ext] cNf[ile] cabo[ve] cad[dbuffer] cadde[xpr] caddf[ile] caf[ter] cb[uffer] cbe[fore] cbel[ow] cbo[ttom] cc ccl[ose] cd cdo ce[nter] cex[pr] cf[ile] cfd[o] cfir[st] cg[etfile] cgetb[uffer] cgete[xpr] changes che[ckpath] checkt[ime] chi[story] cl[ist] clip[reset] cla[st] clo[se] cle[arjumps] cn[ext] cnew[er] cnf[ile] col[der] colo[rscheme] com[mand] comc[lear] comp[iler] con[tinue] conf[irm] cons[t] cope[n] cp[revious] cpf[ile] nextgroup=vimBang +syn keyword vimCommand contained cq[uit] cr[ewind] cs[cope] cst[ag] cw[indow] delm[arks] deb[ug] defc[ompile] defe[r] di[splay] dif[fupdate] diffg[et] diffo[ff] diffp[atch] diffpu[t] diffs[plit] difft[his] dig[raphs] disa[ssemble] dj[ump] dli[st] dr[op] ds[earch] dsp[lit] e[dit] ea[rlier] em[enu] endfo[r] endt[ry] endw[hile] ene[w] ex exi[t] exu[sage] f[ile] files fin[d] fina[lly] fini[sh] fir[st] fix[del] fo[ld] foldc[lose] foldd[oopen] folddoc[losed] foldo[pen] g[lobal] go[to] gu[i] gv[im] h[elp] helpc[lose] helpf[ind] helpt[ags] ha[rdcopy] hi[ghlight] his[tory] ij[ump] il[ist] int[ro] ip[ut] is[earch] isp[lit] ju[mps] l[ist] lN[ext] lNf[ile] la[st] lab[ove] lan[guage] lad[dexpr] laddb[uffer] laddf[ile] laf[ter] lat[er] lb[uffer] lbe[fore] lbel[ow] lbo[ttom] nextgroup=vimBang +syn keyword vimCommand contained lc[d] lch[dir] lcl[ose] lcs[cope] ld[o] le[ft] lex[pr] lf[ile] lfd[o] lfir[st] lg[etfile] lgetb[uffer] lgete[xpr] lgr[ep] lgrepa[dd] lhi[story] ll lla[st] lli[st] lmak[e] lne[xt] lnew[er] lnf[ile] lo[adview] lockv[ar] lol[der] lop[en] lp[revious] lpf[ile] lr[ewind] lt[ag] lw[indow] ls m[ove] marks menut[ranslate] mes[sages] mk[exrc] mks[ession] mksp[ell] mkv[imrc] mkvie[w] mod[e] n[ext] nb[key] nbc[lose] nbs[tart] noh[lsearch] nu[mber] o[pen] ol[dfiles] on[ly] opt[ions] ow[nsyntax] p[rint] pa[ckadd] packl[oadall] pb[uffer] pc[lose] ped[it] po[p] pp[op] pre[serve] prev[ious] pro[mptfind] promptr[epl] ps[earch] pt[ag] ptN[ext] ptf[irst] ptj[ump] ptl[ast] ptn[ext] ptp[revious] ptr[ewind] pts[elect] pu[t] pw[d] q[uit] quita[ll] qa[ll] nextgroup=vimBang +syn keyword vimCommand contained r[ead] rec[over] red[o] redr[aw] redraws[tatus] redrawt[abline] redrawtabp[anel] reg[isters] res[ize] ret[ab] rew[ind] ri[ght] ru[ntime] rub[y] rubyd[o] rubyf[ile] rund[o] rv[iminfo] sN[ext] sa[rgument] sal[l] sav[eas] sb[uffer] sbN[ext] sba[ll] sbf[irst] sbl[ast] sbm[odified] sbn[ext] sbp[revious] sbr[ewind] scr[iptnames] scripte[ncoding] scriptv[ersion] scs[cope] setf[iletype] sf[ind] sfir[st] sh[ell] sim[alt] sig[n] sla[st] sn[ext] so[urce] spe[llgood] spelld[ump] spelli[nfo] spellr[epall] spellra[re] spellu[ndo] spellw[rong] spr[evious] sre[wind] st[op] sta[g] star[tinsert] startg[replace] startr[eplace] stopi[nsert] stj[ump] sts[elect] sun[hide] sus[pend] sv[iew] synti[me] sync[bind] smi[le] t tN[ext] ta[g] tags tabc[lose] nextgroup=vimBang +syn keyword vimCommand contained tabd[o] tabe[dit] tabf[ind] tabfir[st] tabm[ove] tabl[ast] tabn[ext] tabnew tabo[nly] tabp[revious] tabN[ext] tabr[ewind] tabs tc[d] tch[dir] te[aroff] ter[minal] tf[irst] tj[ump] tl[ast] tn[ext] tp[revious] tr[ewind] try ts[elect] u[ndo] undoj[oin] undol[ist] unh[ide] unlo[ckvar] up[date] v[global] ve[rsion] vi[sual] vie[w] viu[sage] vne[w] vs[plit] w[rite] wN[ext] wa[ll] wi[nsize] winc[md] wind[o] winp[os] wl[restore] wn[ext] wp[revious] wq wqa[ll] wu[ndo] wv[iminfo] x[it] xa[ll] xr[estore] y[ank] z dl dell delel deletl deletel dp dep delp delep deletp deletep a i nextgroup=vimBang + +" Lower priority :syn-match to allow for :command/function() distinction +syn match vimCommand "\" nextgroup=vimBang +syn match vimCommand "\" nextgroup=vimBang +syn match vimCommand "\" nextgroup=vimBang +syn match vimCommand "\" nextgroup=vimBang +syn match vimCommand "\" nextgroup=vimBang +syn match vimCommand "\" nextgroup=vimBang + +" GEN_SYN_VIM: vimCommand modifier, START_STR='syn keyword vimCommandModifier', END_STR='skipwhite nextgroup=vimCommandModifierBang,@vimCmdList' +syn keyword vimCommandModifier abo[veleft] bel[owright] bo[tright] hid[e] hor[izontal] kee[pmarks] keepj[umps] keepp[atterns] keepa[lt] lefta[bove] leg[acy] loc[kmarks] noa[utocmd] nos[wapfile] rightb[elow] san[dbox] sil[ent] tab to[pleft] uns[ilent] verb[ose] vert[ical] vim9[cmd] skipwhite nextgroup=vimCommandModifierBang,@vimCmdList +" :filter is handled specially elsewhere +syn match vimCommandModifierBang contained "\a\@1<=!" skipwhite nextgroup=@vimCmdList + +" Lower priority :syn-match to allow for :command/function() distinction +syn match vimCommand "\" skipwhite nextgroup=vimCommandModifierBang,@vimCmdList +syn match vimCommand "\" skipwhite nextgroup=vimCommandModifierBang,@vimCmdList " Lower priority for _new_ to distinguish constructors from the command. syn match vimCommand contained "\(\@!" @@ -47,28 +63,29 @@ syn keyword vimStdPlugin contained Arguments Asm Break Cfilter Clear Continue Di " vimOptions are caught only when contained in a vimSet {{{2 " GEN_SYN_VIM: vimOption normal, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod' -syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete cfu completefunc skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc imak imactivatekey skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot mis menuitems mopt messagesopt msm mkspellmem ml modeline skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize skipwhite nextgroup=vimSetEqual,vimSetMod -syn keyword vimOption contained ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained cpt complete cfu completefunc cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dia diffanchors dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained et expandtab ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained ic ignorecase imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained mmt maxmemtot msc maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained smd showmode stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight skipwhite nextgroup=vimSetEqual,vimSetMod +syn keyword vimOption contained wmw winminwidth winptydll wiw winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes skipwhite nextgroup=vimSetEqual,vimSetMod " vimOptions: These are the turn-off setting variants {{{2 " GEN_SYN_VIM: vimOption turn-off, START_STR='syn keyword vimOption contained', END_STR='' syn keyword vimOption contained noari noallowrevins noarab noarabic noarshape noarabicshape noacd noautochdir noai noautoindent noar noautoread noasd noautoshelldir noaw noautowrite noawa noautowriteall nobk nobackup nobeval noballooneval nobevalterm noballoonevalterm nobin nobinary nobomb nobri nobreakindent nobl nobuflisted nocdh nocdhome nocin nocindent nocp nocompatible nocf noconfirm noci nocopyindent nocsre nocscoperelative nocst nocscopetag nocsverb nocscopeverbose nocrb nocursorbind nocuc nocursorcolumn nocul nocursorline nodeco nodelcombine nodiff nodg nodigraph noed noedcompatible noemo noemoji noeof noendoffile noeol noendofline noea noequalalways noeb noerrorbells noek noesckeys noet noexpandtab noex noexrc nofic nofileignorecase nofixeol nofixendofline syn keyword vimOption contained nofen nofoldenable nofs nofsync nogd nogdefault noguipty nohid nohidden nohk nohkmap nohkp nohkmapp nohls nohlsearch noicon noic noignorecase noimc noimcmdline noimd noimdisable nois noincsearch noinf noinfercase noim noinsertmode nojs nojoinspaces nolnr nolangnoremap nolrm nolangremap nolz nolazyredraw nolbr nolinebreak nolisp nolist nolpl noloadplugins nomagic noml nomodeline nomle nomodelineexpr noma nomodifiable nomod nomodified nomore nomousef nomousefocus nomh nomousehide nomousemev nomousemoveevent nonu nonumber noodev noopendevice nopaste nopi nopreserveindent nopvw nopreviewwindow noprompt noro noreadonly nornu norelativenumber noremap nors norestorescreen nori norevins norl norightleft noru noruler noscb noscrollbind noscf noscrollfocus -syn keyword vimOption contained nosecure nossl noshellslash nostmp noshelltemp nosr noshiftround nosn noshortname nosc noshowcmd nosft noshowfulltag nosm noshowmatch nosmd noshowmode noscs nosmartcase nosi nosmartindent nosta nosmarttab nosms nosmoothscroll nospell nosb nosplitbelow nospr nosplitright nosol nostartofline noswf noswapfile notbs notagbsearch notr notagrelative notgst notagstack notbidi notermbidi notgc notermguicolors noterse nota notextauto notx notextmode notop notildeop noto notimeout notitle nottimeout notbi nottybuiltin notf nottyfast noudf noundofile novb novisualbell nowarn nowiv noweirdinvert nowic nowildignorecase nowmnu nowildmenu nowfb nowinfixbuf nowfh nowinfixheight nowfw nowinfixwidth nowrap nows nowrapscan nowrite nowa nowriteany -syn keyword vimOption contained nowb nowritebackup noxtermcodes +syn keyword vimOption contained nosecure nossl noshellslash nostmp noshelltemp nosr noshiftround nosn noshortname nosc noshowcmd nosft noshowfulltag nosm noshowmatch nosmd noshowmode noscs nosmartcase nosi nosmartindent nosta nosmarttab nosms nosmoothscroll nospell nosb nosplitbelow nospr nosplitright nosol nostartofline noswf noswapfile notbs notagbsearch notr notagrelative notgst notagstack notbidi notermbidi notgc notermguicolors noterse nota notextauto notx notextmode notop notildeop noto notimeout notitle nottimeout notbi nottybuiltin notf nottyfast noudf noundofile novb novisualbell nowarn nowiv noweirdinvert nowic nowildignorecase nowmnu nowildmenu nowfb nowinfixbuf nowfh nowinfixheight nowfw nowinfixwidth nowst nowlsteal nowrap nows nowrapscan nowrite +syn keyword vimOption contained nowa nowriteany nowb nowritebackup noxtermcodes " vimOptions: These are the invertible variants {{{2 " GEN_SYN_VIM: vimOption invertible, START_STR='syn keyword vimOption contained', END_STR='' syn keyword vimOption contained invari invallowrevins invarab invarabic invarshape invarabicshape invacd invautochdir invai invautoindent invar invautoread invasd invautoshelldir invaw invautowrite invawa invautowriteall invbk invbackup invbeval invballooneval invbevalterm invballoonevalterm invbin invbinary invbomb invbri invbreakindent invbl invbuflisted invcdh invcdhome invcin invcindent invcp invcompatible invcf invconfirm invci invcopyindent invcsre invcscoperelative invcst invcscopetag invcsverb invcscopeverbose invcrb invcursorbind invcuc invcursorcolumn invcul invcursorline invdeco invdelcombine invdiff invdg invdigraph inved invedcompatible invemo invemoji inveof invendoffile inveol invendofline invea invequalalways inveb inverrorbells invek invesckeys syn keyword vimOption contained invet invexpandtab invex invexrc invfic invfileignorecase invfixeol invfixendofline invfen invfoldenable invfs invfsync invgd invgdefault invguipty invhid invhidden invhk invhkmap invhkp invhkmapp invhls invhlsearch invicon invic invignorecase invimc invimcmdline invimd invimdisable invis invincsearch invinf invinfercase invim invinsertmode invjs invjoinspaces invlnr invlangnoremap invlrm invlangremap invlz invlazyredraw invlbr invlinebreak invlisp invlist invlpl invloadplugins invmagic invml invmodeline invmle invmodelineexpr invma invmodifiable invmod invmodified invmore invmousef invmousefocus invmh invmousehide invmousemev invmousemoveevent invnu invnumber invodev invopendevice invpaste invpi invpreserveindent invpvw invpreviewwindow syn keyword vimOption contained invprompt invro invreadonly invrnu invrelativenumber invremap invrs invrestorescreen invri invrevins invrl invrightleft invru invruler invscb invscrollbind invscf invscrollfocus invsecure invssl invshellslash invstmp invshelltemp invsr invshiftround invsn invshortname invsc invshowcmd invsft invshowfulltag invsm invshowmatch invsmd invshowmode invscs invsmartcase invsi invsmartindent invsta invsmarttab invsms invsmoothscroll invspell invsb invsplitbelow invspr invsplitright invsol invstartofline invswf invswapfile invtbs invtagbsearch invtr invtagrelative invtgst invtagstack invtbidi invtermbidi invtgc invtermguicolors invterse invta invtextauto invtx invtextmode invtop invtildeop invto invtimeout invtitle invttimeout invtbi invttybuiltin -syn keyword vimOption contained invtf invttyfast invudf invundofile invvb invvisualbell invwarn invwiv invweirdinvert invwic invwildignorecase invwmnu invwildmenu invwfb invwinfixbuf invwfh invwinfixheight invwfw invwinfixwidth invwrap invws invwrapscan invwrite invwa invwriteany invwb invwritebackup invxtermcodes +syn keyword vimOption contained invtf invttyfast invudf invundofile invvb invvisualbell invwarn invwiv invweirdinvert invwic invwildignorecase invwmnu invwildmenu invwfb invwinfixbuf invwfh invwinfixheight invwfw invwinfixwidth invwst invwlsteal invwrap invws invwrapscan invwrite invwa invwriteany invwb invwritebackup invxtermcodes " termcap codes (which can also be set) {{{2 " GEN_SYN_VIM: vimOption term output code, START_STR='syn keyword vimOption contained', END_STR='skipwhite nextgroup=vimSetEqual,vimSetMod' syn keyword vimOption contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo skipwhite nextgroup=vimSetEqual,vimSetMod @@ -85,15 +102,15 @@ syn match vimOption contained "t_k;" " vimOptions: These are the variable names {{{2 " GEN_SYN_VIM: vimOption normal variable, START_STR='syn keyword vimOptionVarName contained', END_STR='' -syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible cpt complete cfu completefunc -syn keyword vimOptionVarName contained cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin et expandtab ex exrc fenc fileencoding -syn keyword vimOptionVarName contained fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring ic ignorecase imaf imactivatefunc -syn keyword vimOptionVarName contained imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern mmt maxmemtot mis menuitems mopt messagesopt -syn keyword vimOptionVarName contained msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome -syn keyword vimOptionVarName contained pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch smd showmode stal showtabline ss sidescroll siso sidescrolloff -syn keyword vimOptionVarName contained scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title -syn keyword vimOptionVarName contained titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight wmw winminwidth winptydll wiw winwidth wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup -syn keyword vimOptionVarName contained wd writedelay xtermcodes +syn keyword vimOptionVarName contained al aleph ari allowrevins ambw ambiwidth arab arabic arshape arabicshape acd autochdir ai autoindent ar autoread asd autoshelldir aw autowrite awa autowriteall bg background bs backspace bk backup bkc backupcopy bdir backupdir bex backupext bsk backupskip bdlay balloondelay beval ballooneval bevalterm balloonevalterm bexpr balloonexpr bo belloff bin binary bomb brk breakat bri breakindent briopt breakindentopt bsdir browsedir bh bufhidden bl buflisted bt buftype cmp casemap cdh cdhome cd cdpath cedit ccv charconvert chi chistory cin cindent cink cinkeys cino cinoptions cinsd cinscopedecls cinw cinwords cb clipboard cpm clipmethod ch cmdheight cwh cmdwinheight cc colorcolumn co columns com comments cms commentstring cp compatible +syn keyword vimOptionVarName contained cpt complete cfu completefunc cfc completefuzzycollect cia completeitemalign cot completeopt cpp completepopup csl completeslash cocu concealcursor cole conceallevel cf confirm ci copyindent cpo cpoptions cm cryptmethod cspc cscopepathcomp csprg cscopeprg csqf cscopequickfix csre cscoperelative cst cscopetag csto cscopetagorder csverb cscopeverbose crb cursorbind cuc cursorcolumn cul cursorline culopt cursorlineopt debug def define deco delcombine dict dictionary diff dia diffanchors dex diffexpr dip diffopt dg digraph dir directory dy display ead eadirection ed edcompatible emo emoji enc encoding eof endoffile eol endofline ea equalalways ep equalprg eb errorbells ef errorfile efm errorformat ek esckeys ei eventignore eiw eventignorewin +syn keyword vimOptionVarName contained et expandtab ex exrc fenc fileencoding fencs fileencodings ff fileformat ffs fileformats fic fileignorecase ft filetype fcs fillchars ffu findfunc fixeol fixendofline fcl foldclose fdc foldcolumn fen foldenable fde foldexpr fdi foldignore fdl foldlevel fdls foldlevelstart fmr foldmarker fdm foldmethod fml foldminlines fdn foldnestmax fdo foldopen fdt foldtext fex formatexpr flp formatlistpat fo formatoptions fp formatprg fs fsync gd gdefault gfm grepformat gp grepprg gcr guicursor gfn guifont gfs guifontset gfw guifontwide ghr guiheadroom gli guiligatures go guioptions guipty gtl guitablabel gtt guitabtooltip hf helpfile hh helpheight hlg helplang hid hidden hl highlight hi history hk hkmap hkp hkmapp hls hlsearch icon iconstring +syn keyword vimOptionVarName contained ic ignorecase imaf imactivatefunc imak imactivatekey imc imcmdline imd imdisable imi iminsert ims imsearch imsf imstatusfunc imst imstyle inc include inex includeexpr is incsearch inde indentexpr indk indentkeys inf infercase im insertmode ise isexpand isf isfname isi isident isk iskeyword isp isprint js joinspaces jop jumpoptions key kmp keymap km keymodel kpc keyprotocol kp keywordprg lmap langmap lm langmenu lnr langnoremap lrm langremap ls laststatus lz lazyredraw lhi lhistory lbr linebreak lines lsp linespace lisp lop lispoptions lw lispwords list lcs listchars lpl loadplugins luadll magic mef makeef menc makeencoding mp makeprg mps matchpairs mat matchtime mco maxcombine mfd maxfuncdepth mmd maxmapdepth mm maxmem mmp maxmempattern +syn keyword vimOptionVarName contained mmt maxmemtot msc maxsearchcount mis menuitems mopt messagesopt msm mkspellmem ml modeline mle modelineexpr mls modelines ma modifiable mod modified more mouse mousef mousefocus mh mousehide mousem mousemodel mousemev mousemoveevent mouses mouseshape mouset mousetime mzq mzquantum mzschemedll mzschemegcdll nf nrformats nu number nuw numberwidth ofu omnifunc odev opendevice opfunc operatorfunc pp packpath para paragraphs paste pt pastetoggle pex patchexpr pm patchmode pa path perldll pi preserveindent pvh previewheight pvp previewpopup pvw previewwindow pdev printdevice penc printencoding pexpr printexpr pfn printfont pheader printheader pmbcs printmbcharset pmbfn printmbfont popt printoptions prompt ph pumheight pmw pummaxwidth +syn keyword vimOptionVarName contained pw pumwidth pythondll pythonhome pythonthreedll pythonthreehome pyx pyxversion qftf quickfixtextfunc qe quoteescape ro readonly rdt redrawtime re regexpengine rnu relativenumber remap rop renderoptions report rs restorescreen ri revins rl rightleft rlc rightleftcmd rubydll ru ruler ruf rulerformat rtp runtimepath scr scroll scb scrollbind scf scrollfocus sj scrolljump so scrolloff sbo scrollopt sect sections secure sel selection slm selectmode ssop sessionoptions sh shell shcf shellcmdflag sp shellpipe shq shellquote srr shellredir ssl shellslash stmp shelltemp st shelltype sxe shellxescape sxq shellxquote sr shiftround sw shiftwidth shm shortmess sn shortname sbr showbreak sc showcmd sloc showcmdloc sft showfulltag sm showmatch +syn keyword vimOptionVarName contained smd showmode stal showtabline stpl showtabpanel ss sidescroll siso sidescrolloff scl signcolumn scs smartcase si smartindent sta smarttab sms smoothscroll sts softtabstop spell spc spellcapcheck spf spellfile spl spelllang spo spelloptions sps spellsuggest sb splitbelow spk splitkeep spr splitright sol startofline stl statusline su suffixes sua suffixesadd swf swapfile sws swapsync swb switchbuf smc synmaxcol syn syntax tcl tabclose tal tabline tpm tabpagemax tpl tabpanel tplo tabpanelopt ts tabstop tbs tagbsearch tc tagcase tfu tagfunc tl taglength tr tagrelative tag tags tgst tagstack tcldll term tbidi termbidi tenc termencoding tgc termguicolors twk termwinkey twsl termwinscroll tws termwinsize twt termwintype terse ta textauto +syn keyword vimOptionVarName contained tx textmode tw textwidth tsr thesaurus tsrfu thesaurusfunc top tildeop to timeout tm timeoutlen title titlelen titleold titlestring tb toolbar tbis toolbariconsize ttimeout ttm ttimeoutlen tbi ttybuiltin tf ttyfast ttym ttymouse tsl ttyscroll tty ttytype udir undodir udf undofile ul undolevels ur undoreload uc updatecount ut updatetime vsts varsofttabstop vts vartabstop vbs verbose vfile verbosefile vdir viewdir vop viewoptions vi viminfo vif viminfofile ve virtualedit vb visualbell warn wiv weirdinvert ww whichwrap wc wildchar wcm wildcharm wig wildignore wic wildignorecase wmnu wildmenu wim wildmode wop wildoptions wak winaltkeys wcr wincolor wi window wfb winfixbuf wfh winfixheight wfw winfixwidth wh winheight wmh winminheight +syn keyword vimOptionVarName contained wmw winminwidth winptydll wiw winwidth wse wlseat wst wlsteal wtm wltimeoutlen wrap wm wrapmargin ws wrapscan write wa writeany wb writebackup wd writedelay xtermcodes " GEN_SYN_VIM: vimOption term output code variable, START_STR='syn keyword vimOptionVarName contained', END_STR='' syn keyword vimOptionVarName contained t_AB t_AF t_AU t_AL t_al t_bc t_BE t_BD t_cd t_ce t_Ce t_CF t_cl t_cm t_Co t_CS t_Cs t_cs t_CV t_da t_db t_DL t_dl t_ds t_Ds t_EC t_EI t_fs t_fd t_fe t_GP t_IE t_IS t_ke t_ks t_le t_mb t_md t_me t_mr t_ms t_nd t_op t_RF t_RB t_RC t_RI t_Ri t_RK t_RS t_RT t_RV t_Sb t_SC t_se t_Sf t_SH t_SI t_Si t_so t_SR t_sr t_ST t_Te t_te t_TE t_ti t_TI t_Ts t_ts t_u7 t_ue t_us t_Us t_ut t_vb t_ve t_vi t_VS t_vs t_WP t_WS t_XM t_xn t_xs t_ZH t_ZR t_8f t_8b t_8u t_xo syn keyword vimOptionVarName contained t_F1 t_F2 t_F3 t_F4 t_F5 t_F6 t_F7 t_F8 t_F9 t_k1 t_K1 t_k2 t_k3 t_K3 t_k4 t_K4 t_k5 t_K5 t_k6 t_K6 t_k7 t_K7 t_k8 t_K8 t_k9 t_K9 t_KA t_kb t_kB t_KB t_KC t_kd t_kD t_KD t_KE t_KF t_KG t_kh t_KH t_kI t_KI t_KJ t_KK t_kl t_KL t_kN t_kP t_kr t_ku @@ -114,34 +131,40 @@ syn keyword vimErrSetting contained invakm invaltkeymap invanti invantialias inv " AutoCmd Events {{{2 syn case ignore -" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR='' -syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre FilterWritePost -syn keyword vimAutoEvent contained FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabClosedPre TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost User VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized WinScrolled +" GEN_SYN_VIM: vimAutoEvent, START_STR='syn keyword vimAutoEvent contained', END_STR='skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern' +syn keyword vimAutoEvent contained BufAdd BufCreate BufDelete BufEnter BufFilePost BufFilePre BufHidden BufLeave BufNew BufNewFile BufRead BufReadCmd BufReadPost BufReadPre BufUnload BufWinEnter BufWinLeave BufWipeout BufWrite BufWriteCmd BufWritePost BufWritePre CmdlineChanged CmdlineEnter CmdlineLeave CmdlineLeavePre CmdUndefined CmdwinEnter CmdwinLeave ColorScheme ColorSchemePre CompleteChanged CompleteDone CompleteDonePre CursorHold CursorHoldI CursorMoved CursorMovedC CursorMovedI DiffUpdated DirChanged DirChangedPre EncodingChanged ExitPre FileAppendCmd FileAppendPost FileAppendPre FileChangedRO FileChangedShell FileChangedShellPost FileEncoding FileReadCmd FileReadPost FileReadPre FileType FileWriteCmd FileWritePost FileWritePre FilterReadPost FilterReadPre skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern +syn keyword vimAutoEvent contained FilterWritePost FilterWritePre FocusGained FocusLost FuncUndefined GUIEnter GUIFailed InsertChange InsertCharPre InsertEnter InsertLeave InsertLeavePre KeyInputPre MenuPopup ModeChanged OptionSet QuickFixCmdPost QuickFixCmdPre QuitPre RemoteReply SafeState SafeStateAgain SessionLoadPost SessionWritePost ShellCmdPost ShellFilterPost SigUSR1 SourceCmd SourcePost SourcePre SpellFileMissing StdinReadPost StdinReadPre SwapExists Syntax TabClosed TabClosedPre TabEnter TabLeave TabNew TermChanged TerminalOpen TerminalWinOpen TermResponse TermResponseAll TextChanged TextChangedI TextChangedP TextChangedT TextYankPost VimEnter VimLeave VimLeavePre VimResized VimResume VimSuspend WinClosed WinEnter WinLeave WinNew WinNewPre WinResized skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern +syn keyword vimAutoEvent contained WinScrolled skipwhite nextgroup=vimAutoEventSep,@vimAutocmdPattern + +syn keyword vimAutoEvent contained User skipwhite nextgroup=vimUserAutoEvent +syn match vimUserAutoEvent contained "\<\h\w*\>" skipwhite nextgroup=vimUserAutoEventSep,vimAutocmdMod,vimAutocmdBlock " Highlight commonly used Groupnames {{{2 -syn keyword vimGroup contained Comment Constant String Character Number Boolean Float Identifier Function Statement Conditional Repeat Label Operator Keyword Exception PreProc Include Define Macro PreCondit Type StorageClass Structure Typedef Special SpecialChar Tag Delimiter SpecialComment Debug Underlined Ignore Error Todo +" GEN_SYN_VIM: vimGroup, START_STR='syn keyword vimGroup contained', END_STR='' +syn keyword vimGroup contained Added Bold BoldItalic Boolean Changed Character Comment Conditional Constant Debug Define Delimiter Error Exception Float Function Identifier Ignore Include Italic Keyword Label Macro Number Operator PreCondit PreProc Removed Repeat Special SpecialChar SpecialComment Statement StorageClass String Structure Tag Todo Type Typedef Underlined " Default highlighting groups {{{2 " GEN_SYN_VIM: vimHLGroup, START_STR='syn keyword vimHLGroup contained', END_STR='' -syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM LineNrAbove LineNrBelow +syn keyword vimHLGroup contained ErrorMsg IncSearch ModeMsg NonText StatusLine StatusLineNC EndOfBuffer VertSplit VisualNOS DiffText DiffTextAdd PmenuSbar TabLineSel TabLineFill TabPanel TabPanelSel TabPanelFill Cursor lCursor QuickFixLine CursorLineSign CursorLineFold CurSearch PmenuKind PmenuKindSel PmenuMatch PmenuMatchSel PmenuExtra PmenuExtraSel PopupSelected MessageWindow PopupNotification Normal Directory LineNr CursorLineNr MoreMsg Question Search SpellBad SpellCap SpellRare SpellLocal PmenuThumb Pmenu PmenuSel SpecialKey Title WarningMsg WildMenu Folded FoldColumn SignColumn Visual DiffAdd DiffChange DiffDelete TabLine CursorColumn CursorLine ColorColumn MatchParen StatusLineTerm StatusLineTermNC ToolbarLine ToolbarButton Menu Tooltip Scrollbar CursorIM +syn keyword vimHLGroup contained ComplMatchIns LineNrAbove LineNrBelow MsgArea Terminal User1 User2 User3 User4 User5 User6 User7 User8 User9 syn match vimHLGroup contained "\" syn case match " Function Names {{{2 " GEN_SYN_VIM: vimFuncName, START_STR='syn keyword vimFuncName contained', END_STR='' syn keyword vimFuncName contained abs acos add and append appendbufline argc argidx arglistid argv asin assert_beeps assert_equal assert_equalfile assert_exception assert_fails assert_false assert_inrange assert_match assert_nobeep assert_notequal assert_notmatch assert_report assert_true atan atan2 autocmd_add autocmd_delete autocmd_get balloon_gettext balloon_show balloon_split base64_decode base64_encode bindtextdomain blob2list blob2str browse browsedir bufadd bufexists buflisted bufload bufloaded bufname bufnr bufwinid bufwinnr byte2line byteidx byteidxcomp call ceil ch_canread ch_close ch_close_in ch_evalexpr ch_evalraw ch_getbufnr ch_getjob ch_info ch_log ch_logfile ch_open ch_read ch_readblob ch_readraw ch_sendexpr ch_sendraw ch_setoptions ch_status changenr -syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches col complete complete_add complete_check complete_info confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect get getbufinfo getbufline getbufoneline -syn keyword vimFuncName contained getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto histadd histdel histget histnr hlID hlexists hlget hlset hostname -syn keyword vimFuncName contained iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str list2tuple listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode mzeval nextnonblank ngettext nr2char or pathshorten perleval popup_atcursor -syn keyword vimFuncName contained popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground -syn keyword vimFuncName contained remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword -syn keyword vimFuncName contained spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors term_setapi term_setkill term_setrestore term_setsize term_start term_wait -syn keyword vimFuncName contained terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_null_tuple test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc tuple2list type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode win_execute win_findbuf win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline -syn keyword vimFuncName contained win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor +syn keyword vimFuncName contained char2nr charclass charcol charidx chdir cindent clearmatches cmdcomplete_info col complete complete_add complete_check complete_info complete_match confirm copy cos cosh count cscope_connection cursor debugbreak deepcopy delete deletebufline did_filetype diff diff_filler diff_hlID digraph_get digraph_getlist digraph_set digraph_setlist echoraw empty environ err_teapot escape eval eventhandler executable execute exepath exists exists_compiled exp expand expandcmd extend extendnew feedkeys filecopy filereadable filewritable filter finddir findfile flatten flattennew float2nr floor fmod fnameescape fnamemodify foldclosed foldclosedend foldlevel foldtext foldtextresult foreach foreground fullcommand funcref function garbagecollect +syn keyword vimFuncName contained get getbufinfo getbufline getbufoneline getbufvar getcellpixels getcellwidths getchangelist getchar getcharmod getcharpos getcharsearch getcharstr getcmdcomplpat getcmdcompltype getcmdline getcmdpos getcmdprompt getcmdscreenpos getcmdtype getcmdwintype getcompletion getcompletiontype getcurpos getcursorcharpos getcwd getenv getfontname getfperm getfsize getftime getftype getimstatus getjumplist getline getloclist getmarklist getmatches getmousepos getmouseshape getpid getpos getqflist getreg getreginfo getregion getregionpos getregtype getscriptinfo getstacktrace gettabinfo gettabvar gettabwinvar gettagstack gettext getwininfo getwinpos getwinposx getwinposy getwinvar glob glob2regpat globpath has has_key haslocaldir hasmapto +syn keyword vimFuncName contained histadd histdel histget histnr hlID hlexists hlget hlset hostname iconv id indent index indexof input inputdialog inputlist inputrestore inputsave inputsecret insert instanceof interrupt invert isabsolutepath isdirectory isinf islocked isnan items job_getchannel job_info job_setoptions job_start job_status job_stop join js_decode js_encode json_decode json_encode keys keytrans len libcall libcallnr line line2byte lispindent list2blob list2str list2tuple listener_add listener_flush listener_remove localtime log log10 luaeval map maparg mapcheck maplist mapnew mapset match matchadd matchaddpos matcharg matchbufline matchdelete matchend matchfuzzy matchfuzzypos matchlist matchstr matchstrlist matchstrpos max menu_info min mkdir mode +syn keyword vimFuncName contained mzeval nextnonblank ngettext nr2char or pathshorten perleval popup_atcursor popup_beval popup_clear popup_close popup_create popup_dialog popup_filter_menu popup_filter_yesno popup_findecho popup_findinfo popup_findpreview popup_getoptions popup_getpos popup_hide popup_list popup_locate popup_menu popup_move popup_notification popup_setbuf popup_setoptions popup_settext popup_show pow prevnonblank printf prompt_getprompt prompt_setcallback prompt_setinterrupt prompt_setprompt prop_add prop_add_list prop_clear prop_find prop_list prop_remove prop_type_add prop_type_change prop_type_delete prop_type_get prop_type_list pum_getpos pumvisible py3eval pyeval pyxeval rand range readblob readdir readdirex readfile reduce reg_executing +syn keyword vimFuncName contained reg_recording reltime reltimefloat reltimestr remote_expr remote_foreground remote_peek remote_read remote_send remote_startserver remove rename repeat resolve reverse round rubyeval screenattr screenchar screenchars screencol screenpos screenrow screenstring search searchcount searchdecl searchpair searchpairpos searchpos server2client serverlist setbufline setbufvar setcellwidths setcharpos setcharsearch setcmdline setcmdpos setcursorcharpos setenv setfperm setline setloclist setmatches setpos setqflist setreg settabvar settabwinvar settagstack setwinvar sha256 shellescape shiftwidth sign_define sign_getdefined sign_getplaced sign_jump sign_place sign_placelist sign_undefine sign_unplace sign_unplacelist simplify sin sinh slice +syn keyword vimFuncName contained sort sound_clear sound_playevent sound_playfile sound_stop soundfold spellbadword spellsuggest split sqrt srand state str2blob str2float str2list str2nr strcharlen strcharpart strchars strdisplaywidth strftime strgetchar stridx string strlen strpart strptime strridx strtrans strutf16len strwidth submatch substitute swapfilelist swapinfo swapname synID synIDattr synIDtrans synconcealed synstack system systemlist tabpagebuflist tabpagenr tabpagewinnr tagfiles taglist tan tanh tempname term_dumpdiff term_dumpload term_dumpwrite term_getaltscreen term_getansicolors term_getattr term_getcursor term_getjob term_getline term_getscrolled term_getsize term_getstatus term_gettitle term_gettty term_list term_scrape term_sendkeys term_setansicolors +syn keyword vimFuncName contained term_setapi term_setkill term_setrestore term_setsize term_start term_wait terminalprops test_alloc_fail test_autochdir test_feedinput test_garbagecollect_now test_garbagecollect_soon test_getvalue test_gui_event test_ignore_error test_mswin_event test_null_blob test_null_channel test_null_dict test_null_function test_null_job test_null_list test_null_partial test_null_string test_null_tuple test_option_not_set test_override test_refcount test_setmouse test_settime test_srand_seed test_unknown test_void timer_info timer_pause timer_start timer_stop timer_stopall tolower toupper tr trim trunc tuple2list type typename undofile undotree uniq utf16idx values virtcol virtcol2col visualmode wildmenumode wildtrigger win_execute win_findbuf +syn keyword vimFuncName contained win_getid win_gettype win_gotoid win_id2tabwin win_id2win win_move_separator win_move_statusline win_screenpos win_splitmove winbufnr wincol windowsversion winheight winlayout winline winnr winrestcmd winrestview winsaveview winwidth wordcount writefile xor " Predefined variable names {{{2 " GEN_SYN_VIM: vimVarName, START_STR='syn keyword vimVimVarName contained', END_STR='' syn keyword vimVimVarName contained count count1 prevcount errmsg warningmsg statusmsg shell_error this_session version lnum termresponse fname lang lc_time ctype charconvert_from charconvert_to fname_in fname_out fname_new fname_diff cmdarg foldstart foldend folddashes foldlevel progname servername dying exception throwpoint register cmdbang insertmode val key profiling fcs_reason fcs_choice beval_bufnr beval_winnr beval_winid beval_lnum beval_col beval_text scrollstart swapname swapchoice swapcommand char mouse_win mouse_winid mouse_lnum mouse_col operator searchforward hlsearch oldfiles windowid progpath completed_item option_new option_old option_oldlocal option_oldglobal option_command option_type errors false true none null numbermax numbermin numbersize -syn keyword vimVimVarName contained vim_did_enter testing t_number t_string t_func t_list t_dict t_float t_bool t_none t_job t_channel t_blob t_class t_object termrfgresp termrbgresp termu7resp termstyleresp termblinkresp event versionlong echospace argv collate exiting colornames sizeofint sizeoflong sizeofpointer maxcol python3_version t_typealias t_enum t_enumvalue stacktrace t_tuple +syn keyword vimVimVarName contained vim_did_enter testing t_number t_string t_func t_list t_dict t_float t_bool t_none t_job t_channel t_blob t_class t_object termrfgresp termrbgresp termu7resp termstyleresp termblinkresp event versionlong echospace argv collate exiting colornames sizeofint sizeoflong sizeofpointer maxcol python3_version t_typealias t_enum t_enumvalue stacktrace t_tuple wayland_display clipmethod "--- syntax here and above generated by runtime/syntax/generator/gen_syntax_vim.vim --- @@ -252,13 +275,6 @@ if exists("g:vimsyntax_noerror") let g:vimsyn_noerror= g:vimsyntax_noerror endif -" Variable options {{{2 -if exists("g:vim_maxlines") - let s:vimsyn_maxlines= g:vim_maxlines -else - let s:vimsyn_maxlines= 60 -endif - " Nulls {{{2 " ===== Vim9 syn keyword vim9Null null null_blob null_channel null_class null_dict null_function null_job null_list null_object null_partial null_string @@ -270,23 +286,24 @@ Vim9 syn keyword vim9Boolean true false " Numbers {{{2 " ======= syn case ignore -syn match vimNumber '\<\d\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript -syn match vimNumber '\<\d\+\.\d\+\%(e[+-]\=\d\+\)\=' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment -syn match vimNumber '\<0b[01]\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript -syn match vimNumber '\<0o\=\o\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript -syn match vimNumber '\<0x\x\+' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript -syn match vimNumber '\<0z\>' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment -syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=vimGlobal,vimSubst1,@vimComment,vimSubscript +syn match vimNumber "\<\d\+\%('\d\+\)*" skipwhite nextgroup=@vimComment,vimSubscript,vimGlobal,vimSubst1 +syn match vimNumber "\<\d\+\%('\d\+\)*\.\d\+\%(e[+-]\=\d\+\)\=" skipwhite nextgroup=@vimComment +syn match vimNumber "\<0b[01]\+\%('[01]\+\)*" skipwhite nextgroup=@vimComment,vimSubscript +syn match vimNumber "\<0o\=\o\+\%('\o\+\)*" skipwhite nextgroup=@vimComment,vimSubscript +syn match vimNumber "\<0x\x\+\%('\x\+\)*" skipwhite nextgroup=@vimComment,vimSubscript +syn match vimNumber '\<0z\>' skipwhite nextgroup=@vimComment +syn match vimNumber '\<0z\%(\x\x\)\+\%(\.\%(\x\x\)\+\)*' skipwhite nextgroup=@vimComment,vimSubscript syn case match " All vimCommands are contained by vimIsCommand. {{{2 -syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutoCmd,vimAugroup,vimBehave,vimCall,vimCatch,vimConst,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,@vimEcho,vimEnddef,vimEndfunction,vimExecute,vimIsCommand,vimExtCmd,vimFor,vimFunction,vimFuncFold,vimGlobal,vimHighlight,vimLet,vimLoadkeymap,vimLockvar,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimSet,vimSleep,vimSyntax,vimThrow,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList +syn cluster vimCmdList contains=vimAbb,vimAddress,vimAutocmd,vimAugroup,vimBehave,vimCall,vimCatch,vimCommandModifier,vimConst,vimDoautocmd,vimDebuggreedy,vimDef,vimDefFold,vimDelcommand,vimDelFunction,@vimEcho,vimElse,vimEnddef,vimEndfunction,vimEndif,vimEval,vimExecute,vimIsCommand,vimExtCmd,vimExFilter,vimExMark,vimFiletype,vimFor,vimFunction,vimFunctionFold,vimGrep,vimGrepAdd,vimGlobal,vimHelpgrep,vimHighlight,vimImport,vimLet,vimLoadkeymap,vimLockvar,vimMake,vimMap,vimMark,vimMatch,vimNotFunc,vimNormal,vimProfdel,vimProfile,vimRedir,vimSet,vimSleep,vimSort,vimSyntax,vimSynColor,vimSynLink,vimThrow,vimUniq,vimUnlet,vimUnlockvar,vimUnmap,vimUserCmd,vimVimgrep,vimVimgrepadd,vimMenu,vimMenutranslate,@vim9CmdList,@vimExUserCmdList,vimLua,vimMzScheme,vimPerl,vimPython,vimPython3,vimPythonX,vimRuby,vimTcl syn cluster vim9CmdList contains=vim9Abstract,vim9Class,vim9Const,vim9Enum,vim9Export,vim9Final,vim9For,vim9Interface,vim9Type,vim9Var -syn match vimCmdSep "\\\@1" nextgroup=vimBang contains=vimCommand +syn match vimIsCommand "\<\h\w*\>" nextgroup=vimBang contains=vimCommand syn match vimBang contained "!" +syn match vimWhitespace contained "\s\+" syn region vimSubscript contained matchgroup=vimSubscriptBracket start="\[" end="]" nextgroup=vimSubscript contains=@vimExprList @@ -304,19 +321,20 @@ syn match vimVimVar "\" contains=vim9Super,vim9This -Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript -Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+[-+/*%]\==" +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s\+\.\.=" +Vim9 syn match vim9LhsVariable "\s\=\%([bwgt]:\)\=\h[a-zA-Z0-9#_]*\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVarScope +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\[" nextgroup=vimSubscript +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\." nextgroup=vimOper contains=vim9Super,vim9This +Vim9 syn match vim9LhsVariable "\s\=\h[a-zA-Z0-9#_]*\ze\s*->" contains=vim9Super,vim9This -Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+[-+/*%]\==" contains=vimVar,@vimSpecialVar -Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+\.\.=" contains=vimVar,@vimSpecialVar +Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+[-+/*%]\==" contains=vimVar,@vimSpecialVar +Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+=<<" skipwhite nextgroup=vimLetHeredoc contains=vimVar,@vimSpecialVar +Vim9 syn match vim9LhsVariableList "\[\_[^]]\+]\ze\s\+\.\.=" contains=vimVar,@vimSpecialVar Vim9 syn match vim9LhsRegister "@["0-9\-a-zA-Z#=*+_/]\ze\s\+\%(\.\.\)\==" -syn cluster vimExprList contains=@vimSpecialVar,vimFunc,vimNumber,vimOper,vimOperParen,vimLambda,vimString,vimVar,@vim9ExprList +syn cluster vimExprList contains=@vimSpecialVar,@vimFunc,vimNumber,vimOper,vimOperParen,vimLambda,vimString,vimVar,@vim9ExprList syn cluster vim9ExprList contains=vim9Boolean,vim9LambdaParams,vim9Null " Insertions And Appends: insert append {{{2 @@ -339,7 +357,7 @@ syn keyword vimBehaveModel contained mswin xterm " Call {{{2 " ==== -syn match vimCall "\" skipwhite nextgroup=vimFunc +syn match vimCall "\" skipwhite nextgroup=vimVar,@vimFunc " Debuggreedy {{{2 " =========== @@ -366,37 +384,89 @@ endif syn keyword vimFTCmd contained filet[ype] syn keyword vimFTOption contained detect indent off on plugin -" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2 -" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking. -syn cluster vimAugroupList contains=@vimCmdList,vimFilter,vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue -syn match vimAugroup "\" contains=vimAugroupKey,vimAugroupBang skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup -if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'a' - syn region vimAugroup fold start="\\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd +" Import {{{2 +" ====== +syn keyword vimImportAutoload contained autoload skipwhite nextgroup=vimImportFilename +if s:vim9script + syn region vimImportFilename contained + \ start="\S" + \ skip=+\%#=1 + "\ continuation operators at SOL + \\n\%(\s*#.*\n\)*\s*\%([[:punct:]]\+\&[^#"'(]\) + \\| + "\ continuation operators at EOL + \\%(\%([[:punct:]]\+\&[^#"')]\)\s*\%(#.*\)\=\)\@<=$ + \\| + \\n\%(\s*#.*\n\)*\s*as\s + \\| + \\%(^\s*#.*\)\@<=$ + \\| + \\n\s*\%(\\\|#\\ \) + \+ + \ matchgroup=vimCommand + \ end="\s\+\zsas\ze\s\+\h" + \ matchgroup=NONE + \ end="$" + \ skipwhite nextgroup=vimImportName + \ contains=@vim9Continue,@vimExprList,vim9Comment + \ transparent else - syn region vimAugroup start="\\ze\s\+\%([eE][nN][dD]\)\@!\S\+" matchgroup=vimAugroupKey end="\\ze\s\+[eE][nN][dD]\>" contains=vimAutoCmd,@vimAugroupList,vimAugroupkey skipwhite nextgroup=vimAugroupEnd + syn region vimImportFilename contained + \ start="\S" + \ skip=+\n\s*\%(\\\|"\\ \)+ + \ matchgroup=vimCommand + \ end="\s\+\zsas\ze\s\+\h" + \ matchgroup=NONE + \ end="$" + \ skipwhite nextgroup=vimImportName + \ contains=@vimContinue,@vimExprList + \ transparent endif +syn match vimImportName contained "\%(\" skipwhite nextgroup=@vimComment +syn match vimImport "\" skipwhite nextgroup=vimImportAutoload,vimImportFilename + +" Augroup : vimAugroupError removed because long augroups caused sync'ing problems. {{{2 +" ======= : Trade-off: Increasing synclines with slower editing vs augroup END error checking. +syn cluster vimAugroupList contains=@vimCmdList,vimFilter,@vimFunc,vimLineComment,vimSpecFile,vimOper,vimNumber,vimOperParen,@vimComment,vimString,vimSubst,vimRegister,vimCmplxRepeat,vimNotation,vimCtrlChar,vimContinue + +" define +VimFolda syn region vimAugroup + \ start="\\ze\s\+\%([eE][nN][dD]\)\@!\S\+" + \ matchgroup=vimAugroupKey + \ end="\\ze\s\+[eE][nN][dD]\>" + \ skipwhite nextgroup=vimAugroupEnd + \ contains=vimAutocmd,@vimAugroupList,vimAugroupkey if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_noaugrouperror") - syn match vimAugroupError "\\s\+[eE][nN][dD]\>" + syn match vimAugroupError "\\s\+[eE][nN][dD]\>" endif -syn match vimAutoCmdGroup contained "\S\+" -syn match vimAugroupEnd contained "\c\" -syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoCmdGroup -syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAutoCmdGroup,vimAugroupEnd +" TODO: Vim9 comment +syn match vimAugroupName contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+" + \ skipwhite nextgroup=vimCmdSep,vimComment +syn match vimAugroupEnd contained "\c\" skipwhite nextgroup=vimCmdSep,vimComment +syn match vimAugroupBang contained "\a\@1<=!" skipwhite nextgroup=vimAugroupName +syn keyword vimAugroupKey contained aug[roup] skipwhite nextgroup=vimAugroupBang,vimAugroupName,vimAugroupEnd + +" remove +syn match vimAugroup "\\ze\s*\%(["|]\|$\)" skipwhite nextgroup=vimCmdSep,vimComment contains=vimAugroupKey +Vim9 syn match vimAugroup "\\ze\s*\%([#|]\|$\)" skipwhite nextgroup=vimCmdSep,vim9Comment contains=vimAugroupKey " Operators: {{{2 " ========= -syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment +syn cluster vimOperGroup contains=@vimContinue,@vimExprList,vim9Comment,vim9LineComment,vimContinueString syn match vimOper "\a\@=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile -syn match vimOper "\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimSpecFile -syn match vimOper "\=\|<=\|=\~\|!\~\|>\|<\)[?#]\=" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile +syn match vimOper "\" skipwhite skipnl nextgroup=@vimOperContinue,@vimExprList,vimContinueString,vimSpecFile +syn match vimOper "\" skipwhite nextgroup=@vimExprList -syn region vimLambda contained matchgroup=Delimiter start="{\ze[[:space:][:alnum:]_.,]*->" end="}" end="$" skip=+\s*\n\s*\\\|\s*\n\s*"\\ + contains=@vimContinue,@vimExprList,vimLambdaParams -syn match vimLambdaParams contained "{\@1<=.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=vimFuncParam - -syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment -syn match vim9LambdaParamsParen contained "[()]" -syn region vim9LambdaParams contained - \ matchgroup=vim9LambdaParamsParen - \ start="(\ze\s*\(\.\.\.\)\=\h\w*[,:]\%(\s\|$\)" - \ start="(\ze\s*\n - "\ line continuations - \\%(\s*\%(#\\ .*\|\\\s*\)\n\)*\s*\\\s* - "\ parameter names - \\(\.\.\.\)\=\h\w*[,:]\%(\s\|$\)" - \ end=")\ze\%(:\s\|\s\+=>\)" - \ matchgroup=vimContinue - \ end="^\s*\\\ze\s\+=>" - \ skipwhite nextgroup=vim9LambdaReturnType,vim9LambdaOperator - \ contains=@vim9Continue,vimDefParam,vim9LambdaParamsParen -syn match vim9LambdaParams contained "(\s*)\|(\s*\(\.\.\.\)\=\h\w*\s*)\ze\%(:\s\|\s\+=>\)" skipwhite nextgroup=vim9LambdaReturnType,vim9LambdaOperator contains=vimDefParam,vim9LambdaParamsParen - -syn region vim9LambdaReturnType contained start=":\s" end="$" end="\ze#" end="\ze=>" skipwhite skipempty nextgroup=vim9LambdaOperator,vim9LamdaOperatorComment contains=vimTypeSep transparent -syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList +syn region vimLambda contained + \ matchgroup=vimLambdaBrace + \ start=+{\ze[[:space:][:alnum:]_.,]*\%(\n\s*\%(\\[[:space:][:alnum:]_.,]*\|"\\ .*\)\)*->+ + \ skip=+\n\s*\%(\\\|"\\ \)+ + \ end="}" end="$" + \ contains=@vimContinue,@vimExprList,vimLambdaParams +syn match vimLambdaParams contained "\%({\n\=\)\@1<=\_.\{-}\%(->\)\@=" nextgroup=vimLambdaOperator contains=@vimContinue,vimFunctionParam + +syn match vim9LambdaOperator contained "=>" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment +syn match vim9LambdaParen contained "[()]" +syn match vim9LambdaParams contained + \ "(\%(\" + \ skipwhite nextgroup=vim9LambdaOperator + \ contains=@vim9Continue,vimDefParam,vim9LambdaParen,vim9LambdaReturnType +syn region vim9LambdaReturnType contained start=")\@<=:\s" end="\ze\s*#" end="\ze\s*=>" contains=@vim9Continue,@vimType transparent +syn region vim9LambdaBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList syn match vim9LambdaOperatorComment contained "#.*" skipwhite skipempty nextgroup=@vimExprList,vim9LambdaBlock,vim9LambdaOperatorComment " Functions: Tag is provided for those who wish to highlight tagged functions {{{2 " ========= -syn cluster vimFuncList contains=vimFuncBang,vimFunctionError,vimFuncKey,vimFuncScope,vimFuncSID,Tag -syn cluster vimDefList contains=vimFuncBang,vimFunctionError,vimDefKey,vimFuncScope,vimFuncSID,Tag - -syn cluster vimFuncBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunc,vimFunction,vimLetHereDoc,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFuncFold,vimDefFold -syn cluster vimFuncBodyList contains=@vimFuncBodyCommon,vimComment,vimLineComment,vimInsert,vimConst,vimLet,vimSearch -syn cluster vimDefBodyList contains=@vimFuncBodyCommon,vim9Comment,vim9LineComment,vim9Block,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9LhsVariable,vim9LhsVariableList,vim9LhsRegister,vim9Search,@vimSpecialVar - -syn region vimFuncPattern contained matchgroup=vimOper start="/" end="$" contains=@vimSubstList -syn match vimFunction "\" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimFuncKey -syn match vimDef "\" skipwhite nextgroup=vimCmdSep,vimComment,vimFuncPattern contains=vimDefKey +syn cluster vimFunctionBodyCommon contains=@vimCmdList,vimCmplxRepeat,vimContinue,vimCtrlChar,vimDef,vimFBVar,vimFunction,vimNotFunc,vimNumber,vimOper,vimOperParen,vimRegister,vimSpecFile,vimString,vimSubst,vimFunctionFold,vimDefFold,vimCmdSep +syn cluster vimFunctionBodyList contains=@vimFunctionBodyCommon,vimComment,vimLineComment,vimInsert,vimConst,vimLet,vimSearch +syn cluster vimDefBodyList contains=@vimFunctionBodyCommon,vim9Comment,vim9LineComment,vim9Block,vim9Const,vim9Final,vim9Var,vim9Null,vim9Boolean,vim9For,vim9LhsVariable,vim9LhsVariableList,vim9LhsRegister,vim9Search,@vimSpecialVar,@vim9Func -syn match vimFunction "\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimFuncList skipwhite nextgroup=vimFuncParams -syn match vimDef "\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+" contains=@vimDefList nextgroup=vimDefParams - -syn region vimFuncComment contained +syn region vimFunctionPattern contained + \ matchgroup=vimOper + \ start="/" + \ end="$" + \ contains=@vimSubstList + +syn match vimFunctionBang contained "\a\@1<=!" skipwhite nextgroup=vimFunctionName +syn match vimDefBang contained "\a\@1<=!" skipwhite nextgroup=vimDefName +syn match vimFunctionSID contained "\c" +syn match vimFunctionScope contained "\<[bwglstav]:" +syn match vimFunctionName contained + \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+" + \ skipwhite nextgroup=vimFunctionParams,vimCmdSep,vimComment,vim9Comment + \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag +syn match vimDefName contained + \ "\%(<[sS][iI][dD]>\|[bwglstav]:\)\=\%([[:alnum:]_#.]\+\|{.\{-1,}}\)\+" + \ nextgroup=vimDefParams,vimCmdSep,vimComment,vim9Comment + \ contains=vimFunctionError,vimFunctionScope,vimFunctionSID,Tag + +syn match vimFunction "\" skipwhite nextgroup=vimFunctionBang,vimFunctionName,vimFunctionPattern,vimCmdSep,vimComment +syn match vimDef "\" skipwhite nextgroup=vimDefBang,vimDefName,vimFunctionPattern,vimCmdSep,vimComment + +syn region vimFunctionComment contained \ start=+".*+ - \ skip=+\n\s*\\\|\n\s*"\\ + + \ skip=+\n\s*\%(\\\|"\\ \)+ \ end="$" - \ skipwhite skipempty nextgroup=vimFuncBody,vimEndfunction + \ skipwhite skipempty nextgroup=vimFunctionBody,vimEndfunction syn region vimDefComment contained \ start="#.*" - \ skip=+\n\s*\\\|\n\s*#\\ + + \ skip=+\n\s*\%(\\\|#\\ \)+ \ end="$" \ skipwhite skipempty nextgroup=vimDefBody,vimEnddef -syn match vimFuncBang contained "!" -syn match vimFuncSID contained "\c" -syn match vimFuncScope contained "\<[sg]:" -syn keyword vimFuncKey contained fu[nction] -syn keyword vimDefKey contained def - -syn region vimFuncParams contained matchgroup=Delimiter start="(" skip=+\n\s*\\\|\n\s*"\\ + end=")" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError contains=vimFuncParam,vimOperParen,@vimContinue -syn region vimDefParams contained matchgroup=Delimiter start="(" end=")" skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError contains=vimDefParam,vim9Comment,vimFuncParamEquals,vimOperParen -syn match vimFuncParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFuncParamEquals -syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFuncParamEquals - -syn match vimFuncParamEquals contained "=" skipwhite nextgroup=@vimExprList -syn match vimFuncMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFuncBody,vimFuncComment,vimEndfunction,vimFuncMod,vim9CommentError - -syn region vimFuncBody contained start="^." matchgroup=vimCmdSep start="|" matchgroup=vimCommand end="\" contains=@vimFuncBodyList skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError -syn region vimDefBody contained start="^." matchgroup=vimCmdSep start="|" matchgroup=vimCommand end="\" contains=@vimDefBodyList skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError +syn region vimFunctionParams contained + \ matchgroup=Delimiter + \ start="(" + \ skip=+\n\s*\%(\\\|"\\ \)+ + \ end=")" + \ skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError + \ contains=vimFunctionParam,vimOperParen,@vimContinue +syn region vimDefParams contained + \ matchgroup=Delimiter + \ start="(" + \ end=")" + \ skipwhite skipempty nextgroup=vimDefBody,vimDefComment,vimEnddef,vimReturnType,vimCommentError + \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals,vimOperParen +syn match vimFunctionParam contained "\<\h\w*\>\|\.\.\." skipwhite nextgroup=vimFunctionParamEquals +syn match vimDefParam contained "\<\h\w*\>" skipwhite nextgroup=vimParamType,vimFunctionParamEquals + +syn match vimFunctionParamEquals contained "=" skipwhite nextgroup=@vimExprList +syn match vimFunctionMod contained "\<\%(abort\|closure\|dict\|range\)\>" skipwhite skipempty nextgroup=vimFunctionBody,vimFunctionComment,vimEndfunction,vimFunctionMod,vim9CommentError + +syn region vimFunctionBody contained + \ start="^." + \ matchgroup=vimCommand + \ end="\" + \ skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError + \ contains=@vimFunctionBodyList +syn region vimDefBody contained + \ start="^." + \ matchgroup=vimCommand + \ end="\" + \ skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError + \ contains=@vimDefBodyList -syn match vimEndfunction "\" skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError -syn match vimEnddef "\" skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError +syn match vimEndfunction "\" skipwhite nextgroup=vimCmdSep,vimComment,vim9CommentError +syn match vimEnddef "\" skipwhite nextgroup=vimCmdSep,vim9Comment,vimCommentError if exists("g:vimsyn_folding") && g:vimsyn_folding =~# 'f' - syn region vimFuncFold start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\|{.\{-1,}}\)\+\s*(" end="\" contains=vimFunction fold keepend extend transparent - syn region vimDefFold start="\!\=\s*\%(<[sS][iI][dD]>\|[sg]:\)\=\%(\i\|[#.]\)\+(" end="\" contains=vimDef fold keepend extend transparent + syn region vimFunctionFold + \ start="\" skipwhite nextgroup=vimDelfunctionBang,vimFunctionName " Types: {{{2 " ===== @@ -506,36 +610,39 @@ syn region vimReturnType contained syn match vimParamType contained ":\s" skipwhite skipnl nextgroup=@vimType contains=vimTypeSep syn match vimTypeSep contained ":\%(\s\|\n\)\@=" skipwhite nextgroup=@vimType -syn keyword vimType contained any blob bool channel float job number string void -syn match vimType contained "\" -syn region vimCompoundType contained matchgroup=vimType start="\" +syn region vimCompoundType contained matchgroup=vimType start="\" -syn cluster vimType contains=vimType,vimCompoundType,vimUserType +syn cluster vimType contains=vimType,vimTypeAny,vimCompoundType,vimUserType " Classes, Enums And Interfaces: {{{2 " ============================= if s:vim9script + " Methods {{{3 syn match vim9MethodDef contained "\" skipwhite nextgroup=vim9MethodDefName,vim9ConstructorDefName syn match vim9MethodDefName contained "\<\h\w*\>" nextgroup=vim9MethodDefParams contains=@vim9MethodName syn region vim9MethodDefParams contained \ matchgroup=Delimiter start="(" end=")" \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vim9MethodDefReturnType,vimCommentError - \ contains=vimDefParam,vim9Comment,vimFuncParamEquals + \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals syn match vim9ConstructorDefName contained "\<_\=new\w*\>" \ nextgroup=vim9ConstructorDefParams \ contains=@vim9MethodName syn match vim9ConstructorDefParam contained "\<\%(this\.\)\=\h\w*\>" - \ skipwhite nextgroup=vimParamType,vimFuncParamEquals + \ skipwhite nextgroup=vimParamType,vimFunctionParamEquals \ contains=vim9This,vimOper syn region vim9ConstructorDefParams contained \ matchgroup=Delimiter start="(" end=")" \ skipwhite skipnl nextgroup=vim9MethodDefBody,vim9MethodDefComment,vimEnddef,vimCommentError - \ contains=vim9ConstructorDefParam,vim9Comment,vimFuncParamEquals + \ contains=vim9ConstructorDefParam,vim9Comment,vimFunctionParamEquals syn region vim9MethodDefReturnType contained \ start=":\%(\s\|\n\)\@=" @@ -597,10 +704,48 @@ if s:vim9script VimFoldc syn region vim9ClassBody start="\" matchgroup=vimCommand end="\" contains=@vim9ClassBodyList transparent " Enums {{{3 - syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,vim9Implements,@vim9MethodDef,vim9Const,vim9Final,vim9Var - - syn match vim9Enum contained "\" skipwhite nextgroup=vim9EnumName - syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9Implements + syn cluster vim9EnumBodyList contains=vim9Comment,vim9LineComment,@vim9Continue,vim9Enum,@vimExprList,@vim9MethodDef,vim9Public,vim9Static,vim9Const,vim9Final,vim9This,vim9Var + + syn match vim9Enum contained "\" skipwhite nextgroup=vim9EnumName + + syn match vim9EnumName contained "\<\u\w*\>" skipwhite skipempty nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements + syn match vim9EnumNameTrailing contained "\S.*" + syn region vim9EnumNameComment contained + \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$" + \ skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue + \ contains=@vimCommentGroup,vimCommentString + " vim9EnumName's "skipempty" should only apply to comments and enum values and not implements clauses + syn match vim9EnumNameEmpty contained "^" skipwhite skipempty nextgroup=vim9EnumNameComment,vim9EnumValue + " allow line continuation between enum name and "implements" + syn match vim9EnumNameContinue contained + \ "^\s*\\" + \ skipwhite skipnl nextgroup=vim9EnumNameTrailing,vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue,vim9EnumImplements + \ contains=vimWhitespace + syn match vim9EnumNameContinueComment contained + \ "^\s*#\\ .*" + \ skipwhite skipnl nextgroup=vim9EnumNameEmpty,vim9EnumNameComment,@vim9EnumNameContinue + \ contains=vimWhitespace + syn cluster vim9EnumNameContinue contains=vim9EnumNameContinue,vim9EnumNameContinueComment + + " enforce enum value list location + syn match vim9EnumValue contained "\<\a\w*\>" nextgroup=vim9EnumValueArgList,vim9EnumValueListComma,vim9Comment + syn match vim9EnumValueListComma contained "," skipwhite skipempty nextgroup=vim9EnumValue,vim9EnumValueListCommaComment + syn region vim9EnumValueListCommaComment contained + \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$" + \ skipwhite skipempty nextgroup=vim9EnumValueListCommaComment,vim9EnumValue + \ contains=@vimCommentGroup,vimCommentString + syn region vim9EnumValueArgList contained + \ matchgroup=vimParenSep start="(" end=")" + \ nextgroup=vim9EnumValueListComma + \ contains=@vimExprList,vimContinueString,vim9Comment + + syn keyword vim9EnumImplements contained implements skipwhite nextgroup=vim9EnumImplementedInterface + syn match vim9EnumImplementedInterface contained "\<\u\w*\>" skipwhite skipnl nextgroup=vim9EnumInterfaceListComma,vim9EnumImplementedInterfaceComment,vim9EnumValue + syn match vim9EnumInterfaceListComma contained "," skipwhite nextgroup=vim9EnumImplementedInterface + syn region vim9EnumImplementedInterfaceComment contained + \ start="#" skip="\n\s*\%(\\\|#\\ \)" end="$" + \ skipwhite skipempty nextgroup=vim9EnumImplementedInterfaceComment,vim9EnumValue + \ contains=@vimCommentGroup,vimCommentString VimFolde syn region vim9EnumBody start="\" matchgroup=vimCommand end="\" contains=@vim9EnumBodyList transparent @@ -616,7 +761,7 @@ if s:vim9script syn region vim9AbstractDefParams contained \ matchgroup=Delimiter start="(" end=")" \ skipwhite skipnl nextgroup=vimDefComment,vim9AbstractDefReturnType,vimCommentError - \ contains=vimDefParam,vim9Comment,vimFuncParamEquals + \ contains=vimDefParam,vim9Comment,vimFunctionParamEquals syn region vim9AbstractDefReturnType contained \ start=":\s" end="$" matchgroup=vim9Comment end="\ze[#"]" \ skipwhite skipnl nextgroup=vimDefComment,vimCommentError @@ -636,7 +781,12 @@ endif " Blocks: {{{2 " ====== -Vim9 syn region vim9Block matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList +Vim9 syn region vim9Block + \ matchgroup=vimSep + \ start="{\ze\s*\%($\|[#|]\)" + \ end="^\s*\zs}" + \ skipwhite nextgroup=vim9Comment,vimCmdSep + \ contains=@vimDefBodyList " Keymaps: {{{2 " ======= @@ -668,23 +818,31 @@ syn match vimSpecFileMod "\(:[phtre]\)\+" contained " User-Specified Commands: {{{2 " ======================= -syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange -syn keyword vimUserCmdKey contained com[mand] -syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock -syn match vimUserCmd "\!\=.*$" contains=vimUserCmdKey,vimBang,vimUserCmdAttr,vimUserCmdAttrError,vimUserCmdName,@vimUserCmdList,vimComFilter -syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)" -syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr -syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrCmplt,vimUserCmdError -syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber -syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs -syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey -syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange -syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey +syn cluster vimUserCmdList contains=@vimCmdList,vimCmplxRepeat,@vimComment,vimCtrlChar,vimEscapeBrace,@vimFunc,vimNotation,vimNumber,vimOper,vimRegister,vimSpecFile,vimString,vimSubst,vimSubstRep,vimSubstRange + +syn match vimUserCmd "\!\=" skipwhite nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang +syn match vimUserCmd +\!\=\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdAttrs,vimUserCmdName contains=vimBang + +syn region vimUserCmdAttrs contained + \ start="-\l" + \ start=+^\s*\%(\\\|["#]\\ \)+ + \ end="\ze\s\u" + \ skipwhite nextgroup=vimUserCmdName + \ contains=@vimContinue,vimUserCmdAttr,vimUserCmdAttrError + \ transparent +syn match vimUserCmdAttrError contained "-\a\+\ze\%(\s\|=\)" +syn match vimUserCmdAttr contained "-addr=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrAddr +syn match vimUserCmdAttr contained "-bang\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-bar\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-buffer\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-complete=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrComplete,vimUserCmdError +syn match vimUserCmdAttr contained "-count\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-count=" contains=vimUserCmdAttrKey nextgroup=vimNumber +syn match vimUserCmdAttr contained "-keepscript\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-nargs=" contains=vimUserCmdAttrKey nextgroup=vimUserCmdAttrNargs +syn match vimUserCmdAttr contained "-range\>" contains=vimUserCmdAttrKey +syn match vimUserCmdAttr contained "-range=" contains=vimUserCmdAttrKey nextgroup=vimNumber,vimUserCmdAttrRange +syn match vimUserCmdAttr contained "-register\>" contains=vimUserCmdAttrKey syn match vimUserCmdAttrNargs contained "[01*?+]" syn match vimUserCmdAttrRange contained "%" @@ -695,19 +853,36 @@ endif syn case ignore syn keyword vimUserCmdAttrKey contained a[ddr] ban[g] bar bu[ffer] com[plete] cou[nt] k[eepscript] n[args] ra[nge] re[gister] -" GEN_SYN_VIM: vimUserCmdAttrCmplt, START_STR='syn keyword vimUserCmdAttrCmplt contained', END_STR='' -syn keyword vimUserCmdAttrCmplt contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var -syn keyword vimUserCmdAttrCmplt contained custom customlist nextgroup=vimUserCmdAttrCmpltFunc,vimUserCmdError -syn match vimUserCmdAttrCmpltFunc contained ",\%([sS]:\|<[sS][iI][dD]>\)\=\%(\h\w*\%([.#]\h\w*\)\+\|\h\w*\)"hs=s+1 nextgroup=vimUserCmdError + +" GEN_SYN_VIM: vimUserCmdAttrComplete, START_STR='syn keyword vimUserCmdAttrComplete contained', END_STR='' +syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype filetypecmd function help highlight history keymap locale mapclear mapping menu messages option packadd retab runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var +syn keyword vimUserCmdAttrComplete contained arglist augroup behave breakpoint buffer color command compiler cscope diff_buffer dir dir_in_path environment event expression file file_in_path filetype function help highlight history keymap locale mapclear mapping menu messages option packadd runtime scriptnames shellcmd shellcmdline sign syntax syntime tag tag_listfiles user var +syn keyword vimUserCmdAttrComplete contained custom customlist nextgroup=vimUserCmdAttrCompleteFunc,vimUserCmdError +syn match vimUserCmdAttrCompleteFunc contained ",\%([bwglstav]:\|<[sS][iI][dD]>\)\=\h\w*\%([.#]\h\w*\)*"hs=s+1 nextgroup=vimUserCmdError contains=vimVarScope,vimFunctionSID + " GEN_SYN_VIM: vimUserCmdAttrAddr, START_STR='syn keyword vimUserCmdAttrAddr contained', END_STR='' syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win -syn match vimUserCmdAttrAddr contained "?" +syn keyword vimUserCmdAttrAddr contained arguments arg buffers buf lines line loaded_buffers load other quickfix qf tabs tab windows win +syn match vimUserCmdAttrAddr contained "?" syn case match -syn region vimUserCmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList +syn match vimUserCmdName contained "\<\u[[:alnum:]]*\>" skipwhite nextgroup=vimUserCmdBlock,vimUserCmdReplacement +syn match vimUserCmdName contained +\<\u[[:alnum:]]*\>\ze\s*\n\s*\%(\\\|["#]\\ \)+ skipwhite skipnl nextgroup=vimUserCmdBlock,vimUserCmdReplacement +syn region vimUserCmdReplacement contained + \ start="\S" + \ start=+^\s*\%(\\\|["#]\\ \)+ + \ skip=+\n\s*\%(\\\|["#]\\ \)+ + \ end="$" + \ contains=@vimContinue,@vimUserCmdList,vimComFilter +syn region vimUserCmdBlock contained + \ matchgroup=vimSep + \ start="{" + \ end="^\s*\zs}" + \ contains=@vimDefBodyList,@vimUserCmdList -syn match vimDelcommand "\" skipwhite nextgroup=vimDelcommandAttr -syn match vimDelcommandAttr contained "-buffer\>" +syn match vimDelcommand "\" skipwhite nextgroup=vimDelcommandAttr,vimDelcommandName +syn match vimDelcommandAttr contained "-buffer\>" skipwhite nextgroup=vimDelcommandName +syn match vimDelcommandName contained "\<\u[[:alnum:]]*\>" " Lower Priority Comments: after some vim commands... {{{2 " ======================= @@ -721,17 +896,20 @@ else syn cluster vimComment contains=vimComment endif -VimL syn match vimComment excludenl +\s"[^\-:.%#=*].*$+lc=1 contains=@vimCommentGroup,vimCommentString extend -VimL syn match vimComment +\\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ nextgroup=vimSubscript contains=@vimStringGroup extend -syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z>\\@]'+lc=1 end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape extend +syn region vimString oneline keepend matchgroup=vimString start=+[^a-zA-Z\\@]"+lc=1 skip=+\\\\\|\\"+ matchgroup=vimStringEnd end=+"+ nextgroup=vimSubscript contains=@vimStringGroup extend +syn region vimString oneline matchgroup=vimString start=+[^a-zA-Z\\@]'+lc=1 end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape extend "syn region vimString oneline start="\s/\s*\A"lc=1 skip="\\\\\|\\+" end="/" contains=@vimStringGroup " see tst45.vim syn match vimEscape contained "\\." @@ -765,22 +943,33 @@ syn match vimEscape contained "\\<" contains=vimNotation syn match vimEscape contained "\\<\*[^>]*>\=>" syn match vimQuoteEscape contained "''" -syn region vimString oneline matchgroup=vimString start=+$'+ skip=+''+ end=+'+ nextgroup=vimSubscript contains=vimQuoteEscape,@vimStringInterpolation extend -syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringGroup,@vimStringInterpolation extend +syn region vimString oneline matchgroup=vimString start=+$'+ end=+'+ nextgroup=vimSubscript contains=@vimStringInterpolation,vimQuoteEscape extend +syn region vimString oneline matchgroup=vimString start=+$"+ end=+"+ nextgroup=vimSubscript contains=@vimStringInterpolation,@vimStringGroup extend syn region vimStringInterpolationExpr oneline contained matchgroup=vimSep start=+{+ end=+}+ contains=@vimExprList syn match vimStringInterpolationBrace contained "{{" syn match vimStringInterpolationBrace contained "}}" syn cluster vimStringInterpolation contains=vimStringInterpolationExpr,vimStringInterpolationBrace +syn region vimContinueString contained matchgroup=vimContinueString start=+"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringGroup +syn region vimContinueString contained matchgroup=vimContinueString start=+'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,vimQuoteEscape +syn region vimContinueString contained matchgroup=vimContinueString start=+$"+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+"+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,@vimStringGroup +syn region vimContinueString contained matchgroup=vimContinueString start=+$'+ skip=+\n\s*\%(\\\|["#]\\ \)+ end=+'+ end="$" skipwhite nextgroup=vimSubscript,vimComment contains=@vimContinue,@vimStringInterpolation,vimQuoteEscape + " Substitutions: {{{2 " ============= syn cluster vimSubstList contains=vimPatSep,vimPatRegion,vimPatSepErr,vimSubstTwoBS,vimSubstRange,vimNotation syn cluster vimSubstRepList contains=vimSubstSubstr,vimSubstTwoBS,vimNotation syn cluster vimSubstList add=vimCollection -syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat -syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat -syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat +syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat,vimSubstFlags,vimSubstCount +syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat +syn match vimSubst "^\s*\%(s\%[ubstitute]\|sm\%[agic]\|sno\%[magic]\)\%(\d\+\)\@=" skipwhite nextgroup=vimSubstCount +syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\>" skipwhite nextgroup=vimSubstPat,vimSubstFlags,vimSubstCount syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)[_#]\@=" skipwhite nextgroup=vimSubstPat +syn match vimSubst1 contained "\%(s\%[ubstitute]\|sm\%[agic]\>\|sno\%[magic]\)\%(\d\+\)\@=" skipwhite nextgroup=vimSubstCount +syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags +" & and # after :s are always pattern delimiters not flags +syn match vimSubstFlags contained "[&cegiIlnpr#]\+" skipwhite nextgroup=vimSubstCount +syn match vimSubstCount contained "\d\+\>" " TODO: Vim9 illegal separators for abbreviated :s form are [-.:], :su\%[...] required " : # is allowed but "not recommended" (see :h pattern-delimiter) syn region vimSubstPat contained matchgroup=vimSubstDelim start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)"rs=s+1 skip="\\\\\|\\\z1" end="\z1"re=e-1,me=e-1 contains=@vimSubstList nextgroup=vimSubstRep4 oneline @@ -790,29 +979,55 @@ syn match vimCollClassErr contained "\[:.\{-\}:\]" syn match vimCollClass contained transparent "\%#=1\[:\(alnum\|alpha\|blank\|cntrl\|digit\|graph\|lower\|print\|punct\|space\|upper\|xdigit\|retu\%[rn]\|tab\|escape\|backspace\):\]" syn match vimSubstSubstr contained "\\z\=\d" syn match vimSubstTwoBS contained "\\\\" -syn match vimSubstFlagErr contained "[^< \t\r|]\+" contains=vimSubstFlags -syn match vimSubstFlags contained "[&cegiIlnpr#]\+" + +" TODO: flags, unlike count, must follow immediately +" : distinguish from with Vim9 &var +" syn match vimSubst "^\s*\zs&&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount +" syn match vimSubst "^\s*\zs\~&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount +" syn match vimSubst1 contained "&&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount +" syn match vimSubst1 contained "\~&\=" skipwhite nextgroup=vimSubstFlags,vimSubstCount + +" two and three letter variants (matched as :s + flags, count may follow immediately) +syn match vimSubst "^\s*\zssc[egiIlnp]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags +syn match vimSubst "^\s*\zssg[ceiIlnpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags +syn match vimSubst "^\s*\zssi[ceInpr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags +syn match vimSubst "^\s*\zssI[ceginplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags +syn match vimSubst "^\s*\zssr[cgiInplr]\=\a\@!" skipwhite nextgroup=vimSubstCount contains=vimSubstFlags + +syn match vimSubst1 contained "\\|[[\]<>'`]\)\@=" nextgroup=@vimMarkArg +VimL syn match vimExMark "\" skipwhite nextgroup=@vimMarkArg +syn match vimExMark "\" skipwhite nextgroup=@vimMarkArg + +syn match vimMarkArg contained "[a-zA-Z]\>\|[[\]<>'`]" skipwhite nextgroup=vimCmdSep,vimComment +syn match vimMarkArgError contained "["^.(){}0-9]" +syn cluster vimMarkArg contains=vimMarkArg,vimMarkArgError + " Marks, Registers, Addresses, Filters: {{{2 +syn match vimMark "'[a-zA-Z0-9]\ze\s*$" +syn match vimMark "'[[\]{}()<>'`"^.]\ze\s*$" syn match vimMark "'[a-zA-Z0-9]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1 -syn match vimMark "'[[\]{}()<>]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1 -syn match vimMark ",\zs'[[\]{}()<>]\ze" nextgroup=vimFilter,vimMarkNumber,vimSubst1 +syn match vimMark "'[[\]{}()<>'`"^.]\ze[-+,!]" nextgroup=vimFilter,vimMarkNumber,vimSubst1 +syn match vimMark ",\zs'[[\]{}()<>'`"^.]" nextgroup=vimFilter,vimMarkNumber,vimSubst1 syn match vimMark "[!,:]\zs'[a-zA-Z0-9]" nextgroup=vimFilter,vimMarkNumber,vimSubst1 -syn match vimMark "\'lc=1 syn match vimCmplxRepeat '@[0-9a-z".=@:]\ze\($\|[^a-zA-Z]\>\)' " Set command and associated set-options (vimOptions) with comment {{{2 -syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimSetArgs -syn region vimSetArgs contained start="\S" skip=+\\|\|\n\s*\\\|\n\s*["#]\\ + matchgroup=vimCmdSep end="|" end="$" matchgroup=vimNotation end="<[cC][rR]>" keepend contains=@vimComment,@vimContinue,vimErrSetting,vimOption,vimSetAll,vimSetTermcap -syn region vimSetEqual contained matchgroup=vimOper start="[=:]\|[-+^]=" skip=+\\|\|\\\s\|\n\s*\\\|\n\s*["#]\\ \|^\s*\\\|^\s*["#]\\ + matchgroup=vimCmdSep end="|" end="\ze\s" end="$" contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep +syn match vimSet "\<\%(setl\%[ocal]\|setg\%[lobal]\|se\%[t]\)\>" skipwhite nextgroup=vimSetBang,vimCmdSep,vimComment,vimSetArgs +syn region vimSetComment contained start=+"+ skip=+\n\s*\%(\\\||"\\ \)+ end="$" contains=@vimCommentGroup,vimCommentString extend +syn match vimSetCmdSep contained "|" skipwhite nextgroup=@vimCmdList,vimSubst1,@vimFunc +syn match vimSetEscape contained "\\\%(\\[|"]\|.\)" +syn match vimSetBarEscape contained "\\|" +syn match vimSetQuoteEscape contained +\\"+ +syn region vimSetArgs contained + \ start="\l\|<" + \ skip=+\n\s*\%(\\\|["#]\\ \)\|^\s*"\\ + + \ end=+\ze\\\@1]\+>" contains=vimOption +syn region vimSetEqual contained + \ matchgroup=vimOper + \ start="[=:]\|[-+^]=" + \ skip=+\\\s\|^\s*\%(\\\|["#]\\ \)+ + \ end="\ze\s" + \ contains=@vimContinue,vimCtrlChar,vimEnvvar,vimNotation,vimSetSep,vimSetEscape,vimSetBarEscape,vimSetQuoteEscape syn match vimSetBang contained "\a\@1<=!" skipwhite nextgroup=vimSetAll,vimSetTermcap syn keyword vimSetAll contained all nextgroup=vimSetMod syn keyword vimSetTermcap contained termcap -syn region vimSetString contained start=+="+hs=s+1 skip=+\\\\\|\\"+ end=+"+ contains=vimCtrlChar syn match vimSetSep contained "[,:]" syn match vimSetMod contained "\a\@1<=\%(&vim\=\|[!&?<]\)" " Variable Declarations: {{{2 " ===================== -VimL syn keyword vimLet let skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList -VimL syn keyword vimConst cons[t] skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList +VimL syn keyword vimLet let skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList,vimLetVar +VimL syn keyword vimConst cons[t] skipwhite nextgroup=@vimSpecialVar,vimVar,vimVarList,vimLetVar syn region vimVarList contained \ start="\[" end="]" + \ skipwhite nextgroup=vimLetHeredoc \ contains=@vimContinue,@vimSpecialVar,vimVar +syn match vimLetVar contained "\<\%([bwglstav]:\)\=\h[a-zA-Z0-9#_]*\>\ze\%(\[.*]\)\=\s*=<<" skipwhite nextgroup=vimLetVarSubscript,vimLetHeredoc contains=vimVarScope,vimSubscript +hi link vimLetVar vimVar +syn region vimLetVarSubscript contained + \ matchgroup=vimSubscriptBracket + \ start="\S\@1<=\[" + \ end="]" + \ skipwhite nextgroup=vimLetVarSubscript,vimLetHeredoc + \ contains=@vimExprList VimL syn keyword vimUnlet unl[et] skipwhite nextgroup=vimUnletBang,vimUnletVars syn match vimUnletBang contained "\a\@1<=!" skipwhite nextgroup=vimUnletVars @@ -852,17 +1097,69 @@ syn region vimUnletVars contained \ nextgroup=vimCmdSep,vimComment \ contains=@vimContinue,vimEnvvar,vimVar,vimVimVar -VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='\%(^\z(\s*\)\S.*\)\@<==<<\s*trim\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1\=\z2$' extend -VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\%(\s*\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1$' extend -VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='\%(^\z(\s*\)\S.*\)\@<==<<\s*\%(trim\s\+eval\|eval\s\+trim\)\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1\=\z2$' contains=@vimStringInterpolation extend -VimFoldh syn region vimLetHereDoc matchgroup=vimLetHereDocStart start='=<<\s*eval\%(\s\+\)\@>\z(\L\S*\)' matchgroup=vimLetHereDocStop end='^\z1$' contains=@vimStringInterpolation extend +" TODO: type error after register or environment variables (strings) +VimFoldh syn region vimLetHeredoc contained + \ matchgroup=vimLetHeredocStart + \ start="\%(^\z(\s*\)\S.*\)\@<==<<\s*trim\%(\s\+\)\@>\z(\L\S*\)" + \ matchgroup=vimLetHeredocStop + \ end="^\z1\=\z2$" + \ extend +VimFoldh syn region vimLetHeredoc contained + \ matchgroup=vimLetHeredocStart + \ start="=<<\%(\s*\)\@>\z(\L\S*\)" + \ matchgroup=vimLetHeredocStop end="^\z1$" + \ extend +VimFoldh syn region vimLetHeredoc contained + \ matchgroup=vimLetHeredocStart + \ start="\%(^\z(\s*\)\S.*\)\@<==<<\s*\%(trim\s\+eval\|eval\s\+trim\)\%(\s\+\)\@>\z(\L\S*\)" + \ matchgroup=vimLetHeredocStop + \ end="^\z1\=\z2$" + \ contains=@vimStringInterpolation + \ extend +VimFoldh syn region vimLetHeredoc contained + \ matchgroup=vimLetHeredocStart + \ start="=<<\s*eval\%(\s\+\)\@>\z(\L\S*\)" + \ matchgroup=vimLetHeredocStop + \ end="^\z1$" + \ contains=@vimStringInterpolation + \ extend Vim9 syn keyword vim9Const const skipwhite nextgroup=vim9Variable,vim9VariableList Vim9 syn keyword vim9Final final skipwhite nextgroup=vim9Variable,vim9VariableList Vim9 syn keyword vim9Var var skipwhite nextgroup=vim9Variable,vim9VariableList -syn match vim9Variable contained "\<\h\w*\>" skipwhite nextgroup=vimTypeSep,vimLetHereDoc,vimOper -syn region vim9VariableList contained start="\[" end="]" contains=@vimContinue,@vimSpecialVar,vim9Variable +syn match vim9Variable contained "\<\h\w*\>" skipwhite nextgroup=vim9VariableTypeSep,vimLetHeredoc,vimOper +syn region vim9VariableList contained start="\[" end="]" contains=@vimContinue,@vimSpecialVar,vim9Variable skipwhite nextgroup=vimLetHeredoc + +syn match vim9VariableTypeSep contained "\S\@1<=:\%(\s\|\n\)\@=" skipwhite nextgroup=@vim9VariableType +syn keyword vim9VariableType contained blob bool channel float job number string void skipwhite nextgroup=vimLetHeredoc +syn keyword vim9VariableTypeAny contained any skipwhite nextgroup=vimLetHeredoc +syn match vim9VariableType contained "\<\%(func\)\>" skipwhite nextgroup=vimLetHeredoc +syn region vim9VariableCompoundType contained + \ matchgroup=vim9VariableType + \ start="\" skipwhite nextgroup=vimLetHeredoc + +syn cluster vim9VariableType contains=vim9VariableType,vim9VariableTypeAny,vim9VariableCompoundType,vim9VariableUserType " Lockvar and Unlockvar: {{{2 " ===================== @@ -903,16 +1200,84 @@ syn keyword vimAbb ab[breviate] ca[bbrev] cnorea[bbrev] cuna[bbrev] ia[bbrev] in " GEN_SYN_VIM: vimCommand abclear, START_STR='syn keyword vimAbb', END_STR='skipwhite nextgroup=vimMapMod' syn keyword vimAbb abc[lear] cabc[lear] iabc[lear] skipwhite nextgroup=vimMapMod -" Autocmd: {{{2 -" ======= -syn match vimAutoCmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutoEventList -syn match vimAutoEventList contained "\%(\a\+,\)*\a\+" contains=vimAutoEvent nextgroup=vimAutoCmdSpace -syn match vimAutoCmdSpace contained "\s\+" nextgroup=vimAutoCmdSfxList -syn match vimAutoCmdSfxList contained "\S*" skipwhite nextgroup=vimAutoCmdMod,vimAutoCmdBlock -syn keyword vimAutoCmd au[tocmd] skipwhite nextgroup=vimAutoCmdBang,vimAutoEventList -syn keyword vimAutoCmd do[autocmd] doautoa[ll] skipwhite nextgroup=vimAutoEventList -syn match vimAutoCmdMod "\(++\)\=\(once\|nested\)" skipwhite nextgroup=vimAutoCmdBlock -syn region vimAutoCmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList +" Filename Patterns: {{{2 +" ================= + +syn match vimWildcardQuestion contained "?" +syn match vimWildcardStar contained "*" + +syn match vimWildcardBraceComma contained "," +syn region vimWildcardBrace contained + \ matchgroup=vimWildcard + \ start="{" + \ end="}" + \ contains=vimWildcardEscape,vimWildcardBrace,vimWildcardBraceComma,vimWildcardQuestion,vimWildcardStar,vimWildcardBracket + \ oneline + +syn match vimWildcardIntervalNumber contained "\d\+" +syn match vimWildcardInterval contained "\\\\\\{\d\+\%(,\d\+\)\=\\}" contains=vimWildcardIntervalNumber + + +syn match vimWildcardBracket contained "\[\%(\^\=]\=\%(\\.\|\[\([:.=]\)[^:.=]\+\1]\|[^][:space:]]\)*\)\@>]" + \ contains=vimWildcardBracketStart,vimWildcardEscape + +syn match vimWildcardBracketCharacter contained "." nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketHyphen,vimWildcardBracketEnd +syn match vimWildcardBracketRightBracket contained "]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd +syn match vimWildcardBracketHyphen contained "-]\@!" nextgroup=@vimWildcardBracketCharacter +syn match vimWildcardBracketEscape contained "\\." nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketHyphen,vimWildcardBracketEnd +syn match vimWildcardBracketCharacterClass contained "\[:[^:]\+:]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd +syn match vimWildcardBracketEquivalenceClass contained "\[=[^=]\+=]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd +syn match vimWildcardBracketCollatingSymbol contained "\[\.[^.]\+\.]" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketEnd + +syn match vimWildcardBracketStart contained "\[" nextgroup=vimWildcardBracketCaret,vimWildcardBracketRightBracket,@vimWildcardBracketCharacter +syn match vimWildcardBracketCaret contained "\^" nextgroup=@vimWildcardBracketCharacter,vimWildcardBracketRightBracket +syn match vimWildcardBracketEnd contained "]" + +syn cluster vimWildcardBracketCharacter contains=vimWildcardBracketCharacter,vimWildcardBracketEscape,vimWildcardBracketCharacterClass,vimWildcardBracketEquivalenceClass,vimWildcardBracketCollatingSymbol + +syn match vimWildcardEscape contained "\\." + +syn cluster vimWildcard contains=vimWildcardQuestion,vimWildcardStar,vimWildcardBrace,vimWildcardBracket,vimWildcardInterval + +" Autocmd and Doauto{cmd,all}: {{{2 +" =========================== + +" TODO: explicitly match the {cmd} arg rather than bailing out to TOP +syn region vimAutocmdBlock contained matchgroup=vimSep start="{" end="^\s*\zs}" contains=@vimDefBodyList + +syn match vimAutocmdGroup contained "\%(\\["|[:space:]]\|[^"|[:space:]]\)\+" skipwhite nextgroup=vimAutoEvent,vimAutoEventGlob +syn match vimAutocmdBang contained "\a\@1<=!" skipwhite nextgroup=vimAutocmdGroup,vimAutoEvent,vimAutoEventGlob + +" TODO: cleaner handling of | in pattern position +" : match pattern items in addition to wildcards +syn region vimAutocmdPattern contained + \ start="|\@!\S" + \ skip="\\\\\|\\[,[:space:]]" + \ end="\ze[,[:space:]]" + \ end="$" + \ skipwhite nextgroup=vimAutocmdPatternSep,vimAutocmdMod,vimAutocmdBlock,@vimFunc + \ contains=vimEnvvar,@vimWildcard,vimAutocmdPatternEscape +syn match vimAutocmdBufferPattern contained "" skipwhite nextgroup=vimAutocmdPatternSep,vimAutocmdMod,vimAutocmdBlock,@vimFunc +" trailing pattern separator comma allowed +syn match vimAutocmdPatternSep contained "," skipwhite nextgroup=@vimAutocmdPattern,vimAutocmdMod,vimAutocmdBlock +syn match vimAutocmdPatternEscape contained "\\." +syn cluster vimAutocmdPattern contains=vimAutocmdPattern,vimAutocmdBufferPattern + +" TODO: Vim9 requires '++' prefix +syn match vimAutocmdMod contained "\%(++\)\=\" skipwhite nextgroup=vimAutocmdMod,vimAutocmdBlock +syn match vimAutocmdMod contained "++once\>" skipwhite nextgroup=vimAutocmdMod,vimAutocmdBlock + +" higher priority than vimAutocmdGroup, assume no group is so named +syn match vimAutoEventGlob contained "*" skipwhite nextgroup=@vimAutocmdPattern +syn match vimAutoEventSep contained "\a\@1<=," nextgroup=vimAutoEvent +syn match vimUserAutoEventSep contained "\a\@1<=," nextgroup=vimUserAutoEvent + +syn match vimAutocmd "\" skipwhite nextgroup=vimAutocmdBang,vimAutocmdGroup,vimAutoEvent,vimAutoEventGlob + + +syn match vimDoautocmdMod contained "" skipwhite nextgroup=vimAutocmdGroup,vimAutoEvent +syn match vimDoautocmd "\" skipwhite nextgroup=vimDoautocmdMod,vimAutocmdGroup,vimAutoEvent +syn match vimDoautocmd "\" skipwhite nextgroup=vimDoautocmdMod,vimAutocmdGroup,vimAutoEvent " Echo And Execute: -- prefer strings! {{{2 " ================ @@ -926,8 +1291,12 @@ syn region vimEcho \ start="\" \ start="\" \ start="\" - \ skip=+\\|\|\n\s*\\\|\n\s*"\\ + - \ matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent + \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+ + \ end="\ze|" + \ excludenl end="$" + \ nextgroup=vimCmdSep + \ contains=@vimContinue,@vimExprList + \ transparent syn match vimEchohl "\" skipwhite nextgroup=vimGroup,vimHLGroup,vimEchohlNone syn case ignore @@ -936,7 +1305,112 @@ syn case match syn cluster vimEcho contains=vimEcho,vimEchohl -syn region vimExecute matchgroup=vimCommand start="\" skip=+\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimExprList transparent +syn region vimExecute + \ matchgroup=vimCommand + \ start="\" + \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+ + \ end="\ze|" + \ excludenl end="$" + \ nextgroup=vimCmdSep + \ contains=@vimContinue,@vimExprList + \ transparent + +syn region vimEval + \ matchgroup=vimCommand + \ start="\" + \ skip=+\\|\|||\|\n\s*\%(\\\|["#]\\ \)+ + \ end="\ze|" + \ excludenl end="$" + \ nextgroup=vimCmdSep + \ contains=@vimContinue,@vimExprList + \ transparent + +" Filter: {{{2 +" ====== +syn match vimExFilter "\" skipwhite nextgroup=vimExFilterBang,vimExFilterPattern +syn region vimExFilterPattern contained + \ start="[[:ident:]]" + \ end="\ze[[:space:]\n]" + \ skipwhite nextgroup=@vimCmdList + \ contains=@vimSubstList + \ oneline +syn region vimExFilterPattern contained + \ matchgroup=Delimiter + \ start="\z([^[:space:][:ident:]|"]\)" + \ skip="\\\\\|\\\z1" + \ end="\z1" + \ skipwhite nextgroup=@vimCmdList + \ contains=@vimSubstList + \ oneline +syn match vimExFilterBang contained "\a\@1<=!" skipwhite nextgroup=vimExFilterPattern + +" Grep and Make: {{{2 +" ============= +" | is the command separator, escaped with \| all other backslashes are passed through literally, no tail comments +syn match vimGrep "\" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep +syn match vimGrepadd "\" skipwhite nextgroup=vimGrepBang,vimGrepArgs,vimCmdSep +syn region vimGrepArgs contained + \ start="|\@!\S" + \ skip=+\n\s*\%(\\\|[#"]\\ \)+ + \ matchgroup=vimCmdSep + \ end="|" + \ end="$" + "\ TODO: include vimSpecFile + \ contains=vimGrepBarEscape +syn match vimGrepBarEscape contained "\\|" +syn match vimGrepBang contained "\a\@1<=!" skipwhite nextgroup=vimGrepArgs,vimCmdSep + +syn match vimMake "\" skipwhite nextgroup=vimMakeBang,vimMakeArgs,vimCmdSep +syn region vimMakeArgs contained + \ start="|\@!\S" + \ skip=+\n\s*\%(\\\|[#"]\\ \)+ + \ matchgroup=vimCmdSep + \ end="|" + \ end="$" + "\ TODO: include vimSpecFile + \ contains=vimMakeBarEscape +syn match vimMakeBarEscape contained "\\|" +syn match vimMakeBang contained "\a\@1<=!" skipwhite nextgroup=vimMakeArgs,vimCmdSep + +syn match vimHelpgrep "\" skipwhite nextgroup=vimHelpgrepBang,vimHelpgrepPattern +syn region vimHelpgrepPattern contained + \ start="\S" + \ matchgroup=Special + \ end="@\w\w\>" + \ end="$" + \ contains=@vimSubstList + \ oneline + +" Vimgrep: {{{2 +" ======= +syn match vimVimgrep "\" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern +syn match vimVimgrepadd "\" skipwhite nextgroup=vimVimgrepBang,vimVimgrepPattern +syn match vimVimgrepBang contained "\a\@1<=!" skipwhite nextgroup=vimVimgrepPattern +syn region vimVimgrepPattern contained + \ start="[[:ident:]]" + \ end="\ze[[:space:]\n]" + \ skipwhite nextgroup=vimVimgrepFile,vimCmdSep + \ contains=@vimSubstList + \ oneline +syn region vimVimgrepPattern contained + \ matchgroup=Delimiter + \ start="\z([^[:space:][:ident:]|"]\)" + \ skip="\\\\\|\\\z1" + \ end="\z1" + \ skipwhite nextgroup=vimVimgrepFlags,vimVimgrepFile,vimCmdSep + \ contains=@vimSubstList + \ oneline +syn match vimVimgrepEscape contained "\\\%(\\|\|.\)" +syn match vimVimgrepBarEscape contained "\\|" +syn region vimVimgrepFile contained + \ start="|\@!\S" + \ matchgroup=vimCmdSep + \ end="|" + \ end="\ze\s" + \ end="$" + \ skipwhite nextgroup=vimVimgrepFile + \ contains=vimSpecFile,vimVimgrepEscape,vimVimgrepBarEscape +syn match vimVimgrepFlags contained "\<[gjf]\{,3\}\>" skipwhite nextgroup=vimVimgrepfile " Maps: {{{2 " ==== @@ -989,6 +1463,12 @@ syn region vimMenutranslate syn match vimMenutranslateName "\%(\\\s\|\S\)\+" contained contains=vimMenuNotation,vimNotation syn match vimMenutranslateComment +".*+ contained containedin=vimMenutranslate +" If, While and Return: {{{2 +" ==================== +syn match vimNotFunc "\%#=1\<\%(if\|el\%[seif]\|retu\%[rn]\|while\)\>" skipwhite nextgroup=@vimExprList,vimNotation +syn match vimElse "\" skipwhite nextgroup=vimComment,vim9Comment +syn match vimEndif "\" skipwhite nextgroup=vimComment,vim9Comment + " Angle-Bracket Notation: (tnx to Michael Geddes) {{{2 " ====================== syn case ignore @@ -1004,25 +1484,16 @@ syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd2-4]-\)\{0,4}scro syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%(sid\|nop\|nul\|lt\|drop\)>" contains=vimBracket syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%(snr\|plug\|cursorhold\|ignore\|cmd\|scriptcmd\|focus\%(gained\|lost\)\)>" contains=vimBracket -syn match vimNotation contained '\%(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket -syn match vimNotation contained '\%#=1\%(\\\|\)\=<\%(q-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|f-args\|f-mods\|lt\)>' contains=vimBracket +" syn match vimNotation contained '\%(\\\|\)\=[0-9a-z"%#:.\-=]'he=e-1 contains=vimBracket +syn match vimNotation contained '\%#=1\%(\\\|\)\=<\%([fq]-\)\=\%(line[12]\|count\|bang\|reg\|args\|mods\|lt\)>' contains=vimBracket skipwhite nextgroup=vimSubst1 syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([cas]file\|abuf\|amatch\|cexpr\|cword\|cWORD\|client\|stack\|script\|sf\=lnum\)>" contains=vimBracket syn match vimNotation contained "\%#=1\%(\\\|\)\=<\%([scamd]-\)\{0,4}char-\%(\d\+\|0\o\+\|0x\x\+\)>" contains=vimBracket syn match vimBracket contained "[\\<>]" syn case match -" User Function Highlighting: {{{2 -" (following Gautam Iyer's suggestion) -" ========================== -syn match vimFunc "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimFuncEcho,vimFuncName,vimUserFunc,vimExecute -syn match vimUserFunc contained "\%(\%([sSgGbBwWtTlL]:\|<[sS][iI][dD]>\)\=\%(\w\+\.\)*\I[a-zA-Z0-9_.]*\)\|\<\u[a-zA-Z0-9.]*\>\|\" contains=vimNotation,vim9MethodName,vim9Super,vim9This -syn keyword vimFuncEcho contained ec ech echo - -syn match vimMap "\\%([(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' +syn match vimUsrCmd '^\s*\zs\u\%(\w*\)\@>\%([.(#[]\|\s\+\%([-+*/%]\=\|\.\.\)=\)\@!' " Vim user commands @@ -1035,39 +1506,122 @@ syn match vimSynMenuPath contained ".*\ze:" nextgroup=vimSynMenuColon contains=v syn match vimSynMenuColon contained ":" nextgroup=vimSynMenuName syn match vimSynMenuName contained "\w\+" -syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynMenu +" runtime/syntax/syncolor.vim +syn match vimSynColor "\" skipwhite nextgroup=vimSynColorGroup +syn match vimSynColorGroup contained "\<\h\w*\>" skipwhite nextgroup=vimHiKeyList contains=vimGroup +syn match vimSynLink "\" skipwhite nextgroup=vimSynLinkGroup +syn match vimSynLinkGroup contained "\<\h\w*\>" skipwhite nextgroup=vimGroup contains=vimGroup + +syn cluster vimExUserCmdList contains=vimCompilerSet,vimSynColor,vimSynLink,vimSynMenu " Errors And Warnings: {{{2 " ==================== if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_novimfunctionerror") - syn match vimFunctionError "\s\zs[a-z0-9]\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank - syn match vimFunctionError "\s\zs\%(<[sS][iI][dD]>\|[sSgGbBwWtTlL]:\)\d\i\{-}\ze\s*(" contained contains=vimFuncKey,vimFuncBlank + syn match vimFunctionError contained "[[:space:]!]\@1<=\<[a-z0-9]\w\{-}\ze\s*(" + syn match vimFunctionError contained "\%(<[sS][iI][dD]>\|[sg]:\)\d\w\{-}\ze\s*(" syn match vimElseIfErr "\" syn match vimBufnrWarn /\" skipwhite nextgroup=@vimExprList,vimNotation - " Match: {{{2 " ===== -syn match vimMatch "\<[23]\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone -syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern +syn match vimMatch "\<\%([1-3]\s*\)\=mat\%[ch]\>" skipwhite nextgroup=vimMatchGroup,vimMatchNone contains=vimCount +syn match vimMatchGroup contained "[[:alnum:]._-]\+" skipwhite nextgroup=vimMatchPattern syn case ignore syn keyword vimMatchNone contained none syn case match -syn region vimMatchPattern contained matchgroup=Delimiter start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" skip="\\\\\|\\\z1" end="\z1" contains=@vimSubstList oneline +syn region vimMatchPattern contained + \ matchgroup=Delimiter + \ start="\z([!#$%&'()*+,-./:;<=>?@[\]^_`{}~]\)" + \ skip="\\\\\|\\\z1" + \ end="\z1" + \ contains=@vimSubstList + \ oneline " Normal: {{{2 " ====== syn match vimNormal "\!\=" skipwhite nextgroup=vimNormalArg contains=vimBang syn region vimNormalArg contained start="\S" skip=+\n\s*\\\|\n\s*["#]\\ + end="$" contains=@vimContinue +" Profile: {{{2 +" ======= +syn match vimProfileBang contained "\a\@1<=!" skipwhite nextgroup=vimProfileArg +syn keyword vimProfileArg contained start skipwhite nextgroup=vimProfilePattern +syn keyword vimProfileArg contained func skipwhite nextgroup=vimProfilePattern +syn keyword vimProfileArg contained file skipwhite nextgroup=vimProfilePattern +syn keyword vimProfileArg contained stop pause skipwhite nextgroup=vimCmdSep,@vimComment +syn keyword vimProfileArg contained continue dump skipwhite nextgroup=vimCmdSep,@vimComment +" TODO: match file pattern +syn region vimProfilePattern contained + \ start="\S" + \ skip=+\\[|"#]+ + \ end="$" end=+\ze\s*[|"#]+ + \ skipwhite nextgroup=vimCmdSep,vimComment,vim9Comment +syn match vimProfile "\" skipwhite nextgroup=vimProfileBang,vimProfileArg + +syn keyword vimProfdelArg contained func skipwhite nextgroup=vimProfilePattern +syn keyword vimProfdelArg contained file skipwhite nextgroup=vimProfilePattern +syn keyword vimProfdelArg contained here skipwhite nextgroup=vimCmdSep,@vimComment +syn match vimProfdel "\" skipwhite nextgroup=vimProfdelArg + +" Redir: {{{2 +" ===== +syn match vimRedir "\" skipwhite nextgroup=vimRedirBang,vimRedirFileOperator,vimRedirVariableOperator,vimRedirRegister,vimRedirEnd +syn match vimRedirBang contained "\a\@1<=!" skipwhite nextgroup=vimRedirFileOperator + +syn match vimRedirFileOperator contained ">>\=" skipwhite nextgroup=vimRedirFile +syn region vimRedirFile contained + \ start="\S" + \ matchgroup=Normal + \ end="\s*$" + \ end="\s*\ze[|"]" + \ nextgroup=vimCmdSep,vimComment + \ contains=vimSpecFile +syn match vimRedirRegisterOperator contained ">>\=" +syn match vimRedirRegister contained "@[a-zA-Z*+"]" nextgroup=vimRedirRegisterOperator +syn match vimRedirVariableOperator contained "=>>\=" skipwhite nextgroup=vimVar +syn keyword vimRedirEnd contained END + " Sleep: {{{2 " ===== syn keyword vimSleep sl[eep] skipwhite nextgroup=vimSleepBang,vimSleepArg syn match vimSleepBang contained "\a\@1<=!" skipwhite nextgroup=vimSleepArg syn match vimSleepArg contained "\<\%(\d\+\)\=m\=\>" +" Sort: {{{2 +" ==== +syn match vimSort "\" skipwhite nextgroup=vimSortBang,@vimSortOptions,vimSortPattern,vimCmdSep +syn match vimSortBang contained "\a\@1<=!" skipwhite nextgroup=@vimSortOptions,vimSortPattern,vimCmdSep +syn match vimSortOptionsError contained "\a\+" +syn match vimSortOptions contained "\<[ilur]*[nfxob]\=[ilur]*\>" skipwhite nextgroup=vimSortPattern,vimCmdSep +syn region vimSortPattern contained + \ matchgroup=Delimiter + \ start="\z([^[:space:][:alpha:]|]\)" + \ skip="\\\\\|\\\z1" + \ end="\z1" + \ skipwhite nextgroup=@vimSortOptions,vimCmdSep + \ contains=@vimSubstList + \ oneline + +syn cluster vimSortOptions contains=vimSortOptions,vimSortOptionsError + +" Uniq: {{{2 +" ==== +syn match vimUniq "\" skipwhite nextgroup=vimUniqBang,@vimUniqOptions,vimUniqPattern,vimCmdSep +syn match vimUniqBang contained "\a\@1<=!" skipwhite nextgroup=@vimUniqOptions,vimUniqPattern,vimCmdSep +syn match vimUniqOptionsError contained "\a\+" +syn match vimUniqOptions contained "\<[ilur]*\>" skipwhite nextgroup=vimUniqPattern,vimCmdSep +syn region vimUniqPattern contained + \ matchgroup=Delimiter + \ start="\z([^[:space:][:alpha:]|]\)" + \ skip="\\\\\|\\\z1" + \ end="\z1" + \ skipwhite nextgroup=@vimUniqOptions,vimCmdSep + \ contains=@vimSubstList + \ oneline + +syn cluster vimUniqOptions contains=vimUniqOptions,vimUniqOptionsError + " Syntax: {{{2 "======= syn match vimGroupList contained "[^[:space:],]\+\%(\s*,\s*[^[:space:],]\+\)*" contains=vimGroupSpecial @@ -1088,7 +1642,7 @@ if has("conceal") endif syn match vimSyntax "\" contains=vimCommand skipwhite nextgroup=vimSynType,@vimComment -syn cluster vimFuncBodyList add=vimSyntax +syn cluster vimFunctionBodyList add=vimSyntax " Syntax: case {{{2 syn keyword vimSynType contained case skipwhite nextgroup=vimSynCase,vimSynCaseError @@ -1206,8 +1760,9 @@ endif syn match vimHighlight "\" skipwhite nextgroup=vimHiBang,@vimHighlightCluster syn match vimHiBang contained "\a\@1<=!" skipwhite nextgroup=@vimHighlightCluster -syn match vimHiGroup contained "\i\+" syn case ignore +" Conceal is a generated low-priority match +syn match vimHiGroup contained "\%(\\)\@!\i\+" syn keyword vimHiNone contained NONE syn keyword vimHiAttrib contained none bold inverse italic nocombine reverse standout strikethrough underline undercurl underdashed underdotted underdouble syn keyword vimFgBgAttrib contained none bg background fg foreground @@ -1224,7 +1779,7 @@ syn match vimHiGuiFontname contained "'[a-zA-Z\-* ]\+'" syn match vimHiGuiRgb contained "#\x\{6}" " Highlighting: hi group key=arg ... {{{2 -syn cluster vimHiCluster contains=vimGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment +syn cluster vimHiCluster contains=vimGroup,vimHLGroup,vimHiGroup,vimHiNone,vimHiTerm,vimHiCTerm,vimHiStartStop,vimHiCtermFgBg,vimHiCtermul,vimHiCtermfont,vimHiGui,vimHiGuiFont,vimHiGuiFgBg,vimHiKeyError,vimNotation,vimComment,vim9comment syn region vimHiKeyList contained start="\i\+" skip=+\\\\\|\\|\|\n\s*\\\|\n\s*"\\ + matchgroup=vimCmdSep end="|" excludenl end="$" contains=@vimContinue,@vimHiCluster if !exists("g:vimsyn_noerror") && !exists("g:vimsyn_vimhikeyerror") syn match vimHiKeyError contained "\i\+="he=e-1 @@ -1242,7 +1797,7 @@ syn match vimHiTermcap contained "\S\+" contains=vimNotation syn match vimHiNmbr contained '\d\+' " Highlight: clear {{{2 -syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHiGroup +syn keyword vimHiClear contained clear skipwhite nextgroup=vimGroup,vimHLGroup,vimHiGroup " Highlight: link {{{2 " see tst24 (hi def vs hi) (Jul 06, 2018) @@ -1254,6 +1809,359 @@ syn region vimHiLink contained matchgroup=Type start="\%(\\)\%(\h\w*\.\)*\h\w*\ze\s*(" skipwhite nextgroup=vimOperParen contains=vimVarScope,vimNotation + +Vim9 syn match vim9UserFunc "^\s*\zs\%([sgbwtv]:\|<[sS][iI][dD]>\)\=\%(\h\w*[.#]\)*\h\w*\ze(" skipwhite nextgroup=vimOperParen contains=vimVarScope,vimNotation,vim9MethodName,vim9Super,vim9This +Vim9 syn match vim9Func "^\s*\zs\l\w*\ze(" skipwhite nextgroup=vimOperParen contains=vimFuncName + +syn cluster vimFunc contains=vimFunc,vimUserFunc +syn cluster vim9Func contains=vim9Func,vim9UserFunc + " Beginners - Patterns that involve ^ {{{2 " ========= Vim9 syn region vim9LineComment start=+^[ \t:]*\zs#.*$+ skip=+\n\s*\\\|\n\s*#\\ + end="$" contains=@vimCommentGroup,vimCommentString,vim9CommentTitle extend @@ -1274,7 +2182,9 @@ syn match vim9ContinueComment "^\s*\zs#\\ .*" extend syn cluster vimContinue contains=vimContinue,vimContinueComment syn cluster vim9Continue contains=vimContinue,vim9ContinueComment -syn region vimString start="^\s*\\\z(['"]\)" skip='\\\\\|\\\z1' end="\z1" oneline keepend contains=@vimStringGroup,vimContinue +syn region vimString start='^\s*\\"' end='"' oneline keepend contains=@vimStringGroup,vimContinue +syn region vimString start="^\s*\\'" end="'" oneline keepend contains=vimQuoteEscape,vimContinue + syn match vimCommentTitleLeader '"\s\+'ms=s+1 contained syn match vim9CommentTitleLeader '#\s\+'ms=s+1 contained @@ -1287,7 +2197,7 @@ syn match vim9SearchDelim '^\s*\zs:[/?]\|[/?]$' contained contains=vimCmdSep syn region vimGlobal matchgroup=Statement start='\:p:h")."/lua.vim") -if !filereadable(s:luapath) - for s:luapath in split(globpath(&rtp,"syntax/lua.vim"),"\n") - if filereadable(fnameescape(s:luapath)) - let s:luapath= fnameescape(s:luapath) - break - endif - endfor -endif -if (g:vimsyn_embed =~# 'l' && has("lua")) && filereadable(s:luapath) - unlet! b:current_syntax - syn cluster vimFuncBodyList add=vimLuaRegion - exe "syn include @vimLuaScript ".s:luapath - VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+^\z(\s*\)lua\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimLuaScript - VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimLuaScript - VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+^\z(\s*\)lua\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimLuaScript - VimFoldl syn region vimLuaRegion matchgroup=vimScriptDelim start=+lua\s*<<\s*$+ end=+^\.$+ contains=@vimLuaScript - syn cluster vimFuncBodyList add=vimLuaRegion -else - syn region vimEmbedError start=+^\z(\s*\)lua\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ - syn region vimEmbedError start=+lua\s*<<\s*\z(\S*\)+ end=+^\z1$+ - syn region vimEmbedError start=+^\z(\s*\)lua\s*<<\s*trim\s\*$+ end=+^\z1\.$+ - syn region vimEmbedError start=+lua\s*<<\s*$+ end=+^\.$+ -endif -unlet s:luapath - -" [-- perl --] {{{3 -let s:perlpath= fnameescape(expand(":p:h")."/perl.vim") -if !filereadable(s:perlpath) - for s:perlpath in split(globpath(&rtp,"syntax/perl.vim"),"\n") - if filereadable(fnameescape(s:perlpath)) - let s:perlpath= fnameescape(s:perlpath) - break - endif - endfor -endif -if (g:vimsyn_embed =~# 'p' && has("perl")) && filereadable(s:perlpath) - unlet! b:current_syntax - syn cluster vimFuncBodyList add=vimPerlRegion - exe "syn include @vimPerlScript ".s:perlpath - VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimPerlScript - VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimPerlScript - VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimPerlScript - VimFoldp syn region vimPerlRegion matchgroup=vimScriptDelim start=+pe\%[rl]\s*<<\s*$+ end=+\.$+ contains=@vimPerlScript - syn cluster vimFuncBodyList add=vimPerlRegion -else - syn region vimEmbedError start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ - syn region vimEmbedError start=+pe\%[rl]\s*<<\s*\z(\S*\)+ end=+^\z1$+ - syn region vimEmbedError start=+^\z(\s*\)pe\%[rl]\s*<<\s*trim\s\*$+ end=+^\z1\.$+ - syn region vimEmbedError start=+pe\%[rl]\s*<<\s*$+ end=+^\.$+ -endif -unlet s:perlpath - -" [-- ruby --] {{{3 -let s:rubypath= fnameescape(expand(":p:h")."/ruby.vim") -if !filereadable(s:rubypath) - for s:rubypath in split(globpath(&rtp,"syntax/ruby.vim"),"\n") - if filereadable(fnameescape(s:rubypath)) - let s:rubypath= fnameescape(s:rubypath) - break - endif - endfor -endif -if (g:vimsyn_embed =~# 'r' && has("ruby")) && filereadable(s:rubypath) - syn cluster vimFuncBodyList add=vimRubyRegion - unlet! b:current_syntax - exe "syn include @vimRubyScript ".s:rubypath - VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimRubyScript - VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub\%[y]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimRubyScript - VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimRubyScript - VimFoldr syn region vimRubyRegion matchgroup=vimScriptDelim start=+rub\%[y]\s*<<\s*$+ end=+\.$+ contains=@vimRubyScript - syn cluster vimFuncBodyList add=vimRubyRegion -else - syn region vimEmbedError start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ - syn region vimEmbedError start=+rub\%[y]\s*<<\s*\z(\S.*\)+ end=+^\z1$+ - syn region vimEmbedError start=+^\z(\s*\)rub\%[y]\s*<<\s*trim\s\*$+ end=+^\z1\.$+ - syn region vimEmbedError start=+rub\%[y]\s*<<\s*$+ end=+^\.$+ -endif -unlet s:rubypath - -" [-- python --] {{{3 -let s:pythonpath= fnameescape(expand(":p:h")."/python.vim") -if !filereadable(s:pythonpath) - for s:pythonpath in split(globpath(&rtp,"syntax/python.vim"),"\n") - if filereadable(fnameescape(s:pythonpath)) - let s:pythonpath= fnameescape(s:pythonpath) - break - endif - endfor -endif -if g:vimsyn_embed =~# 'P' && has("pythonx") && filereadable(s:pythonpath) - unlet! b:current_syntax - syn cluster vimFuncBodyList add=vimPythonRegion - exe "syn include @vimPythonScript ".s:pythonpath - VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimPythonScript - VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*\z(\S\+\)+ end=+^\z1$+ contains=@vimPythonScript - VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimPythonScript - VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+py\%[thon][3x]\=\s*<<\s*$+ end=+^\.$+ contains=@vimPythonScript - VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=\z(\S\+\)+ end=+^\z1$+ contains=@vimPythonScript - VimFoldP syn region vimPythonRegion matchgroup=vimScriptDelim start=+Py\%[thon]2or3\s*<<\s*\%(trim\s*\)\=$+ end=+^\.$+ contains=@vimPythonScript - syn cluster vimFuncBodyList add=vimPythonRegion -else - syn region vimEmbedError start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ - syn region vimEmbedError start=+py\%[thon][3x]\=\s*<<\s*\z(\S\+\)+ end=+^\z1$+ - syn region vimEmbedError start=+^\z(\s*\)py\%[thon][3x]\=\s*<<\s*trim\s*$+ end=+^\z1\.$+ - syn region vimEmbedError start=+py\%[thon][3x]\=\s*<<\s*$+ end=+^\.$+ -endif -unlet s:pythonpath - -" [-- tcl --] {{{3 -if has("win32") || has("win95") || has("win64") || has("win16") - " apparently has("tcl") has been hanging vim on some windows systems with cygwin - let s:trytcl= (&shell !~ '\<\%(bash\>\|4[nN][tT]\|\\%(\.exe\)\=$') -else - let s:trytcl= 1 -endif -if s:trytcl - let s:tclpath= fnameescape(expand(":p:h")."/tcl.vim") - if !filereadable(s:tclpath) - for s:tclpath in split(globpath(&rtp,"syntax/tcl.vim"),"\n") - if filereadable(fnameescape(s:tclpath)) - let s:tclpath= fnameescape(s:tclpath) - break - endif - endfor - endif - if (g:vimsyn_embed =~# 't' && has("tcl")) && filereadable(s:tclpath) - unlet! b:current_syntax - syn cluster vimFuncBodyList add=vimTclRegion - exe "syn include @vimTclScript ".s:tclpath - VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimTclScript - VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimTclScript - VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimTclScript - VimFoldt syn region vimTclRegion matchgroup=vimScriptDelim start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+ contains=@vimTclScript - syn cluster vimFuncBodyList add=vimTclScript - else - syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ - syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+ - syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\*$+ end=+^\z1\.$+ - syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+ - endif - unlet s:tclpath -else - syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ - syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*\z(\S*\)+ end=+^\z1$+ - syn region vimEmbedError start=+^\z(\s*\)tc\%[l]\s*<<\s*trim\s\*$+ end=+^\z1\.$+ - syn region vimEmbedError start=+tc\%[l]\=\s*<<\s*$+ end=+^\.$+ -endif -unlet s:trytcl - -" [-- mzscheme --] {{{3 -let s:mzschemepath= fnameescape(expand(":p:h")."/scheme.vim") -if !filereadable(s:mzschemepath) - for s:mzschemepath in split(globpath(&rtp,"syntax/mzscheme.vim"),"\n") - if filereadable(fnameescape(s:mzschemepath)) - let s:mzschemepath= fnameescape(s:mzschemepath) - break - endif - endfor -endif -if (g:vimsyn_embed =~# 'm' && has("mzscheme")) && filereadable(s:mzschemepath) - unlet! b:current_syntax - let s:iskKeep= &isk - syn cluster vimFuncBodyList add=vimMzSchemeRegion - exe "syn include @vimMzSchemeScript ".s:mzschemepath - let &isk= s:iskKeep - unlet s:iskKeep - VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ contains=@vimMzSchemeScript - VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*\z(\S*\)+ end=+^\z1$+ contains=@vimMzSchemeScript - VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s*$+ end=+^\z1\.$+ contains=@vimMzSchemeScript - VimFoldm syn region vimMzSchemeRegion matchgroup=vimScriptDelim start=+mz\%[scheme]\s*<<\s*$+ end=+^\.$+ contains=@vimMzSchemeScript - syn cluster vimFuncBodyList add=vimMzSchemeRegion -else - syn region vimEmbedError start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\+\z(\S\+\)+ end=+^\z1\z2$+ - syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*\z(\S*\)+ end=+^\z1$+ - syn region vimEmbedError start=+^\z(\s*\)mz\%[scheme]\s*<<\s*trim\s\*$+ end=+^\z1\.$+ - syn region vimEmbedError start=+mz\%[scheme]\s*<<\s*$+ end=+^\.$+ -endif -unlet s:mzschemepath - " Synchronize (speed) {{{2 "============ -if exists("g:vimsyn_minlines") - exe "syn sync minlines=".g:vimsyn_minlines -endif -exe "syn sync maxlines=".s:vimsyn_maxlines + +exe "syn sync minlines=" .. get(g:, "vimsyn_minlines", 100) +exe "syn sync maxlines=" .. get(g:, "vimsyn_maxlines", 200) + syn sync linecont "^\s\+\\" -syn sync linebreaks=1 +syn sync linebreaks=2 syn sync match vimAugroupSyncA groupthere NONE "\\s\+[eE][nN][dD]" " ==================== @@ -1517,15 +2227,17 @@ if !exists("skip_vim_syntax_inits") hi def link vimBehaveError vimError hi def link vimCollClassErr vimError hi def link vimErrSetting vimError - hi def link vimEmbedError vimError hi def link vimFTError vimError hi def link vimFunctionError vimError hi def link vimFunc vimError + hi def link vim9Func vimError hi def link vimHiAttribList vimError hi def link vimHiCtermError vimError hi def link vimHiKeyError vimError hi def link vimMapModErr vimError + hi def link vimMarkArgError vimError hi def link vimShebangError vimError + hi def link vimSortOptionsError Error hi def link vimSubstFlagErr vimError hi def link vimSynCaseError vimError hi def link vimSyncError vimError @@ -1544,10 +2256,14 @@ if !exists("skip_vim_syntax_inits") hi def link vimAugroupBang vimBang hi def link vimAugroupError vimError hi def link vimAugroupKey vimCommand - hi def link vimAutoCmd vimCommand - hi def link vimAutoCmdBang vimBang + hi def link vimAutocmd vimCommand + hi def link vimAutocmdBang vimBang + hi def link vimAutocmdPatternEscape Special hi def link vimAutoEvent Type - hi def link vimAutoCmdMod Special + hi def link vimAutoEventGlob Type + hi def link vimAutocmdBufferPattern Special + hi def link vimAutocmdMod Special + hi def link vimAutocmdPatternSep vimSep hi def link vimBang vimOper hi def link vimBehaveBang vimBang hi def link vimBehaveModel vimBehave @@ -1557,6 +2273,8 @@ if !exists("skip_vim_syntax_inits") hi def link vimCatch vimCommand hi def link vimCmplxRepeat SpecialChar hi def link vimCommand Statement + hi def link vimCommandModifier vimCommand + hi def link vimCommandModifierBang vimBang hi def link vimComment Comment hi def link vimCommentError vimError hi def link vimCommentString vimString @@ -1565,23 +2283,35 @@ if !exists("skip_vim_syntax_inits") hi def link vimConst vimCommand hi def link vimContinue Special hi def link vimContinueComment vimComment + hi def link vimContinueString vimString hi def link vimCount Number hi def link vimCtrlChar SpecialChar hi def link vimDebuggreedy vimCommand + hi def link vimDef vimCommand + hi def link vimDefBang vimBang hi def link vimDefComment vim9Comment - hi def link vimDefKey vimCommand hi def link vimDefParam vimVar hi def link vimDelcommand vimCommand hi def link vimDelcommandAttr vimUserCmdAttr + hi def link vimDelfunction vimCommand + hi def link vimDelfunctionBang vimBang + hi def link vimDoautocmd vimCommand + hi def link vimDoautocmdMod Special hi def link vimEcho vimCommand hi def link vimEchohlNone vimGroup hi def link vimEchohl vimCommand + hi def link vimElse vimCommand hi def link vimElseIfErr Error hi def link vimEndfunction vimCommand hi def link vimEnddef vimCommand + hi def link vimEndif vimCommand hi def link vimEnvvar PreProc hi def link vimError Error hi def link vimEscape Special + hi def link vimEval vimCommand + hi def link vimExFilter vimCommand + hi def link vimExFilterBang vimBang + hi def link vimExMark vimCommand hi def link vimFBVar vimVar hi def link vimFgBgAttrib vimHiAttrib hi def link vimFuncEcho vimCommand @@ -1590,20 +2320,24 @@ if !exists("skip_vim_syntax_inits") hi def link vimForInContinueComment vimContinueComment hi def link vimFTCmd vimCommand hi def link vimFTOption vimSynType - hi def link vimFuncBang vimBang - hi def link vimFuncComment vimComment - hi def link vimFuncKey vimCommand + hi def link vimFunction vimCommand + hi def link vimFunctionBang vimBang + hi def link vimFunctionComment vimComment hi def link vimFuncName Function - hi def link vimFuncMod Special - hi def link vimFuncParam vimVar - hi def link vimFuncParamEquals vimOper - hi def link vimFuncScope vimVarScope - hi def link vimFuncSID vimNotation + hi def link vimFunctionMod Special + hi def link vimFunctionParam vimVar + hi def link vimFunctionParamEquals vimOper + hi def link vimFunctionScope vimVarScope + hi def link vimFunctionSID vimNotation + hi def link vimGrep vimCommand + hi def link vimGrepadd vimCommand + hi def link vimGrepBang vimBang hi def link vimGroupAdd vimSynOption hi def link vimGroupName Normal hi def link vimGroupRem vimSynOption hi def link vimGroupSpecial Special hi def link vimGroup Type + hi def link vimHelpgrep vimCommand hi def link vimHiAttrib PreProc hi def link vimHiBang vimBang hi def link vimHiClear Type @@ -1623,21 +2357,29 @@ if !exists("skip_vim_syntax_inits") hi def link vimHiStartStop vimHiTerm hi def link vimHiTerm Type hi def link vimHLGroup vimGroup + hi def link vimImport vimCommand + hi def link vimImportAutoload Special + hi def link vimImportAs vimImport hi def link vimInsert vimString hi def link vim9KeymapLineComment vimKeymapLineComment hi def link vimKeymapLineComment vimComment hi def link vimKeymapTailComment vimComment + hi def link vimLambdaBrace Delimiter hi def link vimLambdaOperator vimOper hi def link vimLet vimCommand - hi def link vimLetHereDoc vimString - hi def link vimLetHereDocStart Special - hi def link vimLetHereDocStop Special - hi def link vimLetRegister Special + hi def link vimLetHeredoc vimString + hi def link vimLetHeredocStart Special + hi def link vimLetHeredocStop Special + hi def link vimLetRegister vimRegister hi def link vimLineComment vimComment + hi def link vimLua vimCommand + hi def link vimMake vimCommand + hi def link vimMakeadd vimCommand + hi def link vimMakeBang vimBang hi def link vimMapBang vimBang hi def link vimMapLeader vimBracket hi def link vimMapLeaderKey vimNotation - hi def link vimMapModKey vimFuncSID + hi def link vimMapModKey vimFunctionSID hi def link vimMapMod vimBracket hi def link vimMap vimCommand hi def link vimMark Number @@ -1656,6 +2398,8 @@ if !exists("skip_vim_syntax_inits") hi def link vimMenutranslateComment vimComment hi def link vim9MethodName vimFuncName hi def link vimMtchComment vimComment + hi def link vimMzScheme vimCommand + hi def link vimNonText NonText hi def link vimNormal vimCommand hi def link vimNotation Special hi def link vimNotFunc vimCommand @@ -1675,25 +2419,46 @@ if !exists("skip_vim_syntax_inits") hi def link vimPatSepZone vimString hi def link vimPatSepZ vimPatSep hi def link vimPattern Type + hi def link vimPerl vimCommand hi def link vimPlainMark vimMark - hi def link vimPlainRegister vimRegister + hi def link vimProfile vimCommand + hi def link vimProfileArg vimSpecial + hi def link vimProfileBang vimBang + hi def link vimProfdel vimCommand + hi def link vimProfdelArg vimSpecial + hi def link vimPython vimCommand + hi def link vimPython3 vimCommand + hi def link vimPythonX vimCommand hi def link vimQuoteEscape vimEscape + hi def link vimRedir vimCommand + hi def link vimRedirBang vimBang + hi def link vimRedirFileOperator vimOper + hi def link vimRedirRegisterOperator vimOper + hi def link vimRedirVariableOperator vimOper + hi def link vimRedirEnd Special + hi def link vimRedirRegister vimRegister hi def link vimRegister SpecialChar + hi def link vimRuby vimCommand hi def link vimScriptDelim Comment + hi def link vimScriptHeredocStart vimLetHeredocStart + hi def link vimScriptHeredocStop vimLetHeredocStop hi def link vimSearch vimString hi def link vimSearchDelim Delimiter hi def link vimSep Delimiter hi def link vimSet vimCommand hi def link vimSetAll vimOption hi def link vimSetBang vimBang + hi def link vimSetComment vimComment hi def link vimSetMod vimOption hi def link vimSetSep vimSep - hi def link vimSetString vimString hi def link vimSetTermcap vimOption hi def link vimShebang PreProc hi def link vimSleep vimCommand hi def link vimSleepArg Constant hi def link vimSleepBang vimBang + hi def link vimSort vimCommand + hi def link vimSortBang vimBang + hi def link vimSortOptions Special hi def link vimSpecFile Identifier hi def link vimSpecFileMod vimSpecFile hi def link vimSpecial Type @@ -1702,6 +2467,7 @@ if !exists("skip_vim_syntax_inits") hi def link vimStringEnd vimString hi def link vimStringInterpolationBrace vimEscape hi def link vimSubst1 vimSubst + hi def link vimSubstCount Number hi def link vimSubstDelim Delimiter hi def link vimSubstFlags Special hi def link vimSubstSubstr SpecialChar @@ -1741,14 +2507,21 @@ if !exists("skip_vim_syntax_inits") hi def link vimSynSpell Type hi def link vimSyntax vimCommand hi def link vimSynType vimSpecial + hi def link vimTcl vimCommand hi def link vimThrow vimCommand hi def link vimTodo Todo hi def link vimType Type + hi def link vimTypeAny vimType + hi def link vimUniq vimCommand + hi def link vimUniqBang vimBang + hi def link vimUniqOptions Special hi def link vimUnlet vimCommand hi def link vimUnletBang vimBang hi def link vimUnmap vimMap + hi def link vimUserCmd vimCommand hi def link vimUserCmdAttrAddr vimSpecial - hi def link vimUserCmdAttrCmplt vimSpecial + hi def link vimUserCmdAttrComplete vimSpecial + hi def link vimUserCmdAttrCompleteFunc vimVar hi def link vimUserCmdAttrNargs vimSpecial hi def link vimUserCmdAttrRange vimSpecial hi def link vimUserCmdAttrKey vimUserCmdAttr @@ -1759,9 +2532,31 @@ if !exists("skip_vim_syntax_inits") hi def link vimUserFunc Normal hi def link vimVar Normal hi def link vimVarScope Identifier + hi def link vimVimgrep vimCommand + hi def link vimVimgrepadd vimCommand + hi def link vimVimgrepBang vimBang + hi def link vimVimgrepFlags Special hi def link vimVimVar Identifier hi def link vimVimVarName Identifier hi def link vimWarn WarningMsg + hi def link vimWildcard Special + hi def link vimWildcardBraceComma vimWildcard + hi def link vimWildcardBracket vimWildcard + hi def link vimWildcardBracketCaret vimWildcard + hi def link vimWildcardBracketCharacter Normal + hi def link vimWildcardBracketCharacter Normal + hi def link vimWildcardBracketCharacterClass vimWildCard + hi def link vimWildcardBracketCollatingSymbol vimWildCard + hi def link vimWildcardBracketEnd vimWildcard + hi def link vimWildcardBracketEquivalenceClass vimWildCard + hi def link vimWildcardBracketEscape vimWildcard + hi def link vimWildcardBracketHyphen vimWildcard + hi def link vimWildcardBracketRightBracket vimWildcardBracketCharacter + hi def link vimWildcardBracketStart vimWildcard + hi def link vimWildcardEscape vimWildcard + hi def link vimWildcardInterval vimWildcard + hi def link vimWildcardQuestion vimWildcard + hi def link vimWildcardStar vimWildcard hi def link vim9Abstract vimCommand hi def link vim9Boolean Boolean @@ -1773,6 +2568,12 @@ if !exists("skip_vim_syntax_inits") hi def link vim9Const vimCommand hi def link vim9ContinueComment vimContinueComment hi def link vim9Enum vimCommand + hi def link vim9EnumImplementedInterfaceComment vim9Comment + hi def link vim9EnumImplements vim9Implements + hi def link vim9EnumNameComment vim9Comment + hi def link vim9EnumNameContinue vimContinue + hi def link vim9EnumNameContinueComment vim9Comment + hi def link vim9EnumValueListCommaComment vim9Comment hi def link vim9Export vimCommand hi def link vim9Extends Keyword hi def link vim9Final vimCommand @@ -1783,7 +2584,7 @@ if !exists("skip_vim_syntax_inits") hi def link vim9Interface vimCommand hi def link vim9LambdaOperator vimOper hi def link vim9LambdaOperatorComment vim9Comment - hi def link vim9LambdaParamsParen vimParenSep + hi def link vim9LambdaParen vimParenSep hi def link vim9LhsRegister vimLetRegister hi def link vim9LhsVariable vimVar hi def link vim9LineComment vimComment @@ -1800,11 +2601,15 @@ if !exists("skip_vim_syntax_inits") hi def link vim9Type vimCommand hi def link vim9TypeEquals vimOper hi def link vim9Variable vimVar + hi def link vim9VariableType vimType + hi def link vim9VariableTypeAny vimType hi def link vim9Var vimCommand hi def link vim9Vim9ScriptArg Special hi def link vim9Vim9Script vimCommand hi def link vimCompilerSet vimCommand + hi def link vimSynColor vimCommand + hi def link vimSynLink vimCommand hi def link vimSynMenu vimCommand hi def link vimSynMenuPath vimMenuName endif diff --git a/runtime/tutor/Make_all.mak b/runtime/tutor/Make_all.mak deleted file mode 100644 index aafc3960ff..0000000000 --- a/runtime/tutor/Make_all.mak +++ /dev/null @@ -1,49 +0,0 @@ -# -# Makefile with common components -# - -CHAPTER1 = \ - tutor1.utf-8 \ - tutor1.bar \ - tutor1.ca.utf-8 \ - tutor1.cs \ - tutor1.cs.cp1250 \ - tutor1.da \ - tutor1.de.utf-8 \ - tutor1.el \ - tutor1.el.cp737 \ - tutor1.eo \ - tutor1.es \ - tutor1.fr.utf-8 \ - tutor1.hr \ - tutor1.hr.cp1250 \ - tutor1.hu \ - tutor1.hu.cp1250 \ - tutor1.it.utf-8 \ - tutor1.ja.sjis \ - tutor1.ja.euc \ - tutor1.ko \ - tutor1.ko.euc \ - tutor1.nl \ - tutor1.no.utf-8 \ - tutor1.nb \ - tutor1.nb.utf-8 \ - tutor1.pl \ - tutor1.pl.cp1250 \ - tutor1.pt \ - tutor1.ru \ - tutor1.ru.cp1251 \ - tutor1.sk \ - tutor1.sk.cp1250 \ - tutor1.sr.cp1250 \ - tutor1.sv.utf-8 \ - tutor1.tr.iso9 \ - tutor1.zh.utf-8 - -CHAPTER2 = \ - tutor2 \ - tutor2.it - -CONVERTED = $(CHAPTER1) $(CHAPTER2) - -# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: diff --git a/runtime/tutor/Make_mvc.mak b/runtime/tutor/Make_mvc.mak deleted file mode 100644 index d917f311bf..0000000000 --- a/runtime/tutor/Make_mvc.mak +++ /dev/null @@ -1,450 +0,0 @@ -# -# Makefile for converting the Vim tutorial on Windows. -# -# 21.11.24, Restorer, restorer@mail2k.ru -# -# Use the UTF-8 version as the original and create the others with conversion. -# For some translation files of chapter one, conversion from traditional -# encodings to UTF-8 encoding is performed. - - -!IF [powershell -nologo -noprofile "exit $$psversiontable.psversion.major"] == 2 -!ERROR The program "PowerShell" version 3.0 or higher is required to work -!ENDIF - -# Common components -!INCLUDE Make_all.mak - -# Correct the following line for the directory where iconv is installed. -# Please do not put the path in quotes. -ICONV_PATH = D:\Programs\GetText\bin - -# In case some package like GnuWin32, UnixUtils, gettext -# or something similar is installed on the system. -# If the "iconv" program is installed on the system, but it is not registered -# in the %PATH% environment variable, then specify the full path to this file. -!IF EXIST ("iconv.exe") -ICONV = "iconv.exe" -!ELSEIF EXIST ("$(ICONV_PATH)\iconv.exe") -ICONV = "$(ICONV_PATH)\iconv.exe" -!ENDIF - -RM = del /q -CP = copy /y -HDLNK = mklink /h -PS = PowerShell.exe - -PSFLAGS = -NoLogo -NoProfile -Command - -.SUFFIXES : - -all : $(CONVERTED) - -tutor1.utf-8 : tutor1 -!IF DEFINED (ICONV) - $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(28591)) ^| \ - 1>nul New-Item -Path . -Name $@ -ItemType file -Force -!ENDIF - -tutor2 : tutor2.utf-8 -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -tutor1.bar tutor2.bar : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -tutor1.ca.utf-8 : tutor1.ca -!IF DEFINED (ICONV) - $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(28591)) ^| \ - 1>nul New-Item -Path . -Name $@ -ItemType file -Force -!ENDIF - -tutor2.ca : tutor2.ca.utf-8 -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -tutor1.cs tutor2.cs : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28592)) -!ENDIF - -tutor1.cs.cp1250 tutor2.cs.cp1250 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP1250 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(1250)) -!ENDIF - -tutor1.da tutor2.da : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-4 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28594)) -!ENDIF - -tutor1.de.utf-8 : tutor1.de -!IF DEFINED (ICONV) - $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(28591)) ^| \ - 1>nul New-Item -Path . -Name $@ -ItemType file -Force -!ENDIF - -tutor2.de : tutor2.de.utf-8 -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -tutor1.el tutor2.el : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-7 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28597)) -!ENDIF - -tutor1.el.cp737 tutor2.el.cp737 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP737 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(737)) -!ENDIF - -tutor1.eo tutor2.eo : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-3 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28593)) -!ENDIF - -tutor1.es tutor2.es : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -tutor1.fr.utf-8 : tutor1.fr -!IF DEFINED (ICONV) - $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(28591)) ^| \ - 1>nul New-Item -Path . -Name $@ -ItemType file -Force -!ENDIF - -tutor2.fr : tutor2.fr.utf-8 -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -tutor1.hr tutor2.hr : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28592)) -!ENDIF - -tutor1.hr.cp1250 tutor2.hr.cp1250 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP1250 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(1250)) -!ENDIF - -tutor1.hu tutor2.hu : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28592)) -!ENDIF - -tutor1.hu.cp1250 tutor2.hu.cp1250 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP1250 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(1250)) -!ENDIF - -tutor1.it.utf-8 : tutor1.it -!IF DEFINED (ICONV) - $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(28591)) ^| \ - 1>nul New-Item -Path . -Name $@ -ItemType file -Force -!ENDIF - -tutor2.it : tutor2.it.utf-8 -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -tutor1.ja.sjis tutor2.ja.sjis : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP932 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(932)) -!ENDIF - -tutor1.ja.euc tutor2.ja.euc : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t EUC-JP $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(51932)) -!ENDIF - -tutor1.ko tutor2.ko : - $(HDLNK) $@ $@.utf-8 - -tutor1.ko.euc tutor2.ko.euc : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t EUC-KR $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(51949)) -!ENDIF - -tutor1.nl tutor2.nl : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -tutor1.no.utf-8 : tutor1.no -!IF DEFINED (ICONV) - $(ICONV) -f ISO-8859-1 -t UTF-8 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(28591)) ^| \ - 1>nul New-Item -Path . -Name $@ -ItemType file -Force -!ENDIF - -tutor2.no : tutor2.no.utf-8 -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-1 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28591)) -!ENDIF - -# nb is an alias for no -tutor1.nb tutor2.nb : $$(@R).no - $(HDLNK) $@ $? - -tutor1.nb.utf-8 tutor2.nb.utf-8 : $$(@R) - $(HDLNK) $@ %|dpfF.no.utf-8 - -tutor1.pl tutor2.pl : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28592)) -!ENDIF - -tutor1.pl.cp1250 tutor2.pl.cp1250 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP1250 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(1252)) -!ENDIF - -tutor1.pt tutor2.pt : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-15 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28605)) -!ENDIF - -tutor1.ru tutor2.ru : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t KOI8-R $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(20866)) -!ENDIF - -tutor1.ru.cp1251 tutor2.ru.cp1251 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP1251 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(1251)) -!ENDIF - -tutor1.sk tutor2.sk : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$@.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28592)) -!ENDIF - -tutor1.sk.cp1250 tutor2.sk.cp1250 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP1250 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(1252)) -!ENDIF - -tutor1.sr.cp1250 tutor2.sr.cp1250 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t CP1250 $(@R).utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$(@R).utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(1252)) -!ENDIF - -tutor1.sv.utf-8 : tutor1.sv -!IF DEFINED (ICONV) - $(ICONV) -f ISO-8859-15 -t UTF-8 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(28605)) ^| \ - 1>nul New-Item -Path . -Name $@ -ItemType file -Force -!ENDIF - -tutor2.sv : tutor2.sv.utf-8 -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-15 $? >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28605)) -!ENDIF - -tutor1.tr.iso9 tutor2.tr.iso9 : -!IF DEFINED (ICONV) - $(ICONV) -f UTF-8 -t ISO-8859-9 $*.utf-8 >$@ -!ELSE - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$*.utf-8\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(28599)) -!ENDIF - -tutor1.zh.utf-8 : tutor1.zh.big5 - $(PS) $(PSFLAGS) [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(950)) ^| \ - 1>nul New-Item -Path . -Name $@ -ItemType file -Force - -tutor2.zh.big5 : tutor2.zh.utf-8 - $(PS) $(PSFLAGS) [System.IO.File]::WriteAllText(\"$@\", \ - [System.IO.File]::ReadAllText(\"$?\", \ - [System.Text.Encoding]::GetEncoding(65001)), \ - [System.Text.Encoding]::GetEncoding(950)) - -clean : - @for %%G in ($(CONVERTED)) do (if exist .\%%G $(RM) .\%%G) - -# vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: diff --git a/runtime/tutor/Makefile b/runtime/tutor/Makefile deleted file mode 100644 index 3eb49846e8..0000000000 --- a/runtime/tutor/Makefile +++ /dev/null @@ -1,150 +0,0 @@ -# Makefile for the Vim tutor. -# -# Use the UTF-8 version as the original and create the others with conversion. -# For some translation files of chapter one, conversion from traditional -# encodings to UTF-8 encoding is performed. - -# Common components -include Make_all.mak - -.PHONY: all clean - -.SUFFIXES: - -all: $(CONVERTED) - -tutor1.utf-8: tutor1 - iconv -f ISO-8859-1 -t UTF-8 $? >$@ - -tutor2: tutor2.utf-8 - iconv -f UTF-8 -t ISO-8859-1 $? >$@ - -tutor1.bar tutor2.bar: - iconv -f UTF-8 -t ISO-8859-1 $@.utf-8 >$@ - -tutor1.ca.utf-8: tutor1.ca - iconv -f ISO-8859-1 -t UTF-8 $? >$@ - -tutor2.ca: tutor2.ca.utf-8 - iconv -f UTF-8 -t ISO-8859-1 $? >$@ - -tutor1.cs tutor2.cs : - iconv -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ - -tutor1.cs.cp1250 tutor2.cs.cp1250 : - iconv -f UTF-8 -t CP1250 $(@:.cp1250=).utf-8 >$@ - -tutor1.da tutor2.da : - iconv -f UTF-8 -t ISO-8859-4 $@.utf-8 >$@ - -tutor1.de.utf-8: tutor1.de - iconv -f ISO-8859-1 -t UTF-8 $? >$@ - -tutor2.de: tutor2.de.utf-8 - iconv -f UTF-8 -t ISO-8859-1 $? >$@ - -tutor1.el tutor2.el: - iconv -f UTF-8 -t ISO-8859-7 $@.utf-8 >$@ - -tutor1.el.cp737 tutor2.el.cp737: - iconv -f UTF-8 -t CP737 $(@:.cp737=.utf-8) >$@ - -tutor1.eo tutor2.eo: - iconv -f UTF-8 -t ISO-8859-3 $@.utf-8 >$@ - -tutor1.es tutor2.es: - iconv -f UTF-8 -t ISO-8859-1 $@.utf-8 >$@ - -tutor1.fr.utf-8: tutor1.fr - iconv -f ISO-8859-1 -t UTF-8 $? >$@ - -tutor2.fr: tutor2.fr.utf-8 - iconv -f UTF-8 -t ISO-8859-1 $? >$@ - -tutor1.hr tutor2.hr: - iconv -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ - -tutor1.hr.cp1250 tutor2.hr.cp1250: - iconv -f UTF-8 -t CP1250 $(@:.cp1250=.utf-8) >$@ - -tutor1.hu tutor2.hu: - iconv -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ - -tutor1.hu.cp1250 tutor2.hu.cp1250: - iconv -f UTF-8 -t CP1250 $(@:.cp1250=.utf-8) >$@ - -tutor1.it.utf-8: tutor1.it - iconv -f ISO-8859-1 -t UTF-8 $? >$@ - -tutor2.it: tutor2.it.utf-8 - iconv -f UTF-8 -t ISO-8859-1 $? >$@ - -tutor1.ja.sjis tutor2.ja.sjis: - iconv -f UTF-8 -t CP932 $(@:.sjis=.utf-8) >$@ - -tutor1.ja.euc tutor2.ja.euc: - iconv -f UTF-8 -t EUC-JP $(@:.euc=.utf-8) >$@ - -tutor1.ko tutor2.ko: - ln $@.utf-8 $@ - -tutor1.ko.euc tutor2.ko.euc: - iconv -f UTF-8 -t EUC-KR $(@:.euc=.utf-8) >$@ - -tutor1.nl tutor2.nl: - iconv -f UTF-8 -t ISO-8859-1 $@.utf-8 >$@ - -tutor1.no.utf-8: tutor1.no - iconv -f ISO-8859-1 -t UTF-8 $? >$@ - -tutor2.no: tutor2.no.utf-8 - iconv -f UTF-8 -t ISO-8859-1 $? >$@ - -# nb is an alias for no -tutor1.nb tutor2.nb: - ln $(@:.nb=.no) $@ - -tutor1.nb.utf-8 tutor2.nb.utf-8: - ln $(@:.nb.utf-8=.no.utf-8) $@ - -tutor1.pl tutor2.pl : - iconv -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ - -tutor1.pl.cp1250 tutor2.pl.cp1250 : - iconv -f UTF-8 -t CP1250 $(@:.cp1250=).utf-8 >$@ - -tutor1.pt tutor2.pt : - iconv -f UTF-8 -t ISO-8859-15 $@.utf-8 >$@ - -tutor1.ru tutor2.ru: - iconv -f UTF-8 -t KOI8-R $@.utf-8 >$@ - -tutor1.ru.cp1251 tutor2.ru.cp1251: - iconv -f UTF-8 -t CP1251 $(@:.cp1251=.utf-8) >$@ - -tutor1.sk tutor2.sk : - iconv -f UTF-8 -t ISO-8859-2 $@.utf-8 >$@ - -tutor1.sk.cp1250 tutor2.sk.cp1250 : - iconv -f UTF-8 -t CP1250 $(@:.cp1250=).utf-8 >$@ - -tutor1.sr.cp1250 tutor2.sr.cp1250 : - iconv -f UTF-8 -t CP1250 $(@:.cp1250=).utf-8 >$@ - -tutor1.sv.utf-8: tutor1.sv - iconv -f ISO-8859-15 -t UTF-8 $? >$@ - -tutor2.sv: tutor2.sv.utf-8 - iconv -f UTF-8 -t ISO-8859-15 $? >$@ - -tutor1.tr.iso9 tutor2.tr.iso9: - iconv -f UTF-8 -t ISO-8859-9 $(@:.iso9=.utf-8) >$@ - -tutor1.zh.utf-8: tutor1.zh.big5 - iconv -f BIG-5 -t UTF-8 -c $? >$@ - -tutor2.zh.big5: tutor2.zh.utf-8 - iconv -f UTF-8 -t BIG-5 -c $? >$@ - -clean: - for G in $(CONVERTED); do if [ -f ./$$G ]; then rm -f ./$$G; fi; done; diff --git a/runtime/tutor/README.el.cp737.txt b/runtime/tutor/README.el.cp737.txt deleted file mode 100644 index 426f929c6f..0000000000 --- a/runtime/tutor/README.el.cp737.txt +++ /dev/null @@ -1,24 +0,0 @@ -�� Tutor �夘� �� "������������" ����㚞�� ��� �⦬� ��㩫�� ��� -����ᡫ� Vim. - -�� ������櫜��� �⦠ ��㩫�� ������ �� �� �����驦�� �� ���櫜�� ��� -�� 騘. �� ����⢜��� �夘� 櫠 �����嫜 �� �ᤜ�� �� ���� ������ -���������嘪 ����⤦� ����������餫�� ��� ����ᡫ� Vim. - -�� Tutor �夘� ⤘ ����� ��� ����⮜� �� ���㣘�� ��� ������������. -�����嫜 �� �����⩜�� ���� "vim tutor" ��� ���� �� �������㩜�� ��� -����圪 ��� ���㣘��. �� ���㣘�� �� ��� ��礜 �� ��������㩜�� -�� �����, ������ ��� �� ������ ��� ��������� ��������� ���. - -�� �穫��� Unix �����嫜 ��婞� �� ����������㩜�� �� ��暨���� "vimtutor". -�� ��������㩜� ��高 ⤘ ��殜��� ���嚨��� ��� tutor. - -�� ������� �� ������� ������櫜�� ����ਞ�⤘ ���㣘�� ���� ��� �� ���� -��� �����嫞�� ��椦. ������驫� �� �������� �� �� �� �⢘�� ��� ���墜�� -��� �������㧦�� �����驜�� �ᤜ��. - -Bob Ware, Colorado School of Mines, Golden, Co 80401, USA -(303) 273-3987 -bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet - -[�� ����� ���� ��������㟞�� ��� ��� Vim ��� ��� Bram Moolenaar] diff --git a/runtime/tutor/README.el.txt b/runtime/tutor/README.el.txt index b2f5e07466..69204019b3 100644 --- a/runtime/tutor/README.el.txt +++ b/runtime/tutor/README.el.txt @@ -1,24 +1,24 @@ -�� Tutor ����� ��� "������������" ��������� ��� ����� ������� ��� -�������� Vim. +Το Tutor είναι μία "χειρονακτική" περιήγηση για νέους χρήστες του +συντάκτη Vim. -�� ������������ ���� ������� ������� �� �� ���������� �� �������� ��� -��� ���. �� ���������� ����� ��� �������� �� ������ ��� ���� ������� -������������ �������� ��������������� ��� �������� Vim. +Οι περισσότεροι νέοι χρήστες μπορούν να το τελειώσουν σε λιγότερο από +μία ώρα. Το αποτέλεσμα είναι ότι μπορείτε να κάνετε μία απλή εργασία +επεξεργασίας κειμένου χρησιμοποιώντας τον συντάκτη Vim. -�� Tutor ����� ��� ������ ��� �������� �� �������� ��� �������������. -�������� �� ���������� ���� "vim tutor" ��� ���� �� ������������ ��� -������� ��� ��������. �� �������� �� ��� ����� �� ������������� -�� ������, �������� ��� �� ������ ��� ��������� ��������� ���. +Το Tutor είναι ένα αρχείο που περιέχει τα μαθήματα της προπαρασκευής. +Μπορείτε να εκτελέσετε απλά "vim tutor" και μετά να ακολουθήσετε τις +οδηγίες στα μαθήματα. Τα μαθήματα θα σας πούνε να τροποποιήσετε +το αρχείο, επομένως ΜΗΝ ΤΟ ΚΑΝΕΤΕ ΣΤΟ ΠΡΩΤΟΤΥΠΟ ΑΝΤΙΓΡΑΦΟ ΣΑΣ. -�� ������� Unix �������� ������ �� ��������������� �� ��������� "vimtutor". -�� ������������ ����� ��� �������� ��������� ��� tutor. +Σε σύστημα Unix μπορείτε επίσης να χρησιμοποιήσετε το πρόγραμμα "vimtutor". +Θα δημιουργήσει πρώτα ένα πρόχειρο αντίγραφο του tutor. -��� ������� �� �������� ����������� ����������� �������� ���� ��� ��� ���� -��� ���������� �����. ���������� �� �������� ��� �� �� ������ ��� �������� -��� ������������ ���������� ������. +Έχω σκεφτεί να προσθέσω περισσότερα προχωρημένα μαθήματα αλλά δεν έχω βρει +τον απαραίτητο χρόνο. Ενημερώστε με παρακαλώ πώς θα το θέλατε και στείλετε +μου οποιεσδήποτε βελτιώσεις κάνετε. Bob Ware, Colorado School of Mines, Golden, Co 80401, USA (303) 273-3987 bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet -[�� ������ ���� ������������� ��� ��� Vim ��� ��� Bram Moolenaar] +[Το αρχείο αυτό τροποποιήθηκε για τον Vim από τον Bram Moolenaar] diff --git a/runtime/tutor/README.ru.utf-8.txt b/runtime/tutor/README.ru.txt similarity index 62% rename from runtime/tutor/README.ru.utf-8.txt rename to runtime/tutor/README.ru.txt index 517ae7bbe0..875cbbb266 100644 --- a/runtime/tutor/README.ru.utf-8.txt +++ b/runtime/tutor/README.ru.txt @@ -29,18 +29,8 @@ bware@mines.colorado.edu bware@slate.mines.colorado.edu bware@mines.bitnet Переводы ----------- -Файлы tutor1.xx и tutor1.xx.utf-8 для первой главы, и tutor2.xx и -tutor2.xx.utf-8 для второй главы, являются переводами учебника (где xx — код -языка). Кодировка текста в файлах tutor1.xx или tutor2.xx может быть latin1 или -другая традиционная кодировка. Если не требуется перевод в такой традиционной -кодировке, вам нужно просто подготовить файл tutor1.xx.utf-8 tutor2.xx.utf-8. -Если необходима другая кодировка текста, вы также можете сделать такой файл, его -наименование должно быть tutor1.xx.enc tutor1.xx.enc (замените «enc» на -фактическое название кодировки). Возможно, что для этого потребуется настроить -файл «tutor.vim». -Для создания файла tutor1.xx или tutor2.xx из tutor1.xx.utf-8 или -tutor2.xx.utf-8 соответственно, можно использовать команду "make". Посмотрите -файл «Makefile», чтобы получить подробную информацию. (Для некоторых языков файл -tutor1.xx.utf-8 создаётся из tutor1.xx в силу исторических причин). +Файлы tutor1.xx для первой главы и tutor2.xx для второй главы учебника являются +переводами (где xx — код языка). Кодировка файлов tutor1.xx и tutor2.xx должна +быть UTF-8. [Брам Моленар (Bram Moolenaar) и др. изменили этот файл для редактора Vim] diff --git a/runtime/tutor/README.txt b/runtime/tutor/README.txt index a8b48a4058..e8f02abf25 100644 --- a/runtime/tutor/README.txt +++ b/runtime/tutor/README.txt @@ -27,18 +27,8 @@ The chapter two of the tutorial was written by Paul D. Parker. Translation ----------- -The files tutor1.xx and tutor1.xx.utf-8 for chapter one and tutor2.xx and -tutor2.xx.utf-8 for chapter two of the tutorial are translated files (where xx -is the language code). -The encoding of tutor1.xx or tutor2.xx might be latin1 or other traditional -encoding. If you don't need a translation with such traditional encoding, -you just need to prepare the tutor1.xx.utf-8 or tutor2.xx.utf-8 file. -If you need another encoding, you can also prepare a file named tutor1.xx.enc or -tutor2.xx.enc (replace enc with the actual encoding name). You might also need -to adjust the tutor.vim file. -The "make" command can be used for creating tutor1.xx or tutor2.xx from -tutor.xx.utf-8 or tutor2.xx.utf-8, respectively. -See the Makefile for detail. (For some languages, tutor1.xx.utf-8 is created -from tutor1.xx for historical reasons.) +The files tutor1.xx for chapter one and tutor2.xx chapter two of the tutorial +are translated files (where xx is the language code). +The encoding of tutor1.xx and tutor2.xx must be utf-8. [This file was modified for Vim by Bram Moolenaar et al.] diff --git a/runtime/tutor/README.txt.info b/runtime/tutor/README.txt.info deleted file mode 100755 index 238b11fa95..0000000000 Binary files a/runtime/tutor/README.txt.info and /dev/null differ diff --git a/runtime/tutor/en/vim-01-beginner.tutor b/runtime/tutor/en/vim-01-beginner.tutor index 85d693d5f3..8af5d465cf 100644 --- a/runtime/tutor/en/vim-01-beginner.tutor +++ b/runtime/tutor/en/vim-01-beginner.tutor @@ -458,7 +458,7 @@ Now go on to the next lesson. # Lesson 4.1: CURSOR LOCATION AND FILE STATUS ** Type ``{normal} to show your location in a file and the file status. - Type `G`{normal} to move to a line in the file. ** + Type `{count}G`{normal} to move to line {count} in the file. ** NOTE: Read this entire lesson before executing any of the steps!! @@ -933,11 +933,20 @@ default. To start using more features you have to create a "vimrc" file. 3. Press ``{normal} and Vim will show a list of commands that start with "e". - 4. Press ``{normal} and Vim will complete the command name to ":edit". + 4. Press ``{normal} and Vim will show a menu with possible completions + (or complete the match, if the entered command is unique, e.g. + ":ed``{normal}" will be completed to ":edit"). - 5. Now add a space and the start of an existing file name: `:edit FIL`{vim} + 5. Use ``{normal} or ``{normal} to go to the next match. Or use + ``{normal} or ``{normal} to go to the previous match. - 6. Press ``{normal}. Vim will complete the name (if it is unique). + 6. Choose the entry `edit`{vim}. Now you can see that the word `edit`{vim} + have been automatically inserted to the command line. + + 7. Now add a space and the start of an existing file name: `:edit FIL`{vim} + + 8. Press ``{normal}. Vim will show a completion menu with list of file + names that start with `FIL` NOTE: Completion works for many commands. It is especially useful for `:help`{vim}. @@ -956,12 +965,12 @@ NOTE: Completion works for many commands. It is especially useful for 5. Create a vimrc startup script to keep your preferred settings. 6. While in command mode, press ``{normal} to see possible completions. - Press ``{normal} to use one completion. + Press ``{normal} to use the completion menu and select a match. # CONCLUSION This concludes Chapter 1 of the Vim Tutor. Consider continuing with -[Chapter 2](@tutor:tutor:vim-02-beginner). +[Chapter 2](@tutor:vim-02-beginner). This was intended to give a brief overview of the Vim editor, just enough to allow you to use the editor fairly easily. It is far from complete as Vim has diff --git a/runtime/tutor/sr/vim-01-beginner.tutor b/runtime/tutor/sr/vim-01-beginner.tutor index 06ca036f04..dfcf45803a 100644 --- a/runtime/tutor/sr/vim-01-beginner.tutor +++ b/runtime/tutor/sr/vim-01-beginner.tutor @@ -912,13 +912,17 @@ Vim има много више могућности него Vi, али је в искључена. Да бисте укључили још фукционалности, морате да креирате „vimrc” фајл. - 1. Започните уређивање „vimrc” фајла. - `:call mkdir(stdpath('config'),'p')`{vim} - `:exe 'edit' stdpath('config').'/init.vim'`{vim} + 1. Започните уређивање „vimrc” фајла. То зависи од вашег система: + за UNIX системе за Windows + `:e ~/.vimrc`{vim} `:e ~/_vimrc`{vim} - 2. Сачувајте фајл са: + 2. Сада учитајте садржај „vimrc” фајла за пример: + `:r $VIMRUNTIME/vimrc_example.vim`{vim} + + 3. Сачувајте фајл са: `:w`{vim} + Следећи пут када покренете Vim користиће се истицање синтаксе. У овај „vimrc” фајл можете додати сва подешавања која желите. За више информација откуцајте `:help vimrc-intro`{vim}. diff --git a/runtime/tutor/tutor.tutor b/runtime/tutor/tutor.tutor index b46fcc4836..cdef5d55ce 100644 --- a/runtime/tutor/tutor.tutor +++ b/runtime/tutor/tutor.tutor @@ -17,15 +17,8 @@ Table of contents: ## SETTING UP *setting-up* -First, you'll need to enable "debug" mode -~~~ cmd - :let g:tutor_debug = 1 -~~~ -This will allow saving changes to the tutor files and will disable conceals, so -you can more easily check your changes. - -After this, create a new .tutor file (we will be practicing on this very file, so you -don't need to do this now): +Create a new .tutor file (we will be practicing on this very file, so you don't +need to do this now): ~~~ cmd :e new-tutorial.tutor ~~~ diff --git a/runtime/tutor/tutor.tutor.json b/runtime/tutor/tutor.tutor.json index bf3eae8586..9ee0974463 100644 --- a/runtime/tutor/tutor.tutor.json +++ b/runtime/tutor/tutor.tutor.json @@ -1,35 +1,35 @@ { - "expect": { - "63": "This is text with **important information**", - "64": "This is text with **important information**", - "71": "Document '&variable'", - "72": "Document '&variable'", - "78": "# This is a level 1 header", - "79": "# This is a level 1 header", - "80": "### This is a level 3 header", - "81": "### This is a level 3 header", - "82": "# This is a header with a label {*label*}", - "83": "# This is a header with a label {*label*}", - "108": "A link to help for the ['breakindent']('breakindent') option", - "109": "A link to help for the ['breakindent']('breakindent') option", - "123": "A link to the [Links](*links*) section", - "124": "A link to the [Links](*links*) section", - "139": "A link to [the vim-tutor-mode tutorial](@tutor:tutor)", - "140": "A link to [the vim-tutor-mode tutorial](@tutor:tutor)", - "157": "~~~ viml", - "158": "echom 'the value of &number is'.string(&number)", - "159": "~~~", - "161": "~~~ viml", - "162": "echom 'the value of &number is'.string(&number)", - "163": "~~~", - "188": "~~~ normal", - "189": "d2w", - "190": "~~~", - "192": "~~~ normal", - "193": "d2w", - "194": "~~~", - "206": "`d2w`{normal}", - "207": "`d2w`{normal}", - "244": -1 - } + "expect": { + "56": "This is text with **important information**", + "57": "This is text with **important information**", + "64": "TODO: Document '&variable'", + "65": "TODO: Document '&variable'", + "71": "# This is a level 1 header", + "72": "# This is a level 1 header", + "73": "### This is a level 3 header", + "74": "### This is a level 3 header", + "75": "# This is a header with a label {*label*}", + "76": "# This is a header with a label {*label*}", + "101": "A link to help for the ['breakindent']('breakindent') option", + "102": "A link to help for the ['breakindent']('breakindent') option", + "116": "A link to the [Links](*links*) section", + "117": "A link to the [Links](*links*) section", + "132": "A link to [the vim-tutor-mode tutorial](@tutor:tutor)", + "133": "A link to [the vim-tutor-mode tutorial](@tutor:tutor)", + "150": "~~~ viml", + "151": "echom 'the value of &number is'.string(&number)", + "152": "~~~", + "154": "~~~ viml", + "155": "echom 'the value of &number is'.string(&number)", + "156": "~~~", + "181": "~~~ normal", + "182": "d2w", + "183": "~~~", + "185": "~~~ normal", + "186": "d2w", + "187": "~~~", + "199": "`d2w`{normal}", + "200": "`d2w`{normal}", + "237": -1 + } } diff --git a/runtime/tutor/tutor.vim b/runtime/tutor/tutor.vim index 6e63937eb7..3aa4c1e3eb 100644 --- a/runtime/tutor/tutor.vim +++ b/runtime/tutor/tutor.vim @@ -1,7 +1,7 @@ " Vim tutor support file " Author: Eduardo F. Amatria " Maintainer: The·Vim·Project· -" Last Change: 2024 Nov 17 +" Last Change: 2025 Jun 20 " This Vim script is used for detecting if a translation of the " tutor file exist, i.e., a tutor.xx file, where xx is the language. @@ -65,121 +65,6 @@ if s:ext =~? '\.en' let s:ext = "" endif -" The Japanese tutor is available in three encodings, guess which one to use -" The "sjis" one is actually "cp932", it doesn't matter for this text. -if s:ext =~? '\.ja' - if &enc =~ "euc" - let s:ext = ".ja.euc" - elseif &enc != "utf-8" - let s:ext = ".ja.sjis" - endif -endif - -" The Korean tutor is available in two encodings, guess which one to use -if s:ext =~? '\.ko' - if &enc != "utf-8" - let s:ext = ".ko.euc" - endif -endif - -" The Chinese tutor is available in three encodings, guess which one to use -" This segment is from the above lines and modified by -" Mendel L Chan for Chinese vim tutorial -" When 'encoding' is utf-8, choose between China (simplified) and Taiwan -" (traditional) based on the language, suggested by Alick Zhao. -if s:ext =~? '\.zh' - if &enc =~ 'big5\|cp950' - let s:ext = ".zh.big5" - elseif &enc != 'utf-8' - let s:ext = ".zh.euc" - elseif s:ext =~? 'zh_tw' || (exists("s:lang") && s:lang =~? 'zh_tw') - let s:ext = ".zh_tw" - else - let s:ext = ".zh_cn" - endif -endif - -" The Polish tutor is available in two encodings, guess which one to use. -if s:ext =~? '\.pl' - if &enc =~ 1250 - let s:ext = ".pl.cp1250" - endif -endif - -" The Turkish tutor is available in two encodings, guess which one to use -if s:ext =~? '\.tr' - if &enc == "iso-8859-9" || &enc == "cp1254" - let s:ext = ".tr.iso9" - endif -endif - -" The Greek tutor is available in three encodings, guess what to use. -" We used ".gr" (Greece) instead of ".el" (Greek); accept both. -if s:ext =~? '\.gr\|\.el' - if &enc == "iso-8859-7" - let s:ext = ".el" - elseif &enc == "utf-8" - let s:ext = ".el.utf-8" - elseif &enc =~ 737 - let s:ext = ".el.cp737" - endif -endif - -" The Slovak tutor is available in three encodings, guess which one to use -if s:ext =~? '\.sk' - if &enc =~ 1250 - let s:ext = ".sk.cp1250" - endif -endif - -" The Serbian tutor is available in two encodings, guess which one to use -" Note that the utf-8 version is the original, the cp1250 version is created -" from it. -if s:ext =~? '\.sr' - if &enc =~ 1250 - let s:ext = ".sr.cp1250" - endif -endif - -" The Czech tutor is available in three encodings, guess which one to use -if s:ext =~? '\.cs' - if &enc =~ 1250 - let s:ext = ".cs.cp1250" - endif -endif - -" The Russian tutor is available in three encodings, guess which one to use. -if s:ext =~? '\.ru' - if &enc =~ '1251' - let s:ext = '.ru.cp1251' - elseif &enc =~ 'koi8' - let s:ext = '.ru' - endif -endif - -" The Hungarian tutor is available in three encodings, guess which one to use. -if s:ext =~? '\.hu' - if &enc =~ 1250 - let s:ext = ".hu.cp1250" - elseif &enc =~ 'iso-8859-2' - let s:ext = '.hu' - endif -endif - -" The Croatian tutor is available in three encodings, guess which one to use. -if s:ext =~? '\.hr' - if &enc =~ 1250 - let s:ext = ".hr.cp1250" - elseif &enc =~ 'iso-8859-2' - let s:ext = '.hr' - endif -endif - -" If 'encoding' is utf-8 s:ext must end in utf-8. -if &enc == 'utf-8' && s:ext !~ '\.utf-8' - let s:ext ..= '.utf-8' -endif - " 2. Build the name of the file and chapter let s:chapter = exists("$CHAPTER") ? $CHAPTER : 1 @@ -189,9 +74,6 @@ let s:tutorxx = $VIMRUNTIME .. s:tutorfile .. s:ext " 3. Finding the file: if filereadable(s:tutorxx) let $TUTOR = s:tutorxx -elseif s:ext !~ '\.utf-8' && filereadable(s:tutorxx .. ".utf-8") - " Fallback to utf-8 if available. - let $TUTOR = s:tutorxx .. ".utf-8" else let $TUTOR = $VIMRUNTIME .. s:tutorfile echo "The file " .. s:tutorxx .. " does not exist.\n" diff --git a/runtime/tutor/tutor1.bar b/runtime/tutor/tutor1.bar index a8a9c8a995..74c3889d67 100644 --- a/runtime/tutor/tutor1.bar +++ b/runtime/tutor/tutor1.bar @@ -4,224 +4,224 @@ = C H A P T E R - 1 = =============================================================================== - Dyr Wimm ist ayn gro m�chtigs Blat, d�s was mit aynn W�sn Befelh aufwartt; z - vil, d�� myn s allsand in aynn Schainer wie d�nn daader unterbr�ng. Der - Schainer ist yso aufbaut, d�� yr halt netty die Befelh allsand bringt, wost - brauchst, d��st mit iem f�r s Eerste wirklich �bbs anfangen kanst. - Durchhinarechtn kanst di, wennst willst, in ayner halbetn Stund; d�s haisst, - wennst di nit groo� mit n Pr�bln und T�ftln aufhaltst. + Dyr Wimm ist ayn gro mächtigs Blat, dös was mit aynn Wösn Befelh aufwartt; z + vil, däß myn s allsand in aynn Schainer wie dönn daader unterbräng. Der + Schainer ist yso aufbaut, däß yr halt netty die Befelh allsand bringt, wost + brauchst, däßst mit iem für s Eerste wirklich öbbs anfangen kanst. + Durchhinarechtn kanst di, wennst willst, in ayner halbetn Stund; dös haisst, + wennst di nit grooß mit n Pröbln und Tüftln aufhaltst. OBACHT: - Die Faudungen, wost daader finddst, gaand istig s Gwort �ndern. D�ssw�gn - machst eyn n B�stn glei ayn Aamum von derer Dautticht daader. Haast alsnan - d�s Gwort daader mit n Befelh "vimtutor bar" ausherlaassn, ist s ee schoon + Die Faudungen, wost daader finddst, gaand istig s Gwort öndern. Dösswögn + machst eyn n Böstn glei ayn Aamum von derer Dautticht daader. Haast alsnan + dös Gwort daader mit n Befelh "vimtutor bar" ausherlaassn, ist s ee schoon ayn Aamum. - Mir kan s nit oft gnueg sagn, d�� der Schainer daader istig gan n �ebn - ghoert. Also muesst schoon aau die Befelh +ausf�ern, wennst ys gscheid ler- - nen willst. Mit n L�sn yllain ist s +nit taan! + Mir kan s nit oft gnueg sagn, däß der Schainer daader istig gan n Üebn + ghoert. Also muesst schoon aau die Befelh +ausfüern, wennst ys gscheid ler- + nen willst. Mit n Lösn yllain ist s +nit taan! - Ietz schaust grad non, d�� dein F�stst�lltastn nit druckt ist; und aft geest - glei aynmaal mit dyr j-Tastn abw�rts (yso laaufft d�s n�mlich), hinst d��st + Ietz schaust grad non, däß dein Föststölltastn nit druckt ist; und aft geest + glei aynmaal mit dyr j-Tastn abwärts (yso laaufft dös nömlich), hinst däßst de gantze Letzn 1.1.1 auf n Bildschirm haast. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.1: MIT N M�RKL UMAYNANDFARN + Letzn 1.1.1: MIT N MÖRKL UMAYNANDFARN -** Dyrmitst mit n M�rkl umaynandkimmst, druck h, j, k und l wie unt zaigt. ** - ^ Ayn �slsbrugg: +** Dyrmitst mit n Mörkl umaynandkimmst, druck h, j, k und l wie unt zaigt. ** + ^ Ayn Öslsbrugg: k De Tastn h ist winster und +geet aau gan winster. < h l > S l leit zesm und richtt si gan zesm. j S j kan myn wie aynn Pfeil gan unt seghn. v Mit n k kimmst gan n KOPF. - 1. Ietz ruedertst ainfach mit n M�rkl auf n Bildschirm umaynand, hinst d��st - di sicher f�elst. + 1. Ietz ruedertst ainfach mit n Mörkl auf n Bildschirm umaynand, hinst däßst + di sicher füelst. 2. Halt d Abhin-Tastn (j) druckt; aft rumplt s ainfach weiter. Netty yso kimmst gan dyr naehstn Letzn. - 3. Wie gsait, ietz bew�gst di also mit derer Tastn gan dyr Letzn 1.1.2. + 3. Wie gsait, ietz bewögst di also mit derer Tastn gan dyr Letzn 1.1.2. -Non �bbs: Allweil, wenn dyr niemer ganz wol ist, wasst �bbenn druckt haast, aft +Non öbbs: Allweil, wenn dyr niemer ganz wol ist, wasst öbbenn druckt haast, aft zipfst ; naacher bist wider ganz gwon in dyr Befelhs-Artweis. - N�bnbei gsait kimmst gwonerweil aau mit de Pfeiltastnen weiter. Aber - hjkl seind z haissn s Wimm-Urgstain; und de "H�rtn" seind ganz dyr- - f�r, d�� myn bei +dene bleibt. Pr�blt s ainfach aus! + Nöbnbei gsait kimmst gwonerweil aau mit de Pfeiltastnen weiter. Aber + hjkl seind z haissn s Wimm-Urgstain; und de "Hörtn" seind ganz dyr- + für, däß myn bei +dene bleibt. Pröblt s ainfach aus! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.2: �NN WIMM AUSSCHALTTN + Letzn 1.1.2: ÖNN WIMM AUSSCHALTTN - ALSO, EE WENNST �BBS VON DAA UNT AUSF�ERST, LIS LIEBER ZEERST DE GANTZE LET- + ALSO, EE WENNST ÖBBS VON DAA UNT AUSFÜERST, LIS LIEBER ZEERST DE GANTZE LET- ZN! - 1. Druck d -Tastn, dyrmitst aau gwi� in dyr Befelhs-Artweis bist. + 1. Druck d -Tastn, dyrmitst aau gwiß in dyr Befelhs-Artweis bist. 2. Demmlt :q! . - Daa dyrmit benddst ys Blat und verwirffst allss, wasst �bbenn g�ndert + Daa dyrmit benddst ys Blat und verwirffst allss, wasst öbbenn göndert haast. - 3. Balst �nn Eingib seghst, gib d� Faudung ein, wo di zo d�nn Schainer brun- + 3. Balst önn Eingib seghst, gib dö Faudung ein, wo di zo dönn Schainer brun- gen haat, also vimtutor bar . - 4. Also, wenn ietz allsse sitzt, naacherd f�erst d Schritt 1 hinst 3 aus, mit + 4. Also, wenn ietz allsse sitzt, naacherd füerst d Schritt 1 hinst 3 aus, mit wasst ys Blat verlaasst und aft wider einhinkimmst. -Anm�rkung: Mit :q! verwirffst allss, wasst g�ndert older enther gschribn - haast. In aynn �ttlych Letznen lernst acht, wiest d�s allss in ayner +Anmörkung: Mit :q! verwirffst allss, wasst göndert older enther gschribn + haast. In aynn Öttlych Letznen lernst acht, wiest dös allss in ayner Dautticht speichertst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.3: GWORT BARECHTN - L�SCHN + Letzn 1.1.3: GWORT BARECHTN - LÖSCHN - ** Druck x , dyrmitst d�s Zaichen unter n M�rkl l�schst. ** + ** Druck x , dyrmitst dös Zaichen unter n Mörkl löschst. ** - 1. Bew�g di mit n M�rkl auf de mit ---> angm�rkte Zeil unt. + 1. Bewög di mit n Mörkl auf de mit ---> angmörkte Zeil unt. - 2. Zo n Faeler Verb�ssern farst mit n M�rkl netty auf d�s Zaichen, d�s wo - gl�scht ghoert. + 2. Zo n Faeler Verbössern farst mit n Mörkl netty auf dös Zaichen, dös wo + glöscht ghoert. - 3. Druck de Tastn x , d��st d�s �berfl�ssige Zaichen l�schst. + 3. Druck de Tastn x , däßst dös überflüssige Zaichen löschst. - 4. Ietz tuest so lang weiter mit 2 hinst 4, hinst d�� dyr Saz stimmt. + 4. Ietz tuest so lang weiter mit 2 hinst 4, hinst däß dyr Saz stimmt. ----> De Kkuue sprangg �bber nn Maanad. +---> De Kkuue sprangg übber nn Maanad. - 5. Wenn ietz de Zeil verb�ssert ist, geest gan dyr Letzn 1.1.4. weiter. + 5. Wenn ietz de Zeil verbössert ist, geest gan dyr Letzn 1.1.4. weiter. -Und ganz wichtig: Dyrweilst d�nn Schainer durcharechtst, versuech nit �bbenn, - allss auswendig z lernen; n�n, lern ainfach mit n Anwenddn! +Und ganz wichtig: Dyrweilst dönn Schainer durcharechtst, versuech nit öbbenn, + allss auswendig z lernen; nän, lern ainfach mit n Anwenddn! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.4: GWORT BARECHTN - EINF�EGN + Letzn 1.1.4: GWORT BARECHTN - EINFÜEGN - ** Druck i , dyrmitst �bbs einf�egst. ** + ** Druck i , dyrmitst öbbs einfüegst. ** - 1. Bew�g �nn M�rkl zo dyr eerstn untignen Zeil, wo mit ---> angeet. + 1. Bewög önn Mörkl zo dyr eerstn untignen Zeil, wo mit ---> angeet. - 2. Dyrmitst de eerste Zeil wie de zwaitte machst, bew�g �nn M�rkl auf d�s - eerste Zaichen NAACH derer St�ll, daa wo s Gwort eingf�egt werdn sollt. + 2. Dyrmitst de eerste Zeil wie de zwaitte machst, bewög önn Mörkl auf dös + eerste Zaichen NAACH derer Stöll, daa wo s Gwort eingfüegt werdn sollt. - 3. Druck i und gib d�s ein, was abgeet. + 3. Druck i und gib dös ein, was abgeet. 4. Wenn ieweils ayn Faeler verweitert ist, aft druck ; dyrmit kimmst gan dyr Befelhsartweis zrugg. - So, und ietz tuest ainfach yso weiter, hinst d�� dyr Saz stimmt. + So, und ietz tuest ainfach yso weiter, hinst däß dyr Saz stimmt. ----> Daader gt dd �bbs b. ----> Daader geet diend �bbs ab. +---> Daader gt dd öbbs b. +---> Daader geet diend öbbs ab. - 5. Balst mainst, d��st ys Gwort-Einf�egn kanst, aft geest gan dyr Letzn 1.1.5. + 5. Balst mainst, däßst ys Gwort-Einfüegn kanst, aft geest gan dyr Letzn 1.1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.5: GWORT BARECHTN - ANF�EGN + Letzn 1.1.5: GWORT BARECHTN - ANFÜEGN - ** Druck A gan n Gwort Anf�egn. ** + ** Druck A gan n Gwort Anfüegn. ** - 1. Gee mit n M�rkl gan dyr eerstn untignen Zeil, wo ayn ---> dyrvor haat. - Daa ist s gleich, wo gnaun dyr M�rkl in derer Zeil steet. + 1. Gee mit n Mörkl gan dyr eerstn untignen Zeil, wo ayn ---> dyrvor haat. + Daa ist s gleich, wo gnaun dyr Mörkl in derer Zeil steet. - 2. Demmlt A und gib de entspr�chetn Erg�ntzungen ein. + 2. Demmlt A und gib de entspröchetn Ergöntzungen ein. - 3. Wennst mit n Anf�egn f�rtig bist, aft druckst , d��st wider eyn de + 3. Wennst mit n Anfüegn förtig bist, aft druckst , däßst wider eyn de Befelhsartweis zruggkimmst. - 4. So, und ietz geest aft non gan dyr zwaittn mit ---> angm�rktn Zeil; und + 4. So, und ietz geest aft non gan dyr zwaittn mit ---> angmörktn Zeil; und daadl machst ys netty yso. ---> In derer Zeil gee In derer Zeil geet ayn Weeng ayn Gwort ab. ---> Aau daader stee - Aau daader steet �bbs Unvollst�ndigs. + Aau daader steet öbbs Unvollstöndigs. - 5. Wennst s Anf�egn von Gwort drauf haast, naacherd gee gan dyr Letzn 1.1.6. + 5. Wennst s Anfüegn von Gwort drauf haast, naacherd gee gan dyr Letzn 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.1.6: AYN DAUTTICHT BARECHTN - ** Mit :wq speichertst ayn Dautticht und verlaasst �nn Wimm ganz. ** + ** Mit :wq speichertst ayn Dautticht und verlaasst önn Wimm ganz. ** - !! OBACHT: Ee wennst mit d�nn alln daa unt weitertuest, lis zeerst de gantze + !! OBACHT: Ee wennst mit dönn alln daa unt weitertuest, lis zeerst de gantze Letzn durch!! - 1. Verlaa� also s Blat, wie s in dyr Letzn 1.1.2. haisst, mit :q! ! + 1. Verlaaß also s Blat, wie s in dyr Letzn 1.1.2. haisst, mit :q! ! - 2. Gib d� Faudung eyn n Eingib ein: vim Schainer . 'vim' ruefft s Blat + 2. Gib dö Faudung eyn n Eingib ein: vim Schainer . 'vim' ruefft s Blat auf, und 'Schainer' haisst de Dautticht, wost barechtn willst. Dyrmit - haast also ayn Dautticht, d� wost barechtn kanst. + haast also ayn Dautticht, dö wost barechtn kanst. - 3. Ietz f�egst �bbs ein older l�schst �bbs, wiest ys in de vorignen Letznen + 3. Ietz füegst öbbs ein older löschst öbbs, wiest ys in de vorignen Letznen glernt haast. - 4. Speichert de g�nderte Dautticht und verlaa� �nn Wimm mit :wq . + 4. Speichert de gönderte Dautticht und verlaaß önn Wimm mit :wq . - 5. Schmei� �nn Wimmschainer neu an und gee gan dyr folgetn Zammenfassung. + 5. Schmeiß önn Wimmschainer neu an und gee gan dyr folgetn Zammenfassung. - 6. Aft d��st de obignen Schritt gl�sn und k�ppt haast, kanst ys durchf�ern. + 6. Aft däßst de obignen Schritt glösn und käppt haast, kanst ys durchfüern. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1.1 - 1. Dyr M�rkl werd mit de Tastnen hjkl older aau mit de Pfeiltastnen gsteuert. + 1. Dyr Mörkl werd mit de Tastnen hjkl older aau mit de Pfeiltastnen gsteuert. h (winst) j (ab) k (auf) l (zes) - 2. Um �nn Wimm umbb n Eingib aus z ginnen, demmlt: vim DAUTTICHT . + 2. Um önn Wimm umbb n Eingib aus z ginnen, demmlt: vim DAUTTICHT . - 3. Willst �nn Wimm verlaassn und aau allss verwerffen, aft gibst ein: + 3. Willst önn Wimm verlaassn und aau allss verwerffen, aft gibst ein: und :q! . Gan n Verlaassn und Speichern aber zipfst und :wq . - 4. Willst d�s Zaichen l�schn, daa wo dyr M�rkl drauf ist, demmltst x . + 4. Willst dös Zaichen löschn, daa wo dyr Mörkl drauf ist, demmltst x . - 5. Willst �bbs vor n M�rkl eing�bn, zipfst i und drafter . - Mechst ys aber eyn s Zeilnend anhinh�ngen, benutzt ys A . - Und ainfach naach n M�rkl f�egst ys mit a ein. + 5. Willst öbbs vor n Mörkl eingöbn, zipfst i und drafter . + Mechst ys aber eyn s Zeilnend anhinhöngen, benutzt ys A . + Und ainfach naach n Mörkl füegst ys mit a ein. -Anm�rkung: Druckst , kimmst eyn de Befelhsartweis zrugg older brichst - ayn Faudung ab, d� wo dyr schiefgangen ist. +Anmörkung: Druckst , kimmst eyn de Befelhsartweis zrugg older brichst + ayn Faudung ab, dö wo dyr schiefgangen ist. Ietz tue mit dyr Letzn 1.2 weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.1: L�SHFAUDUNGEN + Letzn 1.2.1: LÖSHFAUDUNGEN - ** Demmlt dw , dyrmitst ayn Wort l�schst. ** + ** Demmlt dw , dyrmitst ayn Wort löschst. ** - 1. Druck , dyrmit s aau gwi� ist, d��st in dyr Befelhsartweis bist. + 1. Druck , dyrmit s aau gwiß ist, däßst in dyr Befelhsartweis bist. - 2. Bew�g �nn M�rkl zo dyr mit ---> angm�rktn Zeil unt. + 2. Bewög önn Mörkl zo dyr mit ---> angmörktn Zeil unt. - 3. Und daa geest ietz auf n Anfang von aynn Wort, d�s wo gl�scht ghoert. + 3. Und daa geest ietz auf n Anfang von aynn Wort, dös wo glöscht ghoert. - 4. Zipf dw , d��st d�s gantze Wort l�schst. + 4. Zipf dw , däßst dös gantze Wort löschst. - N�bnbei: Dyr Buechstabn d erscheint auf dyr l�sstn Zeil von n Bildschirm, - sobaldst n eingibst. Dyr Wimm wartt ietz drauf, d�� �bbs kimmt, al- - so daader ayn w . Seghst freilich �bbs Anderts wie ayn d , - naacherd haast �bbs Falschs demmlt. Druck aft und pr�blt + Nöbnbei: Dyr Buechstabn d erscheint auf dyr lösstn Zeil von n Bildschirm, + sobaldst n eingibst. Dyr Wimm wartt ietz drauf, däß öbbs kimmt, al- + so daader ayn w . Seghst freilich öbbs Anderts wie ayn d , + naacherd haast öbbs Falschs demmlt. Druck aft und pröblt s non aynmaal. ----> Ayn �ttlych W�rter lustig ghoernd nit Fisper eyn d�nn Saz einhin. +---> Ayn Öttlych Wörter lustig ghoernd nit Fisper eyn dönn Saz einhin. - 5. �fert d Schritt 3 und 4, hinst d�� dyr Saz p�sst, und gee aft gan dyr + 5. Äfert d Schritt 3 und 4, hinst däß dyr Saz pässt, und gee aft gan dyr Letzn 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.2: NON MEERER L�SHFAUDUNGEN + Letzn 1.2.2: NON MEERER LÖSHFAUDUNGEN - ** Gib d$ ein, d��st hinst eyn s Zeilnend l�schst. ** + ** Gib d$ ein, däßst hinst eyn s Zeilnend löschst. ** - 1. Druck , dyrmitst aau gwi� in dyr Befelhsartweis bist. + 1. Druck , dyrmitst aau gwiß in dyr Befelhsartweis bist. - 2. Bew�g �nn M�rkl hinst eyn de mit ---> angm�rkte Zeil untn. + 2. Bewög önn Mörkl hinst eyn de mit ---> angmörkte Zeil untn. - 3. Gee mit n M�rkl auf s End von dyr faelerfreien Zeil, NAACH n eerstn . . + 3. Gee mit n Mörkl auf s End von dyr faelerfreien Zeil, NAACH n eerstn . . - 4. Zipf d$ , d��st hinst eyn s End von dyr Zeil l�schst. + 4. Zipf d$ , däßst hinst eyn s End von dyr Zeil löschst. ----> �bber haat s End von dyr Zeil doplt eing�bn. doplt eing�bn. +---> Öbber haat s End von dyr Zeil doplt eingöbn. doplt eingöbn. 5. Gee weiter gan dyr Letzn 1.2.3, dyrmitst versteest, was daader ablaaufft. @@ -234,42 +234,42 @@ Anm Letzn 1.2.3: PFEMERER UND WOLENDER - Vil Faudungen, wo s Gwort �ndernd, s�tznd si aus aynn Pfemerer und aynn Wo- - lend zamm. Bal i also �bbs l�schn will, schreib i ainsting d und aft s "Wo- - lend", d�s haisst also, "wolend", "wohin" d�� i will - older was i halt gnaun - l�schn will. + Vil Faudungen, wo s Gwort öndernd, sötznd si aus aynn Pfemerer und aynn Wo- + lend zamm. Bal i also öbbs löschn will, schreib i ainsting d und aft s "Wo- + lend", dös haisst also, "wolend", "wohin" däß i will - older was i halt gnaun + löschn will. - Daader also, was i wie l�schn kan: - w - hinst eyn n Anfang von n naehstn Wort AANE d�nn sein eersts Zaichen. - e - gan n End von n ietzundn Wort MIT d�nn seinn l�sstn Zaichen. - $ - zo n End von dyr Zeil MIT derer irn l�sstn Zaichen. + Daader also, was i wie löschn kan: + w - hinst eyn n Anfang von n naehstn Wort AANE dönn sein eersts Zaichen. + e - gan n End von n ietzundn Wort MIT dönn seinn lösstn Zaichen. + $ - zo n End von dyr Zeil MIT derer irn lösstn Zaichen. - Also l�scht de Tastnfolg de allss umbb n M�rkl hinst eyn s Wortend. -Anm�rkung: Gib i grad d�s zwaitte Zaichen yllain ein, ruckt halt dyr M�rkl - entspr�chet weiter. + Also löscht de Tastnfolg de allss umbb n Mörkl hinst eyn s Wortend. +Anmörkung: Gib i grad dös zwaitte Zaichen yllain ein, ruckt halt dyr Mörkl + entspröchet weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.4: MIT AYNN Z�LER D WOLENDER �FERN + Letzn 1.2.4: MIT AYNN ZÖLER D WOLENDER ÄFERN - ** Gib i ayn Zal vor aynn Wolend ein, werd d�s Sel entspr�chet oft gangen. ** + ** Gib i ayn Zal vor aynn Wolend ein, werd dös Sel entspröchet oft gangen. ** - 1. Bew�g �nn M�rkl gan n Anfang von dyr Zeil mit ---> dyrvor unt. + 1. Bewög önn Mörkl gan n Anfang von dyr Zeil mit ---> dyrvor unt. - 2. Zipf 2w , d��st mit n M�rkl zwai W�rter weitergeest. + 2. Zipf 2w , däßst mit n Mörkl zwai Wörter weitergeest. - 3. Zipf 3e , d��st mit n M�rkl auf s End von n drittn Wort kimmst. + 3. Zipf 3e , däßst mit n Mörkl auf s End von n drittn Wort kimmst. - 4. Zipf 0 (aynn Nuller), d��st eyn n Anfang von dyr Zeil hinkimmst. + 4. Zipf 0 (aynn Nuller), däßst eyn n Anfang von dyr Zeil hinkimmst. - 5. Widerhol d Schritt 2 und 3 mit verschaidne Z�ler. + 5. Widerhol d Schritt 2 und 3 mit verschaidne Zöler. - ---> D�s ist ietz grad ayn Zeil zo n drinn Umaynanderruedern. + ---> Dös ist ietz grad ayn Zeil zo n drinn Umaynanderruedern. 6. Gee weiter gan dyr Letzn 1.2.5. @@ -277,25 +277,25 @@ Anm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.5: DURCH AYNN Z�LER GLEI MEERER L�SCHN + Letzn 1.2.5: DURCH AYNN ZÖLER GLEI MEERER LÖSCHN - ** Ayn Zal vor aynn Pfemerer f�ert d�nn entspr�chet oft aus. ** + ** Ayn Zal vor aynn Pfemerer füert dönn entspröchet oft aus. ** - Also, i mecht l�schn, und zwaar �bbs Bestimmts, und d�s so und so oft: Daa - dyrzue benutz i aynn Z�ler: - d Z�ler Wolend (also �nn Bew�gungsschrit) + Also, i mecht löschn, und zwaar öbbs Bestimmts, und dös so und so oft: Daa + dyrzue benutz i aynn Zöler: + d Zöler Wolend (also önn Bewögungsschrit) - 1. Bew�g �nn M�rkl zo n eerstn Wort in GROOSSBUECHSTABN in dyr mit ---> an- - gm�rktn Zeil. + 1. Bewög önn Mörkl zo n eerstn Wort in GROOSSBUECHSTABN in dyr mit ---> an- + gmörktn Zeil. - 2. Demmlt d2w , dyrmitst de ganz groo�gschribnen W�rter l�schst. + 2. Demmlt d2w , dyrmitst de ganz grooßgschribnen Wörter löschst. - 3. �fert d Schritt 1 und 2 mit d�nn entspr�chetn Z�ler, dyrmitst de drauf- - folgetn ganz gro�gschribnen W�rter mit ayner ainzignen Faudung l�schst: + 3. Äfert d Schritt 1 und 2 mit dönn entspröchetn Zöler, dyrmitst de drauf- + folgetn ganz großgschribnen Wörter mit ayner ainzignen Faudung löschst: ----> D� ABC DE Zeil FGHI JK LMN OP mit W�rter ist Q RS TUV ietz berichtigt. +---> Dö ABC DE Zeil FGHI JK LMN OP mit Wörter ist Q RS TUV ietz berichtigt. @@ -303,179 +303,179 @@ Anm Letzn 1.2.6: ARECHTN AUF ZEILN - ** Zipf dd , um ayn gantze Zeil z l�schn. ** + ** Zipf dd , um ayn gantze Zeil z löschn. ** - Weil s gro oft v�rkimmt, d�� myn gantze Zeiln l�scht, kaamend schoon d Ent- - wickler von n Urwimm daa drauf, d�� myn ainfach dd gan d�nn Zw�k schreibt. + Weil s gro oft vürkimmt, däß myn gantze Zeiln löscht, kaamend schoon d Ent- + wickler von n Urwimm daa drauf, däß myn ainfach dd gan dönn Zwök schreibt. - 1. Bew�g �nn M�rkl gan dyr zwaittn Zeil in n untignen "Gedicht". - 2. Zipf dd , um d� Zeil z l�schn. - 3. Ietz bew�gst di gan dyr viertn Zeil. - 4. Zipf 2dd , um zwo Zeiln zo n L�schn. + 1. Bewög önn Mörkl gan dyr zwaittn Zeil in n untignen "Gedicht". + 2. Zipf dd , um dö Zeil z löschn. + 3. Ietz bewögst di gan dyr viertn Zeil. + 4. Zipf 2dd , um zwo Zeiln zo n Löschn. ---> 1) Roosn seind root; ---> 2) Drunter ist s Koot. ---> 3) Veigerln seind blau. ---> 4) Umgrabn tuet s d Sau. ---> 5) D Ur sait de Zeit, ----> 6) Sait, d�� s mi freut, +---> 6) Sait, däß s mi freut, ---> 7) Dirndl, dein Gschau. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.7: RUGGG�NGIG MACHEN (RUGGLN) + Letzn 1.2.7: RUGGGÖNGIG MACHEN (RUGGLN) - ** Zipf u , dyrmitst de l�sstn Faudungen ruggltst ** - ** older U , um ayn gantze Zeil widerherzst�lln. ** + ** Zipf u , dyrmitst de lösstn Faudungen ruggltst ** + ** older U , um ayn gantze Zeil widerherzstölln. ** - 1. Bew�g �nn M�rkl gan dyr mit ---> angm�rktn Zeil unt und gee dyrmit auf n + 1. Bewög önn Mörkl gan dyr mit ---> angmörktn Zeil unt und gee dyrmit auf n eerstn Faeler. - 2. Zipf x , d��st d�s eerste z vile Zaichen l�schst. - 3. Ietz demmlt u , dyrmitst de l�sste Faudung ruggltst. - 4. Ietz beh�b allsand Faeler auf dyr Zeil mit dyr Hilf von n Befelh x . - 5. Aft gibst ayn U (groo�) ein, d��st de Zeil wider yso hinbringst, wie s - gw�sn ist. - 6. So, und ietz demmltst so oft u , hinst d��st s U und de andern Fau- - dungen ruggg�ngig gmacht haast. - 7. Und ietzet widerum schreibst so oft r , hinst d��st allsand Be- - felh widerhergst�llt, z haissn allsse rugg-grugglt haast (also d Ruggg�n- - gigmachungen ruggg�ngig gmacht). ----> Beerichtig d Faeller voon dehrer Zeiil und stt�ll s mitt n Ruggruggln wi- + 2. Zipf x , däßst dös eerste z vile Zaichen löschst. + 3. Ietz demmlt u , dyrmitst de lösste Faudung ruggltst. + 4. Ietz behöb allsand Faeler auf dyr Zeil mit dyr Hilf von n Befelh x . + 5. Aft gibst ayn U (grooß) ein, däßst de Zeil wider yso hinbringst, wie s + gwösn ist. + 6. So, und ietz demmltst so oft u , hinst däßst s U und de andern Fau- + dungen rugggöngig gmacht haast. + 7. Und ietzet widerum schreibst so oft r , hinst däßst allsand Be- + felh widerhergstöllt, z haissn allsse rugg-grugglt haast (also d Rugggön- + gigmachungen rugggöngig gmacht). +---> Beerichtig d Faeller voon dehrer Zeiil und sttöll s mitt n Ruggruggln wi- der her. - 8. Die Faudungen seind gro wichtig; s� helffend ainn n�rrisch weiter. + 8. Die Faudungen seind gro wichtig; sö helffend ainn närrisch weiter. Ietz gee weiter gan dyr Zammenfassung von dyr Letzn 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1.2 - 1. Um von n M�rkl aus hinst eyn s naehste Wort zo n L�schn, zipf: dw - 2. Um umbb n M�rkl hinst eyn s End von dyr Zeil zo n L�schn, demmlt d$ - 3. Dyrmitst ayn gantze Zeil l�schst, gib ein: dd - 4. Mechst ayn Bew�gung, ayn "Wolend", �fters, st�ll de entspr�chete Zal dyr- + 1. Um von n Mörkl aus hinst eyn s naehste Wort zo n Löschn, zipf: dw + 2. Um umbb n Mörkl hinst eyn s End von dyr Zeil zo n Löschn, demmlt d$ + 3. Dyrmitst ayn gantze Zeil löschst, gib ein: dd + 4. Mechst ayn Bewögung, ayn "Wolend", öfters, stöll de entspröchete Zal dyr- vor: 3dw older aau: d3w - 5. Dyr Pfueg f�r ayn �nderungsfaudung lautt yso: - Pfemerer [Zal] Bew�gungsschrit (Wolend) - Und d�s haisst: - Dyr PFEMERER gibt an, WAS taan ghoert, �bbenn d = l�schn (�delete�). - [ZAL] - Ayn Zal KAN myn ang�bn, wenn myn halt ayn Wolend �fter habn will. - S WOLEND, also dyr Schrit WOHIN, besagt, auf was i aushin will, �bbenn + 5. Dyr Pfueg für ayn Önderungsfaudung lautt yso: + Pfemerer [Zal] Bewögungsschrit (Wolend) + Und dös haisst: + Dyr PFEMERER gibt an, WAS taan ghoert, öbbenn d = löschn (»delete«). + [ZAL] - Ayn Zal KAN myn angöbn, wenn myn halt ayn Wolend öfter habn will. + S WOLEND, also dyr Schrit WOHIN, besagt, auf was i aushin will, öbbenn auf aynn Wortanfang ( w ), s End von dyr Zeil ( $ ) und so weiter. - 6. D��st eyn n Anfang von dyr Zeil hinkimmst, schreib aynn Nuller: 0 + 6. Däßst eyn n Anfang von dyr Zeil hinkimmst, schreib aynn Nuller: 0 - 7. Um �bbs Vorigs wider z ruggln, gib ein: u (klain also) - Um allsand �nderungen in ayner Zeil z ruggln, haast: U (also groo�) - Um "rugg-z-ruggln", also allss wider herzst�lln, zipf: r + 7. Um öbbs Vorigs wider z ruggln, gib ein: u (klain also) + Um allsand Önderungen in ayner Zeil z ruggln, haast: U (also grooß) + Um "rugg-z-ruggln", also allss wider herzstölln, zipf: r ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.3.1: ANF�EGN (�put�) + Letzn 1.3.1: ANFÜEGN (»put«) - ** Zipf p , dyrmitst �bbs gnetty Gl�schts naach n M�rkl anf�egst. ** + ** Zipf p , dyrmitst öbbs gnetty Glöschts naach n Mörkl anfüegst. ** - 1. Bew�g �nn M�rkl gan dyr eerstn untignen Zeil mit ---> dyrvor. + 1. Bewög önn Mörkl gan dyr eerstn untignen Zeil mit ---> dyrvor. - 2. Zipf dd , um sele Zeil z l�schn und dyrmit in ayner Wimm-Osn zo n Spei- + 2. Zipf dd , um sele Zeil z löschn und dyrmit in ayner Wimm-Osn zo n Spei- chern. - 3. Bew�g �nn M�rkl gan dyr Zeil c), �BER derer, daa wo de gl�schte Zeil ein- + 3. Bewög önn Mörkl gan dyr Zeil c), ÜBER derer, daa wo de glöschte Zeil ein- hinkemmen sollt. - 4. So, und ietz gibst ainfach p ein, und schoon haast d� Zeil unter derer - mit n M�rkl drinn. - 5. �fert d Schritt 2 hinst 4, hinst d��st allsand Zeiln yso naachynaynand + 4. So, und ietz gibst ainfach p ein, und schoon haast dö Zeil unter derer + mit n Mörkl drinn. + 5. Äfert d Schritt 2 hinst 4, hinst däßst allsand Zeiln yso naachynaynand haast, wie s hinghoernd. ----> d) Kanst du d�s aau? +---> d) Kanst du dös aau? ---> b) Veigerln seind blau. ---> c) Bedachtn kan myn lernen. ---> a) Roosn seind root. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.3.2: ERS�TZN (�replace�) + Letzn 1.3.2: ERSÖTZN (»replace«) - ** Zipf rx , um d�s Zaichen unter n M�rkl durch x z ers�tzn. ** + ** Zipf rx , um dös Zaichen unter n Mörkl durch x z ersötzn. ** - 1. Bew�g �nn M�rkl zo dyr eerstn untignen Zeil mit ---> dyrvor. + 1. Bewög önn Mörkl zo dyr eerstn untignen Zeil mit ---> dyrvor. - 2. Bew�g �nn M�rkl, hinst d�� yr auf n eerstn Faeler steet. + 2. Bewög önn Mörkl, hinst däß yr auf n eerstn Faeler steet. - 3. Zipf r und drafter d�s Zaichen, wo dyrf�r daa hinghoert. + 3. Zipf r und drafter dös Zaichen, wo dyrfür daa hinghoert. - 4. Widerhol d Schritt 2 und 3, hinst d��st de eerste Zeil gmae� dyr zwaittn + 4. Widerhol d Schritt 2 und 3, hinst däßst de eerste Zeil gmaeß dyr zwaittn berichtigt haast: ----> Wie d� Zeit eingobn wurd, wurdnd ainike falsche Zastnen zipft! ----> Wie d� Zeil eing�bn wurd, wurdnd ainige falsche Tastnen zipft! +---> Wie dö Zeit eingobn wurd, wurdnd ainike falsche Zastnen zipft! +---> Wie dö Zeil eingöbn wurd, wurdnd ainige falsche Tastnen zipft! 5. Ietz tue mit dyr Letzn 1.3.3 weiter. -Anm�rkung: Vergi� nit drauf, d��st mit n Anwenddn lernen solltst und nit �bbenn +Anmörkung: Vergiß nit drauf, däßst mit n Anwenddn lernen solltst und nit öbbenn mit n Auswendiglernen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.3.3: �NDERN (�change�) + Letzn 1.3.3: ÖNDERN (»change«) - ** Um hinst eyn s Wortend z �ndern, zipf ce . ** + ** Um hinst eyn s Wortend z öndern, zipf ce . ** - 1. Gee mit n M�rkl auf de eerste mit ---> angm�rkte Zeil. + 1. Gee mit n Mörkl auf de eerste mit ---> angmörkte Zeil. 2. Ietz farst netty auf s "s" von Wstwr hin. - 3. Zipf ce ein und aft d Wortberichtigung, daader also �rter . + 3. Zipf ce ein und aft d Wortberichtigung, daader also örter . - 4. Druck und bew�g �nn M�rkl zo n naehstn Zaichen, wo g�ndert ghoert. + 4. Druck und bewög önn Mörkl zo n naehstn Zaichen, wo göndert ghoert. - 5. �fert d Schritt 3 und 4, hinst d�� dyr eerste Saz wie dyr zwaitte ist. + 5. Äfert d Schritt 3 und 4, hinst däß dyr eerste Saz wie dyr zwaitte ist. ----> Ainige Wstwr von derer Zlww ghhnnd mit n �ndern-Pfemerer gaauu. ----> Ainige W�rter von derer Zeil ghoernd mit n �ndern-Pfemerer g�ndert. +---> Ainige Wstwr von derer Zlww ghhnnd mit n Öndern-Pfemerer gaauu. +---> Ainige Wörter von derer Zeil ghoernd mit n Öndern-Pfemerer göndert. -ce l�scht also s Wort und schlaaufft di eyn d Eingaab-Artweis. +ce löscht also s Wort und schlaaufft di eyn d Eingaab-Artweis. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 3.4.: NON MEERER �NDERUNGEN PFELFS c + Letzn 3.4.: NON MEERER ÖNDERUNGEN PFELFS c - ** D L�shfaudung c arechtt mit de n�mlichnen Wolender wie d� mit d ** + ** D Löshfaudung c arechtt mit de nömlichnen Wolender wie dö mit d ** - 1. Dyr �nder-Pfemerer arechtt anleich wie d L�shfaudung mit d , und zwaar + 1. Dyr Önder-Pfemerer arechtt anleich wie d Löshfaudung mit d , und zwaar yso: - c [Zal] Bew�gungsschrit (Wolend) + c [Zal] Bewögungsschrit (Wolend) - 2. D Wolender seind de gleichn, �bbenn w f�r Wort und $ f�r s Zeilnend. + 2. D Wolender seind de gleichn, öbbenn w für Wort und $ für s Zeilnend. - 3. Bew�g di zo dyr eerstn untignen Zeil mit ---> . + 3. Bewög di zo dyr eerstn untignen Zeil mit ---> . - 4. Ietz geest auf d�nn eerstn Faeler. + 4. Ietz geest auf dönn eerstn Faeler. - 5. Zipf c$ , gib �nn Rest von dyr Zeil wie in dyr zwaittn ein und druck aft + 5. Zipf c$ , gib önn Rest von dyr Zeil wie in dyr zwaittn ein und druck aft . ---> S End von derer Zeil sollt an de zwaitte daader anglichen werdn. ---> S End von derer Zeil sollt mit n Befelh c$ berichtigt werdn. -Denk allweil dran, d��st iederzeit mit dyr Ruggtastn Faeler ausb�ssern kanst. +Denk allweil dran, däßst iederzeit mit dyr Ruggtastn Faeler ausbössern kanst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1.3 - 1. Um ayn vorher gl�schts Gwort anzf�egn, zipf p . Daa dyrmit werd d�s - gantze Gwort NAACH n M�rkl angf�egt. Wenn s ayn gantze Zeil gw�sn ist, - werd d� sel als de Zeil unterhalb n M�rkl eingf�egt. + 1. Um ayn vorher glöschts Gwort anzfüegn, zipf p . Daa dyrmit werd dös + gantze Gwort NAACH n Mörkl angfüegt. Wenn s ayn gantze Zeil gwösn ist, + werd dö sel als de Zeil unterhalb n Mörkl eingfüegt. - 2. Um d�s Zaichen unter n M�rkl, also wo dyr M�rkl ist, z ers�tzn, zipf r - und aft d�s Zaichen, wost daadl habn willst. + 2. Um dös Zaichen unter n Mörkl, also wo dyr Mörkl ist, z ersötzn, zipf r + und aft dös Zaichen, wost daadl habn willst. - 3. Dyr �nderungspfemerer ( c = �change�) laasst ainn umbb n M�rkl hinst eyn s - End von n Wolend �ndern. Zipf ce , dyrmitst umbb n M�rkl hinst eyn s End - von n Wort �ndertst, und c$ hinst eyn s End von dyr Zeil. + 3. Dyr Önderungspfemerer ( c = »change«) laasst ainn umbb n Mörkl hinst eyn s + End von n Wolend öndern. Zipf ce , dyrmitst umbb n Mörkl hinst eyn s End + von n Wort öndertst, und c$ hinst eyn s End von dyr Zeil. - 4. F�r d �nderung lautt dyr Pfueg: + 4. Für d Önderung lautt dyr Pfueg: c [Zal] Wolend @@ -484,447 +484,447 @@ Ietz tue mit dyr naehstn Letzn weiter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.4.1: M�RKLST�LLUNG UND DAUTTICHTDARSTAND + Letzn 1.4.1: MÖRKLSTÖLLUNG UND DAUTTICHTDARSTAND -** Demmlt g, d��st �nn Befand und Darstand von dyr Dautticht anzaigst. ** +** Demmlt g, däßst önn Befand und Darstand von dyr Dautticht anzaigst. ** ** Zipf G , dyrmitst auf ayn bestimmte Zeil in dyr Dautticht hinkimmst. ** -Anm�rkung: Lis d� gantze Letzn daader durch, ee wennst iewign �bbs unternimmst! +Anmörkung: Lis dö gantze Letzn daader durch, ee wennst iewign öbbs unternimmst! - 1. Druck g . Auf d�s hin erscheint auf derer Seitt ganz unt ayn Dar- + 1. Druck g . Auf dös hin erscheint auf derer Seitt ganz unt ayn Dar- standsmeldung mit n Dauttichtnam und n Befand innerhalb dyr Dautticht. - M�rk dyr de Zeilnnummer f�r n Schrit 3. + Mörk dyr de Zeilnnummer für n Schrit 3. -Anm�rkung: M�glicherweis seghst aau �nn M�rklbefand in n zesmen untern Bild- - schirm�gg. Aft ist s "Lindl" (�ruler�) eingst�llt; meerer �ber d�s +Anmörkung: Müglicherweis seghst aau önn Mörklbefand in n zesmen untern Bild- + schirmögg. Aft ist s "Lindl" (»ruler«) eingstöllt; meerer über dös laasst dyr dyr Befelh :help 'ruler' ausher. 2. Druck G , um an s End von dyr Dautticht z kemmen. - gg gibst ein, d��st gan n Anfang von dyr Dautticht aufhinkimmst. + gg gibst ein, däßst gan n Anfang von dyr Dautticht aufhinkimmst. 3. Gib d Nummer von derer Zeil ein, daa wost vorher warst, und aft non G . - D�s bringt di zrugg gan seler Zeil, daa wost stuenddst, wiest d�s eerste + Dös bringt di zrugg gan seler Zeil, daa wost stuenddst, wiest dös eerste Maal g gadruckst. - 4. Wennst di sicher gnueg f�elst, aft f�er d Schritt 1 hinst 3 aus. + 4. Wennst di sicher gnueg füelst, aft füer d Schritt 1 hinst 3 aus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.4.2: DYR BEFELH ZO N SUECHEN ** Zipf / und dyrnaach aynn Ausdruk, um selbignen zo n Suechen. ** - 1. Du gibst also in dyr Befelhsartweis s Zaichen / ein. D�s sel wie aau dyr - M�rkl erscheinend drauf unt auf n Schirm, netty wie bei dyr Faudung : . + 1. Du gibst also in dyr Befelhsartweis s Zaichen / ein. Dös sel wie aau dyr + Mörkl erscheinend drauf unt auf n Schirm, netty wie bei dyr Faudung : . - 2. Ietz zipf Faeeler . Netty um d�s 'Faeeler' willst ietz suechen. + 2. Ietz zipf Faeeler . Netty um dös 'Faeeler' willst ietz suechen. - 3. Willst um gnaun d�nn Ausdruk weitersuechen, zipf ainfach n (wie �next�). + 3. Willst um gnaun dönn Ausdruk weitersuechen, zipf ainfach n (wie »next«). Willst hinzrugg suechen, aft gibst N ein. 4. Um von Haus aus zruggaus z suechen, nimm ? statt / her. - 5. Dyrmitst wider daa hinkimmst, wost herkemmen bist, nimm o , und d�s - �fter, wennst weiter zrugg willst. Mit i widerum kimmst vorw�rts. + 5. Dyrmitst wider daa hinkimmst, wost herkemmen bist, nimm o , und dös + öfter, wennst weiter zrugg willst. Mit i widerum kimmst vorwärts. ---> Aynn Faeler schreibt myn nit "Faeeler"; Faeeler ist ayn Faeler -Anm�rkung: Wenn d Suech s Dauttichtend dyrraicht haat, geet s eyn n Anfang wi- - der weiter dyrmit, men Sach dyr Schaltter 'wrapscan' w�r auf aus. +Anmörkung: Wenn d Suech s Dauttichtend dyrraicht haat, geet s eyn n Anfang wi- + der weiter dyrmit, men Sach dyr Schaltter 'wrapscan' wär auf aus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.4.3: DE G�GNKLAMMERN FINDDN + Letzn 1.4.3: DE GÖGNKLAMMERN FINDDN - ** Zipf % , um de entspr�chete Klammer ) , ] older } z finddn. ** + ** Zipf % , um de entspröchete Klammer ) , ] older } z finddn. ** - 1. S�tz �nn M�rkl auf iewign aine von dene drei Klammern ( , [ older { - in dyr untignen Zeil, wo mit ---> angm�rkt ist. + 1. Sötz önn Mörkl auf iewign aine von dene drei Klammern ( , [ older { + in dyr untignen Zeil, wo mit ---> angmörkt ist. 2. Ietzet zipf s Zaichen % . - 3. Dyr M�rkl geet ietz auf de p�ssete schliessete Klammer. + 3. Dyr Mörkl geet ietz auf de pässete schliessete Klammer. - 4. Ietz demmlt % , und dyrmit kimmst gan dyr �ffneretn Klammer zrugg. + 4. Ietz demmlt % , und dyrmit kimmst gan dyr öffneretn Klammer zrugg. - 5. S�tz �nn M�rkl auf ayn anderne Klammer von ({[]}) und pr�blt % aus. + 5. Sötz önn Mörkl auf ayn anderne Klammer von ({[]}) und pröblt % aus. ----> D�s ( ist bloo� ayn Pochzeil ( mit [ verschaidne ] { Klammern } drinn. )) +---> Dös ( ist blooß ayn Pochzeil ( mit [ verschaidne ] { Klammern } drinn. )) -Anm�rkung: Um d� M�glichkeit gaast bsunders froo sein, wennst aynmaal in aynn - Spaichgwort verzweiflt ayn faelete G�gnklammer suechst! +Anmörkung: Um dö Müglichkeit gaast bsunders froo sein, wennst aynmaal in aynn + Spaichgwort verzweiflt ayn faelete Gögnklammer suechst! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.4.4: D ERS�TZUNGSFAUDUNG (�substitute�) + Letzn 1.4.4: D ERSÖTZUNGSFAUDUNG (»substitute«) - ** Zipf :s/alt/neu/g , um 'alt' durch 'neu' zo n Ers�tzn. ** + ** Zipf :s/alt/neu/g , um 'alt' durch 'neu' zo n Ersötzn. ** - 1. Gee mit n M�rkl zo dyr unt steehetn mit ---> angm�rktn Zeil. + 1. Gee mit n Mörkl zo dyr unt steehetn mit ---> angmörktn Zeil. - 2. Zipf :s/dee/de . Der Befelh ers�tzt alsnan grad d�s +eerste "dee", - wo v�rkimmt. + 2. Zipf :s/dee/de . Der Befelh ersötzt alsnan grad dös +eerste "dee", + wo vürkimmt. - 3. Ietz pr�blt s mit :s/dee/de/g . D�s zues�tzliche g ("Pflok" nennt myn - �bbs S�lchers) bewirkt, d�� allss, was dyrmit kennzaichnet ist, innerhalb - von dyr ainn Zeil ers�tzt werd. + 3. Ietz pröblt s mit :s/dee/de/g . Dös zuesötzliche g ("Pflok" nennt myn + öbbs Sölchers) bewirkt, däß allss, was dyrmit kennzaichnet ist, innerhalb + von dyr ainn Zeil ersötzt werd. ----> Dee schoenste Zeit, d�� myn dee Bl�emln anschaut, ist dee schoene Lan- +---> Dee schoenste Zeit, däß myn dee Blüemln anschaut, ist dee schoene Lan- gesszeit. - 4. Um ietz allsand Suechbegriff innerhalb von zwo Zeiln zo n �ndern, zipf - :#,#s/alt/neu/g , wobei # ieweils f�r de eerste und l�sste Zeil von d�nn + 4. Um ietz allsand Suechbegriff innerhalb von zwo Zeiln zo n Öndern, zipf + :#,#s/alt/neu/g , wobei # ieweils für de eerste und lösste Zeil von dönn Pfraich steet. - :%s/alt/neu/g zipfst, d��st d V�rkemmen in dyr gantzn Dautticht �ndertst. - Mit :%s/alt/neu/gc finddst allsand V�rkemmen in dyr gsamtn Dautticht; - daa werst aber zeerst non gfraagt, obst ys ers�tzn willst older nity. + :%s/alt/neu/g zipfst, däßst d Vürkemmen in dyr gantzn Dautticht öndertst. + Mit :%s/alt/neu/gc finddst allsand Vürkemmen in dyr gsamtn Dautticht; + daa werst aber zeerst non gfraagt, obst ys ersötzn willst older nity. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1.4 - 1. g zaigt d�nn ietzundn Dauttichtbefand und �nn Darstand dyrvon an. + 1. g zaigt dönn ietzundn Dauttichtbefand und önn Darstand dyrvon an. G bringt di an s End von dyr Dautticht. - G bringt di gan dyr entspr�chetn Zeilnnummer. + G bringt di gan dyr entspröchetn Zeilnnummer. gg geet +grad yso. gg bringt di zo dyr eerstn Zeil. - 2. D Eingaab von / mit aynn Ausdruk suecht V�RSHLING um d�nn Ausdruk. - Gibst ? und aynn Suechbegrif ein, suecht s um d�nn �RSHLING. + 2. D Eingaab von / mit aynn Ausdruk suecht VÜRSHLING um dönn Ausdruk. + Gibst ? und aynn Suechbegrif ein, suecht s um dönn ÄRSHLING. Zipf naach ayner Suech n ; naacherd werd in de gleiche Richtung weiter- gsuecht. Mit N geet s umkeerter weiter. - o bringt di zo �lterne Bef�ndd zrugg, i zo neuerne. + o bringt di zo ölterne Befändd zrugg, i zo neuerne. - 3. D Eingaab von % , wenn dyr M�rkl auf ainer von dene Klammern steet: ({[ - )]} , bringt di zo dyr G�gnklammer. + 3. D Eingaab von % , wenn dyr Mörkl auf ainer von dene Klammern steet: ({[ + )]} , bringt di zo dyr Gögnklammer. - 4. Um d�s eerste V�rkemmen von "alt" in ayner Zeil durch "neu" z ers�tzn, + 4. Um dös eerste Vürkemmen von "alt" in ayner Zeil durch "neu" z ersötzn, zipf :s/alt/neu . - Um allsand in ayner Zeil z ers�tzn, zipf :s/alt/neu/g . - Mechst allss in zwo Zeiln ers�tzn, demmlt zo n Beispil :5,6s/alt/neu/g . - Mechst allss in dyr gantzn Dautticht ers�tzn, gib ein: :%s/alt/neu/g . - Willst ayn ieds Maal bstaetln, h�ng 'c' wie �confirm� hint anhin. + Um allsand in ayner Zeil z ersötzn, zipf :s/alt/neu/g . + Mechst allss in zwo Zeiln ersötzn, demmlt zo n Beispil :5,6s/alt/neu/g . + Mechst allss in dyr gantzn Dautticht ersötzn, gib ein: :%s/alt/neu/g . + Willst ayn ieds Maal bstaetln, höng 'c' wie »confirm« hint anhin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.5.1: ZWISCHNDRINN AYNN AUSSERIGNEN BEFELH AUSF�ERN + Letzn 1.5.1: ZWISCHNDRINN AYNN AUSSERIGNEN BEFELH AUSFÜERN - ** Willst ayn Gf��faudung ausf�ern, gib ainfach d� sel naach :! ein. ** + ** Willst ayn Gfäßfaudung ausfüern, gib ainfach dö sel naach :! ein. ** - 1. Zipf d�nn bekanntn Befelh : , dyrmitst mit n M�rkl auf n Bildschirm - ganz abhin kimmst. Draufhin kanst aynn gwonen Gf��befelh eing�bn. + 1. Zipf dönn bekanntn Befelh : , dyrmitst mit n Mörkl auf n Bildschirm + ganz abhin kimmst. Draufhin kanst aynn gwonen Gfäßbefelh eingöbn. - 2. Zeerst kimmt aber non ayn Ruefzaichen ! . Und ietzet haast d M�glich- - keit, ayn beliebige ausserige Gf��faudung auszf�ern. + 2. Zeerst kimmt aber non ayn Ruefzaichen ! . Und ietzet haast d Müglich- + keit, ayn beliebige ausserige Gfäßfaudung auszfüern. 3. Als Beispil zipf :!ls ; und schoon haast ayn Auflistung von deinn - Verzaichniss, netty wie wennst ganz gwon in n Eingib w�rst. Geet ls - aus iewign aynn Grund nit, aft pr�blt s mit :!dir . + Verzaichniss, netty wie wennst ganz gwon in n Eingib wärst. Geet ls + aus iewign aynn Grund nit, aft pröblt s mit :!dir . -Also non aynmaal: Mit d�nn Angang kan ayn iede beliebige ausserige Faudung aus- - gf�ert werdn, aau mit Auerwerdd. +Also non aynmaal: Mit dönn Angang kan ayn iede beliebige ausserige Faudung aus- + gfüert werdn, aau mit Auerwerdd. -Und wolgm�rkt: Alle Befelh, wo mit : angeend, m�essend mit bst�- - tigt werdn. D�s dyrsagn myr f�rba� +niemer. +Und wolgmörkt: Alle Befelh, wo mit : angeend, müessend mit bstö- + tigt werdn. Dös dyrsagn myr fürbaß +niemer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.5.2: NON MEERER DR�BER, WIE MYN DAUTTICHTN SCHREIBT + Letzn 1.5.2: NON MEERER DRÜBER, WIE MYN DAUTTICHTN SCHREIBT - ** Um �bbs G�nderts neu z speichern, zipf :w NEUER_DAUTTICHTNAM . ** + ** Um öbbs Gönderts neu z speichern, zipf :w NEUER_DAUTTICHTNAM . ** - 1. Zipf :!dir older :!ls , d��st dyr ayn Auflistung von deinn Verzaich- - niss ausherlaasst. D��st drafter eing�bn muesst, waisst ee schoon. + 1. Zipf :!dir older :!ls , däßst dyr ayn Auflistung von deinn Verzaich- + niss ausherlaasst. Däßst drafter eingöbn muesst, waisst ee schoon. - 2. Suech dyr aynn Dauttichtnam aus, d�nn wo s non nit geit, �bbenn POCH . + 2. Suech dyr aynn Dauttichtnam aus, dönn wo s non nit geit, öbbenn POCH . - 3. Ietz demmlt: :w POCH (also mit POCH als d�nn neuen Dauttichtnam). + 3. Ietz demmlt: :w POCH (also mit POCH als dönn neuen Dauttichtnam). - 4. D�s speichert ietz de gantze Dautticht, also �nn Wimmschainer, unter d�nn - Nam POCH. D�s kanst leicht �berpr�effen, indem d��st ainfach :!ls older + 4. Dös speichert ietz de gantze Dautticht, also önn Wimmschainer, unter dönn + Nam POCH. Dös kanst leicht überprüeffen, indem däßst ainfach :!ls older :!dir zipfst und dyrmit deinn Verzaichnissinhalt seghst. -Anm�rkung: Stigst ietz aus n Wimm aus und g�nnst n aft wider mit vim POCH , - naacherd w�r d� Dautticht ayn gnaune Aamum von n Schainer dyrselbn, +Anmörkung: Stigst ietz aus n Wimm aus und gännst n aft wider mit vim POCH , + naacherd wär dö Dautticht ayn gnaune Aamum von n Schainer dyrselbn, wiest n gspeichert haast. - 5. Ietz verweitert d� Dautticht - fallsst s Fenstl haast - , mit :!del POCH - beziehungsweis bei aynn Unixgeb�u mit :!rm POCH . + 5. Ietz verweitert dö Dautticht - fallsst s Fenstl haast - , mit :!del POCH + beziehungsweis bei aynn Unixgebäu mit :!rm POCH . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.5.3: AYNN TAIL VON N GWORT ZO N SPEICHERN AUSWALN ** Um aynn Tail von dyr Dautticht z speichern, zipf v [Wolend] :w DAUTTICHT ** - 1. Ruck �nn M�rkl auf netty d� Zeil daader. + 1. Ruck önn Mörkl auf netty dö Zeil daader. - 2. Demmlt v und gee mit n M�rkl auf d�nn f�mftn Auflistungspunt untet. Du - seghst glei, d�� s Gwort v�rhergh�bt erscheint. + 2. Demmlt v und gee mit n Mörkl auf dönn fümftn Auflistungspunt untet. Du + seghst glei, däß s Gwort vürherghöbt erscheint. 3. Druck s Zaichen : . Ganz unt auf n Bildschirm erscheint :'<,'> . - 4. Zipf w POCH , wobei s d�nn Dauttichtnam POCH non nit geit. Vergwi� di, - d��st d�s :'<,'>w POCH aau +seghst, ee wennst druckst. + 4. Zipf w POCH , wobei s dönn Dauttichtnam POCH non nit geit. Vergwiß di, + däßst dös :'<,'>w POCH aau +seghst, ee wennst druckst. 5. Dyr Wimm schreibt de ausgwaltn Zeiln eyn de Dautticht POCH einhin. Benutz - :!dir older :!ls , d��st d�s �berpr�effst. L�sh s fein nit �bbenn! Mir - brauchend s n�mlich f�r de naehste Letzn. + :!dir older :!ls , däßst dös überprüeffst. Lösh s fein nit öbbenn! Mir + brauchend s nömlich für de naehste Letzn. -Anm�rkung: Druckt myn v , ginnt d Sichtisch-Auswal. Du kanst mit n M�rkl um- - aynandfarn, um d Auswal z ver�ndern. Drafter kan myn mit yn aynn - Pfemerer mit d�nn Gwort �bbs machen. Zo n Beispil l�scht d d�s +Anmörkung: Druckt myn v , ginnt d Sichtisch-Auswal. Du kanst mit n Mörkl um- + aynandfarn, um d Auswal z veröndern. Drafter kan myn mit yn aynn + Pfemerer mit dönn Gwort öbbs machen. Zo n Beispil löscht d dös Gwort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.5.4: EINL�SN UND ZAMMENF�ERN VON DAUTTICHTN + Letzn 1.5.4: EINLÖSN UND ZAMMENFÜERN VON DAUTTICHTN - ** Um �nn Inhalt von ayner Dautticht einzl�sn, zipf :r DAUTTICHTNAM ** + ** Um önn Inhalt von ayner Dautticht einzlösn, zipf :r DAUTTICHTNAM ** - 1. S�tz �nn M�rkl �ber d� Zeil daader. + 1. Sötz önn Mörkl über dö Zeil daader. -OBACHT: Aft d��st �nn Schrit 2 ausgf�ert haast, seghst auf aynmaal �bbs aus - dyr Letzn 1.5.3. Bew�g di naacherd wider abw�rts, dyrmitst d� Letzn wi- +OBACHT: Aft däßst önn Schrit 2 ausgfüert haast, seghst auf aynmaal öbbs aus + dyr Letzn 1.5.3. Bewög di naacherd wider abwärts, dyrmitst dö Letzn wi- derfinddst. - 2. Ietz lis dein Dautticht POCH ein, indem d��st d Faudung :r POCH aus- - f�erst, wobei wie gsait POCH f�r d�nn von dir ausgsuechtn Dauttichtnam - steet. De eingl�sne Dautticht werd unterhalb dyr M�rklzeil eingf�egt. + 2. Ietz lis dein Dautticht POCH ein, indem däßst d Faudung :r POCH aus- + füerst, wobei wie gsait POCH für dönn von dir ausgsuechtn Dauttichtnam + steet. De einglösne Dautticht werd unterhalb dyr Mörklzeil eingfüegt. - 3. Um zo n �berpr�effen, ob de Dautticht aau gwi� eingl�sn ist, gee zrugg; - und du seghst, d�� s ietz zwo Ausf�rtigungen von dyr Letzn 1.5.3. geit, s - Urniss und de eingf�egte Dauttichtfassung. + 3. Um zo n Überprüeffen, ob de Dautticht aau gwiß einglösn ist, gee zrugg; + und du seghst, däß s ietz zwo Ausförtigungen von dyr Letzn 1.5.3. geit, s + Urniss und de eingfüegte Dauttichtfassung. -Anm�rkung: Du kanst aau d Ausgaab von aynn Ausserigbefelh einl�sn. Zo n Bei- - spil list :r !ls d Ausgaab von dyr Faudung ls ein und f�egt s - unterhalb n M�rkl ein. +Anmörkung: Du kanst aau d Ausgaab von aynn Ausserigbefelh einlösn. Zo n Bei- + spil list :r !ls d Ausgaab von dyr Faudung ls ein und füegt s + unterhalb n Mörkl ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1.5 - 1. :!FAUDUNG f�ert aynn ausserignen Befelh aus. + 1. :!FAUDUNG füert aynn ausserignen Befelh aus. - Daader ayn �ttlych gw�nddte Beispiler: + Daader ayn Öttlych gwänddte Beispiler: (Fenstl) (Unix - Linux) :!dir :!ls - listt s Verzaichniss auf. :!del DAUTTICHT :!rm DAUTTICHT - verweitert sele Dautticht. - 2. :w DAUTTICHT speichert de ietzunde Wimmdautticht unter d�nn besagtn Nam. + 2. :w DAUTTICHT speichert de ietzunde Wimmdautticht unter dönn besagtn Nam. 3. v WOLEND :w DAUTTICHTNAM schreibt de sichtisch ausgwaltn Zeiln eyn de Dautticht mit seln Nam. - 4. :r DAUTTICHTNAM ladt sele Dautticht und f�egt s unterhalb n M�rklbefand + 4. :r DAUTTICHTNAM ladt sele Dautticht und füegt s unterhalb n Mörklbefand ein. - 5. :r !dir list d Ausgaab von dyr Faudung dir und f�egt s unterhalb n - M�rklbefand ein. + 5. :r !dir list d Ausgaab von dyr Faudung dir und füegt s unterhalb n + Mörklbefand ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.1: ZEIL �FFNEN (�open�) + Letzn 1.6.1: ZEIL ÖFFNEN (»open«) - ** Zipf o , um ayn Zeil unterhalb n M�rkl z �ffnen und eyn d ** - ** Einf�egartweis z kemmen. ** + ** Zipf o , um ayn Zeil unterhalb n Mörkl z öffnen und eyn d ** + ** Einfüegartweis z kemmen. ** - 1. Bew�g �nn M�rkl zo dyr eerstn mit ---> angm�rktn Zeil unt. + 1. Bewög önn Mörkl zo dyr eerstn mit ---> angmörktn Zeil unt. - 2. Zipf o (klain), um ayn Zeil UNTERHALB n M�rkl z �ffnen und mit dyr Ein- - f�egartweis weiterztuen. + 2. Zipf o (klain), um ayn Zeil UNTERHALB n Mörkl z öffnen und mit dyr Ein- + füegartweis weiterztuen. - 3. Ietzet zipf ayn Weeng �bbs und druck , um d Einf�egartweis z ver- + 3. Ietzet zipf ayn Weeng öbbs und druck , um d Einfüegartweis z ver- laassn. ----> Mit o werd dyr M�rkl in dyr Einf�egartweis auf de offene Zeil gs�tzt. +---> Mit o werd dyr Mörkl in dyr Einfüegartweis auf de offene Zeil gsötzt. - 4. Um ayn Zeil OBERHALB n M�rkl aufzmachen, gib ainfach ayn groosss O statt - yn aynn klainen ein. Versuech d�s auf dyr untignen Zeil. + 4. Um ayn Zeil OBERHALB n Mörkl aufzmachen, gib ainfach ayn groosss O statt + yn aynn klainen ein. Versuech dös auf dyr untignen Zeil. ----> �ffnet ayn Zeil �ber derer daader mit O , wenn dyr M�rkl auf derer Zeil +---> Öffnet ayn Zeil über derer daader mit O , wenn dyr Mörkl auf derer Zeil ist. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.2: GWORT ANF�EGN (�append�) + Letzn 1.6.2: GWORT ANFÜEGN (»append«) - ** Zipf a , um �bbs NAACH n M�rkl einzf�egn. ** + ** Zipf a , um öbbs NAACH n Mörkl einzfüegn. ** - 1. Bew�g �nn M�rkl gan n Anfang von dyr eerstn �ebungszeil mit ---> unt. + 1. Bewög önn Mörkl gan n Anfang von dyr eerstn Üebungszeil mit ---> unt. - 2. Druck e , hinst d�� dyr M�rkl an n End von Zei steet. + 2. Druck e , hinst däß dyr Mörkl an n End von Zei steet. - 3. Zipf ayn klains a , um �bbs NAACH n M�rkl anzf�egn. + 3. Zipf ayn klains a , um öbbs NAACH n Mörkl anzfüegn. - 4. Verg�ntz d�s Wort wie in dyr Zeil drunter. Druck , um d Schreib- + 4. Vergöntz dös Wort wie in dyr Zeil drunter. Druck , um d Schreib- Artweis z verlaassn. - 5. Bew�g di mit e zo n naehstn ungantzn Wort und widerhol d Schritt 3 und + 5. Bewög di mit e zo n naehstn ungantzn Wort und widerhol d Schritt 3 und 4. ----> D� Ze biett ayn Gl�gn , ayn Gwort in ayner Zeil anzf�. ----> D� Zeil biett ayn Gl�gnet, ayn Gwort in ayner Zeil anzf�egn. +---> Dö Ze biett ayn Glögn , ayn Gwort in ayner Zeil anzfü. +---> Dö Zeil biett ayn Glögnet, ayn Gwort in ayner Zeil anzfüegn. -Anm�rkung: a , i und A bringend ainn gleichermaa�n eyn d Einf�egartweis; - dyr ainzige Unterschaid ist, WO mit n Einf�egn angfangt werd. +Anmörkung: a , i und A bringend ainn gleichermaaßn eyn d Einfüegartweis; + dyr ainzige Unterschaid ist, WO mit n Einfüegn angfangt werd. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.3: AYN ANDERNE WEIS ZO N ERS�TZN (�replace�) + Letzn 1.6.3: AYN ANDERNE WEIS ZO N ERSÖTZN (»replace«) - ** Demmlt ayn groosss R , um meerer als wie grad ain Zaichen z ers�tzn. ** + ** Demmlt ayn groosss R , um meerer als wie grad ain Zaichen z ersötzn. ** - 1. Bew�g �nn M�rkl zo dyr eerstn untignen, mit ---> angm�rktn Zeil. - Gee mit n M�rkl gan n Anfang von n eerstn xxx . + 1. Bewög önn Mörkl zo dyr eerstn untignen, mit ---> angmörktn Zeil. + Gee mit n Mörkl gan n Anfang von n eerstn xxx . 2. Ietz druck R und zipf sele Zal, wo drunter in dyr zwaittn Zeil steet, - yso d�� de sel s xxx ers�tzt. + yso däß de sel s xxx ersötzt. - 3. Druck , um d Ers�tzungsartweis z verlaassn. Du gspannst, d�� dyr - Rest von dyr Zeil unver�ndert bleibt. + 3. Druck , um d Ersötzungsartweis z verlaassn. Du gspannst, däß dyr + Rest von dyr Zeil unveröndert bleibt. - 4. �fert die Schritt, um d�s �berblibne xxx z ers�tzn. + 4. Äfert die Schritt, um dös überblibne xxx z ersötzn. ---> S Zunddn von 123 zo xxx ergibt xxx. ---> S Zunddn von 123 zo 456 ergibt 579. -Anm�rkung: D Ers�tzungsartweis ist wie d Einf�egartweis, aber ayn ieds eindem- - mlte Zaichen l�scht ayn vorhanddns. +Anmörkung: D Ersötzungsartweis ist wie d Einfüegartweis, aber ayn ieds eindem- + mlte Zaichen löscht ayn vorhanddns. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.4: GWORT AAMEN UND EINF�EGN + Letzn 1.6.4: GWORT AAMEN UND EINFÜEGN - ** Benutz �nn Pfemerer y , um �bbs z aamen, und p , um �bbs einzf�egn. ** + ** Benutz önn Pfemerer y , um öbbs z aamen, und p , um öbbs einzfüegn. ** - 1. Gee zo dyr mit ---> angm�rktn Zeil unt und s�tz �nn M�rkl hinter "a)". + 1. Gee zo dyr mit ---> angmörktn Zeil unt und sötz önn Mörkl hinter "a)". - 2. Ginn d Sichtisch-Artweis mit v und bew�g �nn M�rkl gnaun vor "eerste". + 2. Ginn d Sichtisch-Artweis mit v und bewög önn Mörkl gnaun vor "eerste". - 3. Zipf y , um d�nn v�rhergh�btn Tail z aamen. + 3. Zipf y , um dönn vürherghöbtn Tail z aamen. - 4. Bew�g �nn M�rkl gan n End von dyr naehstn Zeil: j$ + 4. Bewög önn Mörkl gan n End von dyr naehstn Zeil: j$ - 5. Demmlt p , um d�s Gwort einzf�egn, und aft: a zwaitte . + 5. Demmlt p , um dös Gwort einzfüegn, und aft: a zwaitte . 6. Benutz d Sichtischartweis, um " Eintrag." auszwaln, aam s mittls y , be- - w�g di gan n End von dyr naehstn Zeil mit j$ und f�eg s Gwort dortn mit + wög di gan n End von dyr naehstn Zeil mit j$ und füeg s Gwort dortn mit p an. ----> a) d�s ist dyr eerste Eintrag. +---> a) dös ist dyr eerste Eintrag. b) -Anm�rkung: Du kanst y aau als Pfemerer verwenddn; yw zo n Beispil aamt - hinst eyn n naehstn Wortanfang (aane d�nn selber). +Anmörkung: Du kanst y aau als Pfemerer verwenddn; yw zo n Beispil aamt + hinst eyn n naehstn Wortanfang (aane dönn selber). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.5: SCHALTTER S�TZN + Letzn 1.6.5: SCHALTTER SÖTZN -** S�tz aynn Schaltter yso, d�� ayn Suech older Ers�tzung Groo�- und Klain- ** - ** schreibung �bergeet. ** +** Sötz aynn Schaltter yso, däß ayn Suech older Ersötzung Grooß- und Klain- ** + ** schreibung übergeet. ** - 1. Suech um '�bergee", indem d��st /�bergee eingibst. - Widerhol d Suech ayn �ttlych Maal, indem d��st de Tastn n druckst. + 1. Suech um 'übergee", indem däßst /übergee eingibst. + Widerhol d Suech ayn Öttlych Maal, indem däßst de Tastn n druckst. - 2. S�tz de Zwisl - �nn Schaltter - 'ic' (�ignore case�), indem d��st :set ic + 2. Sötz de Zwisl - önn Schaltter - 'ic' (»ignore case«), indem däßst :set ic eingibst. - 3. Ietz suech wider um '�bergee' und tue aau wider mit n weiter. Daa fallt - dyr auf, d�� ietz �bbenn aau �bergee und �BERGEE hergeet. + 3. Ietz suech wider um 'übergee' und tue aau wider mit n weiter. Daa fallt + dyr auf, däß ietz öbbenn aau Übergee und ÜBERGEE hergeet. - 4. S�tz de Zwisln 'hlsearch' und 'incsearch' pfelfs: :set hls is + 4. Sötz de Zwisln 'hlsearch' und 'incsearch' pfelfs: :set hls is - 5. Widerhol d Suech und bobacht, was ietz gschieght: /�bergee + 5. Widerhol d Suech und bobacht, was ietz gschieght: /übergee - 6. D��st groo� und klain wider gwon unterscheidst, zipf: :set noic + 6. Däßst grooß und klain wider gwon unterscheidst, zipf: :set noic -Anm�rkung: Mechst de Tr�ffer niemer v�rhergh�bt seghn, gib ein: :nohlsearch -Anm�rkung: Sollt klain/groo� bei ayner ainzignen Suech wurst sein, benutz \c - in n Suechausdruk: /�bergee\c +Anmörkung: Mechst de Tröffer niemer vürherghöbt seghn, gib ein: :nohlsearch +Anmörkung: Sollt klain/grooß bei ayner ainzignen Suech wurst sein, benutz \c + in n Suechausdruk: /übergee\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1.6 - 1. Zipf o , um ayn Zeil UNTERHALB n M�rkl z �ffnen und d Einf�egartweis z + 1. Zipf o , um ayn Zeil UNTERHALB n Mörkl z öffnen und d Einfüegartweis z ginnen. - Zipf O , um ayn Zeil OBERHALB n M�rkl z �ffnen. + Zipf O , um ayn Zeil OBERHALB n Mörkl z öffnen. - 2. Zipf a , um NAACH n M�rkl ayn Gwort einzf�egn. - Zipf A , um ayn Gwort naach n Zeilnend anzf�egn. + 2. Zipf a , um NAACH n Mörkl ayn Gwort einzfüegn. + Zipf A , um ayn Gwort naach n Zeilnend anzfüegn. 3. D Faudung e bringt di gan n End von aynn Wort. - 4. Dyr Pfemerer y (�yank�) aamt �bbs, p (�put�) f�egt d�s ein. + 4. Dyr Pfemerer y (»yank«) aamt öbbs, p (»put«) füegt dös ein. - 5. Ayn groosss R geet eyn d Ers�tzungsartweis, hinst d�� myn druckt. + 5. Ayn groosss R geet eyn d Ersötzungsartweis, hinst däß myn druckt. - 6. D Eingaab von ":set xxx" s�tzt de Zwisl "xxx". Ayn �ttlych Zwisln seind: - 'ic' 'ignorecase' Groo�/klain wurst bei ayner Suech - 'is' 'incsearch' Zaig aau schoon ayn Tail�berainstimmung - 'hls' 'hlsearch' H�b allsand p�ssetn Ausdr�ck v�rher - Dyr Schaltternam kan in dyr Kurz- older Langform ang�bn werdn. + 6. D Eingaab von ":set xxx" sötzt de Zwisl "xxx". Ayn Öttlych Zwisln seind: + 'ic' 'ignorecase' Grooß/klain wurst bei ayner Suech + 'is' 'incsearch' Zaig aau schoon ayn Tailüberainstimmung + 'hls' 'hlsearch' Höb allsand pässetn Ausdrück vürher + Dyr Schaltternam kan in dyr Kurz- older Langform angöbn werdn. - 7. St�ll yn ayner Zwisl "no" voran, d��st ys abschalttst: :set noic + 7. Stöll yn ayner Zwisl "no" voran, däßst ys abschalttst: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Letzn 1.7.1: AYN HILFGWORT AUFRUEFFEN - ** Nutz d�s einbaute Hilfgeb�u, de "Betribsanlaittung". ** + ** Nutz dös einbaute Hilfgebäu, de "Betribsanlaittung". ** - Eyn n Wimm ist ayn ausf�erliche "Gebrauchsanweisung" einbaut. F�r s Eerste - pr�blt ainfach ains von dene dreu aus: - - Druck d -Tastn, wennst �bbenn aine haast. + Eyn n Wimm ist ayn ausfüerliche "Gebrauchsanweisung" einbaut. Für s Eerste + pröblt ainfach ains von dene dreu aus: + - Druck d -Tastn, wennst öbbenn aine haast. - Druck de Tastn , fallsst ys haast. - Zipf :help - Lis di eyn s Hilffenster ein, dyrmitst draufkimmst, wie d�s mit dyr Hilf geet. + Lis di eyn s Hilffenster ein, dyrmitst draufkimmst, wie dös mit dyr Hilf geet. Demmlt w w , um von ainn Fenster zo n andern zo n Springen. Demmlt :q , um s Hilffenster zo n Schliessn. - Du kanst zo so guet wie allssand ayn Hilf finddn, indem d��st yn dyr Faudung - :help aynn Auerwerd naachst�llst und istig nit vergisst. Pr�blt d�s: + Du kanst zo so guet wie allssand ayn Hilf finddn, indem däßst yn dyr Faudung + :help aynn Auerwerd naachstöllst und istig nit vergisst. Pröblt dös: :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.7.2: ERST�LL AYN GIN-SCHRIPF + Letzn 1.7.2: ERSTÖLL AYN GIN-SCHRIPF - ** Mutz �nn Wimm mit de einbautn Faehigkeitn auf. ** + ** Mutz önn Wimm mit de einbautn Faehigkeitn auf. ** - Dyr Wimm besitzt ayn W�sn Sch�ftungen, wo �ber n Urwimm aushingeend, aber de + Dyr Wimm besitzt ayn Wösn Schäftungen, wo über n Urwimm aushingeend, aber de meerern dyrvon seind in dyr Vorgaab ausgschaltt. Dyrmitst meerer aus n Wimm - ausherholst, erst�llst ayn "vimrc"-Dautticht. + ausherholst, erstöllst ayn "vimrc"-Dautticht. - 1. L�g ayn "vimrc"-Dautticht an; d�s geet ie naach Betribsgeb�u verschidn: - :e ~/.vimrc f�r s Unix + 1. Lög ayn "vimrc"-Dautticht an; dös geet ie naach Betribsgebäu verschidn: + :e ~/.vimrc für s Unix :e ~/_vimrc bei n Fenstl - 2. Ietz lis �nn Inhalt von dyr Beispil-"vimrc"-Dautticht ein: + 2. Ietz lis önn Inhalt von dyr Beispil-"vimrc"-Dautticht ein: :r $VIMRUNTIME/vimrc_example.vim 3. Speichert de Dautticht mit: :w - 4. Bei n naehstn Gin von n Wimm ist aft d F�egnussv�rherh�bung zuegschalttn. - Du kanst dyr allss eyn d� Dautticht einhinschreibn, wasst bst�ndig habn + 4. Bei n naehstn Gin von n Wimm ist aft d Füegnussvürherhöbung zuegschalttn. + Du kanst dyr allss eyn dö Dautticht einhinschreibn, wasst bständig habn willst. Meerer dyrzue erfarst unter: :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.7.3: VERG�NTZN + Letzn 1.7.3: VERGÖNTZN - ** Befelhszeilnverg�ntzung mit d und ** + ** Befelhszeilnvergöntzung mit d und ** - 1. Vergwi� di, d�� dyr Wimm nit auf n Urwimm-"Glais" fart: :set nocp + 1. Vergwiß di, däß dyr Wimm nit auf n Urwimm-"Glais" fart: :set nocp - 2. Schaug naach, w�lcherne Dauttichtn d�� s in n Verzaichniss geit: :!ls + 2. Schaug naach, wölcherne Dauttichtn däß s in n Verzaichniss geit: :!ls older :!dir - 3. Zipf �nn Anfang von ayner Faudung: :e + 3. Zipf önn Anfang von ayner Faudung: :e 4. Druck d , und dyr Wimm zaigt ayn Listn von Faudungen, wo mit "e" angeend. - 5. Druck , und dyr Wimm vervollst�ndigt �nn Faudungsnam zo ":edit". + 5. Druck , und dyr Wimm vervollstöndigt önn Faudungsnam zo ":edit". - 6. F�eg ayn Laerzaichen und �nn Anfang von ayner besteehetn Dautticht an: + 6. Füeg ayn Laerzaichen und önn Anfang von ayner besteehetn Dautticht an: :edit DAU - 7. Druck . Dyr Wimm verg�ntzt �nn Nam, d�s haisst, wenn yr aindeuttig + 7. Druck . Dyr Wimm vergöntzt önn Nam, dös haisst, wenn yr aindeuttig ist. -Anm�rkung: D Verg�ntzung geit s f�r aynn Hauffen Faudungen. Versuech ainfach - d und . Bsunders n�tzlich ist d�s bei :help . +Anmörkung: D Vergöntzung geit s für aynn Hauffen Faudungen. Versuech ainfach + d und . Bsunders nützlich ist dös bei :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZAMMENFASSUNG VON DYR LETZN 1.7 - 1. Zipf :help oder druck oder , um ayn Hilffenster z �ffnen. + 1. Zipf :help oder druck oder , um ayn Hilffenster z öffnen. 2. Zipf :help FAUDUNG , um auf ayn Hilf gan aynn Befelh z kemmen. @@ -932,11 +932,11 @@ Anm 4. Zipf :q , um s Hilffenster z schliessn. - 5. Erst�ll ayn vimrc-Ginschripf zuer Sicherung von deine M�tzneinst�llungen. + 5. Erstöll ayn vimrc-Ginschripf zuer Sicherung von deine Mötzneinstöllungen. - 6. Druck d , aft d��st naach : ayn Faudung angfangt haast, dyr- - mitst m�gliche Verg�ntzungen anzaigt kriegst. - Druck f�r ain Vervollst�ndigung yllain. + 6. Druck d , aft däßst naach : ayn Faudung angfangt haast, dyr- + mitst mügliche Vergöntzungen anzaigt kriegst. + Druck für ain Vervollstöndigung yllain. @@ -945,39 +945,39 @@ Anm ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - D�s w�r ietzet s End von n Wimmschainer. Gangen ist s daa drum, aynn kurtzn - und b�ndignen �berblik �ber s Blat WIMM z lifern, netty vil gnueg, d�� myn - f�r s Eerste wirklich �bbs dyrmit anfangen kan. Dyrmit ist s aber auf kain + Dös wär ietzet s End von n Wimmschainer. Gangen ist s daa drum, aynn kurtzn + und bündignen Überblik über s Blat WIMM z lifern, netty vil gnueg, däß myn + für s Eerste wirklich öbbs dyrmit anfangen kan. Dyrmit ist s aber auf kain Weitn non nit taan; dyr Wimm haat schoon non vil meerer auf Lager. Lis als Naehsts aynmaal s Benutzerhandbuech: :help user-manual - Zo n Weiterl�sn und Weiterlernen w�r d�s Buech daader zo n Empfelhen: + Zo n Weiterlösn und Weiterlernen wör dös Buech daader zo n Empfelhen: Vim - Vi Improved - von n OUALLINE Steve Verlaag: New Riders - D�s ist d�s eerste Buech, wo ganz yn n Wimm gwidmt ist, netty d�s Grechte f�r - Anf�nger. Es haat ayn W�sn Beispiler und aau Bilder drinn. + Dös ist dös eerste Buech, wo ganz yn n Wimm gwidmt ist, netty dös Grechte für + Anfönger. Es haat ayn Wösn Beispiler und aau Bilder drinn. See https://iccf-holland.org/click5.html - D�s folgete Buech ist schoon �lter und meerer �ber n Urwimm als wie �ber n + Dös folgete Buech ist schoon ölter und meerer über n Urwimm als wie über n Wimm, aber aau zo n Empfelhen: Textbearbeitung mit dem vi-Editor - von dyr LAMB Linda und n ROBBINS Arnold - Verlaag O'Reilly - Buechlaittzal (ISBN): 3897211262 - In d�nn Buech kan myn fast allss finddn, was myn mit n Urwimm angeen mecht. - De s�xte Ausgaab enthaltt aau schoon �bbs �ber n Wimm. - Als ietzunde Bezugniss f�r d Fassung 7 und ayn pfrenge Einf�erung dient d�s + In dönn Buech kan myn fast allss finddn, was myn mit n Urwimm angeen mecht. + De söxte Ausgaab enthaltt aau schoon öbbs über n Wimm. + Als ietzunde Bezugniss für d Fassung 7 und ayn pfrenge Einfüerung dient dös folgete Buech: vim ge-packt von n WOBST Reinhard mitp-Verlaag, Buechlaittzal 978-3-8266-1781-2 - Trotz dyr recht pfrengen Darst�llung ist s durch seine viln n�tzlichnen Bei- - spiler aau f�r Einsteiger grad grecht. Probhaeupster und de Beispilschripfer + Trotz dyr recht pfrengen Darstöllung ist s durch seine viln nützlichnen Bei- + spiler aau für Einsteiger grad grecht. Probhaeupster und de Beispilschripfer seind zesig zo n Kriegn; see https://iccf-holland.org/click5.html - Verfasst habnd d�nn Schainer dyr PIERCE Michael C. und WARE Robert K. von dyr - Kolraader Knappnschuel (Colorado School of Mines). Er beruet auf Entw�rff, wo + Verfasst habnd dönn Schainer dyr PIERCE Michael C. und WARE Robert K. von dyr + Kolraader Knappnschuel (Colorado School of Mines). Er beruet auf Entwürff, wo dyr SMITH Charles von dyr Kolraader Allschuel (Colorado State University) - zuer Verf�egung gst�llt haat. Gundpost: bware@mines.colorado.edu - F�r n Wimm haat n dyr MOOLENAAR Bram barechtt. - De bairische �bers�tzung stammt von n HELL Sepp 2009, ayn Weeng �berarechtt - 2011. Sein Gundpostbr�cht ist sturmibund@t-online.de + zuer Verfüegung gstöllt haat. Gundpost: bware@mines.colorado.edu + Für n Wimm haat n dyr MOOLENAAR Bram barechtt. + De bairische Übersötzung stammt von n HELL Sepp 2009, ayn Weeng überarechtt + 2011. Sein Gundpostbrächt ist sturmibund@t-online.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.bar.utf-8 b/runtime/tutor/tutor1.bar.utf-8 deleted file mode 100644 index 74c3889d67..0000000000 --- a/runtime/tutor/tutor1.bar.utf-8 +++ /dev/null @@ -1,983 +0,0 @@ -=============================================================================== -= G o t i k a m i n n W I M M - S c h a i n e r - Fassung 1.7 = -=============================================================================== -= C H A P T E R - 1 = -=============================================================================== - - Dyr Wimm ist ayn gro mächtigs Blat, dös was mit aynn Wösn Befelh aufwartt; z - vil, däß myn s allsand in aynn Schainer wie dönn daader unterbräng. Der - Schainer ist yso aufbaut, däß yr halt netty die Befelh allsand bringt, wost - brauchst, däßst mit iem für s Eerste wirklich öbbs anfangen kanst. - Durchhinarechtn kanst di, wennst willst, in ayner halbetn Stund; dös haisst, - wennst di nit grooß mit n Pröbln und Tüftln aufhaltst. - - OBACHT: - Die Faudungen, wost daader finddst, gaand istig s Gwort öndern. Dösswögn - machst eyn n Böstn glei ayn Aamum von derer Dautticht daader. Haast alsnan - dös Gwort daader mit n Befelh "vimtutor bar" ausherlaassn, ist s ee schoon - ayn Aamum. - Mir kan s nit oft gnueg sagn, däß der Schainer daader istig gan n Üebn - ghoert. Also muesst schoon aau die Befelh +ausfüern, wennst ys gscheid ler- - nen willst. Mit n Lösn yllain ist s +nit taan! - - Ietz schaust grad non, däß dein Föststölltastn nit druckt ist; und aft geest - glei aynmaal mit dyr j-Tastn abwärts (yso laaufft dös nömlich), hinst däßst - de gantze Letzn 1.1.1 auf n Bildschirm haast. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.1: MIT N MÖRKL UMAYNANDFARN - -** Dyrmitst mit n Mörkl umaynandkimmst, druck h, j, k und l wie unt zaigt. ** - ^ Ayn Öslsbrugg: - k De Tastn h ist winster und +geet aau gan winster. - < h l > S l leit zesm und richtt si gan zesm. - j S j kan myn wie aynn Pfeil gan unt seghn. - v Mit n k kimmst gan n KOPF. - 1. Ietz ruedertst ainfach mit n Mörkl auf n Bildschirm umaynand, hinst däßst - di sicher füelst. - 2. Halt d Abhin-Tastn (j) druckt; aft rumplt s ainfach weiter. Netty yso - kimmst gan dyr naehstn Letzn. - - 3. Wie gsait, ietz bewögst di also mit derer Tastn gan dyr Letzn 1.1.2. - -Non öbbs: Allweil, wenn dyr niemer ganz wol ist, wasst öbbenn druckt haast, aft - zipfst ; naacher bist wider ganz gwon in dyr Befelhs-Artweis. - - - Nöbnbei gsait kimmst gwonerweil aau mit de Pfeiltastnen weiter. Aber - hjkl seind z haissn s Wimm-Urgstain; und de "Hörtn" seind ganz dyr- - für, däß myn bei +dene bleibt. Pröblt s ainfach aus! -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.2: ÖNN WIMM AUSSCHALTTN - - - ALSO, EE WENNST ÖBBS VON DAA UNT AUSFÜERST, LIS LIEBER ZEERST DE GANTZE LET- - ZN! - - 1. Druck d -Tastn, dyrmitst aau gwiß in dyr Befelhs-Artweis bist. - - 2. Demmlt :q! . - Daa dyrmit benddst ys Blat und verwirffst allss, wasst öbbenn göndert - haast. - - 3. Balst önn Eingib seghst, gib dö Faudung ein, wo di zo dönn Schainer brun- - gen haat, also vimtutor bar . - - 4. Also, wenn ietz allsse sitzt, naacherd füerst d Schritt 1 hinst 3 aus, mit - wasst ys Blat verlaasst und aft wider einhinkimmst. - -Anmörkung: Mit :q! verwirffst allss, wasst göndert older enther gschribn - haast. In aynn Öttlych Letznen lernst acht, wiest dös allss in ayner - Dautticht speichertst. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.3: GWORT BARECHTN - LÖSCHN - - - ** Druck x , dyrmitst dös Zaichen unter n Mörkl löschst. ** - - 1. Bewög di mit n Mörkl auf de mit ---> angmörkte Zeil unt. - - 2. Zo n Faeler Verbössern farst mit n Mörkl netty auf dös Zaichen, dös wo - glöscht ghoert. - - 3. Druck de Tastn x , däßst dös überflüssige Zaichen löschst. - - 4. Ietz tuest so lang weiter mit 2 hinst 4, hinst däß dyr Saz stimmt. - ----> De Kkuue sprangg übber nn Maanad. - - 5. Wenn ietz de Zeil verbössert ist, geest gan dyr Letzn 1.1.4. weiter. - -Und ganz wichtig: Dyrweilst dönn Schainer durcharechtst, versuech nit öbbenn, - allss auswendig z lernen; nän, lern ainfach mit n Anwenddn! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.4: GWORT BARECHTN - EINFÜEGN - - - ** Druck i , dyrmitst öbbs einfüegst. ** - - 1. Bewög önn Mörkl zo dyr eerstn untignen Zeil, wo mit ---> angeet. - - 2. Dyrmitst de eerste Zeil wie de zwaitte machst, bewög önn Mörkl auf dös - eerste Zaichen NAACH derer Stöll, daa wo s Gwort eingfüegt werdn sollt. - - 3. Druck i und gib dös ein, was abgeet. - - 4. Wenn ieweils ayn Faeler verweitert ist, aft druck ; dyrmit kimmst - gan dyr Befelhsartweis zrugg. - So, und ietz tuest ainfach yso weiter, hinst däß dyr Saz stimmt. - ----> Daader gt dd öbbs b. ----> Daader geet diend öbbs ab. - - 5. Balst mainst, däßst ys Gwort-Einfüegn kanst, aft geest gan dyr Letzn 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.5: GWORT BARECHTN - ANFÜEGN - - - ** Druck A gan n Gwort Anfüegn. ** - - 1. Gee mit n Mörkl gan dyr eerstn untignen Zeil, wo ayn ---> dyrvor haat. - Daa ist s gleich, wo gnaun dyr Mörkl in derer Zeil steet. - - 2. Demmlt A und gib de entspröchetn Ergöntzungen ein. - - 3. Wennst mit n Anfüegn förtig bist, aft druckst , däßst wider eyn de - Befelhsartweis zruggkimmst. - - 4. So, und ietz geest aft non gan dyr zwaittn mit ---> angmörktn Zeil; und - daadl machst ys netty yso. - ----> In derer Zeil gee - In derer Zeil geet ayn Weeng ayn Gwort ab. ----> Aau daader stee - Aau daader steet öbbs Unvollstöndigs. - - 5. Wennst s Anfüegn von Gwort drauf haast, naacherd gee gan dyr Letzn 1.1.6. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.1.6: AYN DAUTTICHT BARECHTN - - - ** Mit :wq speichertst ayn Dautticht und verlaasst önn Wimm ganz. ** - - !! OBACHT: Ee wennst mit dönn alln daa unt weitertuest, lis zeerst de gantze - Letzn durch!! - - 1. Verlaaß also s Blat, wie s in dyr Letzn 1.1.2. haisst, mit :q! ! - - 2. Gib dö Faudung eyn n Eingib ein: vim Schainer . 'vim' ruefft s Blat - auf, und 'Schainer' haisst de Dautticht, wost barechtn willst. Dyrmit - haast also ayn Dautticht, dö wost barechtn kanst. - - 3. Ietz füegst öbbs ein older löschst öbbs, wiest ys in de vorignen Letznen - glernt haast. - - 4. Speichert de gönderte Dautticht und verlaaß önn Wimm mit :wq . - - 5. Schmeiß önn Wimmschainer neu an und gee gan dyr folgetn Zammenfassung. - - 6. Aft däßst de obignen Schritt glösn und käppt haast, kanst ys durchfüern. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZAMMENFASSUNG VON DYR LETZN 1.1 - - - 1. Dyr Mörkl werd mit de Tastnen hjkl older aau mit de Pfeiltastnen gsteuert. - h (winst) j (ab) k (auf) l (zes) - - 2. Um önn Wimm umbb n Eingib aus z ginnen, demmlt: vim DAUTTICHT . - - 3. Willst önn Wimm verlaassn und aau allss verwerffen, aft gibst ein: - und :q! . - Gan n Verlaassn und Speichern aber zipfst und :wq . - - 4. Willst dös Zaichen löschn, daa wo dyr Mörkl drauf ist, demmltst x . - - 5. Willst öbbs vor n Mörkl eingöbn, zipfst i und drafter . - Mechst ys aber eyn s Zeilnend anhinhöngen, benutzt ys A . - Und ainfach naach n Mörkl füegst ys mit a ein. - -Anmörkung: Druckst , kimmst eyn de Befelhsartweis zrugg older brichst - ayn Faudung ab, dö wo dyr schiefgangen ist. - - Ietz tue mit dyr Letzn 1.2 weiter. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.1: LÖSHFAUDUNGEN - - - ** Demmlt dw , dyrmitst ayn Wort löschst. ** - - 1. Druck , dyrmit s aau gwiß ist, däßst in dyr Befelhsartweis bist. - - 2. Bewög önn Mörkl zo dyr mit ---> angmörktn Zeil unt. - - 3. Und daa geest ietz auf n Anfang von aynn Wort, dös wo glöscht ghoert. - - 4. Zipf dw , däßst dös gantze Wort löschst. - - Nöbnbei: Dyr Buechstabn d erscheint auf dyr lösstn Zeil von n Bildschirm, - sobaldst n eingibst. Dyr Wimm wartt ietz drauf, däß öbbs kimmt, al- - so daader ayn w . Seghst freilich öbbs Anderts wie ayn d , - naacherd haast öbbs Falschs demmlt. Druck aft und pröblt - s non aynmaal. ----> Ayn Öttlych Wörter lustig ghoernd nit Fisper eyn dönn Saz einhin. - - 5. Äfert d Schritt 3 und 4, hinst däß dyr Saz pässt, und gee aft gan dyr - Letzn 1.2.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.2: NON MEERER LÖSHFAUDUNGEN - - - ** Gib d$ ein, däßst hinst eyn s Zeilnend löschst. ** - - 1. Druck , dyrmitst aau gwiß in dyr Befelhsartweis bist. - - 2. Bewög önn Mörkl hinst eyn de mit ---> angmörkte Zeil untn. - - 3. Gee mit n Mörkl auf s End von dyr faelerfreien Zeil, NAACH n eerstn . . - - 4. Zipf d$ , däßst hinst eyn s End von dyr Zeil löschst. - ----> Öbber haat s End von dyr Zeil doplt eingöbn. doplt eingöbn. - - - 5. Gee weiter gan dyr Letzn 1.2.3, dyrmitst versteest, was daader ablaaufft. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.3: PFEMERER UND WOLENDER - - - Vil Faudungen, wo s Gwort öndernd, sötznd si aus aynn Pfemerer und aynn Wo- - lend zamm. Bal i also öbbs löschn will, schreib i ainsting d und aft s "Wo- - lend", dös haisst also, "wolend", "wohin" däß i will - older was i halt gnaun - löschn will. - - - - - - - Daader also, was i wie löschn kan: - w - hinst eyn n Anfang von n naehstn Wort AANE dönn sein eersts Zaichen. - e - gan n End von n ietzundn Wort MIT dönn seinn lösstn Zaichen. - $ - zo n End von dyr Zeil MIT derer irn lösstn Zaichen. - - Also löscht de Tastnfolg de allss umbb n Mörkl hinst eyn s Wortend. -Anmörkung: Gib i grad dös zwaitte Zaichen yllain ein, ruckt halt dyr Mörkl - entspröchet weiter. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.4: MIT AYNN ZÖLER D WOLENDER ÄFERN - - - ** Gib i ayn Zal vor aynn Wolend ein, werd dös Sel entspröchet oft gangen. ** - - 1. Bewög önn Mörkl gan n Anfang von dyr Zeil mit ---> dyrvor unt. - - 2. Zipf 2w , däßst mit n Mörkl zwai Wörter weitergeest. - - 3. Zipf 3e , däßst mit n Mörkl auf s End von n drittn Wort kimmst. - - 4. Zipf 0 (aynn Nuller), däßst eyn n Anfang von dyr Zeil hinkimmst. - - 5. Widerhol d Schritt 2 und 3 mit verschaidne Zöler. - - ---> Dös ist ietz grad ayn Zeil zo n drinn Umaynanderruedern. - - 6. Gee weiter gan dyr Letzn 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.5: DURCH AYNN ZÖLER GLEI MEERER LÖSCHN - - - ** Ayn Zal vor aynn Pfemerer füert dönn entspröchet oft aus. ** - - Also, i mecht löschn, und zwaar öbbs Bestimmts, und dös so und so oft: Daa - dyrzue benutz i aynn Zöler: - d Zöler Wolend (also önn Bewögungsschrit) - - 1. Bewög önn Mörkl zo n eerstn Wort in GROOSSBUECHSTABN in dyr mit ---> an- - gmörktn Zeil. - - 2. Demmlt d2w , dyrmitst de ganz grooßgschribnen Wörter löschst. - - 3. Äfert d Schritt 1 und 2 mit dönn entspröchetn Zöler, dyrmitst de drauf- - folgetn ganz großgschribnen Wörter mit ayner ainzignen Faudung löschst: - - ----> Dö ABC DE Zeil FGHI JK LMN OP mit Wörter ist Q RS TUV ietz berichtigt. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.6: ARECHTN AUF ZEILN - - - ** Zipf dd , um ayn gantze Zeil z löschn. ** - - Weil s gro oft vürkimmt, däß myn gantze Zeiln löscht, kaamend schoon d Ent- - wickler von n Urwimm daa drauf, däß myn ainfach dd gan dönn Zwök schreibt. - - - 1. Bewög önn Mörkl gan dyr zwaittn Zeil in n untignen "Gedicht". - 2. Zipf dd , um dö Zeil z löschn. - 3. Ietz bewögst di gan dyr viertn Zeil. - 4. Zipf 2dd , um zwo Zeiln zo n Löschn. - ----> 1) Roosn seind root; ----> 2) Drunter ist s Koot. ----> 3) Veigerln seind blau. ----> 4) Umgrabn tuet s d Sau. ----> 5) D Ur sait de Zeit, ----> 6) Sait, däß s mi freut, ----> 7) Dirndl, dein Gschau. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.2.7: RUGGGÖNGIG MACHEN (RUGGLN) - - - ** Zipf u , dyrmitst de lösstn Faudungen ruggltst ** - ** older U , um ayn gantze Zeil widerherzstölln. ** - - 1. Bewög önn Mörkl gan dyr mit ---> angmörktn Zeil unt und gee dyrmit auf n - eerstn Faeler. - 2. Zipf x , däßst dös eerste z vile Zaichen löschst. - 3. Ietz demmlt u , dyrmitst de lösste Faudung ruggltst. - 4. Ietz behöb allsand Faeler auf dyr Zeil mit dyr Hilf von n Befelh x . - 5. Aft gibst ayn U (grooß) ein, däßst de Zeil wider yso hinbringst, wie s - gwösn ist. - 6. So, und ietz demmltst so oft u , hinst däßst s U und de andern Fau- - dungen rugggöngig gmacht haast. - 7. Und ietzet widerum schreibst so oft r , hinst däßst allsand Be- - felh widerhergstöllt, z haissn allsse rugg-grugglt haast (also d Rugggön- - gigmachungen rugggöngig gmacht). ----> Beerichtig d Faeller voon dehrer Zeiil und sttöll s mitt n Ruggruggln wi- - der her. - 8. Die Faudungen seind gro wichtig; sö helffend ainn närrisch weiter. - Ietz gee weiter gan dyr Zammenfassung von dyr Letzn 1.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZAMMENFASSUNG VON DYR LETZN 1.2 - - - 1. Um von n Mörkl aus hinst eyn s naehste Wort zo n Löschn, zipf: dw - 2. Um umbb n Mörkl hinst eyn s End von dyr Zeil zo n Löschn, demmlt d$ - 3. Dyrmitst ayn gantze Zeil löschst, gib ein: dd - 4. Mechst ayn Bewögung, ayn "Wolend", öfters, stöll de entspröchete Zal dyr- - vor: 3dw older aau: d3w - 5. Dyr Pfueg für ayn Önderungsfaudung lautt yso: - Pfemerer [Zal] Bewögungsschrit (Wolend) - Und dös haisst: - Dyr PFEMERER gibt an, WAS taan ghoert, öbbenn d = löschn (»delete«). - [ZAL] - Ayn Zal KAN myn angöbn, wenn myn halt ayn Wolend öfter habn will. - S WOLEND, also dyr Schrit WOHIN, besagt, auf was i aushin will, öbbenn - auf aynn Wortanfang ( w ), s End von dyr Zeil ( $ ) und so weiter. - - 6. Däßst eyn n Anfang von dyr Zeil hinkimmst, schreib aynn Nuller: 0 - - 7. Um öbbs Vorigs wider z ruggln, gib ein: u (klain also) - Um allsand Önderungen in ayner Zeil z ruggln, haast: U (also grooß) - Um "rugg-z-ruggln", also allss wider herzstölln, zipf: r - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.3.1: ANFÜEGN (»put«) - - - ** Zipf p , dyrmitst öbbs gnetty Glöschts naach n Mörkl anfüegst. ** - - 1. Bewög önn Mörkl gan dyr eerstn untignen Zeil mit ---> dyrvor. - - 2. Zipf dd , um sele Zeil z löschn und dyrmit in ayner Wimm-Osn zo n Spei- - chern. - - 3. Bewög önn Mörkl gan dyr Zeil c), ÜBER derer, daa wo de glöschte Zeil ein- - hinkemmen sollt. - - 4. So, und ietz gibst ainfach p ein, und schoon haast dö Zeil unter derer - mit n Mörkl drinn. - 5. Äfert d Schritt 2 hinst 4, hinst däßst allsand Zeiln yso naachynaynand - haast, wie s hinghoernd. - ----> d) Kanst du dös aau? ----> b) Veigerln seind blau. ----> c) Bedachtn kan myn lernen. ----> a) Roosn seind root. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.3.2: ERSÖTZN (»replace«) - - - ** Zipf rx , um dös Zaichen unter n Mörkl durch x z ersötzn. ** - - 1. Bewög önn Mörkl zo dyr eerstn untignen Zeil mit ---> dyrvor. - - 2. Bewög önn Mörkl, hinst däß yr auf n eerstn Faeler steet. - - 3. Zipf r und drafter dös Zaichen, wo dyrfür daa hinghoert. - - 4. Widerhol d Schritt 2 und 3, hinst däßst de eerste Zeil gmaeß dyr zwaittn - berichtigt haast: ----> Wie dö Zeit eingobn wurd, wurdnd ainike falsche Zastnen zipft! ----> Wie dö Zeil eingöbn wurd, wurdnd ainige falsche Tastnen zipft! - - 5. Ietz tue mit dyr Letzn 1.3.3 weiter. - -Anmörkung: Vergiß nit drauf, däßst mit n Anwenddn lernen solltst und nit öbbenn - mit n Auswendiglernen! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.3.3: ÖNDERN (»change«) - - - ** Um hinst eyn s Wortend z öndern, zipf ce . ** - - 1. Gee mit n Mörkl auf de eerste mit ---> angmörkte Zeil. - - 2. Ietz farst netty auf s "s" von Wstwr hin. - - 3. Zipf ce ein und aft d Wortberichtigung, daader also örter . - - 4. Druck und bewög önn Mörkl zo n naehstn Zaichen, wo göndert ghoert. - - 5. Äfert d Schritt 3 und 4, hinst däß dyr eerste Saz wie dyr zwaitte ist. - ----> Ainige Wstwr von derer Zlww ghhnnd mit n Öndern-Pfemerer gaauu. ----> Ainige Wörter von derer Zeil ghoernd mit n Öndern-Pfemerer göndert. - -ce löscht also s Wort und schlaaufft di eyn d Eingaab-Artweis. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 3.4.: NON MEERER ÖNDERUNGEN PFELFS c - - - ** D Löshfaudung c arechtt mit de nömlichnen Wolender wie dö mit d ** - - 1. Dyr Önder-Pfemerer arechtt anleich wie d Löshfaudung mit d , und zwaar - yso: - c [Zal] Bewögungsschrit (Wolend) - - 2. D Wolender seind de gleichn, öbbenn w für Wort und $ für s Zeilnend. - - - 3. Bewög di zo dyr eerstn untignen Zeil mit ---> . - - 4. Ietz geest auf dönn eerstn Faeler. - - 5. Zipf c$ , gib önn Rest von dyr Zeil wie in dyr zwaittn ein und druck aft - . ----> S End von derer Zeil sollt an de zwaitte daader anglichen werdn. ----> S End von derer Zeil sollt mit n Befelh c$ berichtigt werdn. - -Denk allweil dran, däßst iederzeit mit dyr Ruggtastn Faeler ausbössern kanst. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZAMMENFASSUNG VON DYR LETZN 1.3 - - - 1. Um ayn vorher glöschts Gwort anzfüegn, zipf p . Daa dyrmit werd dös - gantze Gwort NAACH n Mörkl angfüegt. Wenn s ayn gantze Zeil gwösn ist, - werd dö sel als de Zeil unterhalb n Mörkl eingfüegt. - - 2. Um dös Zaichen unter n Mörkl, also wo dyr Mörkl ist, z ersötzn, zipf r - und aft dös Zaichen, wost daadl habn willst. - - 3. Dyr Önderungspfemerer ( c = »change«) laasst ainn umbb n Mörkl hinst eyn s - End von n Wolend öndern. Zipf ce , dyrmitst umbb n Mörkl hinst eyn s End - von n Wort öndertst, und c$ hinst eyn s End von dyr Zeil. - - 4. Für d Önderung lautt dyr Pfueg: - - c [Zal] Wolend - -Ietz tue mit dyr naehstn Letzn weiter. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.4.1: MÖRKLSTÖLLUNG UND DAUTTICHTDARSTAND - -** Demmlt g, däßst önn Befand und Darstand von dyr Dautticht anzaigst. ** - ** Zipf G , dyrmitst auf ayn bestimmte Zeil in dyr Dautticht hinkimmst. ** - -Anmörkung: Lis dö gantze Letzn daader durch, ee wennst iewign öbbs unternimmst! - - 1. Druck g . Auf dös hin erscheint auf derer Seitt ganz unt ayn Dar- - standsmeldung mit n Dauttichtnam und n Befand innerhalb dyr Dautticht. - Mörk dyr de Zeilnnummer für n Schrit 3. - -Anmörkung: Müglicherweis seghst aau önn Mörklbefand in n zesmen untern Bild- - schirmögg. Aft ist s "Lindl" (»ruler«) eingstöllt; meerer über dös - laasst dyr dyr Befelh :help 'ruler' ausher. - 2. Druck G , um an s End von dyr Dautticht z kemmen. - gg gibst ein, däßst gan n Anfang von dyr Dautticht aufhinkimmst. - - 3. Gib d Nummer von derer Zeil ein, daa wost vorher warst, und aft non G . - Dös bringt di zrugg gan seler Zeil, daa wost stuenddst, wiest dös eerste - Maal g gadruckst. - - 4. Wennst di sicher gnueg füelst, aft füer d Schritt 1 hinst 3 aus. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.4.2: DYR BEFELH ZO N SUECHEN - - - ** Zipf / und dyrnaach aynn Ausdruk, um selbignen zo n Suechen. ** - - 1. Du gibst also in dyr Befelhsartweis s Zaichen / ein. Dös sel wie aau dyr - Mörkl erscheinend drauf unt auf n Schirm, netty wie bei dyr Faudung : . - - 2. Ietz zipf Faeeler . Netty um dös 'Faeeler' willst ietz suechen. - - 3. Willst um gnaun dönn Ausdruk weitersuechen, zipf ainfach n (wie »next«). - Willst hinzrugg suechen, aft gibst N ein. - - 4. Um von Haus aus zruggaus z suechen, nimm ? statt / her. - - 5. Dyrmitst wider daa hinkimmst, wost herkemmen bist, nimm o , und dös - öfter, wennst weiter zrugg willst. Mit i widerum kimmst vorwärts. - ----> Aynn Faeler schreibt myn nit "Faeeler"; Faeeler ist ayn Faeler - -Anmörkung: Wenn d Suech s Dauttichtend dyrraicht haat, geet s eyn n Anfang wi- - der weiter dyrmit, men Sach dyr Schaltter 'wrapscan' wär auf aus. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.4.3: DE GÖGNKLAMMERN FINDDN - - - ** Zipf % , um de entspröchete Klammer ) , ] older } z finddn. ** - - 1. Sötz önn Mörkl auf iewign aine von dene drei Klammern ( , [ older { - in dyr untignen Zeil, wo mit ---> angmörkt ist. - - 2. Ietzet zipf s Zaichen % . - - 3. Dyr Mörkl geet ietz auf de pässete schliessete Klammer. - - 4. Ietz demmlt % , und dyrmit kimmst gan dyr öffneretn Klammer zrugg. - - 5. Sötz önn Mörkl auf ayn anderne Klammer von ({[]}) und pröblt % aus. - ----> Dös ( ist blooß ayn Pochzeil ( mit [ verschaidne ] { Klammern } drinn. )) - -Anmörkung: Um dö Müglichkeit gaast bsunders froo sein, wennst aynmaal in aynn - Spaichgwort verzweiflt ayn faelete Gögnklammer suechst! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.4.4: D ERSÖTZUNGSFAUDUNG (»substitute«) - - - ** Zipf :s/alt/neu/g , um 'alt' durch 'neu' zo n Ersötzn. ** - - 1. Gee mit n Mörkl zo dyr unt steehetn mit ---> angmörktn Zeil. - - 2. Zipf :s/dee/de . Der Befelh ersötzt alsnan grad dös +eerste "dee", - wo vürkimmt. - - 3. Ietz pröblt s mit :s/dee/de/g . Dös zuesötzliche g ("Pflok" nennt myn - öbbs Sölchers) bewirkt, däß allss, was dyrmit kennzaichnet ist, innerhalb - von dyr ainn Zeil ersötzt werd. - ----> Dee schoenste Zeit, däß myn dee Blüemln anschaut, ist dee schoene Lan- - gesszeit. - 4. Um ietz allsand Suechbegriff innerhalb von zwo Zeiln zo n Öndern, zipf - :#,#s/alt/neu/g , wobei # ieweils für de eerste und lösste Zeil von dönn - Pfraich steet. - :%s/alt/neu/g zipfst, däßst d Vürkemmen in dyr gantzn Dautticht öndertst. - Mit :%s/alt/neu/gc finddst allsand Vürkemmen in dyr gsamtn Dautticht; - daa werst aber zeerst non gfraagt, obst ys ersötzn willst older nity. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZAMMENFASSUNG VON DYR LETZN 1.4 - - 1. g zaigt dönn ietzundn Dauttichtbefand und önn Darstand dyrvon an. - G bringt di an s End von dyr Dautticht. - G bringt di gan dyr entspröchetn Zeilnnummer. - gg geet +grad yso. - gg bringt di zo dyr eerstn Zeil. - 2. D Eingaab von / mit aynn Ausdruk suecht VÜRSHLING um dönn Ausdruk. - Gibst ? und aynn Suechbegrif ein, suecht s um dönn ÄRSHLING. - Zipf naach ayner Suech n ; naacherd werd in de gleiche Richtung weiter- - gsuecht. Mit N geet s umkeerter weiter. - o bringt di zo ölterne Befändd zrugg, i zo neuerne. - - 3. D Eingaab von % , wenn dyr Mörkl auf ainer von dene Klammern steet: ({[ - )]} , bringt di zo dyr Gögnklammer. - - 4. Um dös eerste Vürkemmen von "alt" in ayner Zeil durch "neu" z ersötzn, - zipf :s/alt/neu . - Um allsand in ayner Zeil z ersötzn, zipf :s/alt/neu/g . - Mechst allss in zwo Zeiln ersötzn, demmlt zo n Beispil :5,6s/alt/neu/g . - Mechst allss in dyr gantzn Dautticht ersötzn, gib ein: :%s/alt/neu/g . - Willst ayn ieds Maal bstaetln, höng 'c' wie »confirm« hint anhin. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.5.1: ZWISCHNDRINN AYNN AUSSERIGNEN BEFELH AUSFÜERN - - - ** Willst ayn Gfäßfaudung ausfüern, gib ainfach dö sel naach :! ein. ** - - 1. Zipf dönn bekanntn Befelh : , dyrmitst mit n Mörkl auf n Bildschirm - ganz abhin kimmst. Draufhin kanst aynn gwonen Gfäßbefelh eingöbn. - - 2. Zeerst kimmt aber non ayn Ruefzaichen ! . Und ietzet haast d Müglich- - keit, ayn beliebige ausserige Gfäßfaudung auszfüern. - - 3. Als Beispil zipf :!ls ; und schoon haast ayn Auflistung von deinn - Verzaichniss, netty wie wennst ganz gwon in n Eingib wärst. Geet ls - aus iewign aynn Grund nit, aft pröblt s mit :!dir . - -Also non aynmaal: Mit dönn Angang kan ayn iede beliebige ausserige Faudung aus- - gfüert werdn, aau mit Auerwerdd. - -Und wolgmörkt: Alle Befelh, wo mit : angeend, müessend mit bstö- - tigt werdn. Dös dyrsagn myr fürbaß +niemer. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.5.2: NON MEERER DRÜBER, WIE MYN DAUTTICHTN SCHREIBT - - - ** Um öbbs Gönderts neu z speichern, zipf :w NEUER_DAUTTICHTNAM . ** - - 1. Zipf :!dir older :!ls , däßst dyr ayn Auflistung von deinn Verzaich- - niss ausherlaasst. Däßst drafter eingöbn muesst, waisst ee schoon. - - 2. Suech dyr aynn Dauttichtnam aus, dönn wo s non nit geit, öbbenn POCH . - - 3. Ietz demmlt: :w POCH (also mit POCH als dönn neuen Dauttichtnam). - - 4. Dös speichert ietz de gantze Dautticht, also önn Wimmschainer, unter dönn - Nam POCH. Dös kanst leicht überprüeffen, indem däßst ainfach :!ls older - :!dir zipfst und dyrmit deinn Verzaichnissinhalt seghst. - -Anmörkung: Stigst ietz aus n Wimm aus und gännst n aft wider mit vim POCH , - naacherd wär dö Dautticht ayn gnaune Aamum von n Schainer dyrselbn, - wiest n gspeichert haast. - - 5. Ietz verweitert dö Dautticht - fallsst s Fenstl haast - , mit :!del POCH - beziehungsweis bei aynn Unixgebäu mit :!rm POCH . -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.5.3: AYNN TAIL VON N GWORT ZO N SPEICHERN AUSWALN - -** Um aynn Tail von dyr Dautticht z speichern, zipf v [Wolend] :w DAUTTICHT ** - - 1. Ruck önn Mörkl auf netty dö Zeil daader. - - 2. Demmlt v und gee mit n Mörkl auf dönn fümftn Auflistungspunt untet. Du - seghst glei, däß s Gwort vürherghöbt erscheint. - - 3. Druck s Zaichen : . Ganz unt auf n Bildschirm erscheint :'<,'> . - - 4. Zipf w POCH , wobei s dönn Dauttichtnam POCH non nit geit. Vergwiß di, - däßst dös :'<,'>w POCH aau +seghst, ee wennst druckst. - - 5. Dyr Wimm schreibt de ausgwaltn Zeiln eyn de Dautticht POCH einhin. Benutz - :!dir older :!ls , däßst dös überprüeffst. Lösh s fein nit öbbenn! Mir - brauchend s nömlich für de naehste Letzn. - -Anmörkung: Druckt myn v , ginnt d Sichtisch-Auswal. Du kanst mit n Mörkl um- - aynandfarn, um d Auswal z veröndern. Drafter kan myn mit yn aynn - Pfemerer mit dönn Gwort öbbs machen. Zo n Beispil löscht d dös - Gwort. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.5.4: EINLÖSN UND ZAMMENFÜERN VON DAUTTICHTN - - - ** Um önn Inhalt von ayner Dautticht einzlösn, zipf :r DAUTTICHTNAM ** - - 1. Sötz önn Mörkl über dö Zeil daader. - -OBACHT: Aft däßst önn Schrit 2 ausgfüert haast, seghst auf aynmaal öbbs aus - dyr Letzn 1.5.3. Bewög di naacherd wider abwärts, dyrmitst dö Letzn wi- - derfinddst. - 2. Ietz lis dein Dautticht POCH ein, indem däßst d Faudung :r POCH aus- - füerst, wobei wie gsait POCH für dönn von dir ausgsuechtn Dauttichtnam - steet. De einglösne Dautticht werd unterhalb dyr Mörklzeil eingfüegt. - - 3. Um zo n Überprüeffen, ob de Dautticht aau gwiß einglösn ist, gee zrugg; - und du seghst, däß s ietz zwo Ausförtigungen von dyr Letzn 1.5.3. geit, s - Urniss und de eingfüegte Dauttichtfassung. - -Anmörkung: Du kanst aau d Ausgaab von aynn Ausserigbefelh einlösn. Zo n Bei- - spil list :r !ls d Ausgaab von dyr Faudung ls ein und füegt s - unterhalb n Mörkl ein. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZAMMENFASSUNG VON DYR LETZN 1.5 - - - 1. :!FAUDUNG füert aynn ausserignen Befelh aus. - - Daader ayn Öttlych gwänddte Beispiler: - (Fenstl) (Unix - Linux) - :!dir :!ls - listt s Verzaichniss auf. - :!del DAUTTICHT :!rm DAUTTICHT - verweitert sele Dautticht. - - 2. :w DAUTTICHT speichert de ietzunde Wimmdautticht unter dönn besagtn Nam. - - 3. v WOLEND :w DAUTTICHTNAM schreibt de sichtisch ausgwaltn Zeiln eyn de - Dautticht mit seln Nam. - - 4. :r DAUTTICHTNAM ladt sele Dautticht und füegt s unterhalb n Mörklbefand - ein. - - 5. :r !dir list d Ausgaab von dyr Faudung dir und füegt s unterhalb n - Mörklbefand ein. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.1: ZEIL ÖFFNEN (»open«) - - - ** Zipf o , um ayn Zeil unterhalb n Mörkl z öffnen und eyn d ** - ** Einfüegartweis z kemmen. ** - - 1. Bewög önn Mörkl zo dyr eerstn mit ---> angmörktn Zeil unt. - - 2. Zipf o (klain), um ayn Zeil UNTERHALB n Mörkl z öffnen und mit dyr Ein- - füegartweis weiterztuen. - - 3. Ietzet zipf ayn Weeng öbbs und druck , um d Einfüegartweis z ver- - laassn. ----> Mit o werd dyr Mörkl in dyr Einfüegartweis auf de offene Zeil gsötzt. - - 4. Um ayn Zeil OBERHALB n Mörkl aufzmachen, gib ainfach ayn groosss O statt - yn aynn klainen ein. Versuech dös auf dyr untignen Zeil. - ----> Öffnet ayn Zeil über derer daader mit O , wenn dyr Mörkl auf derer Zeil - ist. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.2: GWORT ANFÜEGN (»append«) - - - ** Zipf a , um öbbs NAACH n Mörkl einzfüegn. ** - - 1. Bewög önn Mörkl gan n Anfang von dyr eerstn Üebungszeil mit ---> unt. - - 2. Druck e , hinst däß dyr Mörkl an n End von Zei steet. - - 3. Zipf ayn klains a , um öbbs NAACH n Mörkl anzfüegn. - - 4. Vergöntz dös Wort wie in dyr Zeil drunter. Druck , um d Schreib- - Artweis z verlaassn. - - 5. Bewög di mit e zo n naehstn ungantzn Wort und widerhol d Schritt 3 und - 4. - ----> Dö Ze biett ayn Glögn , ayn Gwort in ayner Zeil anzfü. ----> Dö Zeil biett ayn Glögnet, ayn Gwort in ayner Zeil anzfüegn. - -Anmörkung: a , i und A bringend ainn gleichermaaßn eyn d Einfüegartweis; - dyr ainzige Unterschaid ist, WO mit n Einfüegn angfangt werd. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.3: AYN ANDERNE WEIS ZO N ERSÖTZN (»replace«) - - - ** Demmlt ayn groosss R , um meerer als wie grad ain Zaichen z ersötzn. ** - - 1. Bewög önn Mörkl zo dyr eerstn untignen, mit ---> angmörktn Zeil. - Gee mit n Mörkl gan n Anfang von n eerstn xxx . - - 2. Ietz druck R und zipf sele Zal, wo drunter in dyr zwaittn Zeil steet, - yso däß de sel s xxx ersötzt. - - 3. Druck , um d Ersötzungsartweis z verlaassn. Du gspannst, däß dyr - Rest von dyr Zeil unveröndert bleibt. - - 4. Äfert die Schritt, um dös überblibne xxx z ersötzn. - ----> S Zunddn von 123 zo xxx ergibt xxx. ----> S Zunddn von 123 zo 456 ergibt 579. - -Anmörkung: D Ersötzungsartweis ist wie d Einfüegartweis, aber ayn ieds eindem- - mlte Zaichen löscht ayn vorhanddns. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.4: GWORT AAMEN UND EINFÜEGN - - ** Benutz önn Pfemerer y , um öbbs z aamen, und p , um öbbs einzfüegn. ** - - 1. Gee zo dyr mit ---> angmörktn Zeil unt und sötz önn Mörkl hinter "a)". - - 2. Ginn d Sichtisch-Artweis mit v und bewög önn Mörkl gnaun vor "eerste". - - 3. Zipf y , um dönn vürherghöbtn Tail z aamen. - - 4. Bewög önn Mörkl gan n End von dyr naehstn Zeil: j$ - - 5. Demmlt p , um dös Gwort einzfüegn, und aft: a zwaitte . - - 6. Benutz d Sichtischartweis, um " Eintrag." auszwaln, aam s mittls y , be- - wög di gan n End von dyr naehstn Zeil mit j$ und füeg s Gwort dortn mit - p an. - ----> a) dös ist dyr eerste Eintrag. - b) -Anmörkung: Du kanst y aau als Pfemerer verwenddn; yw zo n Beispil aamt - hinst eyn n naehstn Wortanfang (aane dönn selber). -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.6.5: SCHALTTER SÖTZN - -** Sötz aynn Schaltter yso, däß ayn Suech older Ersötzung Grooß- und Klain- ** - ** schreibung übergeet. ** - - 1. Suech um 'übergee", indem däßst /übergee eingibst. - Widerhol d Suech ayn Öttlych Maal, indem däßst de Tastn n druckst. - - 2. Sötz de Zwisl - önn Schaltter - 'ic' (»ignore case«), indem däßst :set ic - eingibst. - 3. Ietz suech wider um 'übergee' und tue aau wider mit n weiter. Daa fallt - dyr auf, däß ietz öbbenn aau Übergee und ÜBERGEE hergeet. - - 4. Sötz de Zwisln 'hlsearch' und 'incsearch' pfelfs: :set hls is - - 5. Widerhol d Suech und bobacht, was ietz gschieght: /übergee - - 6. Däßst grooß und klain wider gwon unterscheidst, zipf: :set noic - -Anmörkung: Mechst de Tröffer niemer vürherghöbt seghn, gib ein: :nohlsearch -Anmörkung: Sollt klain/grooß bei ayner ainzignen Suech wurst sein, benutz \c - in n Suechausdruk: /übergee\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZAMMENFASSUNG VON DYR LETZN 1.6 - - 1. Zipf o , um ayn Zeil UNTERHALB n Mörkl z öffnen und d Einfüegartweis z - ginnen. - Zipf O , um ayn Zeil OBERHALB n Mörkl z öffnen. - - 2. Zipf a , um NAACH n Mörkl ayn Gwort einzfüegn. - Zipf A , um ayn Gwort naach n Zeilnend anzfüegn. - - 3. D Faudung e bringt di gan n End von aynn Wort. - - 4. Dyr Pfemerer y (»yank«) aamt öbbs, p (»put«) füegt dös ein. - - 5. Ayn groosss R geet eyn d Ersötzungsartweis, hinst däß myn druckt. - - 6. D Eingaab von ":set xxx" sötzt de Zwisl "xxx". Ayn Öttlych Zwisln seind: - 'ic' 'ignorecase' Grooß/klain wurst bei ayner Suech - 'is' 'incsearch' Zaig aau schoon ayn Tailüberainstimmung - 'hls' 'hlsearch' Höb allsand pässetn Ausdrück vürher - Dyr Schaltternam kan in dyr Kurz- older Langform angöbn werdn. - - 7. Stöll yn ayner Zwisl "no" voran, däßst ys abschalttst: :set noic -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.7.1: AYN HILFGWORT AUFRUEFFEN - - - ** Nutz dös einbaute Hilfgebäu, de "Betribsanlaittung". ** - - Eyn n Wimm ist ayn ausfüerliche "Gebrauchsanweisung" einbaut. Für s Eerste - pröblt ainfach ains von dene dreu aus: - - Druck d -Tastn, wennst öbbenn aine haast. - - Druck de Tastn , fallsst ys haast. - - Zipf :help - - Lis di eyn s Hilffenster ein, dyrmitst draufkimmst, wie dös mit dyr Hilf geet. - Demmlt w w , um von ainn Fenster zo n andern zo n Springen. - Demmlt :q , um s Hilffenster zo n Schliessn. - - Du kanst zo so guet wie allssand ayn Hilf finddn, indem däßst yn dyr Faudung - :help aynn Auerwerd naachstöllst und istig nit vergisst. Pröblt dös: - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.7.2: ERSTÖLL AYN GIN-SCHRIPF - - - ** Mutz önn Wimm mit de einbautn Faehigkeitn auf. ** - - Dyr Wimm besitzt ayn Wösn Schäftungen, wo über n Urwimm aushingeend, aber de - meerern dyrvon seind in dyr Vorgaab ausgschaltt. Dyrmitst meerer aus n Wimm - ausherholst, erstöllst ayn "vimrc"-Dautticht. - - 1. Lög ayn "vimrc"-Dautticht an; dös geet ie naach Betribsgebäu verschidn: - :e ~/.vimrc für s Unix - :e ~/_vimrc bei n Fenstl - - 2. Ietz lis önn Inhalt von dyr Beispil-"vimrc"-Dautticht ein: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Speichert de Dautticht mit: - :w - - 4. Bei n naehstn Gin von n Wimm ist aft d Füegnussvürherhöbung zuegschalttn. - Du kanst dyr allss eyn dö Dautticht einhinschreibn, wasst bständig habn - willst. Meerer dyrzue erfarst unter: :help vimrc-intro -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Letzn 1.7.3: VERGÖNTZN - - - ** Befelhszeilnvergöntzung mit d und ** - - 1. Vergwiß di, däß dyr Wimm nit auf n Urwimm-"Glais" fart: :set nocp - - 2. Schaug naach, wölcherne Dauttichtn däß s in n Verzaichniss geit: :!ls - older :!dir - 3. Zipf önn Anfang von ayner Faudung: :e - - 4. Druck d , und dyr Wimm zaigt ayn Listn von Faudungen, wo mit "e" - angeend. - 5. Druck , und dyr Wimm vervollstöndigt önn Faudungsnam zo ":edit". - - 6. Füeg ayn Laerzaichen und önn Anfang von ayner besteehetn Dautticht an: - :edit DAU - - 7. Druck . Dyr Wimm vergöntzt önn Nam, dös haisst, wenn yr aindeuttig - ist. -Anmörkung: D Vergöntzung geit s für aynn Hauffen Faudungen. Versuech ainfach - d und . Bsunders nützlich ist dös bei :help . -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZAMMENFASSUNG VON DYR LETZN 1.7 - - - 1. Zipf :help oder druck oder , um ayn Hilffenster z öffnen. - - 2. Zipf :help FAUDUNG , um auf ayn Hilf gan aynn Befelh z kemmen. - - 3. Zipf w w , um zo n andern Fenster z springen. - - 4. Zipf :q , um s Hilffenster z schliessn. - - 5. Erstöll ayn vimrc-Ginschripf zuer Sicherung von deine Mötzneinstöllungen. - - 6. Druck d , aft däßst naach : ayn Faudung angfangt haast, dyr- - mitst mügliche Vergöntzungen anzaigt kriegst. - Druck für ain Vervollstöndigung yllain. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Dös wär ietzet s End von n Wimmschainer. Gangen ist s daa drum, aynn kurtzn - und bündignen Überblik über s Blat WIMM z lifern, netty vil gnueg, däß myn - für s Eerste wirklich öbbs dyrmit anfangen kan. Dyrmit ist s aber auf kain - Weitn non nit taan; dyr Wimm haat schoon non vil meerer auf Lager. Lis als - Naehsts aynmaal s Benutzerhandbuech: :help user-manual - - Zo n Weiterlösn und Weiterlernen wör dös Buech daader zo n Empfelhen: - Vim - Vi Improved - von n OUALLINE Steve - Verlaag: New Riders - Dös ist dös eerste Buech, wo ganz yn n Wimm gwidmt ist, netty dös Grechte für - Anfönger. Es haat ayn Wösn Beispiler und aau Bilder drinn. - See https://iccf-holland.org/click5.html - - Dös folgete Buech ist schoon ölter und meerer über n Urwimm als wie über n - Wimm, aber aau zo n Empfelhen: Textbearbeitung mit dem vi-Editor - von dyr - LAMB Linda und n ROBBINS Arnold - Verlaag O'Reilly - Buechlaittzal (ISBN): - 3897211262 - In dönn Buech kan myn fast allss finddn, was myn mit n Urwimm angeen mecht. - De söxte Ausgaab enthaltt aau schoon öbbs über n Wimm. - Als ietzunde Bezugniss für d Fassung 7 und ayn pfrenge Einfüerung dient dös - folgete Buech: - vim ge-packt von n WOBST Reinhard - mitp-Verlaag, Buechlaittzal 978-3-8266-1781-2 - Trotz dyr recht pfrengen Darstöllung ist s durch seine viln nützlichnen Bei- - spiler aau für Einsteiger grad grecht. Probhaeupster und de Beispilschripfer - seind zesig zo n Kriegn; see https://iccf-holland.org/click5.html - - Verfasst habnd dönn Schainer dyr PIERCE Michael C. und WARE Robert K. von dyr - Kolraader Knappnschuel (Colorado School of Mines). Er beruet auf Entwürff, wo - dyr SMITH Charles von dyr Kolraader Allschuel (Colorado State University) - zuer Verfüegung gstöllt haat. Gundpost: bware@mines.colorado.edu - Für n Wimm haat n dyr MOOLENAAR Bram barechtt. - De bairische Übersötzung stammt von n HELL Sepp 2009, ayn Weeng überarechtt - 2011. Sein Gundpostbrächt ist sturmibund@t-online.de - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.bg.utf-8 b/runtime/tutor/tutor1.bg similarity index 100% rename from runtime/tutor/tutor1.bg.utf-8 rename to runtime/tutor/tutor1.bg diff --git a/runtime/tutor/tutor1.ca b/runtime/tutor/tutor1.ca index 6ff996c2b2..98bda7e6c1 100644 --- a/runtime/tutor/tutor1.ca +++ b/runtime/tutor/tutor1.ca @@ -1,105 +1,105 @@ =============================================================================== -= B e n v i n g u t s a l t u t o r d e l V I M - Versi� 1.5 = += B e n v i n g u t s a l t u t o r d e l V I M - Versió 1.5 = =============================================================================== - El Vim �s un editor potent i t� moltes ordres, massa com per a - explicar-les totes un tutor com aquest. Aquest tutor est� pensat per a - ensenyar les ordres b�siques que us permetin fer servir el Vim com a - editor de prop�sit general. + El Vim és un editor potent i té moltes ordres, massa com per a + explicar-les totes un tutor com aquest. Aquest tutor està pensat per a + ensenyar les ordres bàsiques que us permetin fer servir el Vim com a + editor de propòsit general. - El temps aproximat de completar el tutor �s d'uns 25 o 30 minuts + El temps aproximat de completar el tutor és d'uns 25 o 30 minuts depenent de quant temps dediqueu a experimentar. - Feu una c�pia d'aquest fitxer per a practicar-hi (si heu comen�at amb - el programa vimtutor aix� que esteu llegint ja �s una c�pia). + Feu una còpia d'aquest fitxer per a practicar-hi (si heu començat amb + el programa vimtutor això que esteu llegint ja és una còpia). - �s important recordar que aquest tutor est� pensat per a ensenyar - practicant, �s a dir que haureu d'executar les ordres si les voleu - aprendre. Si nom�s llegiu el text el m�s probable �s que les oblideu. + És important recordar que aquest tutor està pensat per a ensenyar + practicant, és a dir que haureu d'executar les ordres si les voleu + aprendre. Si només llegiu el text el més probable és que les oblideu. - Ara assegureu-vos que la tecla de bloqueig de maj�scules no est� + Ara assegureu-vos que la tecla de bloqueig de majúscules no està activada i premeu la tecla j per a moure el cursor avall, fins que la - lli�� 1.1.1 ocupi completament la pantalla. + lliçó 1.1.1 ocupi completament la pantalla. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.1.1: MOURE EL CURSOR + Lliçó 1.1.1: MOURE EL CURSOR ** Per a moure el cursor premeu les tecles h, j, k, l tal com s'indica. ** ^ - k Pista: La h �s a l'esquerra i mou el cursor cap a l'esquerra. - < h l > La l �s a la dreta i mou el cursor cap a la dreta. + k Pista: La h és a l'esquerra i mou el cursor cap a l'esquerra. + < h l > La l és a la dreta i mou el cursor cap a la dreta. j La j sembla una fletxa cap avall. v 1. Moveu el cursor per la pantalla fins que us sentiu confortables. 2. Mantingueu premuda la tecla avall (j) una estona. ----> Ara ja sabeu com moure-us fins a la seg�ent lli��. +---> Ara ja sabeu com moure-us fins a la següent lliçó. - 3. Usant la tecla avall, aneu a la lli�� 1.1.2. + 3. Usant la tecla avall, aneu a la lliçó 1.1.2. Nota: Si no esteu segurs de la tecla que heu premut, premeu per a - tornar al mode Normal. Llavors torneu a teclejar l'ordre que vol�eu. + tornar al mode Normal. Llavors torneu a teclejar l'ordre que volíeu. -Nota: Les tecles de moviment del cursor (fletxes) tamb� funcionen. Per� - usant hjkl anireu m�s r�pid un cop us hi hagueu acostumant. +Nota: Les tecles de moviment del cursor (fletxes) també funcionen. Però + usant hjkl anireu més ràpid un cop us hi hagueu acostumant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.1.2: ENTRAR I SORTIR DEL VIM + Lliçó 1.1.2: ENTRAR I SORTIR DEL VIM - !! NOTA: Abans de seguir els passos seg�ents llegiu *tota* la lli��!! + !! NOTA: Abans de seguir els passos següents llegiu *tota* la lliçó!! 1. Premeu (per a estar segurs que esteu en el mode Normal). 2. Teclegeu: :q! . ----> Amb aix� sortireu de l'editor SENSE desar els canvis que hagueu pogut +---> Amb això sortireu de l'editor SENSE desar els canvis que hagueu pogut fer. Si voleu desar els canvis teclegeu: :wq - 3. Quan vegeu l'introductor de l'int�rpret escriviu l'ordre amb la + 3. Quan vegeu l'introductor de l'intèrpret escriviu l'ordre amb la qual heu arribat a aquest tutor. Podria ser: vimtutor - O b�: vim tutor + O bé: vim tutor ----> 'vim' �s l'editor vim, i 'tutor' �s el fitxer que voleu editar. +---> 'vim' és l'editor vim, i 'tutor' és el fitxer que voleu editar. 4. Si heu memoritzat les ordres, feu els passos anteriors, de l'1 al 3, per a sortir i tornar a entrar a l'editor. Llavors moveu el cursor - avall fins a la lli�� 1.1.3. + avall fins a la lliçó 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.1.3: EDITAR TEXT - ESBORRAR + Lliçó 1.1.3: EDITAR TEXT - ESBORRAR - ** En mode Normal premeu x per a esborrar el car�cter sota el cursor. ** + ** En mode Normal premeu x per a esborrar el caràcter sota el cursor. ** - 1. Moveu el cursor fins a la l�nia que hi ha m�s avall senyalada amb --->. + 1. Moveu el cursor fins a la línia que hi ha més avall senyalada amb --->. - 2. Poseu el cursor a sobre el car�cter que cal esborrar per a corregir + 2. Poseu el cursor a sobre el caràcter que cal esborrar per a corregir els errors. - 3. Premeu la tecla x per a esborrar el car�cter. + 3. Premeu la tecla x per a esborrar el caràcter. 4. Repetiu els passos 2 i 3 fins que la frase sigui correcta. ---> Unna vaaca vva salttar perr sobbree la llluna. - 5. Ara que la l�nia �s correcta, aneu a la lli�� 1.1.4. + 5. Ara que la línia és correcta, aneu a la lliçó 1.1.4. NOTA: Mentre aneu fent no tracteu de memoritzar, practiqueu i prou. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.1.4: EDITAR TEXT - INSERIR + Lliçó 1.1.4: EDITAR TEXT - INSERIR ** En mode Normal premeu i per a inserir text. ** - 1. Moveu el cursor avall fins la primera l�nia senyalada amb --->. + 1. Moveu el cursor avall fins la primera línia senyalada amb --->. - 2. Per a fer la primera l�nia igual que la segona poseu el cursor sobre - el primer car�cter POSTERIOR al text que s'ha d'inserir. + 2. Per a fer la primera línia igual que la segona poseu el cursor sobre + el primer caràcter POSTERIOR al text que s'ha d'inserir. 3. Premeu la tecla i i escriviu el text que falta. @@ -107,351 +107,351 @@ NOTA: Mentre aneu fent no tracteu de memoritzar, practiqueu i prou. els passos 2, 3 i 4 fins a corregir la frase. ---> Falten carctrs en aquesta . ----> Falten alguns car�cters en aquesta l�nia. +---> Falten alguns caràcters en aquesta línia. - 5. Quan us trobeu c�modes inserint text aneu al sumari de baix. + 5. Quan us trobeu còmodes inserint text aneu al sumari de baix. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLI�� 1.1 SUMARI + LLIÇÓ 1.1 SUMARI - 1. El cursor es mou amb les fletxes o b� amb les tecles hjkl. + 1. El cursor es mou amb les fletxes o bé amb les tecles hjkl. h (esquerra) j (avall) k (amunt) l (dreta) - 2. Per a entrar al Vim (des de l'int�rpret) escriviu: vim FITXER + 2. Per a entrar al Vim (des de l'intèrpret) escriviu: vim FITXER 3. Per a sortir teclegeu: :q! per a descartar els canvis. - O B� teclegeu: :wq per a desar els canvis. + O BÉ teclegeu: :wq per a desar els canvis. - 4. Per a esborrar el car�cter de sota el cursor en el mode Normal premeu: x + 4. Per a esborrar el caràcter de sota el cursor en el mode Normal premeu: x 5. Per a inserir text on hi ha el cursor, en mode Normal, premeu: i escriviu el text -NOTA: La tecla us porta al mode Normal o cancel�la una ordre que +NOTA: La tecla us porta al mode Normal o cancel·la una ordre que estigui a mitges. -Ara continueu a la lli�� 1.2. +Ara continueu a la lliçó 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.2.1: ORDRES PER ESBORRAR + Lliçó 1.2.1: ORDRES PER ESBORRAR ** Teclegeu dw per a esborrar fins al final d'una paraula. ** 1. Premeu per estar segurs que esteu en mode normal. - 2. Moveu el cursor avall fins a la l�nia senyalada amb --->. + 2. Moveu el cursor avall fins a la línia senyalada amb --->. 3. Moveu el cursor fins al principi de la paraula que s'ha d'esborrar. - 4. Teclegeu dw per a fer desapar�ixer la paraula. + 4. Teclegeu dw per a fer desaparèixer la paraula. -NOTA: Les lletres dw apareixeran a la l�nia de baix de la pantalla mentre - les aneu escrivint. Si us equivoqueu premeu i torneu a comen�ar. +NOTA: Les lletres dw apareixeran a la línia de baix de la pantalla mentre + les aneu escrivint. Si us equivoqueu premeu i torneu a començar. ---> Hi ha algunes paraules divertit que no pertanyen paper a aquesta frase. 5. Repetiu el passos 3 i 4 fins que la frase sigui correcta i continueu - a la lli�� 1.2.2. + a la lliçó 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.2.2: M�S ORDRES PER ESBORRAR + Lliçó 1.2.2: MÉS ORDRES PER ESBORRAR - ** Escriviu d$ per a esborrar fins al final de la l�nia. ** + ** Escriviu d$ per a esborrar fins al final de la línia. ** 1. Premeu per a estar segurs que esteu en el mode Normal. - 2. Moveu el cursor avall fins a la l�nia senyalada amb --->. + 2. Moveu el cursor avall fins a la línia senyalada amb --->. - 3. Moveu el cursor fins al final de la l�nia correcta - (DESPR�S del primer . ). + 3. Moveu el cursor fins al final de la línia correcta + (DESPRÉS del primer . ). - 4. Teclegeu d$ per a esborrar fins al final de la l�nia. + 4. Teclegeu d$ per a esborrar fins al final de la línia. ----> Alg� ha escrit el final d'aquesta l�nia dos cops. l�nia dos cops. +---> Algú ha escrit el final d'aquesta línia dos cops. línia dos cops. - 5. Aneu a la lli�� 1.2.3 per a entendre qu� est� passant. + 5. Aneu a la lliçó 1.2.3 per a entendre què està passant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.2.3: SOBRE ORDRES I OBJECTES + Lliçó 1.2.3: SOBRE ORDRES I OBJECTES - El format de l'ordre d'esborrar d �s el seg�ent: + El format de l'ordre d'esborrar d és el següent: - [nombre] d objecte O B� d [nombre] objecte + [nombre] d objecte O BÉ d [nombre] objecte On: - nombre - �s el nombre de cops que s'ha d'executar (opcional, omissi�=1). - d - �s l'ordre d'esborrar. - objecte - �s la cosa amb la qual operar (llista a baix). + nombre - és el nombre de cops que s'ha d'executar (opcional, omissió=1). + d - és l'ordre d'esborrar. + objecte - és la cosa amb la qual operar (llista a baix). Una petita llista d'objectes: w - des del cursor fins al final de la paraula, incloent l'espai. e - des del cursor fins al final de la paraula, SENSE incloure l'espai. - $ - des del cursor fins al final de la l�nia. + $ - des del cursor fins al final de la línia. -NOTA: Per als aventurers: si teclegeu nom�s l'objecte, en el mode Normal, - sense cap ordre, el cursor es mour� tal com est� descrit a la llista +NOTA: Per als aventurers: si teclegeu només l'objecte, en el mode Normal, + sense cap ordre, el cursor es mourà tal com està descrit a la llista d'objectes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.2.4: UNA EXCEPCI� A 'ORDRE-OBJECTE' + Lliçó 1.2.4: UNA EXCEPCIÓ A 'ORDRE-OBJECTE' - ** Teclegeu dd per a esborrar tota la l�nia. ** + ** Teclegeu dd per a esborrar tota la línia. ** - Com que molt sovint s'han d'eliminar l�nies senceres, els programadors - del Vi van creure que seria m�s convenient teclejar dd per a esborrar - tota la l�nia. + Com que molt sovint s'han d'eliminar línies senceres, els programadors + del Vi van creure que seria més convenient teclejar dd per a esborrar + tota la línia. - 1. Moveu el cursor a la segona l�nia de la frase de baix. - 2. Teclegeu dd per a esborrar la l�nia. - 3. Ara aneu a la quarta l�nia. - 4. Teclegeu 2dd per a esborrar dues l�nies (recordeu nombre-ordre-objecte). + 1. Moveu el cursor a la segona línia de la frase de baix. + 2. Teclegeu dd per a esborrar la línia. + 3. Ara aneu a la quarta línia. + 4. Teclegeu 2dd per a esborrar dues línies (recordeu nombre-ordre-objecte). - 1) Les roses s�n vermelles, - 2) El fang �s divertit, - 3) Les violetes s�n blaves, + 1) Les roses són vermelles, + 2) El fang és divertit, + 3) Les violetes són blaves, 4) Tinc un cotxe, 5) Els rellotges diuen l'hora, - 6) El sucre �s dol�, + 6) El sucre és dolç, 7) Igual que tu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.2.5: L'ORDRE DESFER + Lliçó 1.2.5: L'ORDRE DESFER - ** Premeu u per a desfer els canvis, U per a restaurar tota la l�nia. ** + ** Premeu u per a desfer els canvis, U per a restaurar tota la línia. ** - 1. Moveu el cursor sobre el primer error de l�nia de baix senyalada amb ---> - 2. Premeu x per a esborrar el car�cter no desitjat. - 3. Ara premeu u per a desfer l'�ltima ordre executada. - 4. Aquest cop corregiu tots els errors de la l�nia amb l'ordre x. - 5. Ara premeu U per a restablir la l�nia al seu estat original. + 1. Moveu el cursor sobre el primer error de línia de baix senyalada amb ---> + 2. Premeu x per a esborrar el caràcter no desitjat. + 3. Ara premeu u per a desfer l'última ordre executada. + 4. Aquest cop corregiu tots els errors de la línia amb l'ordre x. + 5. Ara premeu U per a restablir la línia al seu estat original. 6. Ara premeu u uns quants cops per a desfer U i les ordres anteriors. 7. Ara premeu CONTROL-R (les dues tecles al mateix temps) uns quants cops per a refer les ordres. ----> Correegiu els errors d'aqquesta l�nia i dessfeu-los aamb desfer. +---> Correegiu els errors d'aqquesta línia i dessfeu-los aamb desfer. - 8. Aquestes ordres s�n molt �tils. Ara aneu al sumari de la lli�� 1.2. + 8. Aquestes ordres són molt útils. Ara aneu al sumari de la lliçó 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLI�� 1.2 SUMARI + LLIÇÓ 1.2 SUMARI 1. Per a esborrar del cursor al final de la paraula teclegeu: dw - 2. Per a esborrar del cursor al final de la l�nia teclegeu: d$ + 2. Per a esborrar del cursor al final de la línia teclegeu: d$ - 3. Per a esborrar una l�nia sencera teclegeu: dd + 3. Per a esborrar una línia sencera teclegeu: dd - 4. El format de qualsevol ordre del mode Normal �s: + 4. El format de qualsevol ordre del mode Normal és: - [nombre] ordre objecte O B� ordre [nombre] objecte + [nombre] ordre objecte O BÉ ordre [nombre] objecte on: - nombre - �s quants cops repetir l'ordre - ordre - �s qu� fer, com ara d per esborrar - objecte - �s amb qu� s'ha d'actuar, com ara w (paraula), - $ (fins a final de l�nia), etc. + nombre - és quants cops repetir l'ordre + ordre - és què fer, com ara d per esborrar + objecte - és amb què s'ha d'actuar, com ara w (paraula), + $ (fins a final de línia), etc. 5. Per a desfer les accions anteriors premeu: u - Per a desfer tots el canvis en una l�nia premeu: U + Per a desfer tots el canvis en una línia premeu: U Per a desfer l'ordre desfer premeu: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.3.1: L'ORDRE 'POSAR' + Lliçó 1.3.1: L'ORDRE 'POSAR' - ** Premeu p per a inserir l'�ltima cosa que heu esborrat - despr�s del cursor. ** + ** Premeu p per a inserir l'última cosa que heu esborrat + després del cursor. ** - 1. Moveu el cursor a la primera l�nia de llista de baix. + 1. Moveu el cursor a la primera línia de llista de baix. - 2. Teclegeu dd per a esborrar la l�nia i desar-la a la mem�ria. + 2. Teclegeu dd per a esborrar la línia i desar-la a la memòria. - 3. Moveu el cursor a la l�nia ANTERIOR d'on hauria d'anar. + 3. Moveu el cursor a la línia ANTERIOR d'on hauria d'anar. - 4. En mode Normal, premeu p per a inserir la l�nia. + 4. En mode Normal, premeu p per a inserir la línia. - 5. Repetiu els passos 2, 3 i 4 per a ordenar les l�nies correctament. + 5. Repetiu els passos 2, 3 i 4 per a ordenar les línies correctament. d) Pots aprendre tu? - b) Les violetes s�n blaves, - c) La intel�lig�ncia s'apr�n, - a) Les roses s�n vermelles, + b) Les violetes són blaves, + c) La intel·ligència s'aprèn, + a) Les roses són vermelles, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.3.2: L'ORDRE SUBSTITUIR + Lliçó 1.3.2: L'ORDRE SUBSTITUIR - ** Premeu r i un car�cter per a substituir el car�cter + ** Premeu r i un caràcter per a substituir el caràcter de sota el cursor. ** - 1. Moveu el cursor a la primera l�nia de sota senyalada amb --->. + 1. Moveu el cursor a la primera línia de sota senyalada amb --->. - 2. Moveu el cursor a sobre del primer car�cter equivocat. + 2. Moveu el cursor a sobre del primer caràcter equivocat. - 3. Premeu r i tot seguit el car�cter correcte per a corregir l'error. + 3. Premeu r i tot seguit el caràcter correcte per a corregir l'error. - 4. Repetiu els passos 2 i 3 fins que la l�nia sigui correcta. + 4. Repetiu els passos 2 i 3 fins que la línia sigui correcta. ----> Quen van escroure aquerta l�nia, algh va pr�mer tikles equivocades! ----> Quan van escriure aquesta l�nia, alg� va pr�mer tecles equivocades! +---> Quen van escroure aquerta línia, algh va prémer tikles equivocades! +---> Quan van escriure aquesta línia, algú va prémer tecles equivocades! - 5. Ara continueu a la lli�� 1.3.2. + 5. Ara continueu a la lliçó 1.3.2. NOTA: Recordeu que heu de practicar, no memoritzar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.3.3: L'ORDRE CANVIAR + Lliçó 1.3.3: L'ORDRE CANVIAR ** Per a canviar una part o tota la paraula, escriviu cw . ** - 1. Moveu el cursor a la primera l�nia de sota senyalada amb --->. + 1. Moveu el cursor a la primera línia de sota senyalada amb --->. 2. Poseu el cursor sobre la u de 'lughc'. - 3. Teclegeu cw i corregiu la paraula (en aquest cas, escrivint '�nia'.) + 3. Teclegeu cw i corregiu la paraula (en aquest cas, escrivint 'ínia'.) - 4. Premeu i aneu al seg�ent error. + 4. Premeu i aneu al següent error. 5. Repetiu els passos 3 i 4 fins que les dues frases siguin iguals. ----> Aquesta lughc t� algunes paradskl que s'han de cdddf. ----> Aquesta l�nia t� algunes paraules que s'han de canviar. +---> Aquesta lughc té algunes paradskl que s'han de cdddf. +---> Aquesta línia té algunes paraules que s'han de canviar. -Noteu que cw no nom�s canvia la paraula, tamb� us posa en mode d'inserci�. +Noteu que cw no només canvia la paraula, també us posa en mode d'inserció. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.3.4: M�S CANVIS AMB c + Lliçó 1.3.4: MÉS CANVIS AMB c ** L'ordre canviar s'usa amb els mateixos objectes que l'ordre esborrar. ** - 1. L'ordre canviar funciona igual que la d'esborrar. El format �s: + 1. L'ordre canviar funciona igual que la d'esborrar. El format és: - [nombre] c objecte O B� c [nombre] objecte + [nombre] c objecte O BÉ c [nombre] objecte - 2. Els objectes s�n els mateixos, w (paraula), $ (final de l�nia), etc. + 2. Els objectes són els mateixos, w (paraula), $ (final de línia), etc. - 3. Moveu el cursor fins la primera l�nia senyalada amb --->. + 3. Moveu el cursor fins la primera línia senyalada amb --->. 4. Avanceu fins al primer error. - 5. Premeu c$ per fer la l�nia igual que la segona i premeu . + 5. Premeu c$ per fer la línia igual que la segona i premeu . ----> El final d'aquesta l�nia necessita canvis per ser igual que la segona. ----> El final d'aquesta l�nia s'ha de corregir amb l'ordre c$. +---> El final d'aquesta línia necessita canvis per ser igual que la segona. +---> El final d'aquesta línia s'ha de corregir amb l'ordre c$. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLI�� 1.3 SUMARI + LLIÇÓ 1.3 SUMARI - 1. Per a tornar a posar el text que heu esborrat, premeu p . Aix� posa - el text esborrat DESPR�S del cursor (si heu esborrat una l�nia anir� - a parar a la l�nia SEG�ENT d'on hi ha el cursor). + 1. Per a tornar a posar el text que heu esborrat, premeu p . Això posa + el text esborrat DESPRÉS del cursor (si heu esborrat una línia anirà + a parar a la línia SEGÜENT d'on hi ha el cursor). - 2. Per a substituir el car�cter de sota el cursor, premeu r i tot - seguit el car�cter que ha de reempla�ar l'original. + 2. Per a substituir el caràcter de sota el cursor, premeu r i tot + seguit el caràcter que ha de reemplaçar l'original. 3. L'ordre canviar permet canviar l'objecte especificat, des del cursor fins el final de l'objecte. Per exemple, cw canvia el que hi ha des del cursor fins al final de la paraula, i c$ fins al final de - l�nia. + línia. - 4. El format de l'ordre canviar �s: + 4. El format de l'ordre canviar és: - [nombre] c objecte O B� c [nombre] objecte + [nombre] c objecte O BÉ c [nombre] objecte -Ara aneu a la seg�ent lli��. +Ara aneu a la següent lliçó. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.4.1: SITUACI� I ESTAT DEL FITXER + Lliçó 1.4.1: SITUACIÓ I ESTAT DEL FITXER - ** Premeu CTRL-g per a veure la situaci� dins del fitxer i el seu estat. - Premeu SHIFT-g per a anar a una l�nia determinada. ** + ** Premeu CTRL-g per a veure la situació dins del fitxer i el seu estat. + Premeu SHIFT-g per a anar a una línia determinada. ** - Nota: No proveu res fins que hagueu llegit TOTA la lli��!! + Nota: No proveu res fins que hagueu llegit TOTA la lliçó!! 1. Mantingueu premuda la tecla Control i premeu g . A la part de baix - de la p�gina apareixer� un l�nia amb el nom del fitxer i la l�nia en - la qual us trobeu. Recordeu el n�mero de la l�nia pel Pas 3. + de la pàgina apareixerà un línia amb el nom del fitxer i la línia en + la qual us trobeu. Recordeu el número de la línia pel Pas 3. 2. Premeu Shift-g per a anar al final de tot del fitxer. - 3. Teclegeu el n�mero de la l�nia on �reu i despr�s premeu Shift-g. Aix� - us tornar� a la l�nia on �reu quan heu premut per primer cop Ctrl-g. - (Quan teclegeu el n�mero NO es veur� a la pantalla.) + 3. Teclegeu el número de la línia on éreu i després premeu Shift-g. Això + us tornarà a la línia on éreu quan heu premut per primer cop Ctrl-g. + (Quan teclegeu el número NO es veurà a la pantalla.) 4. Ara executeu els passos de l'1 al 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.4.2: L'ORDRE CERCAR + Lliçó 1.4.2: L'ORDRE CERCAR ** Premeu / seguit de la frase que vulgueu cercar. ** - 1. En el mode Normal premeu el car�cter / . Noteu que el cursor apareix + 1. En el mode Normal premeu el caràcter / . Noteu que el cursor apareix a la part de baix de la pantalla igual que amb l'ordre : . - 2. Ara escriviu 'errroor' . Aquesta �s la paraula que voleu + 2. Ara escriviu 'errroor' . Aquesta és la paraula que voleu cercar. 3. Per a tornar a cercar la mateixa frase, premeu n . Per a cercar la - mateixa frase en direcci� contraria, premeu Shift-n . + mateixa frase en direcció contraria, premeu Shift-n . - 4. Si voleu cercar una frase en direcci� ascendent, useu l'ordre ? en + 4. Si voleu cercar una frase en direcció ascendent, useu l'ordre ? en lloc de /. ----> "errroor" no �s com s'escriu error; errroor �s un error. +---> "errroor" no és com s'escriu error; errroor és un error. -Nota: Quan la cerca arribi al final del fitxer continuar� a l'inici. +Nota: Quan la cerca arribi al final del fitxer continuarà a l'inici. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.4.3: CERCA DE PAR�NTESIS + Lliçó 1.4.3: CERCA DE PARÈNTESIS ** Premeu % per cercar el ), ], o } corresponent. ** - 1. Poseu el cursor a qualsevol (, [, o { de la l�nia senyalada amb --->. + 1. Poseu el cursor a qualsevol (, [, o { de la línia senyalada amb --->. - 2. Ara premeu el car�cter % . + 2. Ara premeu el caràcter % . - 3. El cursor hauria d'anar a la clau o par�ntesis corresponent. + 3. El cursor hauria d'anar a la clau o parèntesis corresponent. - 4. Premeu % per a tornar el cursor al primer par�ntesi. + 4. Premeu % per a tornar el cursor al primer parèntesi. ----> Aix� ( �s una l�nia amb car�cters (, [ ] i { } de prova. )) +---> Això ( és una línia amb caràcters (, [ ] i { } de prova. )) -Nota: Aix� �s molt �til per a trobar errors en programes inform�tics! +Nota: Això és molt útil per a trobar errors en programes informàtics! @@ -459,68 +459,68 @@ Nota: Aix ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.4.4: UNA MANERA DE CORREGIR ERRORS + Lliçó 1.4.4: UNA MANERA DE CORREGIR ERRORS ** Escriviu :s/vell/nou/g per a substituir 'vell' per 'nou'. ** - 1. Moveu el cursor a la l�nia de sota senyalada amb --->. + 1. Moveu el cursor a la línia de sota senyalada amb --->. - 2. Escriviu :s/laa/la . Aquesta ordre nom�s canvia la primera - coincid�ncia que es trobi a la l�nia. + 2. Escriviu :s/laa/la . Aquesta ordre només canvia la primera + coincidència que es trobi a la línia. - 3. Ara escriviu :s/laa/la/g per a fer una substituci� global. Aix� - canviar� totes les coincid�ncies que es trobin a la l�nia. + 3. Ara escriviu :s/laa/la/g per a fer una substitució global. Això + canviarà totes les coincidències que es trobin a la línia. ----> laa millor �poca per a veure laa flor �s laa primavera. +---> laa millor època per a veure laa flor és laa primavera. - 4. Per a canviar totes les coincid�ncies d'una cadena entre dues l�nies, - escriviu :#,#s/vell/nou/g on #,# s�n els nombres de les l�nies. + 4. Per a canviar totes les coincidències d'una cadena entre dues línies, + escriviu :#,#s/vell/nou/g on #,# són els nombres de les línies. Escriviu :%s/vell/nou/g per a substituir la cadena a tot el fitxer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLI�� 1.4 SUMARI + LLIÇÓ 1.4 SUMARI - 1. Ctrl-g mostra la posici� dins del fitxer i l'estat del mateix. - Shift-g us porta al final del fitxer. Un n�mero seguit de Shift-g us - porta a la l�nia corresponent. + 1. Ctrl-g mostra la posició dins del fitxer i l'estat del mateix. + Shift-g us porta al final del fitxer. Un número seguit de Shift-g us + porta a la línia corresponent. 2. L'ordre / seguida d'una frase cerca la frase cap ENDAVANT. L'ordre ? seguida d'una frase cerca la frase cap ENDARRERE. - Despr�s d'una cerca premeu n per a trobar la pr�xima coincid�ncia en - la mateixa direcci�, o Shift-n per a cercar en la direcci� contr�ria. + Després d'una cerca premeu n per a trobar la pròxima coincidència en + la mateixa direcció, o Shift-n per a cercar en la direcció contrària. 3. L'ordre % quan el cursor es troba en un (, ), [, ], {, o } troba la parella corresponent. - 4. Per a substituir el primer 'vell' per 'nou' en una l�nia :s/vell/nou - Per a substituir tots els 'vell' per 'nou' en una l�nia :s/vell/nou/g - Per a substituir frases entre les l�nies # i # :#,#s/vell/nou/g - Per a substituir totes les coincid�ncies en el fitxer :%s/vell/nou/g - Per a demanar confirmaci� cada cop afegiu 'c' :%s/vell/nou/gc + 4. Per a substituir el primer 'vell' per 'nou' en una línia :s/vell/nou + Per a substituir tots els 'vell' per 'nou' en una línia :s/vell/nou/g + Per a substituir frases entre les línies # i # :#,#s/vell/nou/g + Per a substituir totes les coincidències en el fitxer :%s/vell/nou/g + Per a demanar confirmació cada cop afegiu 'c' :%s/vell/nou/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.5.1: COM EXECUTAR UNA ORDRE EXTERNA + Lliçó 1.5.1: COM EXECUTAR UNA ORDRE EXTERNA ** Teclegeu :! seguit d'una ordre externa per a executar-la. ** - 1. Premeu el familiar : per a col�locar el cursor a la part de baix de - la pantalla. Aix� us permet entrar una ordre. + 1. Premeu el familiar : per a col·locar el cursor a la part de baix de + la pantalla. Això us permet entrar una ordre. - 2. Ara teclegeu el car�cter ! (signe d'exclamaci�). Aix� us permet - executar qualsevol ordre de l'int�rpret del sistema. + 2. Ara teclegeu el caràcter ! (signe d'exclamació). Això us permet + executar qualsevol ordre de l'intèrpret del sistema. - 3. Per exemple, escriviu ls i tot seguit premeu . Aix� us - mostrar� el contingut del directori, tal com si estigu�ssiu a la - l�nia d'ordres. Proveu :!dir si ls no funciona. + 3. Per exemple, escriviu ls i tot seguit premeu . Això us + mostrarà el contingut del directori, tal com si estiguéssiu a la + línia d'ordres. Proveu :!dir si ls no funciona. -Nota: D'aquesta manera �s possible executar qualsevol ordre externa. +Nota: D'aquesta manera és possible executar qualsevol ordre externa. Nota: Totes les ordres : s'han d'acabar amb la tecla @@ -528,30 +528,30 @@ Nota: Totes les ordres : s'han d'acabar amb la tecla ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.5.2: M�S SOBRE L'ESCRIPTURA DE FITXERS + Lliçó 1.5.2: MÉS SOBRE L'ESCRIPTURA DE FITXERS ** Per a desar els canvis fets, escriviu :w FITXER. ** - 1. Escriviu :!dir o b� :!ls per a obtenir un llistat del directori. - Ja sabeu que heu de pr�mer despr�s d'aix�. + 1. Escriviu :!dir o bé :!ls per a obtenir un llistat del directori. + Ja sabeu que heu de prémer després d'això. 2. Trieu un nom de fitxer que no existeixi, com ara PROVA. - 3. Ara feu: :w PROVA (on PROVA �s el nom que heu triat.) + 3. Ara feu: :w PROVA (on PROVA és el nom que heu triat.) - 4. Aix� desa el text en un fitxer amb el nom de PROVA. Per a comprovar-ho + 4. Això desa el text en un fitxer amb el nom de PROVA. Per a comprovar-ho escriviu :!dir i mireu el contingut del directori. Note: Si sortiu del Vim i entreu una altra vegada amb el fitxer PROVA, el - fitxer ser� una c�pia exacta del tutor que heu desat. + fitxer serà una còpia exacta del tutor que heu desat. 5. Ara esborreu el fitxer teclejant (MS-DOS): :!del PROVA - o b� (Unix): :!rm PROVA + o bé (Unix): :!rm PROVA ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.5.3: UNA ORDRE SELECTIVA PER A DESAR + Lliçó 1.5.3: UNA ORDRE SELECTIVA PER A DESAR ** Per a desar una part del fitxer, escriviu :#,# w FITXER ** @@ -559,60 +559,60 @@ Note: Si sortiu del Vim i entreu una altra vegada amb el fitxer PROVA, el 1. Un altre cop, feu :!dir o :!ls per a obtenir un llistat del directori i trieu un nom de fitxer adequat com ara PROVA. - 2. Moveu el cursor a dalt de tot de la p�gina i premeu Ctrl-g per - saber el n�mero de la l�nia. RECORDEU AQUEST N�MERO! + 2. Moveu el cursor a dalt de tot de la pàgina i premeu Ctrl-g per + saber el número de la línia. RECORDEU AQUEST NÚMERO! - 3. Ara aneu a baix de tot de la p�gina i torneu a pr�mer Ctrl-g. - RECORDEU AQUEST N�MERO TAMB�! + 3. Ara aneu a baix de tot de la pàgina i torneu a prémer Ctrl-g. + RECORDEU AQUEST NÚMERO TAMBÉ! - 4. Per a desar NOM�S una secci� en un fitxer, escriviu :#,# w PROVA on - #,# s�n els dos n�meros que heu recordat (dalt, baix) i PROVA el nom + 4. Per a desar NOMÉS una secció en un fitxer, escriviu :#,# w PROVA on + #,# són els dos números que heu recordat (dalt, baix) i PROVA el nom del fitxer. - 5. Comproveu que el fitxer nou hi sigui amb :!dir per� no l'esborreu. + 5. Comproveu que el fitxer nou hi sigui amb :!dir però no l'esborreu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.5.4: OBTENIR I AJUNTAR FITXERS + Lliçó 1.5.4: OBTENIR I AJUNTAR FITXERS ** Per a inserir el contingut d'un fitxer, feu :r FITXER ** - 1. Assegureu-vos, amb l'ordre :!dir , que el fitxer PROVA encara hi �s. + 1. Assegureu-vos, amb l'ordre :!dir , que el fitxer PROVA encara hi és. - 2. Situeu el cursor a dalt de tot d'aquesta p�gina. + 2. Situeu el cursor a dalt de tot d'aquesta pàgina. -NOTA: Despr�s d'executar el Pas 3 veureu la lli�� 1.5.3. Tireu cap avall - fins a aquesta lli�� un altre cop. +NOTA: Després d'executar el Pas 3 veureu la lliçó 1.5.3. Tireu cap avall + fins a aquesta lliçó un altre cop. - 3. Ara obtingueu el fitxer PROVA amb l'ordre :r PROVA on PROVA �s el + 3. Ara obtingueu el fitxer PROVA amb l'ordre :r PROVA on PROVA és el nom del fitxer. NOTA: El fitxer que obtingueu s'insereix en el lloc on hi hagi el cursor. 4. Per a comprovar que s'ha obtingut el fitxer tireu enrere i mireu com - ara hi ha dues c�pies de la lli�� 1.5.3, l'original i la del fitxer. + ara hi ha dues còpies de la lliçó 1.5.3, l'original i la del fitxer. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLI�� 1.5 SUMARI + LLIÇÓ 1.5 SUMARI 1. :!ordre executa una ordre externa. - Alguns exemples �tils: + Alguns exemples útils: (MS-DOS) (Unix) :!dir :!ls - mostra un llistat del directori :!del FITXER :!rm FITXER - esborra el fitxer FITXER 2. :w FITXER escriu el fitxer editat al disc dur, amb el nom FITXER. - 3. :#,#w FITXER desa les l�nies de # a # en el fitxer FITXER. + 3. :#,#w FITXER desa les línies de # a # en el fitxer FITXER. 4. :r FITXER llegeix el fitxer FITXER del disc dur i l'insereix en el - fitxer editat a la posici� on hi ha el cursor. + fitxer editat a la posició on hi ha el cursor. @@ -620,111 +620,111 @@ NOTA: El fitxer que obtingueu s'insereix en el lloc on hi hagi el cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.6.1: L'ORDRE OBRIR + Lliçó 1.6.1: L'ORDRE OBRIR - ** Premeu o per a obrir una l�nia i entrar en mode inserci�. ** + ** Premeu o per a obrir una línia i entrar en mode inserció. ** - 1. Moveu el cursor a la l�nia de sota senyalada amb --->. + 1. Moveu el cursor a la línia de sota senyalada amb --->. - 2. Premeu o (min�scula) per a obrir una l�nia a BAIX del cursor i - situar-vos en mode d'inserci�. + 2. Premeu o (minúscula) per a obrir una línia a BAIX del cursor i + situar-vos en mode d'inserció. - 3. Copieu la l�nia senyalada amb ---> i premeu per a tornar al mode + 3. Copieu la línia senyalada amb ---> i premeu per a tornar al mode normal. ----> Despr�s de pr�mer o el cursor se situa a la l�nia nova en mode inserci�. +---> Després de prémer o el cursor se situa a la línia nova en mode inserció. - 4. Per a obrir una l�nia a SOBRE del cursor, premeu la O maj�scula, en lloc - de la min�scula. Proveu-ho amb la l�nia de sota. -Obriu una l�nia sobre aquesta prement Shift-o amb el cursor en aquesta l�nia. + 4. Per a obrir una línia a SOBRE del cursor, premeu la O majúscula, en lloc + de la minúscula. Proveu-ho amb la línia de sota. +Obriu una línia sobre aquesta prement Shift-o amb el cursor en aquesta línia. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.6.2: L'ORDRE AFEGIR + Lliçó 1.6.2: L'ORDRE AFEGIR - ** Premeu a per a afegir text DESPR�S del cursor. ** + ** Premeu a per a afegir text DESPRÉS del cursor. ** - 1. Moveu el cursor al final de la primera l�nia de sota senyalada + 1. Moveu el cursor al final de la primera línia de sota senyalada amb ---> prement $ en el mode Normal. - 2. Premeu la lletra a (min�scula) per a afegir text DESPR�S del car�cter - sota el cursor. (La A maj�scula afegeix text al final de la l�nia.) + 2. Premeu la lletra a (minúscula) per a afegir text DESPRÉS del caràcter + sota el cursor. (La A majúscula afegeix text al final de la línia.) -Nota: Aix� s'evita haver de pr�mer i , l'�ltim car�cter, el text a inserir, - la tecla , cursor a la dreta, i finalment x , nom�s per afegir - text a final de l�nia. +Nota: Així s'evita haver de prémer i , l'últim caràcter, el text a inserir, + la tecla , cursor a la dreta, i finalment x , només per afegir + text a final de línia. - 3. Ara completeu la primera l�nia. Tingueu en compte que aquesta ordre - �s exactament igual que la d'inserir, excepte pel que fa al lloc on + 3. Ara completeu la primera línia. Tingueu en compte que aquesta ordre + és exactament igual que la d'inserir, excepte pel que fa al lloc on s'insereix el text. ----> Aquesta l�nia us permetr� practicar ----> Aquesta l�nia us permetr� practicar afegir text a final de l�nia. +---> Aquesta línia us permetrà practicar +---> Aquesta línia us permetrà practicar afegir text a final de línia. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.6.3: UNA ALTRA MANERA DE SUBSTITUIR + Lliçó 1.6.3: UNA ALTRA MANERA DE SUBSTITUIR - ** Teclegeu una R maj�scula per a substituir m�s d'un car�cter. ** + ** Teclegeu una R majúscula per a substituir més d'un caràcter. ** - 1. Moveu el cursor a la l�nia de sota senyalada amb --->. + 1. Moveu el cursor a la línia de sota senyalada amb --->. - 2. Poseu el cursor al principi de la primera paraula que �s diferent - respecte a la segona l�nia senyalada amb ---> (la paraula "l'�ltima"). + 2. Poseu el cursor al principi de la primera paraula que és diferent + respecte a la segona línia senyalada amb ---> (la paraula "l'última"). - 3. Ara premeu R i substitu�u el que queda de text a la primera l�nia + 3. Ara premeu R i substituïu el que queda de text a la primera línia escrivint sobre el text vell, per a fer-la igual que la segona. ----> Per a fer aquesta l�nia igual que l'�ltima useu les tecles. ----> Per a fer aquesta l�nia igual que la segona, premeu R i el text nou. +---> Per a fer aquesta línia igual que l'última useu les tecles. +---> Per a fer aquesta línia igual que la segona, premeu R i el text nou. - 4. Tingueu en compte que en pr�mer per a sortir, el text que no - s'hagi alterat es mant�. + 4. Tingueu en compte que en prémer per a sortir, el text que no + s'hagi alterat es manté. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lli�� 1.6.4: ESTABLIR OPCIONS + Lliçó 1.6.4: ESTABLIR OPCIONS - ** Feu que les ordres cercar o substituir ignorin les difer�ncies - entre maj�scules i min�scules ** + ** Feu que les ordres cercar o substituir ignorin les diferències + entre majúscules i minúscules ** 1. Cerqueu la paraula 'ignorar' amb: /ignorar Repetiu-ho uns quants cops amb la tecla n. - 2. Establiu l'opci� 'ic' (ignore case) escrivint: + 2. Establiu l'opció 'ic' (ignore case) escrivint: :set ic 3. Ara cerqueu 'ignorar' un altre cop amb la tecla n. - Repetiu-ho uns quants cops m�s. + Repetiu-ho uns quants cops més. 4. Establiu les opcions 'hlsearch' i 'incsearch': :set hls is - 5. Ara torneu a executar una ordre de cerca, i mireu qu� passa: + 5. Ara torneu a executar una ordre de cerca, i mireu què passa: /ignorar 6. Per a treure el ressaltat dels resultats, feu: :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLI�� 1.6 SUMARI + LLIÇÓ 1.6 SUMARI - 1. L'ordre o obre una l�nia a SOTA la del cursor i mou el cursor a la nova - l�nia, en mode Inserci�. - La O maj�scula obre la l�nia a SOBRE la que hi ha el cursor. + 1. L'ordre o obre una línia a SOTA la del cursor i mou el cursor a la nova + línia, en mode Inserció. + La O majúscula obre la línia a SOBRE la que hi ha el cursor. - 2. Premeu una a per a afegir text DESPR�S del car�cter a sota del cursor. - La A maj�scula afegeix autom�ticament el text a final de l�nia. + 2. Premeu una a per a afegir text DESPRÉS del caràcter a sota del cursor. + La A majúscula afegeix automàticament el text a final de línia. - 3. L'ordre R maj�scula us posa en mode substituci� fins que premeu . + 3. L'ordre R majúscula us posa en mode substitució fins que premeu . - 4. Escriviu ":set xxx" per a establir l'opci� "xxx" + 4. Escriviu ":set xxx" per a establir l'opció "xxx" @@ -735,12 +735,12 @@ Nota: Aix ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLI�� 1.7: ORDRES D'AJUDA + LLIÇÓ 1.7: ORDRES D'AJUDA ** Utilitzeu el sistema intern d'ajuda ** - El Vim t� un extens sistema d'ajuda. Per a llegir una introducci� proveu una + El Vim té un extens sistema d'ajuda. Per a llegir una introducció proveu una d'aquestes tres coses: - premeu la tecla (si la teniu) - premeu la tecla (si la teniu) @@ -748,8 +748,8 @@ Nota: Aix Teclegeu :q per a tancar la finestra d'ajuda. - Podeu trobar ajuda sobre pr�cticament qualsevol tema passant un argument - a l'ordre ":help". Proveu el seg�ent (no oblideu pr�mer ): + Podeu trobar ajuda sobre pràcticament qualsevol tema passant un argument + a l'ordre ":help". Proveu el següent (no oblideu prémer ): :help w :help c_ La l és a la dreta i mou el cursor cap a la dreta. - j La j sembla una fletxa cap avall. - v - 1. Moveu el cursor per la pantalla fins que us sentiu confortables. - - 2. Mantingueu premuda la tecla avall (j) una estona. ----> Ara ja sabeu com moure-us fins a la següent lliçó. - - 3. Usant la tecla avall, aneu a la lliçó 1.1.2. - -Nota: Si no esteu segurs de la tecla que heu premut, premeu per a - tornar al mode Normal. Llavors torneu a teclejar l'ordre que volíeu. - -Nota: Les tecles de moviment del cursor (fletxes) també funcionen. Però - usant hjkl anireu més ràpid un cop us hi hagueu acostumant. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.1.2: ENTRAR I SORTIR DEL VIM - - - !! NOTA: Abans de seguir els passos següents llegiu *tota* la lliçó!! - - 1. Premeu (per a estar segurs que esteu en el mode Normal). - - 2. Teclegeu: :q! . - ----> Amb això sortireu de l'editor SENSE desar els canvis que hagueu pogut - fer. Si voleu desar els canvis teclegeu: - :wq - - 3. Quan vegeu l'introductor de l'intèrpret escriviu l'ordre amb la - qual heu arribat a aquest tutor. Podria ser: vimtutor - O bé: vim tutor - ----> 'vim' és l'editor vim, i 'tutor' és el fitxer que voleu editar. - - 4. Si heu memoritzat les ordres, feu els passos anteriors, de l'1 al 3, - per a sortir i tornar a entrar a l'editor. Llavors moveu el cursor - avall fins a la lliçó 1.1.3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.1.3: EDITAR TEXT - ESBORRAR - - - ** En mode Normal premeu x per a esborrar el caràcter sota el cursor. ** - - 1. Moveu el cursor fins a la línia que hi ha més avall senyalada amb --->. - - 2. Poseu el cursor a sobre el caràcter que cal esborrar per a corregir - els errors. - - 3. Premeu la tecla x per a esborrar el caràcter. - - 4. Repetiu els passos 2 i 3 fins que la frase sigui correcta. - ----> Unna vaaca vva salttar perr sobbree la llluna. - - 5. Ara que la línia és correcta, aneu a la lliçó 1.1.4. - -NOTA: Mentre aneu fent no tracteu de memoritzar, practiqueu i prou. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.1.4: EDITAR TEXT - INSERIR - - - ** En mode Normal premeu i per a inserir text. ** - - 1. Moveu el cursor avall fins la primera línia senyalada amb --->. - - 2. Per a fer la primera línia igual que la segona poseu el cursor sobre - el primer caràcter POSTERIOR al text que s'ha d'inserir. - - 3. Premeu la tecla i i escriviu el text que falta. - - 4. Quan hageu acabat premeu per tornar al mode Normal. Repetiu - els passos 2, 3 i 4 fins a corregir la frase. - ----> Falten carctrs en aquesta . ----> Falten alguns caràcters en aquesta línia. - - 5. Quan us trobeu còmodes inserint text aneu al sumari de baix. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 1.1 SUMARI - - - 1. El cursor es mou amb les fletxes o bé amb les tecles hjkl. - h (esquerra) j (avall) k (amunt) l (dreta) - - 2. Per a entrar al Vim (des de l'intèrpret) escriviu: vim FITXER - - 3. Per a sortir teclegeu: :q! per a descartar els canvis. - O BÉ teclegeu: :wq per a desar els canvis. - - 4. Per a esborrar el caràcter de sota el cursor en el mode Normal premeu: x - - 5. Per a inserir text on hi ha el cursor, en mode Normal, premeu: - i escriviu el text - -NOTA: La tecla us porta al mode Normal o cancel·la una ordre que - estigui a mitges. - -Ara continueu a la lliçó 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.2.1: ORDRES PER ESBORRAR - - - ** Teclegeu dw per a esborrar fins al final d'una paraula. ** - - 1. Premeu per estar segurs que esteu en mode normal. - - 2. Moveu el cursor avall fins a la línia senyalada amb --->. - - 3. Moveu el cursor fins al principi de la paraula que s'ha d'esborrar. - - 4. Teclegeu dw per a fer desaparèixer la paraula. - -NOTA: Les lletres dw apareixeran a la línia de baix de la pantalla mentre - les aneu escrivint. Si us equivoqueu premeu i torneu a començar. - ----> Hi ha algunes paraules divertit que no pertanyen paper a aquesta frase. - - 5. Repetiu el passos 3 i 4 fins que la frase sigui correcta i continueu - a la lliçó 1.2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.2.2: MÉS ORDRES PER ESBORRAR - - - ** Escriviu d$ per a esborrar fins al final de la línia. ** - - 1. Premeu per a estar segurs que esteu en el mode Normal. - - 2. Moveu el cursor avall fins a la línia senyalada amb --->. - - 3. Moveu el cursor fins al final de la línia correcta - (DESPRÉS del primer . ). - - 4. Teclegeu d$ per a esborrar fins al final de la línia. - ----> Algú ha escrit el final d'aquesta línia dos cops. línia dos cops. - - 5. Aneu a la lliçó 1.2.3 per a entendre què està passant. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.2.3: SOBRE ORDRES I OBJECTES - - - El format de l'ordre d'esborrar d és el següent: - - [nombre] d objecte O BÉ d [nombre] objecte - On: - nombre - és el nombre de cops que s'ha d'executar (opcional, omissió=1). - d - és l'ordre d'esborrar. - objecte - és la cosa amb la qual operar (llista a baix). - - Una petita llista d'objectes: - w - des del cursor fins al final de la paraula, incloent l'espai. - e - des del cursor fins al final de la paraula, SENSE incloure l'espai. - $ - des del cursor fins al final de la línia. - -NOTA: Per als aventurers: si teclegeu només l'objecte, en el mode Normal, - sense cap ordre, el cursor es mourà tal com està descrit a la llista - d'objectes. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.2.4: UNA EXCEPCIÓ A 'ORDRE-OBJECTE' - - - ** Teclegeu dd per a esborrar tota la línia. ** - - Com que molt sovint s'han d'eliminar línies senceres, els programadors - del Vi van creure que seria més convenient teclejar dd per a esborrar - tota la línia. - - 1. Moveu el cursor a la segona línia de la frase de baix. - 2. Teclegeu dd per a esborrar la línia. - 3. Ara aneu a la quarta línia. - 4. Teclegeu 2dd per a esborrar dues línies (recordeu nombre-ordre-objecte). - - 1) Les roses són vermelles, - 2) El fang és divertit, - 3) Les violetes són blaves, - 4) Tinc un cotxe, - 5) Els rellotges diuen l'hora, - 6) El sucre és dolç, - 7) Igual que tu. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.2.5: L'ORDRE DESFER - - - ** Premeu u per a desfer els canvis, U per a restaurar tota la línia. ** - - 1. Moveu el cursor sobre el primer error de línia de baix senyalada amb ---> - 2. Premeu x per a esborrar el caràcter no desitjat. - 3. Ara premeu u per a desfer l'última ordre executada. - 4. Aquest cop corregiu tots els errors de la línia amb l'ordre x. - 5. Ara premeu U per a restablir la línia al seu estat original. - 6. Ara premeu u uns quants cops per a desfer U i les ordres anteriors. - 7. Ara premeu CONTROL-R (les dues tecles al mateix temps) uns quants cops - per a refer les ordres. - ----> Correegiu els errors d'aqquesta línia i dessfeu-los aamb desfer. - - 8. Aquestes ordres són molt útils. Ara aneu al sumari de la lliçó 1.2. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 1.2 SUMARI - - - 1. Per a esborrar del cursor al final de la paraula teclegeu: dw - - 2. Per a esborrar del cursor al final de la línia teclegeu: d$ - - 3. Per a esborrar una línia sencera teclegeu: dd - - 4. El format de qualsevol ordre del mode Normal és: - - [nombre] ordre objecte O BÉ ordre [nombre] objecte - on: - nombre - és quants cops repetir l'ordre - ordre - és què fer, com ara d per esborrar - objecte - és amb què s'ha d'actuar, com ara w (paraula), - $ (fins a final de línia), etc. - - 5. Per a desfer les accions anteriors premeu: u - Per a desfer tots el canvis en una línia premeu: U - Per a desfer l'ordre desfer premeu: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.3.1: L'ORDRE 'POSAR' - - - ** Premeu p per a inserir l'última cosa que heu esborrat - després del cursor. ** - - - 1. Moveu el cursor a la primera línia de llista de baix. - - 2. Teclegeu dd per a esborrar la línia i desar-la a la memòria. - - 3. Moveu el cursor a la línia ANTERIOR d'on hauria d'anar. - - 4. En mode Normal, premeu p per a inserir la línia. - - 5. Repetiu els passos 2, 3 i 4 per a ordenar les línies correctament. - - d) Pots aprendre tu? - b) Les violetes són blaves, - c) La intel·ligència s'aprèn, - a) Les roses són vermelles, - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.3.2: L'ORDRE SUBSTITUIR - - - ** Premeu r i un caràcter per a substituir el caràcter - de sota el cursor. ** - - 1. Moveu el cursor a la primera línia de sota senyalada amb --->. - - 2. Moveu el cursor a sobre del primer caràcter equivocat. - - 3. Premeu r i tot seguit el caràcter correcte per a corregir l'error. - - 4. Repetiu els passos 2 i 3 fins que la línia sigui correcta. - ----> Quen van escroure aquerta línia, algh va prémer tikles equivocades! ----> Quan van escriure aquesta línia, algú va prémer tecles equivocades! - - 5. Ara continueu a la lliçó 1.3.2. - -NOTA: Recordeu que heu de practicar, no memoritzar. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.3.3: L'ORDRE CANVIAR - - - ** Per a canviar una part o tota la paraula, escriviu cw . ** - - 1. Moveu el cursor a la primera línia de sota senyalada amb --->. - - 2. Poseu el cursor sobre la u de 'lughc'. - - 3. Teclegeu cw i corregiu la paraula (en aquest cas, escrivint 'ínia'.) - - 4. Premeu i aneu al següent error. - - 5. Repetiu els passos 3 i 4 fins que les dues frases siguin iguals. - ----> Aquesta lughc té algunes paradskl que s'han de cdddf. ----> Aquesta línia té algunes paraules que s'han de canviar. - -Noteu que cw no només canvia la paraula, també us posa en mode d'inserció. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.3.4: MÉS CANVIS AMB c - - - ** L'ordre canviar s'usa amb els mateixos objectes que l'ordre esborrar. ** - - 1. L'ordre canviar funciona igual que la d'esborrar. El format és: - - [nombre] c objecte O BÉ c [nombre] objecte - - 2. Els objectes són els mateixos, w (paraula), $ (final de línia), etc. - - 3. Moveu el cursor fins la primera línia senyalada amb --->. - - 4. Avanceu fins al primer error. - - 5. Premeu c$ per fer la línia igual que la segona i premeu . - ----> El final d'aquesta línia necessita canvis per ser igual que la segona. ----> El final d'aquesta línia s'ha de corregir amb l'ordre c$. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 1.3 SUMARI - - - 1. Per a tornar a posar el text que heu esborrat, premeu p . Això posa - el text esborrat DESPRÉS del cursor (si heu esborrat una línia anirà - a parar a la línia SEGÜENT d'on hi ha el cursor). - - 2. Per a substituir el caràcter de sota el cursor, premeu r i tot - seguit el caràcter que ha de reemplaçar l'original. - - 3. L'ordre canviar permet canviar l'objecte especificat, des del cursor - fins el final de l'objecte. Per exemple, cw canvia el que hi ha des - del cursor fins al final de la paraula, i c$ fins al final de - línia. - - 4. El format de l'ordre canviar és: - - [nombre] c objecte O BÉ c [nombre] objecte - -Ara aneu a la següent lliçó. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.4.1: SITUACIÓ I ESTAT DEL FITXER - - - ** Premeu CTRL-g per a veure la situació dins del fitxer i el seu estat. - Premeu SHIFT-g per a anar a una línia determinada. ** - - Nota: No proveu res fins que hagueu llegit TOTA la lliçó!! - - 1. Mantingueu premuda la tecla Control i premeu g . A la part de baix - de la pàgina apareixerà un línia amb el nom del fitxer i la línia en - la qual us trobeu. Recordeu el número de la línia pel Pas 3. - - 2. Premeu Shift-g per a anar al final de tot del fitxer. - - 3. Teclegeu el número de la línia on éreu i després premeu Shift-g. Això - us tornarà a la línia on éreu quan heu premut per primer cop Ctrl-g. - (Quan teclegeu el número NO es veurà a la pantalla.) - - 4. Ara executeu els passos de l'1 al 3. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.4.2: L'ORDRE CERCAR - - - ** Premeu / seguit de la frase que vulgueu cercar. ** - - 1. En el mode Normal premeu el caràcter / . Noteu que el cursor apareix - a la part de baix de la pantalla igual que amb l'ordre : . - - 2. Ara escriviu 'errroor' . Aquesta és la paraula que voleu - cercar. - - 3. Per a tornar a cercar la mateixa frase, premeu n . Per a cercar la - mateixa frase en direcció contraria, premeu Shift-n . - - 4. Si voleu cercar una frase en direcció ascendent, useu l'ordre ? en - lloc de /. - ----> "errroor" no és com s'escriu error; errroor és un error. - -Nota: Quan la cerca arribi al final del fitxer continuarà a l'inici. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.4.3: CERCA DE PARÈNTESIS - - - ** Premeu % per cercar el ), ], o } corresponent. ** - - 1. Poseu el cursor a qualsevol (, [, o { de la línia senyalada amb --->. - - 2. Ara premeu el caràcter % . - - 3. El cursor hauria d'anar a la clau o parèntesis corresponent. - - 4. Premeu % per a tornar el cursor al primer parèntesi. - ----> Això ( és una línia amb caràcters (, [ ] i { } de prova. )) - -Nota: Això és molt útil per a trobar errors en programes informàtics! - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.4.4: UNA MANERA DE CORREGIR ERRORS - - - ** Escriviu :s/vell/nou/g per a substituir 'vell' per 'nou'. ** - - 1. Moveu el cursor a la línia de sota senyalada amb --->. - - 2. Escriviu :s/laa/la . Aquesta ordre només canvia la primera - coincidència que es trobi a la línia. - - 3. Ara escriviu :s/laa/la/g per a fer una substitució global. Això - canviarà totes les coincidències que es trobin a la línia. - ----> laa millor època per a veure laa flor és laa primavera. - - 4. Per a canviar totes les coincidències d'una cadena entre dues línies, - escriviu :#,#s/vell/nou/g on #,# són els nombres de les línies. - Escriviu :%s/vell/nou/g per a substituir la cadena a tot el fitxer. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 1.4 SUMARI - - - 1. Ctrl-g mostra la posició dins del fitxer i l'estat del mateix. - Shift-g us porta al final del fitxer. Un número seguit de Shift-g us - porta a la línia corresponent. - - 2. L'ordre / seguida d'una frase cerca la frase cap ENDAVANT. - L'ordre ? seguida d'una frase cerca la frase cap ENDARRERE. - Després d'una cerca premeu n per a trobar la pròxima coincidència en - la mateixa direcció, o Shift-n per a cercar en la direcció contrària. - - 3. L'ordre % quan el cursor es troba en un (, ), [, ], {, o } troba la - parella corresponent. - - 4. Per a substituir el primer 'vell' per 'nou' en una línia :s/vell/nou - Per a substituir tots els 'vell' per 'nou' en una línia :s/vell/nou/g - Per a substituir frases entre les línies # i # :#,#s/vell/nou/g - Per a substituir totes les coincidències en el fitxer :%s/vell/nou/g - Per a demanar confirmació cada cop afegiu 'c' :%s/vell/nou/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.5.1: COM EXECUTAR UNA ORDRE EXTERNA - - - ** Teclegeu :! seguit d'una ordre externa per a executar-la. ** - - 1. Premeu el familiar : per a col·locar el cursor a la part de baix de - la pantalla. Això us permet entrar una ordre. - - 2. Ara teclegeu el caràcter ! (signe d'exclamació). Això us permet - executar qualsevol ordre de l'intèrpret del sistema. - - 3. Per exemple, escriviu ls i tot seguit premeu . Això us - mostrarà el contingut del directori, tal com si estiguéssiu a la - línia d'ordres. Proveu :!dir si ls no funciona. - -Nota: D'aquesta manera és possible executar qualsevol ordre externa. - -Nota: Totes les ordres : s'han d'acabar amb la tecla - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.5.2: MÉS SOBRE L'ESCRIPTURA DE FITXERS - - - ** Per a desar els canvis fets, escriviu :w FITXER. ** - - 1. Escriviu :!dir o bé :!ls per a obtenir un llistat del directori. - Ja sabeu que heu de prémer després d'això. - - 2. Trieu un nom de fitxer que no existeixi, com ara PROVA. - - 3. Ara feu: :w PROVA (on PROVA és el nom que heu triat.) - - 4. Això desa el text en un fitxer amb el nom de PROVA. Per a comprovar-ho - escriviu :!dir i mireu el contingut del directori. - -Note: Si sortiu del Vim i entreu una altra vegada amb el fitxer PROVA, el - fitxer serà una còpia exacta del tutor que heu desat. - - 5. Ara esborreu el fitxer teclejant (MS-DOS): :!del PROVA - o bé (Unix): :!rm PROVA - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.5.3: UNA ORDRE SELECTIVA PER A DESAR - - - ** Per a desar una part del fitxer, escriviu :#,# w FITXER ** - - 1. Un altre cop, feu :!dir o :!ls per a obtenir un llistat del - directori i trieu un nom de fitxer adequat com ara PROVA. - - 2. Moveu el cursor a dalt de tot de la pàgina i premeu Ctrl-g per - saber el número de la línia. RECORDEU AQUEST NÚMERO! - - 3. Ara aneu a baix de tot de la pàgina i torneu a prémer Ctrl-g. - RECORDEU AQUEST NÚMERO TAMBÉ! - - 4. Per a desar NOMÉS una secció en un fitxer, escriviu :#,# w PROVA on - #,# són els dos números que heu recordat (dalt, baix) i PROVA el nom - del fitxer. - - 5. Comproveu que el fitxer nou hi sigui amb :!dir però no l'esborreu. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.5.4: OBTENIR I AJUNTAR FITXERS - - - ** Per a inserir el contingut d'un fitxer, feu :r FITXER ** - - 1. Assegureu-vos, amb l'ordre :!dir , que el fitxer PROVA encara hi és. - - 2. Situeu el cursor a dalt de tot d'aquesta pàgina. - -NOTA: Després d'executar el Pas 3 veureu la lliçó 1.5.3. Tireu cap avall - fins a aquesta lliçó un altre cop. - - 3. Ara obtingueu el fitxer PROVA amb l'ordre :r PROVA on PROVA és el - nom del fitxer. - -NOTA: El fitxer que obtingueu s'insereix en el lloc on hi hagi el cursor. - - 4. Per a comprovar que s'ha obtingut el fitxer tireu enrere i mireu com - ara hi ha dues còpies de la lliçó 1.5.3, l'original i la del fitxer. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 1.5 SUMARI - - - 1. :!ordre executa una ordre externa. - - Alguns exemples útils: - (MS-DOS) (Unix) - :!dir :!ls - mostra un llistat del directori - :!del FITXER :!rm FITXER - esborra el fitxer FITXER - - 2. :w FITXER escriu el fitxer editat al disc dur, amb el nom FITXER. - - 3. :#,#w FITXER desa les línies de # a # en el fitxer FITXER. - - 4. :r FITXER llegeix el fitxer FITXER del disc dur i l'insereix en el - fitxer editat a la posició on hi ha el cursor. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.6.1: L'ORDRE OBRIR - - - ** Premeu o per a obrir una línia i entrar en mode inserció. ** - - 1. Moveu el cursor a la línia de sota senyalada amb --->. - - 2. Premeu o (minúscula) per a obrir una línia a BAIX del cursor i - situar-vos en mode d'inserció. - - 3. Copieu la línia senyalada amb ---> i premeu per a tornar al mode - normal. - ----> Després de prémer o el cursor se situa a la línia nova en mode inserció. - - 4. Per a obrir una línia a SOBRE del cursor, premeu la O majúscula, en lloc - de la minúscula. Proveu-ho amb la línia de sota. -Obriu una línia sobre aquesta prement Shift-o amb el cursor en aquesta línia. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.6.2: L'ORDRE AFEGIR - - - ** Premeu a per a afegir text DESPRÉS del cursor. ** - - 1. Moveu el cursor al final de la primera línia de sota senyalada - amb ---> prement $ en el mode Normal. - - 2. Premeu la lletra a (minúscula) per a afegir text DESPRÉS del caràcter - sota el cursor. (La A majúscula afegeix text al final de la línia.) - -Nota: Així s'evita haver de prémer i , l'últim caràcter, el text a inserir, - la tecla , cursor a la dreta, i finalment x , només per afegir - text a final de línia. - - 3. Ara completeu la primera línia. Tingueu en compte que aquesta ordre - és exactament igual que la d'inserir, excepte pel que fa al lloc on - s'insereix el text. - ----> Aquesta línia us permetrà practicar ----> Aquesta línia us permetrà practicar afegir text a final de línia. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.6.3: UNA ALTRA MANERA DE SUBSTITUIR - - - ** Teclegeu una R majúscula per a substituir més d'un caràcter. ** - - 1. Moveu el cursor a la línia de sota senyalada amb --->. - - 2. Poseu el cursor al principi de la primera paraula que és diferent - respecte a la segona línia senyalada amb ---> (la paraula "l'última"). - - 3. Ara premeu R i substituïu el que queda de text a la primera línia - escrivint sobre el text vell, per a fer-la igual que la segona. - ----> Per a fer aquesta línia igual que l'última useu les tecles. ----> Per a fer aquesta línia igual que la segona, premeu R i el text nou. - - 4. Tingueu en compte que en prémer per a sortir, el text que no - s'hagi alterat es manté. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lliçó 1.6.4: ESTABLIR OPCIONS - - ** Feu que les ordres cercar o substituir ignorin les diferències - entre majúscules i minúscules ** - - 1. Cerqueu la paraula 'ignorar' amb: /ignorar - Repetiu-ho uns quants cops amb la tecla n. - - 2. Establiu l'opció 'ic' (ignore case) escrivint: - :set ic - - 3. Ara cerqueu 'ignorar' un altre cop amb la tecla n. - Repetiu-ho uns quants cops més. - - 4. Establiu les opcions 'hlsearch' i 'incsearch': - :set hls is - - 5. Ara torneu a executar una ordre de cerca, i mireu què passa: - /ignorar - - 6. Per a treure el ressaltat dels resultats, feu: - :nohlsearch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 1.6 SUMARI - - - 1. L'ordre o obre una línia a SOTA la del cursor i mou el cursor a la nova - línia, en mode Inserció. - La O majúscula obre la línia a SOBRE la que hi ha el cursor. - - 2. Premeu una a per a afegir text DESPRÉS del caràcter a sota del cursor. - La A majúscula afegeix automàticament el text a final de línia. - - 3. L'ordre R majúscula us posa en mode substitució fins que premeu . - - 4. Escriviu ":set xxx" per a establir l'opció "xxx" - - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LLIÇÓ 1.7: ORDRES D'AJUDA - - - ** Utilitzeu el sistema intern d'ajuda ** - - El Vim té un extens sistema d'ajuda. Per a llegir una introducció proveu una - d'aquestes tres coses: - - premeu la tecla (si la teniu) - - premeu la tecla (si la teniu) - - escriviu :help - - Teclegeu :q per a tancar la finestra d'ajuda. - - Podeu trobar ajuda sobre pràcticament qualsevol tema passant un argument - a l'ordre ":help". Proveu el següent (no oblideu prémer ): - - :help w - :help c_ Kl�vesa l je vpravo a vykon� pohyb vpravo. - j Kl�vesa j vypad� na �ipku dolu. + k Funkce: Klávesa h je vlevo a vykoná pohyb vlevo. + < h l > Klávesa l je vpravo a vykoná pohyb vpravo. + j Klávesa j vypadá na šipku dolu. v - 1. Pohybuj kurzorem po obrazovce dokud si na to nezvykne�. + 1. Pohybuj kurzorem po obrazovce dokud si na to nezvykneš. - 2. Dr� kl�vesu pro pohyb dolu (j), dokud se jej� funkce nezopakuje. ----> Te� v�� jak se p�esunout na n�sleduj�c� lekci. + 2. Drž klávesu pro pohyb dolu (j), dokud se její funkce nezopakuje. +---> Teď víš jak se přesunout na následující lekci. - 3. Pou�it�m kl�vesy dolu p�ejdi na lekci 1.1.2. + 3. Použitím klávesy dolu přejdi na lekci 1.1.2. -Pozn�mka: Pokud si n�kdy nejsi jist n���m, co jsi napsal, stla� pro - p�echod do Norm�ln�ho m�du. Pot� p�epi� po�adovan� p��kaz. +Poznámka: Pokud si někdy nejsi jist něčím, co jsi napsal, stlač pro + přechod do Normálního módu. Poté přepiš požadovaný příkaz. -Pozn�mka: Kurzorov� kl�vesy tak� funguj�, av�ak pou��v�n� hjkl je rychlej�� - jakmile si na n�j zvykne�. +Poznámka: Kurzorové klávesy také fungují, avšak používání hjkl je rychlejší + jakmile si na něj zvykneš. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.2: SPU�T�N� A UKON�EN� VIM + Lekce 1.1.2: SPUŠTĚNÍ A UKONČENÍ VIM - !! POZN�MKA: P�ed vykon�n�m t�chto krok� si p�e�ti celou lekci!! + !! POZNÁMKA: Před vykonáním těchto kroků si přečti celou lekci!! - 1. Stla� (pro uji�t�n�, �e se nach�z�� v Norm�ln�m m�du). + 1. Stlač (pro ujištění, že se nacházíš v Normálním módu). - 2. Napi�: :q! . + 2. Napiš: :q! . ----> T�mto ukon��� editor BEZ ulo�en� zm�n, kter� si vykonal. - Pokud chce� ulo�it zm�ny a ukon�it editor napi�: +---> Tímto ukončíš editor BEZ uložení změn, které si vykonal. + Pokud chceš uložit změny a ukončit editor napiš: :wq - 3. A� se dostane� na p��kazov� ��dek, napi� p��kaz, kter�m se dostane� zp�t - do t�to v�uky. To m��e b�t: vimtutor - B�n� se pou��v�: vim tutor + 3. Až se dostaneš na příkazový řádek, napiš příkaz, kterým se dostaneš zpět + do této výuky. To může být: vimtutor + Běžně se používá: vim tutor ----> 'vim' znamen� spu�t�n� editoru, 'tutor' je soubor k editaci. +---> 'vim' znamená spuštění editoru, 'tutor' je soubor k editaci. - 4. Pokud si tyto kroky spolehliv� pamatuje�, vykonej kroky 1 a� 3, ��m� - ukon��� a znovu spust�� editor. Potom p�esu� kurzor dolu na lekci 1.1.3. + 4. Pokud si tyto kroky spolehlivě pamatuješ, vykonej kroky 1 až 3, čímž + ukončíš a znovu spustíš editor. Potom přesuň kurzor dolu na lekci 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.3: �PRAVA TEXTU - MAZ�N� + Lekce 1.1.3: ÚPRAVA TEXTU - MAZÁNÍ - ** Stisknut�m kl�vesy x v Norm�ln�m m�du sma�e� znak na m�st� kurzoru. ** + ** Stisknutím klávesy x v Normálním módu smažeš znak na místě kurzoru. ** - 1. P�esu� kurzor n��e na ��dek ozna�en� --->. + 1. Přesuň kurzor níže na řádek označený --->. - 2. K odstran�n� chyb p�ejdi kurzorem na znak, kter� chce� smazat. + 2. K odstranění chyb přejdi kurzorem na znak, který chceš smazat. - 3. Stla� kl�vesu x k odstran�n� necht�n�ch znak�. + 3. Stlač klávesu x k odstranění nechtěných znaků. - 4. Opakuj kroky 2 a� 4 dokud nen� v�ta spr�vn�. + 4. Opakuj kroky 2 až 4 dokud není věta správně. ----> Kr��va sko��illa p�ess m�ss�c. +---> Krááva skoččilla přess měssíc. - 5. Pokud je v�ta spr�vn�, p�ejdi na lekci 1.1.4. + 5. Pokud je věta správně, přejdi na lekci 1.1.4. -POZN�MKA: Nesna� se pouze zapamatovat p�edv�d�n� p��kazy, u� se je pou��v�n�m. +POZNÁMKA: Nesnaž se pouze zapamatovat předváděné příkazy, uč se je používáním. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.4: �PRAVA TEXTU - VKL�D�N� + Lekce 1.1.4: ÚPRAVA TEXTU - VKLÁDÁNÍ - ** Stla�en� kl�vesy i v Norm�ln�m m�du umo��uje vkl�d�n� textu. ** + ** Stlačení klávesy i v Normálním módu umožňuje vkládání textu. ** - 1. P�esu� kurzor na prvn� ��dek ozna�en� --->. + 1. Přesuň kurzor na první řádek označený --->. - 2. Pro upraven� prvn�ho ��dku do podoby ��dku druh�ho, p�esu� kurzor na - prvn� znak za m�sto, kde m� b�t text vlo�en�. + 2. Pro upravení prvního řádku do podoby řádku druhého, přesuň kurzor na + první znak za místo, kde má být text vložený. - 3. Stla� i a napi� pot�ebn� dodatek. + 3. Stlač i a napiš potřebný dodatek. - 4. Po opraven� ka�d� chyby stla� pro n�vrat do Norm�ln�ho m�du. - Opakuj kroky 2 a� 4 dokud nen� v�ta spr�vn�. + 4. Po opravení každé chyby stlač pro návrat do Normálního módu. + Opakuj kroky 2 až 4 dokud není věta správně. ----> N�jak� txt na t�to . ----> N�jak� text chyb� na t�to ��dce. +---> Nějaký txt na této . +---> Nějaký text chybí na této řádce. - 5. Pokud ji� ovl�d� vkl�d�n� textu, p�ejdi na n�sleduj�c� shrnut�. + 5. Pokud již ovládáš vkládání textu, přejdi na následující shrnutí. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.1 + SHRNUTÍ LEKCE 1.1 - 1. Kurzorem se pohybuje pomoc� �ipek nebo kl�vesami hjkl. + 1. Kurzorem se pohybuje pomocí šipek nebo klávesami hjkl. h (vlevo) j (dolu) k (nahoru) l (vpravo) - 2. Pro spu�t�n� Vimu (z p��kazov�ho ��dku) napi�: vim SOUBOR + 2. Pro spuštění Vimu (z příkazového řádku) napiš: vim SOUBOR - 3. Pro ukon�en� Vimu napi�: :q! bez ulo�en� zm�n. - anebo: :wq pro ulo�en� zm�n. + 3. Pro ukončení Vimu napiš: :q! bez uložení změn. + anebo: :wq pro uložení změn. - 4. Pro smaz�n� znaku pod kurzorem napi� v Norm�ln�m m�du: x + 4. Pro smazání znaku pod kurzorem napiš v Normálním módu: x - 5. Pro vkl�d�n� textu od m�sta kurzoru napi� v Norm�ln�m m�du: - i vkl�dan� text + 5. Pro vkládání textu od místa kurzoru napiš v Normálním módu: + i vkládaný text -POZN�MKA: Stla�en� t� p�em�st� do Norm�ln�ho m�du nebo zru�� necht�n� - a ��ste�n� dokon�en� p��kaz. +POZNÁMKA: Stlačení tě přemístí do Normálního módu nebo zruší nechtěný + a částečně dokončený příkaz. -Nyn� pokra�uj Lekc� 2. +Nyní pokračuj Lekcí 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.1: P��KAZY MAZ�N� + Lekce 1.2.1: PŘÍKAZY MAZÁNÍ - ** P��kaz dw sma�e znaky do konce slova. ** + ** Příkaz dw smaže znaky do konce slova. ** - 1. Stla� k ubezpe�en�, �e jsi v Norm�ln�m m�du. + 1. Stlač k ubezpečení, že jsi v Normálním módu. - 2. P�esu� kurzor n��e na ��dek ozna�en� --->. + 2. Přesuň kurzor níže na řádek označený --->. - 3. P�esu� kurzor na za��tek slova, kter� je pot�eba smazat. + 3. Přesuň kurzor na začátek slova, které je potřeba smazat. - 4. Napi� dw , aby slovo zmizelo. + 4. Napiš dw , aby slovo zmizelo. -POZN�MKA: P�smena dw se zobraz� na posledn�m ��dku obrazovky jakmile je - nap��e�. Kdy� nap��e� n�co �patn�, stla� a za�ni znova. +POZNÁMKA: Písmena dw se zobrazí na posledním řádku obrazovky jakmile je + napíšeš. Když napíšeš něco špatně, stlač a začni znova. ----> Jsou tu n�jak� slova z�bava, kter� nepat�� list do t�to v�ty. +---> Jsou tu nějaká slova zábava, která nepatří list do této věty. - 5. Opakuj kroky 3 a� 4 dokud nen� v�ta spr�vn� a p�ejdi na lekci 1.2.2. + 5. Opakuj kroky 3 až 4 dokud není věta správně a přejdi na lekci 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.2: V�CE P��KAZ� MAZ�N� + Lekce 1.2.2: VÍCE PŘÍKAZŮ MAZÁNÍ - ** Naps�n� p��kazu d$ sma�e v�e a� do konce ��dky. ** + ** Napsání příkazu d$ smaže vše až do konce řádky. ** - 1. Stla� k ubezpe�en�, �e jsi v Norm�ln�m m�du. + 1. Stlač k ubezpečení, že jsi v Normálním módu. - 2. P�esu� kurzor n��e na ��dek ozna�en� --->. + 2. Přesuň kurzor níže na řádek označený --->. - 3. P�esu� kurzor na konec spr�vn� v�ty (ZA prvn� te�ku). + 3. Přesuň kurzor na konec správné věty (ZA první tečku). - 4. Napi� d$ ,aby jsi smazal znaky a� do konce ��dku. + 4. Napiš d$ ,aby jsi smazal znaky až do konce řádku. ----> N�kdo napsal konec t�to v�ty dvakr�t. konec t�to v�ty dvakr�t. +---> Někdo napsal konec této věty dvakrát. konec této věty dvakrát. - 5. P�ejdi na lekci 1.2.3 pro pochopen� toho, co se stalo. + 5. Přejdi na lekci 1.2.3 pro pochopení toho, co se stalo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.3: ROZ�I�OVAC� P��KAZY A OBJEKTY + Lekce 1.2.3: ROZŠIŘOVACÍ PŘÍKAZY A OBJEKTY - Form�t mazac�ho p��kazu d je n�sleduj�c�: + Formát mazacího příkazu d je následující: - [��slo] d objekt NEBO d [��slo] objekt + [číslo] d objekt NEBO d [číslo] objekt Kde: - ��slo - ud�v� kolikr�t se p��kaz vykon� (voliteln�, v�choz�=1). - d - je p��kaz maz�n�. - objekt - ud�v� na �em se p��kaz vykon�v� (vypsan� n��e). + číslo - udává kolikrát se příkaz vykoná (volitelné, výchozí=1). + d - je příkaz mazání. + objekt - udává na čem se příkaz vykonává (vypsané níže). - Kr�tk� v�pis objekt�: - w - od kurzoru do konce slova, v�etn� mezer. + Krátký výpis objektů: + w - od kurzoru do konce slova, včetně mezer. e - od kurzoru do konce slova, BEZ mezer. - $ - od kurzoru do konce ��dku. + $ - od kurzoru do konce řádku. -POZN�MKA: Stla�en�m kl�vesy objektu v Norm�ln�m m�du se kurzor p�esune na - m�sto up�esn�n� ve v�pisu objekt�. +POZNÁMKA: Stlačením klávesy objektu v Normálním módu se kurzor přesune na + místo upřesněné ve výpisu objektů. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.4: V�JIMKA Z 'P��KAZ-OBJEKT' + Lekce 1.2.4: VÝJIMKA Z 'PŘÍKAZ-OBJEKT' - ** Naps�n�m dd sma�e� cel� ��dek. ** + ** Napsáním dd smažeš celý řádek. ** - Vzhledem k �astosti maz�n� cel�ho ��dku se auto�i Vimu rozhodli, �e bude - jednodu�� napsat prost� dv� d k smaz�n� cel�ho ��dku. + Vzhledem k častosti mazání celého řádku se autoři Vimu rozhodli, že bude + jednoduší napsat prostě dvě d k smazání celého řádku. - 1. P�esu� kurzor na druh� ��dek spodn�ho textu. - 2. Napi� dd pro smaz�n� ��dku. - 3. P�ejdi na �tvrt� ��dek. - 4. Napi� 2dd (vzpome� si ��slo-p��kaz-objekt) pro smaz�n� dvou ��dk�. + 1. Přesuň kurzor na druhý řádek spodního textu. + 2. Napiš dd pro smazání řádku. + 3. Přejdi na čtvrtý řádek. + 4. Napiš 2dd (vzpomeň si číslo-příkaz-objekt) pro smazání dvou řádků. - 1) R��e jsou �erven�, - 2) Bl�to je z�bavn�, - 3) Fialky jsou modr�, - 4) M�m auto, - 5) Hodinky ukazuj� �as, - 6) Cukr je sladk�, + 1) Růže jsou červené, + 2) Bláto je zábavné, + 3) Fialky jsou modré, + 4) Mám auto, + 5) Hodinky ukazují čas, + 6) Cukr je sladký, 7) A to jsi i ty. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.5: P��KAZ UNDO + Lekce 1.2.5: PŘÍKAZ UNDO - ** Stla� u pro vr�cen� posledn�ho p��kazu, U pro celou ��dku. ** + ** Stlač u pro vrácení posledního příkazu, U pro celou řádku. ** - 1. P�esu� kurzor n��e na ��dek ozna�en� ---> a p�em�sti ho na prvn� chybu. - 2. Napi� x pro smaz�n� prvn�ho necht�n�ho znaku. - 3. Te� napi� u ��m� vr�t�� zp�t posledn� vykonan� p��kaz. - 4. Nyn� oprav v�echny chyby na ��dku pomoc� p��kazu x . - 5. Napi� velk� U ��m� vr�t�� ��dek do p�vodn�ho stavu. - 6. Te� napi� u n�kolikr�t, ��m� vr�t�� zp�t p��kaz U . - 7. Stla� CTRL-R (kl�vesu CTRL dr� stla�enou a stiskni R) n�kolikr�t, - ��m� vr�t�� zp�t p�edt�m vr�cen� p��kazy (redo). + 1. Přesuň kurzor níže na řádek označený ---> a přemísti ho na první chybu. + 2. Napiš x pro smazání prvního nechtěného znaku. + 3. Teď napiš u čímž vrátíš zpět poslední vykonaný příkaz. + 4. Nyní oprav všechny chyby na řádku pomocí příkazu x . + 5. Napiš velké U čímž vrátíš řádek do původního stavu. + 6. Teď napiš u několikrát, čímž vrátíš zpět příkaz U . + 7. Stlač CTRL-R (klávesu CTRL drž stlačenou a stiskni R) několikrát, + čímž vrátíš zpět předtím vrácené příkazy (redo). ----> Opprav chybby nna toomto ��dku a nahra� je pommoc� undo. +---> Opprav chybby nna toomto řádku a nahraď je pommocí undo. - 8. Toto jsou velmi u�ite�n� p��kazy. Nyn� p�ejdi na souhrn Lekce 1.2. + 8. Toto jsou velmi užitečné příkazy. Nyní přejdi na souhrn Lekce 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.2 + SHRNUTÍ LEKCE 1.2 - 1. Pro smaz�n� znak� od kurzoru do konce slova napi�: dw + 1. Pro smazání znaků od kurzoru do konce slova napiš: dw - 2. Pro smaz�n� znak� od kurzoru do konce ��dku napi�: d$ + 2. Pro smazání znaků od kurzoru do konce řádku napiš: d$ - 3. Pro smaz�n� cel�ho ��dku napi�: dd + 3. Pro smazání celého řádku napiš: dd - 4. Form�t p��kazu v Norm�ln�m m�du je: + 4. Formát příkazu v Normálním módu je: - [��slo] p��kaz objekt NEBO p��kaz [��slo] objekt + [číslo] příkaz objekt NEBO příkaz [číslo] objekt kde: - ��slo - ud�v� po�et opakov�n� p��kazu - p��kaz - ud�v� co je t�eba vykonat, nap��klad d ma�e - objekt - ud�v� rozsah p��kazu, nap��klad w (slovo), - $ (do konce ��dku), atd. + číslo - udává počet opakování příkazu + příkaz - udává co je třeba vykonat, například d maže + objekt - udává rozsah příkazu, například w (slovo), + $ (do konce řádku), atd. - 5. Pro vr�cen� p�ede�l� �innosti, napi�: u (mal� u) - Pro vr�cen� v�ech �prav na ��dku napi�: U (velk� U) - Pro vr�cen� vr�cen�ch �prav (redo) napi�: CTRL-R + 5. Pro vrácení předešlé činnosti, napiš: u (malé u) + Pro vrácení všech úprav na řádku napiš: U (velké U) + Pro vrácení vrácených úprav (redo) napiš: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.1: P��KAZ VLO�IT + Lekce 1.3.1: PŘÍKAZ VLOŽIT - ** P��ka p vlo�� posledn� vymazan� text za kurzor. ** + ** Příka p vloží poslední vymazaný text za kurzor. ** - 1. P�esu� kurzor n��e na posledn� ��dek textu. + 1. Přesuň kurzor níže na poslední řádek textu. - 2. Napi� dd pro smaz�n� ��dku a jeho ulo�en� do bufferu. + 2. Napiš dd pro smazání řádku a jeho uložení do bufferu. - 3. P�esu� kurzor VݩE tam, kam smazan� ��dek pat��. + 3. Přesuň kurzor VÝŠE tam, kam smazaný řádek patří. - 4. V Norm�ln�m m�du napi� p pro op�tn� vlo�en� ��dku. + 4. V Normálním módu napiš p pro opětné vložení řádku. - 5. Opakuj kroky 2 a� 4 dokud ��dky nebudou ve spr�vn�m po�ad�. + 5. Opakuj kroky 2 až 4 dokud řádky nebudou ve správném pořadí. - d) Tak� se dok�e� vzd�l�vat? - b) Fialky jsou modr�, - c) Inteligence se u��, - a) R��e jsou �erven�, + d) Také se dokážeš vzdělávat? + b) Fialky jsou modré, + c) Inteligence se učí, + a) Růže jsou červené, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.2: P��KAZ NAHRAZEN� + Lekce 1.3.2: PŘÍKAZ NAHRAZENÍ - ** Naps�n�m r a znaku se nahrad� znak pod kurzorem. ** + ** Napsáním r a znaku se nahradí znak pod kurzorem. ** - 1. P�esu� kurzor n��e na prvn� ��dek ozna�en� --->. + 1. Přesuň kurzor níže na první řádek označený --->. - 2. P�esu� kurzor na za��tek prvn� chyby. + 2. Přesuň kurzor na začátek první chyby. - 3. Napi� r a potom znak, kter� nahrad� chybu. + 3. Napiš r a potom znak, který nahradí chybu. - 4. Opakuj kroky 2 a� 3 dokud nen� prvn� ��dka spr�vn�. + 4. Opakuj kroky 2 až 3 dokud není první řádka správně. ----> Kdi� byl pz�n tento ��deg, n�kdu stla�il �paqn� kl�vesy! ----> Kdy� byl ps�n tento ��dek, n�kdo stla��l �patn� kl�vesy! +---> Kdiž byl pzán tento řádeg, někdu stlažil špaqné klávesy! +---> Když byl psán tento řádek, někdo stlačíl špatné klávesy! - 5. Nyn� p�ejdi na Lekci 1.3.2. + 5. Nyní přejdi na Lekci 1.3.2. -POZN�MKA: Zapamatuj si, �e by ses m�l u�it pou��v�n�m, ne zapamatov�n�m. +POZNÁMKA: Zapamatuj si, že by ses měl učit používáním, ne zapamatováním. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.3: P��KAZ �PRAVY + Lekce 1.3.3: PŘÍKAZ ÚPRAVY - ** Pokud chce� zm�nit ��st nebo cel� slovo, napi� cw . ** + ** Pokud chceš změnit část nebo celé slovo, napiš cw . ** - 1. P�esu� kurzor n��e na prvn� ��dek ozna�en� --->. + 1. Přesuň kurzor níže na první řádek označený --->. - 2. Um�sti kurzor na p�smeno i v slov� �i�ok. + 2. Umísti kurzor na písmeno i v slově řiťok. - 3. Napi� cw a oprav slovo (v tomto p��pad� napi� '�dek'.) + 3. Napiš cw a oprav slovo (v tomto případě napiš 'ádek'.) - 4. Stla� a p�ejdi na dal�� chybu (prvn� znak, kter� t�eba zm�nit.) + 4. Stlač a přejdi na další chybu (první znak, který třeba změnit.) - 5. Opakuj kroky 3 a� 4 dokud nen� prvn� v�ta stejn� jako ta druh�. + 5. Opakuj kroky 3 až 4 dokud není první věta stejná jako ta druhá. ----> Tento �i�ok m� n�kolik skic, kter� psadoinsa zm�nit pasdgf p��kazu. ----> Tento ��dek m� n�kolik slov, kter� pot�ebuj� zm�nit pomoc� p��kazu. +---> Tento řiťok má několik skic, které psadoinsa změnit pasdgf příkazu. +---> Tento řádek má několik slov, které potřebují změnit pomocí příkazu. -V�imni si, �e cw nejen nahrazuje slovo, ale tak� p�em�st� do vkl�d�n�. +Všimni si, že cw nejen nahrazuje slovo, ale také přemístí do vkládání. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.4: V�CE ZM�N POU�IT�M c + Lekce 1.3.4: VÍCE ZMĚN POUŽITÍM c - ** P��kaz pro �pravu se dru�� se stejn�mi objekty jako ten pro maz�n�. ** + ** Příkaz pro úpravu se druží se stejnými objekty jako ten pro mazání. ** - 1. P��kaz pro �pravu pracuje stejn� jako pro maz�n�. Form�t je: + 1. Příkaz pro úpravu pracuje stejně jako pro mazání. Formát je: - [��slo] c objekt NEBO c [��slo] objekt + [číslo] c objekt NEBO c [číslo] objekt - 2. Objekty jsou tak� shodn�, jako nap�.: w (slovo), $ (konec ��dku), atd. + 2. Objekty jsou také shodné, jako např.: w (slovo), $ (konec řádku), atd. - 3. P�ejdi n��e na prvn� ��dek ozna�en� --->. + 3. Přejdi níže na první řádek označený --->. - 4. P�esu� kurzor na prvn� rozd�l. + 4. Přesuň kurzor na první rozdíl. - 5. Napi� c$ pro upraven� zbytku ��dku podle toho druh�ho a stla� . + 5. Napiš c$ pro upravení zbytku řádku podle toho druhého a stlač . ----> Konec tohoto ��dku pot�ebuje pomoc, aby byl jako ten druh�. ----> Konec tohoto ��dku pot�ebuje opravit pou�it�m p��kazu c$ . +---> Konec tohoto řádku potřebuje pomoc, aby byl jako ten druhý. +---> Konec tohoto řádku potřebuje opravit použitím příkazu c$ . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.3 + SHRNUTÍ LEKCE 1.3 - 1. Pro vlo�en� textu, kter� byl smaz�n, napi� p . To vlo�� smazan� text - ZA kurzor (pokud byl ��dek smazan�, p�ejde na ��dek pod kurzorem). + 1. Pro vložení textu, který byl smazán, napiš p . To vloží smazaný text + ZA kurzor (pokud byl řádek smazaný, přejde na řádek pod kurzorem). - 2. Pro nahrazen� znaku pod kurzorem, napi� r a potom znak, kter�m - chce� p�vodn� znak nahradit. + 2. Pro nahrazení znaku pod kurzorem, napiš r a potom znak, kterým + chceš původní znak nahradit. - 3. P��kaz na upravov�n� umo��uje zm�nit specifikovan� objekt od kurzoru - do konce objektu. Nap��klad: Napi� cw ,��m� zm�n�� text od pozice - kurzoru do konce slova, c$ zm�n� text do konce ��dku. + 3. Příkaz na upravování umožňuje změnit specifikovaný objekt od kurzoru + do konce objektu. Například: Napiš cw ,čímž změníš text od pozice + kurzoru do konce slova, c$ změní text do konce řádku. - 4. Form�t pro nahrazov�n� je: + 4. Formát pro nahrazování je: - [��slo] c objekt NEBO c [��slo] objekt + [číslo] c objekt NEBO c [číslo] objekt -Nyn� p�ejdi na n�sleduj�c� lekci. +Nyní přejdi na následující lekci. @@ -392,225 +392,225 @@ Lekce 1.4.1: POZICE A STATUS SOUBORU - ** Stla� CTRL-g pro zobrazen� sv� pozice v souboru a statusu souboru. - Stla� SHIFT-G pro p�echod na ��dek v souboru. ** + ** Stlač CTRL-g pro zobrazení své pozice v souboru a statusu souboru. + Stlač SHIFT-G pro přechod na řádek v souboru. ** - Pozn�mka: P�e�ti si celou lekci ne� za�ne� vykon�vat kroky!! + Poznámka: Přečti si celou lekci než začneš vykonávat kroky!! - 1. Dr� kl�vesu Ctrl stla�enou a stiskni g . Vespod obrazovky se zobraz� - stavov� ��dek s n�zvem souboru a ��dkou na kter� se nach�z��. Zapamatuj - si ��slo ��dku pro krok 3. + 1. Drž klávesu Ctrl stlačenou a stiskni g . Vespod obrazovky se zobrazí + stavový řádek s názvem souboru a řádkou na které se nacházíš. Zapamatuj + si číslo řádku pro krok 3. - 2. Stla� shift-G pro p�esun na konec souboru. + 2. Stlač shift-G pro přesun na konec souboru. - 3. Napi� ��slo ��dku na kter�m si se nach�zel a stla� shift-G. To t� - vr�t� na ��dek, na kter�m jsi d��ve stiskl Ctrl-g. - (Kdy� p��e� ��sla, tak se NEZOBRAZUJ� na obrazovce.) + 3. Napiš číslo řádku na kterém si se nacházel a stlač shift-G. To tě + vrátí na řádek, na kterém jsi dříve stiskl Ctrl-g. + (Když píšeš čísla, tak se NEZOBRAZUJÍ na obrazovce.) - 4. Pokud se c�t�� schopn� vykonat tyto kroky, vykonej je. + 4. Pokud se cítíš schopný vykonat tyto kroky, vykonej je. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.2: P��KAZ VYHLED�V�N� + Lekce 1.4.2: PŘÍKAZ VYHLEDÁVÁNÍ - ** Napi� / n�sledovan� �et�zcem pro vyhled�n� onoho �et�zce. ** + ** Napiš / následované řetězcem pro vyhledání onoho řetězce. ** - 1. Stiskni / v Norm�ln�m m�du. V�imni si, �e tento znak se spolu s - kurzorem zobraz� v doln� ��sti obrazovky jako p��kaz : . + 1. Stiskni / v Normálním módu. Všimni si, že tento znak se spolu s + kurzorem zobrazí v dolní části obrazovky jako příkaz : . - 2. Nyn� napi� 'chhybba' . To je slovo, kter� chce� vyhledat. + 2. Nyní napiš 'chhybba' . To je slovo, které chceš vyhledat. - 3. Pro vyhled�n� dal��ho v�sledku stejn�ho �et�zce, jednodu�e stla� n . - Pro vyhled�n� dal��ho v�sledku stejn�ho �et�zce opa�n�m sm�rem, stiskni + 3. Pro vyhledání dalšího výsledku stejného řetězce, jednoduše stlač n . + Pro vyhledání dalšího výsledku stejného řetězce opačným směrem, stiskni Shift-N. - 4. Pokud chce� vyhledat �et�zec v opa�n�m sm�ru, pou�ij p��kaz ? m�sto - p��kazu / . + 4. Pokud chceš vyhledat řetězec v opačném směru, použij příkaz ? místo + příkazu / . ----> "chhybba" nen� zp�sob, jak hl�skovat chyba; chhybba je chyba. +---> "chhybba" není způsob, jak hláskovat chyba; chhybba je chyba. -Pozn�mka: Kdy� vyhled�v�n� dos�hne konce souboru, bude pokra�ovat na jeho - za��tku. +Poznámka: Když vyhledávání dosáhne konce souboru, bude pokračovat na jeho + začátku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.3: VYHLED�V�N� P�ROV� Z�VORKY + Lekce 1.4.3: VYHLEDÁVÁNÍ PÁROVÉ ZÁVORKY - ** Napi� % pro nalezen� p�rov� ),], nebo } . ** + ** Napiš % pro nalezení párové ),], nebo } . ** - 1. P�em�sti kurzor na kteroukoli (, [, nebo { v ��dku ozna�en�m --->. + 1. Přemísti kurzor na kteroukoli (, [, nebo { v řádku označeném --->. - 2. Nyn� napi� znak % . + 2. Nyní napiš znak % . - 3. Kurzor se p�em�st� na odpov�daj�c� z�vorku. + 3. Kurzor se přemístí na odpovídající závorku. - 4. Stla� % pro p�esun kurzoru zp�t na otv�raj�c� z�vorku. + 4. Stlač % pro přesun kurzoru zpět na otvírající závorku. ----> Toto ( je testovac� ��dek ('s, ['s ] a {'s } v n�m. )) +---> Toto ( je testovací řádek ('s, ['s ] a {'s } v něm. )) -Pozn�mka: Toto je velmi u�ite�n� p�� lad�n� programu s chyb�j�c�mi - uzav�rac�mi z�vorkami. +Poznámka: Toto je velmi užitečné pří ladění programu s chybějícími + uzavíracími závorkami. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.4: ZP�SOB JAK ZM�NIT CHYBY + Lekce 1.4.4: ZPŮSOB JAK ZMĚNIT CHYBY - ** Napi� :s/star�/nov�/g pro nahrazen� slova 'nov�' za 'star�'. ** + ** Napiš :s/staré/nové/g pro nahrazení slova 'nové' za 'staré'. ** - 1. P�esu� kurzor na ��dek ozna�en� --->. + 1. Přesuň kurzor na řádek označený --->. - 2. Napi� :s/dobr��/dobr� . V�imni si, �e tento p��kaz zm�n� pouze - prvn� v�skyt v ��dku. + 2. Napiš :s/dobréé/dobré . Všimni si, že tento příkaz změní pouze + první výskyt v řádku. - 3. Nyn� napi� :s/dobr��/dobr�/g co� znamen� celkov� nahrazen� v ��dku. - Toto nahrad� v�echny v�skyty v ��dku. + 3. Nyní napiš :s/dobréé/dobré/g což znamená celkové nahrazení v řádku. + Toto nahradí všechny výskyty v řádku. ----> dobr�� suroviny a dobr�� n��in� jsou z�kladem dobr�� kuchyn�. +---> dobréé suroviny a dobréé náčiní jsou základem dobréé kuchyně. - 4. Pro zm�nu v�ech v�skyt� �et�zce mezi dv�ma ��dky, - Napi� :#,#s/star�/nov�/g kde #,# jsou ��sla on�ch ��dek. - Napi� :%s/star�/nov�/g pro zm�nu v�ech v�skyt� v cel�m souboru. + 4. Pro změnu všech výskytů řetězce mezi dvěma řádky, + Napiš :#,#s/staré/nové/g kde #,# jsou čísla oněch řádek. + Napiš :%s/staré/nové/g pro změnu všech výskytů v celém souboru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.4 + SHRNUTÍ LEKCE 1.4 - 1. Ctrl-g vyp��e tvou pozici v souboru a status souboru. - Shift-G t� p�em�st� na konec souboru. ��slo n�sledovan� - Shift-G t� p�esune na dan� ��slo ��dku. + 1. Ctrl-g vypíše tvou pozici v souboru a status souboru. + Shift-G tě přemístí na konec souboru. Číslo následované + Shift-G tě přesune na dané číslo řádku. - 2. Naps�n� / n�sledovan� �et�zcem vyhled� �et�zec sm�rem DOP�EDU. - Naps�n� ? n�sledovan� �et�zcem vyhled� �et�zec sm�rem DOZADU. - Naps�n� n po vyhled�v�n� najde n�sleduj�c� v�skyt �et�zce ve stejn�m - sm�ru, Shift-N ve sm�ru opa�n�m. + 2. Napsání / následované řetězcem vyhledá řetězec směrem DOPŘEDU. + Napsání ? následované řetězcem vyhledá řetězec směrem DOZADU. + Napsání n po vyhledávání najde následující výskyt řetězce ve stejném + směru, Shift-N ve směru opačném. - 3. Stisknut� % kdy� je kurzor na (,),[,],{, nebo } najde odpov�daj�c� - p�rovou z�vorku. + 3. Stisknutí % když je kurzor na (,),[,],{, nebo } najde odpovídající + párovou závorku. - 4. Pro nahrazen� nov�ho za prvn� star� v ��dku napi� :s/star�/nov� - Pro nahrazen� nov�ho za v�echny star� v ��dku napi� :s/star�/nov�/g - Pro nahrazen� �et�zc� mezi dv�mi ��dkami # napi� :#,#s/star�/nov�/g - Pro nahrazen� v�ech v�skyt� v souboru napi� :%s/star�/nov�/g - Pro potvrzen� ka�d�ho nahrazen� p�idej 'c' :%s/star�/nov�/gc + 4. Pro nahrazení nového za první starý v řádku napiš :s/staré/nové + Pro nahrazení nového za všechny staré v řádku napiš :s/staré/nové/g + Pro nahrazení řetězců mezi dvěmi řádkami # napiš :#,#s/staré/nové/g + Pro nahrazení všech výskytů v souboru napiš :%s/staré/nové/g + Pro potvrzení každého nahrazení přidej 'c' :%s/staré/nové/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.1: JAK VYKONAT VN�J�� P��KAZ + Lekce 1.5.1: JAK VYKONAT VNĚJŠÍ PŘÍKAZ - ** Napi� :! n�sledovan� vn�j��m p��kazem pro spu�t�n� p��kazu. ** + ** Napiš :! následované vnějším příkazem pro spuštění příkazu. ** - 1. Napi� obvykl� p��kaz : , kter� um�st� kurzor na spodek obrazovky - To umo�n� napsat p��kaz. + 1. Napiš obvyklý příkaz : , který umístí kurzor na spodek obrazovky + To umožní napsat příkaz. - 2. Nyn� stiskni ! (vyk�i�n�k). To umo�n� vykonat jak�koliv vn�j�� - p��kaz z p��kazov�ho ��dku. + 2. Nyní stiskni ! (vykřičník). To umožní vykonat jakýkoliv vnější + příkaz z příkazového řádku. - 3. Nap��klad napi� ls za ! a stiskni . Tento p��kaz zobraz� - obsah tv�ho adres��e jako v p��kazov�m ��dku. - Vyzkou�ej :!dir pokud ls nefunguje. + 3. Například napiš ls za ! a stiskni . Tento příkaz zobrazí + obsah tvého adresáře jako v příkazovém řádku. + Vyzkoušej :!dir pokud ls nefunguje. -Pozn�mka: Takto je mo�n� vykonat jak�koliv p��kaz. +Poznámka: Takto je možné vykonat jakýkoliv příkaz. -Pozn�mka: V�echny p��kazy : mus� b�t dokon�en� stisknut�m +Poznámka: Všechny příkazy : musí být dokončené stisknutím ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.2: V�CE O UKL�D�N� SOUBOR� + Lekce 1.5.2: VÍCE O UKLÁDÁNÍ SOUBORŮ - ** Pro ulo�en� zm�n v souboru napi� :w SOUBOR. ** + ** Pro uložení změn v souboru napiš :w SOUBOR. ** - 1. Napi� :!dir nebo :!ls pro v�pis aktu�ln�ho adres��e. - U� v��, �e za t�mto mus�� stisknout . + 1. Napiš :!dir nebo :!ls pro výpis aktuálního adresáře. + Už víš, že za tímto musíš stisknout . - 2. Vyber si n�zev souboru, kter� je�t� neexistuje, nap��klad TEST. + 2. Vyber si název souboru, který ještě neexistuje, například TEST. - 3. Nyn� napi�: :w TEST (kde TEST je vybran� n�zev souboru.) + 3. Nyní napiš: :w TEST (kde TEST je vybraný název souboru.) - 4. To ulo�� cel� soubor (V�uka Vimu) pod n�zvem TEST. - Pro ov��en� napi� znovu :!dir , ��m� zobraz�� obsah adres��e. + 4. To uloží celý soubor (Výuka Vimu) pod názvem TEST. + Pro ověření napiš znovu :!dir , čímž zobrazíš obsah adresáře. -Pozn�mka: Jakmile ukon��� Vim a znovu ho spust�� s n�zvem souboru TEST, - soubor bude p�esn� kopie v�uky, kdy� si ji ukl�dal. +Poznámka: Jakmile ukončíš Vim a znovu ho spustíš s názvem souboru TEST, + soubor bude přesná kopie výuky, když si ji ukládal. - 5. Nyn� odstra� soubor naps�n�m (MS-DOS): :!del TEST + 5. Nyní odstraň soubor napsáním (MS-DOS): :!del TEST nebo (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.3: V�B�ROV� P��KAZ ULO�EN� + Lekce 1.5.3: VÝBĚROVÝ PŘÍKAZ ULOŽENÍ - ** Pro ulo�en� ��sti souboru napi� :#,# w SOUBOR ** + ** Pro uložení části souboru napiš :#,# w SOUBOR ** - 1. Je�t� jednou napi� :!dir nebo :!ls pro v�pis aktu�ln�ho adres��e - a vyber vhodn� n�zev souboru jako nap�. TEST. + 1. Ještě jednou napiš :!dir nebo :!ls pro výpis aktuálního adresáře + a vyber vhodný název souboru jako např. TEST. - 2. P�esu� kurzor na vrch t�to str�nky a stiskni Ctrl-g pro zobrazen� - ��sla ��dku. ZAPAMATUJ SI TOTO ��SLO! + 2. Přesuň kurzor na vrch této stránky a stiskni Ctrl-g pro zobrazení + čísla řádku. ZAPAMATUJ SI TOTO ČÍSLO! - 3. Nyn� se p�esu� na spodek t�to str�nky a op�t stiskni Ctrl-g. - ZAPAMATUJ SI I ��SLO TOHOTO ��DKU! + 3. Nyní se přesuň na spodek této stránky a opět stiskni Ctrl-g. + ZAPAMATUJ SI I ČÍSLO TOHOTO ŘÁDKU! - 4. Pro ulo�en� POUZE ��sti souboru, napi� :#,# w TEST kde #,# jsou - ��sla dvou zapamatovan�ch ��dk� (vrch, spodek) a TEST je n�zev souboru. + 4. Pro uložení POUZE části souboru, napiš :#,# w TEST kde #,# jsou + čísla dvou zapamatovaných řádků (vrch, spodek) a TEST je název souboru. - 5. Znova se ujisti, �e tam ten soubor je pomoc� :!dir ale NEODSTRA�UJ ho. + 5. Znova se ujisti, že tam ten soubor je pomocí :!dir ale NEODSTRAŇUJ ho. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.4: SLU�OV�N� SOUBOR� + Lekce 1.5.4: SLUČOVÁNÍ SOUBORŮ - ** K vlo�en� obsahu souboru napi� :r N�ZEV_SOUBORU ** + ** K vložení obsahu souboru napiš :r NÁZEV_SOUBORU ** - 1. Napi� :!dir pro uji�t�n�, �e soubor TEST st�le existuje. + 1. Napiš :!dir pro ujištění, že soubor TEST stále existuje. - 2. P�esu� kurzor na vrch t�to str�nky. + 2. Přesuň kurzor na vrch této stránky. -POZN�MKA: Po vykon�n� kroku 3 uvid�� lekci 1.5.3. Potom se op�t p�esu� dol� +POZNÁMKA: Po vykonání kroku 3 uvidíš lekci 1.5.3. Potom se opět přesuň dolů na tuto lekci. - 3. Nyn� vlo� soubor TEST pou�it�m p��kazu :r TEST kde TEST je n�zev + 3. Nyní vlož soubor TEST použitím příkazu :r TEST kde TEST je název souboru. -POZN�MKA: Soubor, kter� vkl�d� se vlo�� od m�sta, kde se nach�z� kurzor. +POZNÁMKA: Soubor, který vkládáš se vloží od místa, kde se nachází kurzor. - 4. Pro potvrzen� vlo�en� souboru, p�esu� kurzor zp�t a v�imni si, �e te� - m� dv� kopie lekce 1.5.3, origin�l a souborovou verzi. + 4. Pro potvrzení vložení souboru, přesuň kurzor zpět a všimni si, že teď + máš dvě kopie lekce 1.5.3, originál a souborovou verzi. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.5 + SHRNUTÍ LEKCE 1.5 - 1. :!p��kaz vykon� vn�j�� p��kaz. + 1. :!příkaz vykoná vnější příkaz. - N�kter� u�ite�n� p��klady jsou: + Některé užitečné příklady jsou: (MS-DOS) (Unix) - :!dir :!ls - zobraz� obsah souboru. - :!del SOUBOR :!rm SOUBOR - odstran� SOUBOR. + :!dir :!ls - zobrazí obsah souboru. + :!del SOUBOR :!rm SOUBOR - odstraní SOUBOR. - 2. :w SOUBOR ulo�� aktu�ln� text jako SOUBOR na disk. + 2. :w SOUBOR uloží aktuální text jako SOUBOR na disk. - 3. :#,#w SOUBOR ulo�� ��dky od # do # do SOUBORU. + 3. :#,#w SOUBOR uloží řádky od # do # do SOUBORU. - 4. :r SOUBOR vybere z disku SOUBOR a vlo�� ho do editovan�ho souboru + 4. :r SOUBOR vybere z disku SOUBOR a vloží ho do editovaného souboru za pozici kurzoru. @@ -619,112 +619,112 @@ za pozici kurzoru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.1: P��KAZ OTEV��T + Lekce 1.6.1: PŘÍKAZ OTEVŘÍT - ** Napi� o pro vlo�en� ��dku pod kurzor a p�epnut� do Vkl�dac�ho m�du. ** + ** Napiš o pro vložení řádku pod kurzor a přepnutí do Vkládacího módu. ** - 1. P�em�sti kurzor n��e na ��dek ozna�en� --->. + 1. Přemísti kurzor níže na řádek označený --->. - 2. Napi� o (mal�) pro vlo�en� ��dku POD kurzor a p�epnut� do - Vkl�dac�ho m�du. + 2. Napiš o (malé) pro vložení řádku POD kurzor a přepnutí do + Vkládacího módu. - 3. Nyn� zkop�ruj ��dek ozna�en� ---> a stiskni pro ukon�en� - Vkl�dac�ho m�du. + 3. Nyní zkopíruj řádek označený ---> a stiskni pro ukončení + Vkládacího módu. ----> Po stisknut� o se kurzor p�em�st� na vlo�en� ��dek do Vkl�dac�ho - m�du. +---> Po stisknutí o se kurzor přemístí na vložený řádek do Vkládacího + módu. - 4. Pro otev�en� ��dku NAD kurzorem jednodu�e napi� velk� O , m�sto - mal�ho o. Vyzkou�ej si to na n�sleduj�c�m ��dku. -Vlo� ��dek nad t�mto naps�n�m Shift-O po um�st�n� kurzoru na tento ��dek. + 4. Pro otevření řádku NAD kurzorem jednoduše napiš velké O , místo + malého o. Vyzkoušej si to na následujícím řádku. +Vlož řádek nad tímto napsáním Shift-O po umístění kurzoru na tento řádek. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.2: P��KAZ P�IDAT + Lekce 1.6.2: PŘÍKAZ PŘIDAT - ** Stiskni a pro vlo�en� textu ZA kurzor. ** + ** Stiskni a pro vložení textu ZA kurzor. ** - 1. P�esu� kurzor na n��e na konec ��dky ozna�en� ---> - stisknut�m $ v Norm�ln�m m�du. + 1. Přesuň kurzor na níže na konec řádky označené ---> + stisknutím $ v Normálním módu. - 2. Stiskni a (mal�) pro p�id�n� textu ZA znak, kter� je pod kurzorem. - (Velk� A p�id� na konec ��dku.) + 2. Stiskni a (malé) pro přidání textu ZA znak, který je pod kurzorem. + (Velké A přidá na konec řádku.) -Pozn�mka: T�mto se vyhne� stisknut� i , posledn�ho znaku, textu na vlo�en�, - , kurzor doprava, a nakonec x na p�id�v�n� na konec ��dku! +Poznámka: Tímto se vyhneš stisknutí i , posledního znaku, textu na vložení, + , kurzor doprava, a nakonec x na přidávání na konec řádku! - 3. Nyn� dokon�� prvn� ��dek. V�imni si, �e p�id�v�n� je vlastn� stejn� jako - Vkl�dac� m�d, krom� m�sta, kam se text vkl�d�. + 3. Nyní dokončí první řádek. Všimni si, že přidávání je vlastně stejné jako + Vkládací mód, kromě místa, kam se text vkládá. ----> Tento ��dek ti umo��uje nacvi�it ----> Tento ��dek ti umo��uje nacvi�it p�id�v�n� textu na konec ��dky. +---> Tento řádek ti umožňuje nacvičit +---> Tento řádek ti umožňuje nacvičit přidávání textu na konec řádky. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.3: JIN� ZP�SOB NAHRAZOV�N� + Lekce 1.6.3: JINÝ ZPŮSOB NAHRAZOVÁNÍ - ** Napi� velk� R pro nahrazen� v�c ne� jednoho znaku. ** + ** Napiš velké R pro nahrazení víc než jednoho znaku. ** - 1. P�esu� kurzor na prvn� ��dek ozna�en� --->. + 1. Přesuň kurzor na první řádek označený --->. - 2. Um�sti kurzor na za��tek prvn�ho slova, kter� je odli�n� od druh�ho - ��dku ozna�en�ho ---> (slovo 'posledn�'). + 2. Umísti kurzor na začátek prvního slova, které je odlišné od druhého + řádku označeného ---> (slovo 'poslední'). - 3. Nyn� stiskni R a nahra� zbytek textu na prvn�m ��dku p�eps�n�m - star�ho textu tak, aby byl prvn� ��dek stejn� jako ten druh�. + 3. Nyní stiskni R a nahraď zbytek textu na prvním řádku přepsáním + starého textu tak, aby byl první řádek stejný jako ten druhý. ----> Pro upraven� prvn�ho ��dku do tvaru toho posledn� na stran� pou�ij kl. ----> Pro upraven� prvn�ho ��dku do tvaru toho druh�ho, napi� R a nov� text. +---> Pro upravení prvního řádku do tvaru toho poslední na straně použij kl. +---> Pro upravení prvního řádku do tvaru toho druhého, napiš R a nový text. - 4. V�imni si, �e jakmile stiskne� v�echen nezm�n�n� text z�st�v�. + 4. Všimni si, že jakmile stiskneš všechen nezměněný text zůstává. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.4: NASTAVEN� MO�NOST� + Lekce 1.6.4: NASTAVENÍ MOŽNOSTÍ - ** Nastav mo�nost, �e vyhled�v�n� anebo nahrazov�n� nedb� velikosti p�smen ** + ** Nastav možnost, že vyhledávání anebo nahrazování nedbá velikosti písmen ** - 1. Vyhledej �et�zec 'ignore' naps�n�m: + 1. Vyhledej řetězec 'ignore' napsáním: /ignore - Zopakuj n�kolikr�t stisknut� kl�vesy n. + Zopakuj několikrát stisknutí klávesy n. - 2. Nastav mo�nost 'ic' (Ignore case) naps�n�m p��kazu: + 2. Nastav možnost 'ic' (Ignore case) napsáním příkazu: :set ic - 3. Nyn� znovu vyhledej 'ignore' stisknut�m: n - N�kolikr�t hled�n� zopakuj stisknut�m kl�vesy n. + 3. Nyní znovu vyhledej 'ignore' stisknutím: n + Několikrát hledání zopakuj stisknutím klávesy n. - 4. Nastav mo�nosti 'hlsearch' a 'incsearch': + 4. Nastav možnosti 'hlsearch' a 'incsearch': :set hls is - 5. Nyn� znovu vykonej vyhled�vac� p��kaz a sleduj, co se stane: + 5. Nyní znovu vykonej vyhledávací příkaz a sleduj, co se stane: /ignore - 6. Pro vypnut� zv�raz�ov�n� v�sledk� napi�: + 6. Pro vypnutí zvýrazňování výsledků napiš: :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRHNUT� LEKCE 1.6 + SHRHNUTÍ LEKCE 1.6 - 1. Stisknut� o otev�e nov� ��dek POD kurzorem a um�st� kurzor na vlo�en� - ��dek do Vkl�dac�ho m�du. - Naps�n� velk�ho O otev�e ��dek NAD ��dkem, na kter�m je kurzor. + 1. Stisknutí o otevře nový řádek POD kurzorem a umístí kurzor na vložený + řádek do Vkládacího módu. + Napsání velkého O otevře řádek NAD řádkem, na kterém je kurzor. - 2. Stiskni a pro vlo�en� textu ZA znak na pozici kurzoru. - Naps�n� velk�ho A automaticky p�id� text na konec ��dku. + 2. Stiskni a pro vložení textu ZA znak na pozici kurzoru. + Napsání velkého A automaticky přidá text na konec řádku. - 3. Stisknut� velk�ho R p�epne do Nahrazovac�ho m�du, dokud - nestiskne� pro jeho ukon�en�. + 3. Stisknutí velkého R přepne do Nahrazovacího módu, dokud + nestiskneš pro jeho ukončení. - 4. Naps�n� ":set xxx" nastav� mo�nosti "xxx". + 4. Napsání ":set xxx" nastaví možnosti "xxx". @@ -734,21 +734,21 @@ za pozici kurzoru. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCE 1.7: P��KAZY ON-LINE N�POV�DY + LEKCE 1.7: PŘÍKAZY ON-LINE NÁPOVĚDY - ** Pou��vej on-line syst�m n�pov�dy ** + ** Používej on-line systém nápovědy ** - Vim m� obs�hl� on-line syst�m n�pov�dy. Pro za��tek vyzkou�ej jeden z - n�sleduj�c�ch: - - stiskni kl�vesu (pokud ji m�) - - stiskni kl�vesu (pokud ji m�) - - napi� :help + Vim má obsáhlý on-line systém nápovědy. Pro začátek vyzkoušej jeden z + následujících: + - stiskni klávesu (pokud ji máš) + - stiskni klávesu (pokud ji máš) + - napiš :help - Napi� :q pro uzav�en� okna n�pov�dy. + Napiš :q pro uzavření okna nápovědy. - M��e� naj�t n�pov�du k jak�mukoliv t�matu p�id�n�m argumentu k - p��kazu ":help". Zkus tyto (nezapome� stisknout ): + Můžeš najít nápovědu k jakémukoliv tématu přidáním argumentu k + příkazu ":help". Zkus tyto (nezapomeň stisknout ): :help w :help c_ Kl�vesa l je vpravo a vykon� pohyb vpravo. - j Kl�vesa j vypad� na �ipku dolu. - v - 1. Pohybuj kurzorem po obrazovce dokud si na to nezvykne�. - - 2. Dr� kl�vesu pro pohyb dolu (j), dokud se jej� funkce nezopakuje. ----> Te� v� jak se p�esunout na n�sleduj�c� lekci. - - 3. Pou�it�m kl�vesy dolu p�ejdi na lekci 1.1.2. - -Pozn�mka: Pokud si n�kdy nejsi jist n���m, co jsi napsal, stla� pro - p�echod do Norm�ln�ho m�du. Pot� p�epi� po�adovan� p��kaz. - -Pozn�mka: Kurzorov� kl�vesy tak� funguj�, av�ak pou��v�n� hjkl je rychlej�� - jakmile si na n�j zvykne�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.2: SPU�T�N� A UKON�EN� VIM - - - !! POZN�MKA: P�ed vykon�n�m t�chto krok� si p�e�ti celou lekci!! - - 1. Stla� (pro uji�t�n�, �e se nach�z� v Norm�ln�m m�du). - - 2. Napi�: :q! . - ----> T�mto ukon�� editor BEZ ulo�en� zm�n, kter� si vykonal. - Pokud chce� ulo�it zm�ny a ukon�it editor napi�: - :wq - - 3. A� se dostane� na p��kazov� ��dek, napi� p��kaz, kter�m se dostane� zp�t - do t�to v�uky. To m��e b�t: vimtutor - B�n� se pou��v�: vim tutor - ----> 'vim' znamen� spu�t�n� editoru, 'tutor' je soubor k editaci. - - 4. Pokud si tyto kroky spolehliv� pamatuje�, vykonej kroky 1 a� 3, ��m� - ukon�� a znovu spust� editor. Potom p�esu� kurzor dolu na lekci 1.1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.3: �PRAVA TEXTU - MAZ�N� - - - ** Stisknut�m kl�vesy x v Norm�ln�m m�du sma�e� znak na m�st� kurzoru. ** - - 1. P�esu� kurzor n�e na ��dek ozna�en� --->. - - 2. K odstran�n� chyb p�ejdi kurzorem na znak, kter� chce� smazat. - - 3. Stla� kl�vesu x k odstran�n� necht�n�ch znak�. - - 4. Opakuj kroky 2 a� 4 dokud nen� v�ta spr�vn�. - ----> Kr��va sko��illa p�ess m�ss�c. - - 5. Pokud je v�ta spr�vn�, p�ejdi na lekci 1.1.4. - -POZN�MKA: Nesna� se pouze zapamatovat p�edv�d�n� p��kazy, u� se je pou��v�n�m. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.4: �PRAVA TEXTU - VKL�D�N� - - - ** Stla�en� kl�vesy i v Norm�ln�m m�du umo��uje vkl�d�n� textu. ** - - 1. P�esu� kurzor na prvn� ��dek ozna�en� --->. - - 2. Pro upraven� prvn�ho ��dku do podoby ��dku druh�ho, p�esu� kurzor na - prvn� znak za m�sto, kde m� b�t text vlo�en�. - - 3. Stla� i a napi� pot�ebn� dodatek. - - 4. Po opraven� ka�d� chyby stla� pro n�vrat do Norm�ln�ho m�du. - Opakuj kroky 2 a� 4 dokud nen� v�ta spr�vn�. - ----> N�jak� txt na t�to . ----> N�jak� text chyb� na t�to ��dce. - - 5. Pokud ji� ovl�d� vkl�d�n� textu, p�ejdi na n�sleduj�c� shrnut�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.1 - - - 1. Kurzorem se pohybuje pomoc� �ipek nebo kl�vesami hjkl. - h (vlevo) j (dolu) k (nahoru) l (vpravo) - - 2. Pro spu�t�n� Vimu (z p��kazov�ho ��dku) napi�: vim SOUBOR - - 3. Pro ukon�en� Vimu napi�: :q! bez ulo�en� zm�n. - anebo: :wq pro ulo�en� zm�n. - - 4. Pro smaz�n� znaku pod kurzorem napi� v Norm�ln�m m�du: x - - 5. Pro vkl�d�n� textu od m�sta kurzoru napi� v Norm�ln�m m�du: - i vkl�dan� text - -POZN�MKA: Stla�en� t� p�em�st� do Norm�ln�ho m�du nebo zru�� necht�n� - a ��ste�n� dokon�en� p��kaz. - -Nyn� pokra�uj Lekc� 2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.1: P��KAZY MAZ�N� - - - ** P��kaz dw sma�e znaky do konce slova. ** - - 1. Stla� k ubezpe�en�, �e jsi v Norm�ln�m m�du. - - 2. P�esu� kurzor n�e na ��dek ozna�en� --->. - - 3. P�esu� kurzor na za��tek slova, kter� je pot�eba smazat. - - 4. Napi� dw , aby slovo zmizelo. - -POZN�MKA: P�smena dw se zobraz� na posledn�m ��dku obrazovky jakmile je - nap�e�. Kdy� nap�e� n�co �patn�, stla� a za�ni znova. - ----> Jsou tu n�jak� slova z�bava, kter� nepat�� list do t�to v�ty. - - 5. Opakuj kroky 3 a� 4 dokud nen� v�ta spr�vn� a p�ejdi na lekci 1.2.2. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.2: V�CE P��KAZ� MAZ�N� - - - ** Naps�n� p��kazu d$ sma�e v�e a� do konce ��dky. ** - - 1. Stla� k ubezpe�en�, �e jsi v Norm�ln�m m�du. - - 2. P�esu� kurzor n�e na ��dek ozna�en� --->. - - 3. P�esu� kurzor na konec spr�vn� v�ty (ZA prvn� te�ku). - - 4. Napi� d$ ,aby jsi smazal znaky a� do konce ��dku. - ----> N�kdo napsal konec t�to v�ty dvakr�t. konec t�to v�ty dvakr�t. - - - 5. P�ejdi na lekci 1.2.3 pro pochopen� toho, co se stalo. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.3: ROZ�I�OVAC� P��KAZY A OBJEKTY - - - Form�t mazac�ho p��kazu d je n�sleduj�c�: - - [��slo] d objekt NEBO d [��slo] objekt - Kde: - ��slo - ud�v� kolikr�t se p��kaz vykon� (voliteln�, v�choz�=1). - d - je p��kaz maz�n�. - objekt - ud�v� na �em se p��kaz vykon�v� (vypsan� n�e). - - Kr�tk� v�pis objekt�: - w - od kurzoru do konce slova, v�etn� mezer. - e - od kurzoru do konce slova, BEZ mezer. - $ - od kurzoru do konce ��dku. - -POZN�MKA: Stla�en�m kl�vesy objektu v Norm�ln�m m�du se kurzor p�esune na - m�sto up�esn�n� ve v�pisu objekt�. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.4: V�JIMKA Z 'P��KAZ-OBJEKT' - - - ** Naps�n�m dd sma�e� cel� ��dek. ** - - Vzhledem k �astosti maz�n� cel�ho ��dku se auto�i Vimu rozhodli, �e bude - jednodu�� napsat prost� dv� d k smaz�n� cel�ho ��dku. - - 1. P�esu� kurzor na druh� ��dek spodn�ho textu. - 2. Napi� dd pro smaz�n� ��dku. - 3. P�ejdi na �tvrt� ��dek. - 4. Napi� 2dd (vzpome� si ��slo-p��kaz-objekt) pro smaz�n� dvou ��dk�. - - 1) R��e jsou �erven�, - 2) Bl�to je z�bavn�, - 3) Fialky jsou modr�, - 4) M�m auto, - 5) Hodinky ukazuj� �as, - 6) Cukr je sladk�, - 7) A to jsi i ty. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.5: P��KAZ UNDO - - - ** Stla� u pro vr�cen� posledn�ho p��kazu, U pro celou ��dku. ** - - 1. P�esu� kurzor n�e na ��dek ozna�en� ---> a p�em�sti ho na prvn� chybu. - 2. Napi� x pro smaz�n� prvn�ho necht�n�ho znaku. - 3. Te� napi� u ��m� vr�t� zp�t posledn� vykonan� p��kaz. - 4. Nyn� oprav v�echny chyby na ��dku pomoc� p��kazu x . - 5. Napi� velk� U ��m� vr�t� ��dek do p�vodn�ho stavu. - 6. Te� napi� u n�kolikr�t, ��m� vr�t� zp�t p��kaz U . - 7. Stla� CTRL-R (kl�vesu CTRL dr� stla�enou a stiskni R) n�kolikr�t, - ��m� vr�t� zp�t p�edt�m vr�cen� p��kazy (redo). - ----> Opprav chybby nna toomto ��dku a nahra� je pommoc� undo. - - 8. Toto jsou velmi u�ite�n� p��kazy. Nyn� p�ejdi na souhrn Lekce 1.2. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.2 - - - 1. Pro smaz�n� znak� od kurzoru do konce slova napi�: dw - - 2. Pro smaz�n� znak� od kurzoru do konce ��dku napi�: d$ - - 3. Pro smaz�n� cel�ho ��dku napi�: dd - - 4. Form�t p��kazu v Norm�ln�m m�du je: - - [��slo] p��kaz objekt NEBO p��kaz [��slo] objekt - kde: - ��slo - ud�v� po�et opakov�n� p��kazu - p��kaz - ud�v� co je t�eba vykonat, nap��klad d ma�e - objekt - ud�v� rozsah p��kazu, nap��klad w (slovo), - $ (do konce ��dku), atd. - - 5. Pro vr�cen� p�ede�l� �innosti, napi�: u (mal� u) - Pro vr�cen� v�ech �prav na ��dku napi�: U (velk� U) - Pro vr�cen� vr�cen�ch �prav (redo) napi�: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.1: P��KAZ VLO�IT - - - ** P��ka p vlo�� posledn� vymazan� text za kurzor. ** - - 1. P�esu� kurzor n�e na posledn� ��dek textu. - - 2. Napi� dd pro smaz�n� ��dku a jeho ulo�en� do bufferu. - - 3. P�esu� kurzor V݊E tam, kam smazan� ��dek pat��. - - 4. V Norm�ln�m m�du napi� p pro op�tn� vlo�en� ��dku. - - 5. Opakuj kroky 2 a� 4 dokud ��dky nebudou ve spr�vn�m po�ad�. - - d) Tak� se dok�e� vzd�l�vat? - b) Fialky jsou modr�, - c) Inteligence se u��, - a) R��e jsou �erven�, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.2: P��KAZ NAHRAZEN� - - - ** Naps�n�m r a znaku se nahrad� znak pod kurzorem. ** - - 1. P�esu� kurzor n�e na prvn� ��dek ozna�en� --->. - - 2. P�esu� kurzor na za��tek prvn� chyby. - - 3. Napi� r a potom znak, kter� nahrad� chybu. - - 4. Opakuj kroky 2 a� 3 dokud nen� prvn� ��dka spr�vn�. - ----> Kdi� byl pz�n tento ��deg, n�kdu stla�il �paqn� kl�vesy! ----> Kdy� byl ps�n tento ��dek, n�kdo stla��l �patn� kl�vesy! - - 5. Nyn� p�ejdi na Lekci 1.3.2. - -POZN�MKA: Zapamatuj si, �e by ses m�l u�it pou��v�n�m, ne zapamatov�n�m. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.3: P��KAZ �PRAVY - - - ** Pokud chce� zm�nit ��st nebo cel� slovo, napi� cw . ** - - 1. P�esu� kurzor n�e na prvn� ��dek ozna�en� --->. - - 2. Um�sti kurzor na p�smeno i v slov� �i�ok. - - 3. Napi� cw a oprav slovo (v tomto p��pad� napi� '�dek'.) - - 4. Stla� a p�ejdi na dal�� chybu (prvn� znak, kter� t�eba zm�nit.) - - 5. Opakuj kroky 3 a� 4 dokud nen� prvn� v�ta stejn� jako ta druh�. - ----> Tento �i�ok m� n�kolik skic, kter� psadoinsa zm�nit pasdgf p��kazu. ----> Tento ��dek m� n�kolik slov, kter� pot�ebuj� zm�nit pomoc� p��kazu. - -V�imni si, �e cw nejen nahrazuje slovo, ale tak� p�em�st� do vkl�d�n�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.4: V�CE ZM�N POU�IT�M c - - - ** P��kaz pro �pravu se dru�� se stejn�mi objekty jako ten pro maz�n�. ** - - 1. P��kaz pro �pravu pracuje stejn� jako pro maz�n�. Form�t je: - - [��slo] c objekt NEBO c [��slo] objekt - - 2. Objekty jsou tak� shodn�, jako nap�.: w (slovo), $ (konec ��dku), atd. - - 3. P�ejdi n�e na prvn� ��dek ozna�en� --->. - - 4. P�esu� kurzor na prvn� rozd�l. - - 5. Napi� c$ pro upraven� zbytku ��dku podle toho druh�ho a stla� . - ----> Konec tohoto ��dku pot�ebuje pomoc, aby byl jako ten druh�. ----> Konec tohoto ��dku pot�ebuje opravit pou�it�m p��kazu c$ . - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.3 - - - 1. Pro vlo�en� textu, kter� byl smaz�n, napi� p . To vlo�� smazan� text - ZA kurzor (pokud byl ��dek smazan�, p�ejde na ��dek pod kurzorem). - - 2. Pro nahrazen� znaku pod kurzorem, napi� r a potom znak, kter�m - chce� p�vodn� znak nahradit. - - 3. P��kaz na upravov�n� umo��uje zm�nit specifikovan� objekt od kurzoru - do konce objektu. Nap��klad: Napi� cw ,��m� zm�n� text od pozice - kurzoru do konce slova, c$ zm�n� text do konce ��dku. - - 4. Form�t pro nahrazov�n� je: - - [��slo] c objekt NEBO c [��slo] objekt - -Nyn� p�ejdi na n�sleduj�c� lekci. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.1: POZICE A STATUS SOUBORU - - - ** Stla� CTRL-g pro zobrazen� sv� pozice v souboru a statusu souboru. - Stla� SHIFT-G pro p�echod na ��dek v souboru. ** - - Pozn�mka: P�e�ti si celou lekci ne� za�ne� vykon�vat kroky!! - - 1. Dr� kl�vesu Ctrl stla�enou a stiskni g . Vespod obrazovky se zobraz� - stavov� ��dek s n�zvem souboru a ��dkou na kter� se nach�z�. Zapamatuj - si ��slo ��dku pro krok 3. - - 2. Stla� shift-G pro p�esun na konec souboru. - - 3. Napi� ��slo ��dku na kter�m si se nach�zel a stla� shift-G. To t� - vr�t� na ��dek, na kter�m jsi d��ve stiskl Ctrl-g. - (Kdy� p�e� ��sla, tak se NEZOBRAZUJ� na obrazovce.) - - 4. Pokud se c�t� schopn� vykonat tyto kroky, vykonej je. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.2: P��KAZ VYHLED�V�N� - - - ** Napi� / n�sledovan� �et�zcem pro vyhled�n� onoho �et�zce. ** - - 1. Stiskni / v Norm�ln�m m�du. V�imni si, �e tento znak se spolu s - kurzorem zobraz� v doln� ��sti obrazovky jako p��kaz : . - - 2. Nyn� napi� 'chhybba' . To je slovo, kter� chce� vyhledat. - - 3. Pro vyhled�n� dal��ho v�sledku stejn�ho �et�zce, jednodu�e stla� n . - Pro vyhled�n� dal��ho v�sledku stejn�ho �et�zce opa�n�m sm�rem, stiskni - Shift-N. - - 4. Pokud chce� vyhledat �et�zec v opa�n�m sm�ru, pou�ij p��kaz ? m�sto - p��kazu / . - ----> "chhybba" nen� zp�sob, jak hl�skovat chyba; chhybba je chyba. - -Pozn�mka: Kdy� vyhled�v�n� dos�hne konce souboru, bude pokra�ovat na jeho - za��tku. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.3: VYHLED�V�N� P�ROV� Z�VORKY - - - ** Napi� % pro nalezen� p�rov� ),], nebo } . ** - - 1. P�em�sti kurzor na kteroukoli (, [, nebo { v ��dku ozna�en�m --->. - - 2. Nyn� napi� znak % . - - 3. Kurzor se p�em�st� na odpov�daj�c� z�vorku. - - 4. Stla� % pro p�esun kurzoru zp�t na otv�raj�c� z�vorku. - ----> Toto ( je testovac� ��dek ('s, ['s ] a {'s } v n�m. )) - -Pozn�mka: Toto je velmi u�ite�n� p�� lad�n� programu s chyb�j�c�mi - uzav�rac�mi z�vorkami. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.4: ZP�SOB JAK ZM�NIT CHYBY - - - ** Napi� :s/star�/nov�/g pro nahrazen� slova 'nov�' za 'star�'. ** - - 1. P�esu� kurzor na ��dek ozna�en� --->. - - 2. Napi� :s/dobr��/dobr� . V�imni si, �e tento p��kaz zm�n� pouze - prvn� v�skyt v ��dku. - - 3. Nyn� napi� :s/dobr��/dobr�/g co� znamen� celkov� nahrazen� v ��dku. - Toto nahrad� v�echny v�skyty v ��dku. - ----> dobr�� suroviny a dobr�� n��in� jsou z�kladem dobr�� kuchyn�. - - 4. Pro zm�nu v�ech v�skyt� �et�zce mezi dv�ma ��dky, - Napi� :#,#s/star�/nov�/g kde #,# jsou ��sla on�ch ��dek. - Napi� :%s/star�/nov�/g pro zm�nu v�ech v�skyt� v cel�m souboru. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.4 - - - 1. Ctrl-g vyp�e tvou pozici v souboru a status souboru. - Shift-G t� p�em�st� na konec souboru. ��slo n�sledovan� - Shift-G t� p�esune na dan� ��slo ��dku. - - 2. Naps�n� / n�sledovan� �et�zcem vyhled� �et�zec sm�rem DOP�EDU. - Naps�n� ? n�sledovan� �et�zcem vyhled� �et�zec sm�rem DOZADU. - Naps�n� n po vyhled�v�n� najde n�sleduj�c� v�skyt �et�zce ve stejn�m - sm�ru, Shift-N ve sm�ru opa�n�m. - - 3. Stisknut� % kdy� je kurzor na (,),[,],{, nebo } najde odpov�daj�c� - p�rovou z�vorku. - - 4. Pro nahrazen� nov�ho za prvn� star� v ��dku napi� :s/star�/nov� - Pro nahrazen� nov�ho za v�echny star� v ��dku napi� :s/star�/nov�/g - Pro nahrazen� �et�zc� mezi dv�mi ��dkami # napi� :#,#s/star�/nov�/g - Pro nahrazen� v�ech v�skyt� v souboru napi� :%s/star�/nov�/g - Pro potvrzen� ka�d�ho nahrazen� p�idej 'c' :%s/star�/nov�/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.1: JAK VYKONAT VN�J�� P��KAZ - - - ** Napi� :! n�sledovan� vn�j��m p��kazem pro spu�t�n� p��kazu. ** - - 1. Napi� obvykl� p��kaz : , kter� um�st� kurzor na spodek obrazovky - To umo�n� napsat p��kaz. - - 2. Nyn� stiskni ! (vyk�i�n�k). To umo�n� vykonat jak�koliv vn�j�� - p��kaz z p��kazov�ho ��dku. - - 3. Nap��klad napi� ls za ! a stiskni . Tento p��kaz zobraz� - obsah tv�ho adres��e jako v p��kazov�m ��dku. - Vyzkou�ej :!dir pokud ls nefunguje. - -Pozn�mka: Takto je mo�n� vykonat jak�koliv p��kaz. - -Pozn�mka: V�echny p��kazy : mus� b�t dokon�en� stisknut�m - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.2: V�CE O UKL�D�N� SOUBOR� - - - ** Pro ulo�en� zm�n v souboru napi� :w SOUBOR. ** - - 1. Napi� :!dir nebo :!ls pro v�pis aktu�ln�ho adres��e. - U� v�, �e za t�mto mus� stisknout . - - 2. Vyber si n�zev souboru, kter� je�t� neexistuje, nap��klad TEST. - - 3. Nyn� napi�: :w TEST (kde TEST je vybran� n�zev souboru.) - - 4. To ulo�� cel� soubor (V�uka Vimu) pod n�zvem TEST. - Pro ov��en� napi� znovu :!dir , ��m� zobraz� obsah adres��e. - -Pozn�mka: Jakmile ukon�� Vim a znovu ho spust� s n�zvem souboru TEST, - soubor bude p�esn� kopie v�uky, kdy� si ji ukl�dal. - - 5. Nyn� odstra� soubor naps�n�m (MS-DOS): :!del TEST - nebo (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.3: V�B�ROV� P��KAZ ULO�EN� - - - ** Pro ulo�en� ��sti souboru napi� :#,# w SOUBOR ** - - 1. Je�t� jednou napi� :!dir nebo :!ls pro v�pis aktu�ln�ho adres��e - a vyber vhodn� n�zev souboru jako nap�. TEST. - - 2. P�esu� kurzor na vrch t�to str�nky a stiskni Ctrl-g pro zobrazen� - ��sla ��dku. ZAPAMATUJ SI TOTO ��SLO! - - 3. Nyn� se p�esu� na spodek t�to str�nky a op�t stiskni Ctrl-g. - ZAPAMATUJ SI I ��SLO TOHOTO ��DKU! - - 4. Pro ulo�en� POUZE ��sti souboru, napi� :#,# w TEST kde #,# jsou - ��sla dvou zapamatovan�ch ��dk� (vrch, spodek) a TEST je n�zev souboru. - - 5. Znova se ujisti, �e tam ten soubor je pomoc� :!dir ale NEODSTRA�UJ ho. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.4: SLU�OV�N� SOUBOR� - - - ** K vlo�en� obsahu souboru napi� :r N�ZEV_SOUBORU ** - - 1. Napi� :!dir pro uji�t�n�, �e soubor TEST st�le existuje. - - 2. P�esu� kurzor na vrch t�to str�nky. - -POZN�MKA: Po vykon�n� kroku 3 uvid� lekci 1.5.3. Potom se op�t p�esu� dol� - na tuto lekci. - - 3. Nyn� vlo� soubor TEST pou�it�m p��kazu :r TEST kde TEST je n�zev - souboru. - -POZN�MKA: Soubor, kter� vkl�d� se vlo�� od m�sta, kde se nach�z� kurzor. - - 4. Pro potvrzen� vlo�en� souboru, p�esu� kurzor zp�t a v�imni si, �e te� - m� dv� kopie lekce 1.5.3, origin�l a souborovou verzi. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUT� LEKCE 1.5 - - - 1. :!p��kaz vykon� vn�j�� p��kaz. - - N�kter� u�ite�n� p��klady jsou: - (MS-DOS) (Unix) - :!dir :!ls - zobraz� obsah souboru. - :!del SOUBOR :!rm SOUBOR - odstran� SOUBOR. - - 2. :w SOUBOR ulo�� aktu�ln� text jako SOUBOR na disk. - - 3. :#,#w SOUBOR ulo�� ��dky od # do # do SOUBORU. - - 4. :r SOUBOR vybere z disku SOUBOR a vlo�� ho do editovan�ho souboru - za pozici kurzoru. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.1: P��KAZ OTEV��T - - - ** Napi� o pro vlo�en� ��dku pod kurzor a p�epnut� do Vkl�dac�ho m�du. ** - - 1. P�em�sti kurzor n�e na ��dek ozna�en� --->. - - 2. Napi� o (mal�) pro vlo�en� ��dku POD kurzor a p�epnut� do - Vkl�dac�ho m�du. - - 3. Nyn� zkop�ruj ��dek ozna�en� ---> a stiskni pro ukon�en� - Vkl�dac�ho m�du. - ----> Po stisknut� o se kurzor p�em�st� na vlo�en� ��dek do Vkl�dac�ho - m�du. - - 4. Pro otev�en� ��dku NAD kurzorem jednodu�e napi� velk� O , m�sto - mal�ho o. Vyzkou�ej si to na n�sleduj�c�m ��dku. -Vlo� ��dek nad t�mto naps�n�m Shift-O po um�st�n� kurzoru na tento ��dek. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.2: P��KAZ P�IDAT - - - ** Stiskni a pro vlo�en� textu ZA kurzor. ** - - 1. P�esu� kurzor na n�e na konec ��dky ozna�en� ---> - stisknut�m $ v Norm�ln�m m�du. - - 2. Stiskni a (mal�) pro p�id�n� textu ZA znak, kter� je pod kurzorem. - (Velk� A p�id� na konec ��dku.) - -Pozn�mka: T�mto se vyhne� stisknut� i , posledn�ho znaku, textu na vlo�en�, - , kurzor doprava, a nakonec x na p�id�v�n� na konec ��dku! - - 3. Nyn� dokon�� prvn� ��dek. V�imni si, �e p�id�v�n� je vlastn� stejn� jako - Vkl�dac� m�d, krom� m�sta, kam se text vkl�d�. - ----> Tento ��dek ti umo��uje nacvi�it ----> Tento ��dek ti umo��uje nacvi�it p�id�v�n� textu na konec ��dky. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.3: JIN� ZP�SOB NAHRAZOV�N� - - - ** Napi� velk� R pro nahrazen� v�c ne� jednoho znaku. ** - - 1. P�esu� kurzor na prvn� ��dek ozna�en� --->. - - 2. Um�sti kurzor na za��tek prvn�ho slova, kter� je odli�n� od druh�ho - ��dku ozna�en�ho ---> (slovo 'posledn�'). - - 3. Nyn� stiskni R a nahra� zbytek textu na prvn�m ��dku p�eps�n�m - star�ho textu tak, aby byl prvn� ��dek stejn� jako ten druh�. - ----> Pro upraven� prvn�ho ��dku do tvaru toho posledn� na stran� pou�ij kl. ----> Pro upraven� prvn�ho ��dku do tvaru toho druh�ho, napi� R a nov� text. - - 4. V�imni si, �e jakmile stiskne� v�echen nezm�n�n� text z�st�v�. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.4: NASTAVEN� MO�NOST� - - ** Nastav mo�nost, �e vyhled�v�n� anebo nahrazov�n� nedb� velikosti p�smen ** - - 1. Vyhledej �et�zec 'ignore' naps�n�m: - /ignore - Zopakuj n�kolikr�t stisknut� kl�vesy n. - - 2. Nastav mo�nost 'ic' (Ignore case) naps�n�m p��kazu: - :set ic - - 3. Nyn� znovu vyhledej 'ignore' stisknut�m: n - N�kolikr�t hled�n� zopakuj stisknut�m kl�vesy n. - - 4. Nastav mo�nosti 'hlsearch' a 'incsearch': - :set hls is - - 5. Nyn� znovu vykonej vyhled�vac� p��kaz a sleduj, co se stane: - /ignore - - 6. Pro vypnut� zv�raz�ov�n� v�sledk� napi�: - :nohlsearch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRHNUT� LEKCE 1.6 - - - 1. Stisknut� o otev�e nov� ��dek POD kurzorem a um�st� kurzor na vlo�en� - ��dek do Vkl�dac�ho m�du. - Naps�n� velk�ho O otev�e ��dek NAD ��dkem, na kter�m je kurzor. - - 2. Stiskni a pro vlo�en� textu ZA znak na pozici kurzoru. - Naps�n� velk�ho A automaticky p�id� text na konec ��dku. - - 3. Stisknut� velk�ho R p�epne do Nahrazovac�ho m�du, dokud - nestiskne� pro jeho ukon�en�. - - 4. Naps�n� ":set xxx" nastav� mo�nosti "xxx". - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCE 1.7: P��KAZY ON-LINE N�POV�DY - - - ** Pou��vej on-line syst�m n�pov�dy ** - - Vim m� obs�hl� on-line syst�m n�pov�dy. Pro za��tek vyzkou�ej jeden z - n�sleduj�c�ch: - - stiskni kl�vesu (pokud ji m�) - - stiskni kl�vesu (pokud ji m�) - - napi� :help - - Napi� :q pro uzav�en� okna n�pov�dy. - - M��e� naj�t n�pov�du k jak�mukoliv t�matu p�id�n�m argumentu k - p��kazu ":help". Zkus tyto (nezapome� stisknout ): - - :help w - :help c_ Klávesa l je vpravo a vykoná pohyb vpravo. - j Klávesa j vypadá na šipku dolu. - v - 1. Pohybuj kurzorem po obrazovce dokud si na to nezvykneš. - - 2. Drž klávesu pro pohyb dolu (j), dokud se její funkce nezopakuje. ----> Teď víš jak se přesunout na následující lekci. - - 3. Použitím klávesy dolu přejdi na lekci 1.1.2. - -Poznámka: Pokud si někdy nejsi jist něčím, co jsi napsal, stlač pro - přechod do Normálního módu. Poté přepiš požadovaný příkaz. - -Poznámka: Kurzorové klávesy také fungují, avšak používání hjkl je rychlejší - jakmile si na něj zvykneš. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.2: SPUŠTĚNÍ A UKONČENÍ VIM - - - !! POZNÁMKA: Před vykonáním těchto kroků si přečti celou lekci!! - - 1. Stlač (pro ujištění, že se nacházíš v Normálním módu). - - 2. Napiš: :q! . - ----> Tímto ukončíš editor BEZ uložení změn, které si vykonal. - Pokud chceš uložit změny a ukončit editor napiš: - :wq - - 3. Až se dostaneš na příkazový řádek, napiš příkaz, kterým se dostaneš zpět - do této výuky. To může být: vimtutor - Běžně se používá: vim tutor - ----> 'vim' znamená spuštění editoru, 'tutor' je soubor k editaci. - - 4. Pokud si tyto kroky spolehlivě pamatuješ, vykonej kroky 1 až 3, čímž - ukončíš a znovu spustíš editor. Potom přesuň kurzor dolu na lekci 1.1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.3: ÚPRAVA TEXTU - MAZÁNÍ - - - ** Stisknutím klávesy x v Normálním módu smažeš znak na místě kurzoru. ** - - 1. Přesuň kurzor níže na řádek označený --->. - - 2. K odstranění chyb přejdi kurzorem na znak, který chceš smazat. - - 3. Stlač klávesu x k odstranění nechtěných znaků. - - 4. Opakuj kroky 2 až 4 dokud není věta správně. - ----> Krááva skoččilla přess měssíc. - - 5. Pokud je věta správně, přejdi na lekci 1.1.4. - -POZNÁMKA: Nesnaž se pouze zapamatovat předváděné příkazy, uč se je používáním. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.1.4: ÚPRAVA TEXTU - VKLÁDÁNÍ - - - ** Stlačení klávesy i v Normálním módu umožňuje vkládání textu. ** - - 1. Přesuň kurzor na první řádek označený --->. - - 2. Pro upravení prvního řádku do podoby řádku druhého, přesuň kurzor na - první znak za místo, kde má být text vložený. - - 3. Stlač i a napiš potřebný dodatek. - - 4. Po opravení každé chyby stlač pro návrat do Normálního módu. - Opakuj kroky 2 až 4 dokud není věta správně. - ----> Nějaký txt na této . ----> Nějaký text chybí na této řádce. - - 5. Pokud již ovládáš vkládání textu, přejdi na následující shrnutí. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUTÍ LEKCE 1.1 - - - 1. Kurzorem se pohybuje pomocí šipek nebo klávesami hjkl. - h (vlevo) j (dolu) k (nahoru) l (vpravo) - - 2. Pro spuštění Vimu (z příkazového řádku) napiš: vim SOUBOR - - 3. Pro ukončení Vimu napiš: :q! bez uložení změn. - anebo: :wq pro uložení změn. - - 4. Pro smazání znaku pod kurzorem napiš v Normálním módu: x - - 5. Pro vkládání textu od místa kurzoru napiš v Normálním módu: - i vkládaný text - -POZNÁMKA: Stlačení tě přemístí do Normálního módu nebo zruší nechtěný - a částečně dokončený příkaz. - -Nyní pokračuj Lekcí 2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.1: PŘÍKAZY MAZÁNÍ - - - ** Příkaz dw smaže znaky do konce slova. ** - - 1. Stlač k ubezpečení, že jsi v Normálním módu. - - 2. Přesuň kurzor níže na řádek označený --->. - - 3. Přesuň kurzor na začátek slova, které je potřeba smazat. - - 4. Napiš dw , aby slovo zmizelo. - -POZNÁMKA: Písmena dw se zobrazí na posledním řádku obrazovky jakmile je - napíšeš. Když napíšeš něco špatně, stlač a začni znova. - ----> Jsou tu nějaká slova zábava, která nepatří list do této věty. - - 5. Opakuj kroky 3 až 4 dokud není věta správně a přejdi na lekci 1.2.2. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.2: VÍCE PŘÍKAZŮ MAZÁNÍ - - - ** Napsání příkazu d$ smaže vše až do konce řádky. ** - - 1. Stlač k ubezpečení, že jsi v Normálním módu. - - 2. Přesuň kurzor níže na řádek označený --->. - - 3. Přesuň kurzor na konec správné věty (ZA první tečku). - - 4. Napiš d$ ,aby jsi smazal znaky až do konce řádku. - ----> Někdo napsal konec této věty dvakrát. konec této věty dvakrát. - - - 5. Přejdi na lekci 1.2.3 pro pochopení toho, co se stalo. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.3: ROZŠIŘOVACÍ PŘÍKAZY A OBJEKTY - - - Formát mazacího příkazu d je následující: - - [číslo] d objekt NEBO d [číslo] objekt - Kde: - číslo - udává kolikrát se příkaz vykoná (volitelné, výchozí=1). - d - je příkaz mazání. - objekt - udává na čem se příkaz vykonává (vypsané níže). - - Krátký výpis objektů: - w - od kurzoru do konce slova, včetně mezer. - e - od kurzoru do konce slova, BEZ mezer. - $ - od kurzoru do konce řádku. - -POZNÁMKA: Stlačením klávesy objektu v Normálním módu se kurzor přesune na - místo upřesněné ve výpisu objektů. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.4: VÝJIMKA Z 'PŘÍKAZ-OBJEKT' - - - ** Napsáním dd smažeš celý řádek. ** - - Vzhledem k častosti mazání celého řádku se autoři Vimu rozhodli, že bude - jednoduší napsat prostě dvě d k smazání celého řádku. - - 1. Přesuň kurzor na druhý řádek spodního textu. - 2. Napiš dd pro smazání řádku. - 3. Přejdi na čtvrtý řádek. - 4. Napiš 2dd (vzpomeň si číslo-příkaz-objekt) pro smazání dvou řádků. - - 1) Růže jsou červené, - 2) Bláto je zábavné, - 3) Fialky jsou modré, - 4) Mám auto, - 5) Hodinky ukazují čas, - 6) Cukr je sladký, - 7) A to jsi i ty. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.2.5: PŘÍKAZ UNDO - - - ** Stlač u pro vrácení posledního příkazu, U pro celou řádku. ** - - 1. Přesuň kurzor níže na řádek označený ---> a přemísti ho na první chybu. - 2. Napiš x pro smazání prvního nechtěného znaku. - 3. Teď napiš u čímž vrátíš zpět poslední vykonaný příkaz. - 4. Nyní oprav všechny chyby na řádku pomocí příkazu x . - 5. Napiš velké U čímž vrátíš řádek do původního stavu. - 6. Teď napiš u několikrát, čímž vrátíš zpět příkaz U . - 7. Stlač CTRL-R (klávesu CTRL drž stlačenou a stiskni R) několikrát, - čímž vrátíš zpět předtím vrácené příkazy (redo). - ----> Opprav chybby nna toomto řádku a nahraď je pommocí undo. - - 8. Toto jsou velmi užitečné příkazy. Nyní přejdi na souhrn Lekce 1.2. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUTÍ LEKCE 1.2 - - - 1. Pro smazání znaků od kurzoru do konce slova napiš: dw - - 2. Pro smazání znaků od kurzoru do konce řádku napiš: d$ - - 3. Pro smazání celého řádku napiš: dd - - 4. Formát příkazu v Normálním módu je: - - [číslo] příkaz objekt NEBO příkaz [číslo] objekt - kde: - číslo - udává počet opakování příkazu - příkaz - udává co je třeba vykonat, například d maže - objekt - udává rozsah příkazu, například w (slovo), - $ (do konce řádku), atd. - - 5. Pro vrácení předešlé činnosti, napiš: u (malé u) - Pro vrácení všech úprav na řádku napiš: U (velké U) - Pro vrácení vrácených úprav (redo) napiš: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.1: PŘÍKAZ VLOŽIT - - - ** Příka p vloží poslední vymazaný text za kurzor. ** - - 1. Přesuň kurzor níže na poslední řádek textu. - - 2. Napiš dd pro smazání řádku a jeho uložení do bufferu. - - 3. Přesuň kurzor VÝŠE tam, kam smazaný řádek patří. - - 4. V Normálním módu napiš p pro opětné vložení řádku. - - 5. Opakuj kroky 2 až 4 dokud řádky nebudou ve správném pořadí. - - d) Také se dokážeš vzdělávat? - b) Fialky jsou modré, - c) Inteligence se učí, - a) Růže jsou červené, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.2: PŘÍKAZ NAHRAZENÍ - - - ** Napsáním r a znaku se nahradí znak pod kurzorem. ** - - 1. Přesuň kurzor níže na první řádek označený --->. - - 2. Přesuň kurzor na začátek první chyby. - - 3. Napiš r a potom znak, který nahradí chybu. - - 4. Opakuj kroky 2 až 3 dokud není první řádka správně. - ----> Kdiž byl pzán tento řádeg, někdu stlažil špaqné klávesy! ----> Když byl psán tento řádek, někdo stlačíl špatné klávesy! - - 5. Nyní přejdi na Lekci 1.3.2. - -POZNÁMKA: Zapamatuj si, že by ses měl učit používáním, ne zapamatováním. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.3: PŘÍKAZ ÚPRAVY - - - ** Pokud chceš změnit část nebo celé slovo, napiš cw . ** - - 1. Přesuň kurzor níže na první řádek označený --->. - - 2. Umísti kurzor na písmeno i v slově řiťok. - - 3. Napiš cw a oprav slovo (v tomto případě napiš 'ádek'.) - - 4. Stlač a přejdi na další chybu (první znak, který třeba změnit.) - - 5. Opakuj kroky 3 až 4 dokud není první věta stejná jako ta druhá. - ----> Tento řiťok má několik skic, které psadoinsa změnit pasdgf příkazu. ----> Tento řádek má několik slov, které potřebují změnit pomocí příkazu. - -Všimni si, že cw nejen nahrazuje slovo, ale také přemístí do vkládání. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.3.4: VÍCE ZMĚN POUŽITÍM c - - - ** Příkaz pro úpravu se druží se stejnými objekty jako ten pro mazání. ** - - 1. Příkaz pro úpravu pracuje stejně jako pro mazání. Formát je: - - [číslo] c objekt NEBO c [číslo] objekt - - 2. Objekty jsou také shodné, jako např.: w (slovo), $ (konec řádku), atd. - - 3. Přejdi níže na první řádek označený --->. - - 4. Přesuň kurzor na první rozdíl. - - 5. Napiš c$ pro upravení zbytku řádku podle toho druhého a stlač . - ----> Konec tohoto řádku potřebuje pomoc, aby byl jako ten druhý. ----> Konec tohoto řádku potřebuje opravit použitím příkazu c$ . - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUTÍ LEKCE 1.3 - - - 1. Pro vložení textu, který byl smazán, napiš p . To vloží smazaný text - ZA kurzor (pokud byl řádek smazaný, přejde na řádek pod kurzorem). - - 2. Pro nahrazení znaku pod kurzorem, napiš r a potom znak, kterým - chceš původní znak nahradit. - - 3. Příkaz na upravování umožňuje změnit specifikovaný objekt od kurzoru - do konce objektu. Například: Napiš cw ,čímž změníš text od pozice - kurzoru do konce slova, c$ změní text do konce řádku. - - 4. Formát pro nahrazování je: - - [číslo] c objekt NEBO c [číslo] objekt - -Nyní přejdi na následující lekci. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.1: POZICE A STATUS SOUBORU - - - ** Stlač CTRL-g pro zobrazení své pozice v souboru a statusu souboru. - Stlač SHIFT-G pro přechod na řádek v souboru. ** - - Poznámka: Přečti si celou lekci než začneš vykonávat kroky!! - - 1. Drž klávesu Ctrl stlačenou a stiskni g . Vespod obrazovky se zobrazí - stavový řádek s názvem souboru a řádkou na které se nacházíš. Zapamatuj - si číslo řádku pro krok 3. - - 2. Stlač shift-G pro přesun na konec souboru. - - 3. Napiš číslo řádku na kterém si se nacházel a stlač shift-G. To tě - vrátí na řádek, na kterém jsi dříve stiskl Ctrl-g. - (Když píšeš čísla, tak se NEZOBRAZUJÍ na obrazovce.) - - 4. Pokud se cítíš schopný vykonat tyto kroky, vykonej je. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.2: PŘÍKAZ VYHLEDÁVÁNÍ - - - ** Napiš / následované řetězcem pro vyhledání onoho řetězce. ** - - 1. Stiskni / v Normálním módu. Všimni si, že tento znak se spolu s - kurzorem zobrazí v dolní části obrazovky jako příkaz : . - - 2. Nyní napiš 'chhybba' . To je slovo, které chceš vyhledat. - - 3. Pro vyhledání dalšího výsledku stejného řetězce, jednoduše stlač n . - Pro vyhledání dalšího výsledku stejného řetězce opačným směrem, stiskni - Shift-N. - - 4. Pokud chceš vyhledat řetězec v opačném směru, použij příkaz ? místo - příkazu / . - ----> "chhybba" není způsob, jak hláskovat chyba; chhybba je chyba. - -Poznámka: Když vyhledávání dosáhne konce souboru, bude pokračovat na jeho - začátku. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.3: VYHLEDÁVÁNÍ PÁROVÉ ZÁVORKY - - - ** Napiš % pro nalezení párové ),], nebo } . ** - - 1. Přemísti kurzor na kteroukoli (, [, nebo { v řádku označeném --->. - - 2. Nyní napiš znak % . - - 3. Kurzor se přemístí na odpovídající závorku. - - 4. Stlač % pro přesun kurzoru zpět na otvírající závorku. - ----> Toto ( je testovací řádek ('s, ['s ] a {'s } v něm. )) - -Poznámka: Toto je velmi užitečné pří ladění programu s chybějícími - uzavíracími závorkami. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.4.4: ZPŮSOB JAK ZMĚNIT CHYBY - - - ** Napiš :s/staré/nové/g pro nahrazení slova 'nové' za 'staré'. ** - - 1. Přesuň kurzor na řádek označený --->. - - 2. Napiš :s/dobréé/dobré . Všimni si, že tento příkaz změní pouze - první výskyt v řádku. - - 3. Nyní napiš :s/dobréé/dobré/g což znamená celkové nahrazení v řádku. - Toto nahradí všechny výskyty v řádku. - ----> dobréé suroviny a dobréé náčiní jsou základem dobréé kuchyně. - - 4. Pro změnu všech výskytů řetězce mezi dvěma řádky, - Napiš :#,#s/staré/nové/g kde #,# jsou čísla oněch řádek. - Napiš :%s/staré/nové/g pro změnu všech výskytů v celém souboru. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUTÍ LEKCE 1.4 - - - 1. Ctrl-g vypíše tvou pozici v souboru a status souboru. - Shift-G tě přemístí na konec souboru. Číslo následované - Shift-G tě přesune na dané číslo řádku. - - 2. Napsání / následované řetězcem vyhledá řetězec směrem DOPŘEDU. - Napsání ? následované řetězcem vyhledá řetězec směrem DOZADU. - Napsání n po vyhledávání najde následující výskyt řetězce ve stejném - směru, Shift-N ve směru opačném. - - 3. Stisknutí % když je kurzor na (,),[,],{, nebo } najde odpovídající - párovou závorku. - - 4. Pro nahrazení nového za první starý v řádku napiš :s/staré/nové - Pro nahrazení nového za všechny staré v řádku napiš :s/staré/nové/g - Pro nahrazení řetězců mezi dvěmi řádkami # napiš :#,#s/staré/nové/g - Pro nahrazení všech výskytů v souboru napiš :%s/staré/nové/g - Pro potvrzení každého nahrazení přidej 'c' :%s/staré/nové/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.1: JAK VYKONAT VNĚJŠÍ PŘÍKAZ - - - ** Napiš :! následované vnějším příkazem pro spuštění příkazu. ** - - 1. Napiš obvyklý příkaz : , který umístí kurzor na spodek obrazovky - To umožní napsat příkaz. - - 2. Nyní stiskni ! (vykřičník). To umožní vykonat jakýkoliv vnější - příkaz z příkazového řádku. - - 3. Například napiš ls za ! a stiskni . Tento příkaz zobrazí - obsah tvého adresáře jako v příkazovém řádku. - Vyzkoušej :!dir pokud ls nefunguje. - -Poznámka: Takto je možné vykonat jakýkoliv příkaz. - -Poznámka: Všechny příkazy : musí být dokončené stisknutím - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.2: VÍCE O UKLÁDÁNÍ SOUBORŮ - - - ** Pro uložení změn v souboru napiš :w SOUBOR. ** - - 1. Napiš :!dir nebo :!ls pro výpis aktuálního adresáře. - Už víš, že za tímto musíš stisknout . - - 2. Vyber si název souboru, který ještě neexistuje, například TEST. - - 3. Nyní napiš: :w TEST (kde TEST je vybraný název souboru.) - - 4. To uloží celý soubor (Výuka Vimu) pod názvem TEST. - Pro ověření napiš znovu :!dir , čímž zobrazíš obsah adresáře. - -Poznámka: Jakmile ukončíš Vim a znovu ho spustíš s názvem souboru TEST, - soubor bude přesná kopie výuky, když si ji ukládal. - - 5. Nyní odstraň soubor napsáním (MS-DOS): :!del TEST - nebo (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.3: VÝBĚROVÝ PŘÍKAZ ULOŽENÍ - - - ** Pro uložení části souboru napiš :#,# w SOUBOR ** - - 1. Ještě jednou napiš :!dir nebo :!ls pro výpis aktuálního adresáře - a vyber vhodný název souboru jako např. TEST. - - 2. Přesuň kurzor na vrch této stránky a stiskni Ctrl-g pro zobrazení - čísla řádku. ZAPAMATUJ SI TOTO ČÍSLO! - - 3. Nyní se přesuň na spodek této stránky a opět stiskni Ctrl-g. - ZAPAMATUJ SI I ČÍSLO TOHOTO ŘÁDKU! - - 4. Pro uložení POUZE části souboru, napiš :#,# w TEST kde #,# jsou - čísla dvou zapamatovaných řádků (vrch, spodek) a TEST je název souboru. - - 5. Znova se ujisti, že tam ten soubor je pomocí :!dir ale NEODSTRAŇUJ ho. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.5.4: SLUČOVÁNÍ SOUBORŮ - - - ** K vložení obsahu souboru napiš :r NÁZEV_SOUBORU ** - - 1. Napiš :!dir pro ujištění, že soubor TEST stále existuje. - - 2. Přesuň kurzor na vrch této stránky. - -POZNÁMKA: Po vykonání kroku 3 uvidíš lekci 1.5.3. Potom se opět přesuň dolů - na tuto lekci. - - 3. Nyní vlož soubor TEST použitím příkazu :r TEST kde TEST je název - souboru. - -POZNÁMKA: Soubor, který vkládáš se vloží od místa, kde se nachází kurzor. - - 4. Pro potvrzení vložení souboru, přesuň kurzor zpět a všimni si, že teď - máš dvě kopie lekce 1.5.3, originál a souborovou verzi. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRNUTÍ LEKCE 1.5 - - - 1. :!příkaz vykoná vnější příkaz. - - Některé užitečné příklady jsou: - (MS-DOS) (Unix) - :!dir :!ls - zobrazí obsah souboru. - :!del SOUBOR :!rm SOUBOR - odstraní SOUBOR. - - 2. :w SOUBOR uloží aktuální text jako SOUBOR na disk. - - 3. :#,#w SOUBOR uloží řádky od # do # do SOUBORU. - - 4. :r SOUBOR vybere z disku SOUBOR a vloží ho do editovaného souboru - za pozici kurzoru. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.1: PŘÍKAZ OTEVŘÍT - - - ** Napiš o pro vložení řádku pod kurzor a přepnutí do Vkládacího módu. ** - - 1. Přemísti kurzor níže na řádek označený --->. - - 2. Napiš o (malé) pro vložení řádku POD kurzor a přepnutí do - Vkládacího módu. - - 3. Nyní zkopíruj řádek označený ---> a stiskni pro ukončení - Vkládacího módu. - ----> Po stisknutí o se kurzor přemístí na vložený řádek do Vkládacího - módu. - - 4. Pro otevření řádku NAD kurzorem jednoduše napiš velké O , místo - malého o. Vyzkoušej si to na následujícím řádku. -Vlož řádek nad tímto napsáním Shift-O po umístění kurzoru na tento řádek. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.2: PŘÍKAZ PŘIDAT - - - ** Stiskni a pro vložení textu ZA kurzor. ** - - 1. Přesuň kurzor na níže na konec řádky označené ---> - stisknutím $ v Normálním módu. - - 2. Stiskni a (malé) pro přidání textu ZA znak, který je pod kurzorem. - (Velké A přidá na konec řádku.) - -Poznámka: Tímto se vyhneš stisknutí i , posledního znaku, textu na vložení, - , kurzor doprava, a nakonec x na přidávání na konec řádku! - - 3. Nyní dokončí první řádek. Všimni si, že přidávání je vlastně stejné jako - Vkládací mód, kromě místa, kam se text vkládá. - ----> Tento řádek ti umožňuje nacvičit ----> Tento řádek ti umožňuje nacvičit přidávání textu na konec řádky. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.3: JINÝ ZPŮSOB NAHRAZOVÁNÍ - - - ** Napiš velké R pro nahrazení víc než jednoho znaku. ** - - 1. Přesuň kurzor na první řádek označený --->. - - 2. Umísti kurzor na začátek prvního slova, které je odlišné od druhého - řádku označeného ---> (slovo 'poslední'). - - 3. Nyní stiskni R a nahraď zbytek textu na prvním řádku přepsáním - starého textu tak, aby byl první řádek stejný jako ten druhý. - ----> Pro upravení prvního řádku do tvaru toho poslední na straně použij kl. ----> Pro upravení prvního řádku do tvaru toho druhého, napiš R a nový text. - - 4. Všimni si, že jakmile stiskneš všechen nezměněný text zůstává. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekce 1.6.4: NASTAVENÍ MOŽNOSTÍ - - ** Nastav možnost, že vyhledávání anebo nahrazování nedbá velikosti písmen ** - - 1. Vyhledej řetězec 'ignore' napsáním: - /ignore - Zopakuj několikrát stisknutí klávesy n. - - 2. Nastav možnost 'ic' (Ignore case) napsáním příkazu: - :set ic - - 3. Nyní znovu vyhledej 'ignore' stisknutím: n - Několikrát hledání zopakuj stisknutím klávesy n. - - 4. Nastav možnosti 'hlsearch' a 'incsearch': - :set hls is - - 5. Nyní znovu vykonej vyhledávací příkaz a sleduj, co se stane: - /ignore - - 6. Pro vypnutí zvýrazňování výsledků napiš: - :nohlsearch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SHRHNUTÍ LEKCE 1.6 - - - 1. Stisknutí o otevře nový řádek POD kurzorem a umístí kurzor na vložený - řádek do Vkládacího módu. - Napsání velkého O otevře řádek NAD řádkem, na kterém je kurzor. - - 2. Stiskni a pro vložení textu ZA znak na pozici kurzoru. - Napsání velkého A automaticky přidá text na konec řádku. - - 3. Stisknutí velkého R přepne do Nahrazovacího módu, dokud - nestiskneš pro jeho ukončení. - - 4. Napsání ":set xxx" nastaví možnosti "xxx". - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCE 1.7: PŘÍKAZY ON-LINE NÁPOVĚDY - - - ** Používej on-line systém nápovědy ** - - Vim má obsáhlý on-line systém nápovědy. Pro začátek vyzkoušej jeden z - následujících: - - stiskni klávesu (pokud ji máš) - - stiskni klávesu (pokud ji máš) - - napiš :help - - Napiš :q pro uzavření okna nápovědy. - - Můžeš najít nápovědu k jakémukoliv tématu přidáním argumentu k - příkazu ":help". Zkus tyto (nezapomeň stisknout ): - - :help w - :help c_ L-tasten er til h�jre og flytter til h�jre. + < h l > L-tasten er til højre og flytter til højre. j J-tasten ligner en ned-pil. v - 1. Flyt mark�ren rundt p� sk�rmen indtil du er fortrolig med det. + 1. Flyt markøren rundt på skærmen indtil du er fortrolig med det. 2. Hold ned-tasten (j) nede, indtil den gentager. - Nu ved du hvordan du flytter til den n�ste lektion. + Nu ved du hvordan du flytter til den næste lektion. 3. Brug ned-tasten til at flytte til lektion 1.2. -BEM�RK: Hvis du nogensinde bliver i tvivl om noget du skrev, s� tryk p� - for at stille dig i normal tilstand. Skriv s� kommandoen igen. +BEMÆRK: Hvis du nogensinde bliver i tvivl om noget du skrev, så tryk på + for at stille dig i normal tilstand. Skriv så kommandoen igen. -BEM�RK: Piletasterne b�r ogs� virke. Men med hjkl kan du flytte rundt - meget hurtigere, n�r du har v�nnet dig til det. Seri�st! +BEMÆRK: Piletasterne bør også virke. Men med hjkl kan du flytte rundt + meget hurtigere, når du har vænnet dig til det. Seriøst! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1.2: AFSLUT VIM - !! BEM�RK: L�s hele lektionen, inden trinnene nedenfor udf�res!! + !! BEMÆRK: Læs hele lektionen, inden trinnene nedenfor udføres!! - 1. Tryk p� -tasten (for at v�re sikker p�, at du er i normal tilstand). + 1. Tryk på -tasten (for at være sikker på, at du er i normal tilstand). 2. Skriv: :q! . - Det afslutter editoren, hvorved �ndringer som du har foretaget forkastes. + Det afslutter editoren, hvorved ændringer som du har foretaget forkastes. - 3. Vend tilbage hertil ved at udf�re kommandoen som fik dig ind i + 3. Vend tilbage hertil ved at udføre kommandoen som fik dig ind i vejledningen. Det var muligvis: vimtutor - 4. Hvis du har l�rt trinnene udenad og er klar, s� udf�r trin + 4. Hvis du har lært trinnene udenad og er klar, så udfør trin 1 til 3 for at afslutte og komme ind i editoren igen. -BEM�RK: :q! forkaster �ndringer som du har foretaget. Om f� lektioner - vil du l�re at gemme �ndringerne til en fil. +BEMÆRK: :q! forkaster ændringer som du har foretaget. Om få lektioner + vil du lære at gemme ændringerne til en fil. - 5. Flyt mark�ren ned til lektion 1.3. + 5. Flyt markøren ned til lektion 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1.3: TEKSTREDIGERING - SLET - ** Tryk p� x for at slette tegnet som mark�ren er ovenp�. ** + ** Tryk på x for at slette tegnet som markøren er ovenpå. ** - 1. Flyt mark�ren ned til linjen med --->. + 1. Flyt markøren ned til linjen med --->. - 2. Ret fejlene ved at flytte mark�ren indtil den er ovenp� + 2. Ret fejlene ved at flytte markøren indtil den er ovenpå tegnet som skal slettes. - 3. Tryk p� x-tasten for at slette det u�nskede tegn. + 3. Tryk på x-tasten for at slette det uønskede tegn. - 4. Gentag trin 2 til 4 indtil s�tningen er korrekt. + 4. Gentag trin 2 til 4 indtil sætningen er korrekt. ----> Kkoen sprangg ovverr m��nen. +---> Kkoen sprangg ovverr måånen. - 5. G� videre til lektion 1.4, nu hvor linjen er korrekt. + 5. Gå videre til lektion 1.4, nu hvor linjen er korrekt. -BEM�RK: Efterh�nden som du gennemg�r vejledningen, s� l�r det ikke udenad, - l�r det ved at g�re det. +BEMÆRK: Efterhånden som du gennemgår vejledningen, så lær det ikke udenad, + lær det ved at gøre det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.4: TEKSTREDIGERING - INDS�T + Lektion 1.1.4: TEKSTREDIGERING - INDSÆT - ** Tryk p� i for at inds�tte tekst. ** + ** Tryk på i for at indsætte tekst. ** - 1. Flyt mark�ren ned til den f�rste linje med --->. + 1. Flyt markøren ned til den første linje med --->. - 2. For at g�re den f�rste linje magen til den anden, skal mark�ren flyttes - ovenp� det f�rst tegn EFTER der hvor teksten skal inds�ttes. + 2. For at gøre den første linje magen til den anden, skal markøren flyttes + ovenpå det først tegn EFTER der hvor teksten skal indsættes. - 3. Tryk p� i og skriv de n�dvendige tilf�jelser. + 3. Tryk på i og skriv de nødvendige tilføjelser. - 4. Efterh�nden som hver fejl rettes, s� tryk p� for at vende tilbage - til normal tilstand. Gentag trin 2 til 4 for at rette s�tningen. + 4. Efterhånden som hver fejl rettes, så tryk på for at vende tilbage + til normal tilstand. Gentag trin 2 til 4 for at rette sætningen. ---> Der mangler tekst dene . ----> Der mangler noget tekst p� denne linje. +---> Der mangler noget tekst på denne linje. - 5. N�r du fortrolig med at inds�tte tekst, s� flyt til lektion 1.5. + 5. Når du fortrolig med at indsætte tekst, så flyt til lektion 1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.5: TEKSTREDIGERING - VEDH�FT + Lektion 1.1.5: TEKSTREDIGERING - VEDHÆFT - ** Tryk p� A for at vedh�fte tekst. ** + ** Tryk på A for at vedhæfte tekst. ** - 1. Flyt mark�ren ned til den f�rste linje med --->. - Det er lige meget hvilket tegn mark�ren er p�, p� linjen. + 1. Flyt markøren ned til den første linje med --->. + Det er lige meget hvilket tegn markøren er på, på linjen. - 2. Tryk p� A og skriv de n�dvendige tilf�jelser. + 2. Tryk på A og skriv de nødvendige tilføjelser. - 3. Tryk p� n�r teksten er blevet vedh�ftet for at vende tilbage til normal tilstand. + 3. Tryk på når teksten er blevet vedhæftet for at vende tilbage til normal tilstand. - 4. Flyt mark�ren til den anden linje med ---> og gentag - trin 2 og 3 for at rette s�tningen. + 4. Flyt markøren til den anden linje med ---> og gentag + trin 2 og 3 for at rette sætningen. ----> Der mangler noget tekst p� den - Der mangler noget tekst p� denne linje. ----> Der mangler ogs� noget tek - Der mangler ogs� noget tekst her. +---> Der mangler noget tekst på den + Der mangler noget tekst på denne linje. +---> Der mangler også noget tek + Der mangler også noget tekst her. - 5. N�r du er fortrolig med at vedh�fte tekst, s� flyt til lektion 1.6. + 5. Når du er fortrolig med at vedhæfte tekst, så flyt til lektion 1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1.6: REDIGER EN FIL ** Brug :wq til at gemme en fil og afslutte. ** - !! BEM�RK: L�s hele lektionen, inden trinnene nedenfor udf�res!! + !! BEMÆRK: Læs hele lektionen, inden trinnene nedenfor udføres!! 1. Afslut vejledningen som du gjorde i lektion 1.1.2: :q! - Eller g�r f�lgende i en anden terminal, hvis du har adgang til en. + Eller gør følgende i en anden terminal, hvis du har adgang til en. 2. Skriv denne kommando i skalprompten: vim tutor - 'vim' er kommandoen til at starte Vim-editoren, 'tutor' er navnet p� - filen som du vil redigere. Brug en fil som kan �ndres. + 'vim' er kommandoen til at starte Vim-editoren, 'tutor' er navnet på + filen som du vil redigere. Brug en fil som kan ændres. - 3. Inds�t og slet tekst, som du l�rte vi de forrige lektioner. + 3. Indsæt og slet tekst, som du lærte vi de forrige lektioner. - 4. Gem filen med �ndringer og afslut Vim med: :wq + 4. Gem filen med ændringer og afslut Vim med: :wq - 5. Hvis du afsluttede vimtutor i trin 1, s� genstart vimtutor og flyt ned - til f�lgende opsummering. + 5. Hvis du afsluttede vimtutor i trin 1, så genstart vimtutor og flyt ned + til følgende opsummering. - 6. Udf�r trinnene ovenfor, n�r du har l�st og forst�et dem. + 6. Udfør trinnene ovenfor, når du har læst og forstået dem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1 OPSUMMERING - 1. Mark�ren flyttes enten med piletasterne eller hjkl-tasterne. - h (venstre) j (ned) k (op) l (h�jre) + 1. Markøren flyttes enten med piletasterne eller hjkl-tasterne. + h (venstre) j (ned) k (op) l (højre) 2. Vim startes fra skalprompten, ved at skrive: vim FILNAVN - 3. Vim afsluttes, ved at skrive: :q! for at forkaste alle �ndringer. - ELLER, ved at skrive: :wq for at gemme �ndringerne. + 3. Vim afsluttes, ved at skrive: :q! for at forkaste alle ændringer. + ELLER, ved at skrive: :wq for at gemme ændringerne. - 4. Slet tegn ved mark�ren, ved at skrive: x + 4. Slet tegn ved markøren, ved at skrive: x - 5. Inds�t eller vedh�ft tekst, ved at skrive: - i skriv indsat tekst inds�t inden mark�ren - A skriv vedh�ftet tekst vedh�ft efter linjen + 5. Indsæt eller vedhæft tekst, ved at skrive: + i skriv indsat tekst indsæt inden markøren + A skriv vedhæftet tekst vedhæft efter linjen -BEM�RK: N�r der trykkes p� , s� stilles du i normal tilstand eller ogs� - annulleres en u�nsket og delvist fuldf�rt kommando. +BEMÆRK: Når der trykkes på , så stilles du i normal tilstand eller også + annulleres en uønsket og delvist fuldført kommando. -Forts�t nu med lektion 2. +Fortsæt nu med lektion 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.2.1: SLETTEKOMMANDOER @@ -188,21 +188,21 @@ Forts ** Skriv dw for at slette et ord. ** - 1. Tryk p� for at v�re sikker p�, at du er i normal tilstand. + 1. Tryk på for at være sikker på, at du er i normal tilstand. - 2. Flyt mark�ren ned til linjen med --->. + 2. Flyt markøren ned til linjen med --->. - 3. Flyt mark�ren til begyndelsen af et ord som skal slettes. + 3. Flyt markøren til begyndelsen af et ord som skal slettes. - 4. Skriv dw for at f� ordet til at forsvinde. + 4. Skriv dw for at få ordet til at forsvinde. - BEM�RK: Bogstavet d vises p� den sidste linje p� den sk�rm du skrev - det p�. Vim venter p� at du skriver w . Hvis du ser et andet tegn - end d , s� skrev du forkert; tryk p� og start forfra. + BEMÆRK: Bogstavet d vises på den sidste linje på den skærm du skrev + det på. Vim venter på at du skriver w . Hvis du ser et andet tegn + end d , så skrev du forkert; tryk på og start forfra. ----> Der er regnorm nogle ord som sjovt ikke h�rer til papir i s�tningen. +---> Der er regnorm nogle ord som sjovt ikke hører til papir i sætningen. - 5. Gentag trin 3 og 4 indtil s�tningen er korrekt og g� til lektion 2.2. + 5. Gentag trin 3 og 4 indtil sætningen er korrekt og gå til lektion 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -211,57 +211,57 @@ Forts ** Skriv d$ for at slette til slutningen af linjen. ** - 1. Tryk p� for at v�re sikker p�, at du er i normal tilstand. + 1. Tryk på for at være sikker på, at du er i normal tilstand. - 2. Flyt mark�ren ned til linjen med --->. + 2. Flyt markøren ned til linjen med --->. - 3. Flyt mark�ren til slutningen af den rette linje (EFTER det f�rste . ). + 3. Flyt markøren til slutningen af den rette linje (EFTER det første . ). 4. Skriv d$ for at slette til slutningen af linjen. ---> Nogen skrev slutningen af linjen to gange. slutningen af linjen to gange. - 5. Flyt videre til lektion 2.3 for at forst� hvad der sker. + 5. Flyt videre til lektion 2.3 for at forstå hvad der sker. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.3: OM OPERATORER OG BEV�GELSER + Lektion 1.2.3: OM OPERATORER OG BEVÆGELSER - Mange kommandoer som �ndre tekst skabes fra en operator og en bev�gelse. - Formatet til en slettekommando med sletteoperatoren d er som f�lger: + Mange kommandoer som ændre tekst skabes fra en operator og en bevægelse. + Formatet til en slettekommando med sletteoperatoren d er som følger: - d bev�gelse + d bevægelse Hvor: d - er sletteoperatoren. - bev�gelse - er hvad operatoren skal arbejde p� (oplistet nedenfor). + bevægelse - er hvad operatoren skal arbejde på (oplistet nedenfor). - En kort liste over bev�gelser: - w - indtil begyndelsen af det n�ste ord, EKSKLUSIV dets f�rste tegn. - e - til slutningen af det nuv�rende ord, INKLUSIV det sidste tegn. + En kort liste over bevægelser: + w - indtil begyndelsen af det næste ord, EKSKLUSIV dets første tegn. + e - til slutningen af det nuværende ord, INKLUSIV det sidste tegn. $ - til slutningen af linjen, INKLUSIV det sidste tegn. - S� n�r der skrives de s� slettes der fra mark�ren til slutningen af ordet. + Så når der skrives de så slettes der fra markøren til slutningen af ordet. -BEM�RK: N�r kun bev�gelsen trykkes i normal tilstand, uden en operator, - s� flyttes mark�ren som angivet. +BEMÆRK: Når kun bevægelsen trykkes i normal tilstand, uden en operator, + så flyttes markøren som angivet. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.4: BRUG T�LLER TIL EN BEV�GELSE + Lektion 1.2.4: BRUG TÆLLER TIL EN BEVÆGELSE - ** N�r der skrives et nummer inden en bev�gelse, s� gentages den det antal gange. ** + ** Når der skrives et nummer inden en bevægelse, så gentages den det antal gange. ** - 1. Flyt mark�ren ned til begyndelsen af linjen med --->. + 1. Flyt markøren ned til begyndelsen af linjen med --->. - 2. Skriv 2w for at flytte mark�ren fremad to ord. + 2. Skriv 2w for at flytte markøren fremad to ord. - 3. Skriv 3e for at flytte mark�ren fremad til slutningen af det tredje ord. + 3. Skriv 3e for at flytte markøren fremad til slutningen af det tredje ord. 4. Skriv 0 (nul) for at flytte til begyndelsen af linjen. @@ -275,21 +275,21 @@ BEM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.5: BRUG T�LLER TIL AT SLETTE FLERE + Lektion 1.2.5: BRUG TÆLLER TIL AT SLETTE FLERE - ** N�r der skrives et nummer med en operator, s� gentages den det antal gange. ** + ** Når der skrives et nummer med en operator, så gentages den det antal gange. ** - I kombinationen med sletteoperatoren og en bev�gelse n�vnt ovenfor kan du - inds�tte en t�ller inden bev�gelsen for at slette flere: - d nummer bev�gelse + I kombinationen med sletteoperatoren og en bevægelse nævnt ovenfor kan du + indsætte en tæller inden bevægelsen for at slette flere: + d nummer bevægelse - 1. Flyt mark�ren til det f�rste ord MED STORT p� linjen med --->. + 1. Flyt markøren til det første ord MED STORT på linjen med --->. 2. Skriv d2w for at slette de to ord MED STORT - 3. Gentag trin 1 og 2 med en anden t�ller for at slette de efterf�lgende - ord MED STORT med �n kommando + 3. Gentag trin 1 og 2 med en anden tæller for at slette de efterfølgende + ord MED STORT med én kommando ---> denne ABC DE linje FGHI JK LMN OP med ord er Q RS TUV renset. @@ -298,45 +298,45 @@ BEM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.6: ARBEJD P� LINJER + Lektion 1.2.6: ARBEJD PÅ LINJER ** Skriv dd for at slette en hel linje. ** - Pga. at sletning af linjer bruges s� ofte, s� besluttede designerne af Vi - at det ville v�re lettere bare at skrive to d'er for at slette en linje. + Pga. at sletning af linjer bruges så ofte, så besluttede designerne af Vi + at det ville være lettere bare at skrive to d'er for at slette en linje. - 1. Flyt mark�ren til den anden linje i frasen nedenfor. + 1. Flyt markøren til den anden linje i frasen nedenfor. 2. Skriv dd for at slette linjen. 3. Flyt nu til den fjerde linje. 4. Skriv 2dd for at slette to linjer. ----> 1) Roser er r�de, +---> 1) Roser er røde, ---> 2) Mudder er sjovt, ----> 3) Violer er bl�, +---> 3) Violer er blå, ---> 4) Jeg har en scooter, ---> 5) Ure viser tiden, ----> 6) Sukker er s�dt ----> 7) Og du er lige s�. +---> 6) Sukker er sødt +---> 7) Og du er lige så. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.2.7: FORTRYD-KOMMANDOEN - ** Tryk p� u for at fortryde de sidste kommandoer, U for at rette en hel linje. ** + ** Tryk på u for at fortryde de sidste kommandoer, U for at rette en hel linje. ** - 1. Flyt mark�ren ned til linjen med ---> og placer den p� - den f�rste fejl. - 2. Skriv x for at slette det f�rste u�nskede tegn. - 3. Skriv nu u for at fortryde den sidste kommando der blev udf�rt. - 4. Ret denne gang alle fejlene p� linjen med x-kommadoen. - 5. Skriv nu et stort U for at f� linjen tilbage til dens oprindelige tilstand. - 6. Skriv nu u nogle f� gange for at fortryde U'et og forudg�ende kommandoer. - 7. Skriv nu CTRL-R (hold CTRL-tasten nede mens der trykkes p� R) nogle f� gange - for at omg�re kommandoerne (fortryd fortrydelserne). + 1. Flyt markøren ned til linjen med ---> og placer den på + den første fejl. + 2. Skriv x for at slette det første uønskede tegn. + 3. Skriv nu u for at fortryde den sidste kommando der blev udført. + 4. Ret denne gang alle fejlene på linjen med x-kommadoen. + 5. Skriv nu et stort U for at få linjen tilbage til dens oprindelige tilstand. + 6. Skriv nu u nogle få gange for at fortryde U'et og forudgående kommandoer. + 7. Skriv nu CTRL-R (hold CTRL-tasten nede mens der trykkes på R) nogle få gange + for at omgøre kommandoerne (fortryd fortrydelserne). ----> Rett fejlene pp� liinjen og errstat dem meed fortryd. +---> Rett fejlene ppå liinjen og errstat dem meed fortryd. 8. Det er meget nyttige kommandoer. Flyt nu til lektion 2 opsummering. @@ -347,45 +347,45 @@ BEM Lektion 2 OPSUMMERING - 1. Slet fra mark�ren op til det n�ste ord, ved at skrive: dw - 2. Slet fra mark�ren til slutningen af en linje, ved at skrive: d$ + 1. Slet fra markøren op til det næste ord, ved at skrive: dw + 2. Slet fra markøren til slutningen af en linje, ved at skrive: d$ 3. Slet en hel linje, ved at skrive: dd - 4. Gentag en bev�gelse ved at vedh�fte et nummer i begyndelsen: 2w - 5. Formatet til en �ndr-kommando er: - operator [nummer] bev�gelse + 4. Gentag en bevægelse ved at vedhæfte et nummer i begyndelsen: 2w + 5. Formatet til en ændr-kommando er: + operator [nummer] bevægelse hvor: - operator - er hvad der skal g�res, s�som d for at slette - [nummer] - er en valgfri t�ller til at gentage bev�gelsen - bev�gelse - flytter over teksten som der skal arbejde p�, s�som w (ord), + operator - er hvad der skal gøres, såsom d for at slette + [nummer] - er en valgfri tæller til at gentage bevægelsen + bevægelse - flytter over teksten som der skal arbejde på, såsom w (ord), $ (til slutningen af linjen), osv. 6. Flyt til begyndelsen af linjen med et nul: 0 7. Fortryd tidligere handlinger, ved at skrive: u (lille u) - Fortryd alle �ndringerne p� en linje, ved at skrive: U (stort U) + Fortryd alle ændringerne på en linje, ved at skrive: U (stort U) Fortryd fortrydelserne, ved at skrive: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.1: PUT-INDS�TTE-KOMMANDOEN + Lektion 1.3.1: PUT-INDSÆTTE-KOMMANDOEN - ** Skriv p for at put-inds�tte tidligere slettede tekst efter mark�ren. ** + ** Skriv p for at put-indsætte tidligere slettede tekst efter markøren. ** - 1. Flyt mark�ren ned til den f�rste linje med --->. + 1. Flyt markøren ned til den første linje med --->. 2. Skriv dd for at slette linjen og gemme den i et Vim-register. - 3. Flyt mark�ren til c)-linjen, OVER hvor den slettede linje skal v�re. + 3. Flyt markøren til c)-linjen, OVER hvor den slettede linje skal være. - 4. Skriv p for at put-inds�tte linjen nedenunder mark�ren. + 4. Skriv p for at put-indsætte linjen nedenunder markøren. - 5. Gentag trin 2 til 4 for at put-inds�tte alle linjerne i den rigtige r�kkef�lge. + 5. Gentag trin 2 til 4 for at put-indsætte alle linjerne i den rigtige rækkefølge. ----> d) Kan du l�re lige s�? ----> b) Violer er bl�, ----> c) Intelligens skal l�res, ----> a) Roser er r�de, +---> d) Kan du lære lige så? +---> b) Violer er blå, +---> c) Intelligens skal læres, +---> a) Roser er røde, @@ -393,160 +393,160 @@ BEM Lektion 1.3.2: ERSTAT-KOMMANDOEN - ** Skriv rx for at erstatte tegnet ved mark�ren med x . ** + ** Skriv rx for at erstatte tegnet ved markøren med x . ** - 1. Flyt mark�ren ned til den f�rste linje med --->. + 1. Flyt markøren ned til den første linje med --->. - 2. Flyt mark�ren s� den er ovenp� den f�rste fejl. + 2. Flyt markøren så den er ovenpå den første fejl. - 3. Skriv r og s� tegnet som skal v�re der. + 3. Skriv r og så tegnet som skal være der. - 4. Gentag trin 2 og 3 indtil den f�rste linje er magen til den anden. + 4. Gentag trin 2 og 3 indtil den første linje er magen til den anden. ----> Def var nohen der trukkede p� de forkerge taster, da linjem blev skrevet! ----> Der var nogen der trykkede p� de forkerte taster, da linjen blev skrevet! +---> Def var nohen der trukkede på de forkerge taster, da linjem blev skrevet! +---> Der var nogen der trykkede på de forkerte taster, da linjen blev skrevet! 5. Flyt nu videre til lektion 3.3. -BEM�RK: Husk p� at du skal l�re ved at g�re det, ikke ved at l�re det udenad. +BEMÆRK: Husk på at du skal lære ved at gøre det, ikke ved at lære det udenad. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.3: �NDRINGSOPERATOREN + Lektion 1.3.3: ÆNDRINGSOPERATOREN - ** �ndr indtil slutningen af et ord, ved at skrive ce . ** + ** Ændr indtil slutningen af et ord, ved at skrive ce . ** - 1. Flyt mark�ren ned til den f�rste linje med --->. + 1. Flyt markøren ned til den første linje med --->. - 2. Placer mark�ren p� k'et i likibj. + 2. Placer markøren på k'et i likibj. - 3. Skriv ce og det korrekte ord (i dette tilf�lde skrives njen ). + 3. Skriv ce og det korrekte ord (i dette tilfælde skrives njen ). - 4. Tryk p� og flyt til det n�ste tegn der skal �ndres. + 4. Tryk på og flyt til det næste tegn der skal ændres. - 5. Gentag trin 3 og 4 indtil den f�rste s�tning er magen til den anden. + 5. Gentag trin 3 og 4 indtil den første sætning er magen til den anden. ----> Likibj har nogle f� ndo som vnes �ndres vrf �ndringsoperatoren. ----> Linjen har nogle f� ord som skal �ndres med �ndringsoperatoren. +---> Likibj har nogle få ndo som vnes ændres vrf ændringsoperatoren. +---> Linjen har nogle få ord som skal ændres med ændringsoperatoren. -Bem�rk at ce sletter ordet og stiller dig i inds�t-tilstand. +Bemærk at ce sletter ordet og stiller dig i indsæt-tilstand. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.4: FLERE �NDRINGER MED c + Lektion 1.3.4: FLERE ÆNDRINGER MED c - ** �NDRINGSOPERATOREN bruges med de samme bev�gelser som slet. ** + ** ÆNDRINGSOPERATOREN bruges med de samme bevægelser som slet. ** - 1. �ndringsoperatoren virker p� samme m�de som slet. Formatet er: + 1. Ændringsoperatoren virker på samme måde som slet. Formatet er: - c [nummer] bev�gelse + c [nummer] bevægelse - 2. Bev�gelserne er de samme, s�som w (ord) og $ (slutningen af linjen). + 2. Bevægelserne er de samme, såsom w (ord) og $ (slutningen af linjen). - 3. Flyt ned til den f�rste linje med --->. + 3. Flyt ned til den første linje med --->. - 4. Flyt mark�ren til den f�rste fejl. + 4. Flyt markøren til den første fejl. - 5. Skriv c$ og skriv resten af linjen som den anden linje og tryk p� . + 5. Skriv c$ og skriv resten af linjen som den anden linje og tryk på . ----> Slutningen af linjen har brug for lidt hj�lp til at blive ligesom den anden. +---> Slutningen af linjen har brug for lidt hjælp til at blive ligesom den anden. ---> Slutningen af linjen skal rettes med c$-kommandoen. -BEM�RK: Du kan bruge backspace-tasten til at rette fejl n�r du skriver. +BEMÆRK: Du kan bruge backspace-tasten til at rette fejl når du skriver. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 3 OPSUMMERING - 1. Put-inds�t tekst tilbage som lige er blevet slettet, ved at skrive p . - Det put-inds�tter den slettede tekst EFTER mark�ren (hvis en linje blev - slettet, s� vil den v�re p� linjen nedenunder mark�ren). + 1. Put-indsæt tekst tilbage som lige er blevet slettet, ved at skrive p . + Det put-indsætter den slettede tekst EFTER markøren (hvis en linje blev + slettet, så vil den være på linjen nedenunder markøren). - 2. Erstat tegnet under mark�ren, ved at skrive r og s� + 2. Erstat tegnet under markøren, ved at skrive r og så tegnet som du vil have der. - 3. �ndringsoperatoren giver dig mulighed for at �ndre fra mark�ren til hvor - bev�gelsen tager dig hen. Skriv f.eks. ce for at �ndre fra mark�ren til - slutningen af ordet, c$ for at �ndre til slutningen af en linjen. + 3. Ændringsoperatoren giver dig mulighed for at ændre fra markøren til hvor + bevægelsen tager dig hen. Skriv f.eks. ce for at ændre fra markøren til + slutningen af ordet, c$ for at ændre til slutningen af en linjen. - 4. Formatet til at �ndre er: + 4. Formatet til at ændre er: - c [nummer] bev�gelse + c [nummer] bevægelse -G� nu videre til den n�ste lektion. +Gå nu videre til den næste lektion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.1: MARK�RPLACERING OG FILSTATUS + Lektion 1.4.1: MARKØRPLACERING OG FILSTATUS ** Skriv CTRL-G for at vise din placering i filen og filstatussen. Skriv G for at flytte til en linje i filen. ** - BEM�RK: L�s hele lektionen, inden trinnene udf�res!! + BEMÆRK: Læs hele lektionen, inden trinnene udføres!! - 1. Hold Ctrl-tasten nede og tryk p� g . Vi kalder det CTRL-G. - Der vises en meddelelse nederst p� siden med filnavnet og + 1. Hold Ctrl-tasten nede og tryk på g . Vi kalder det CTRL-G. + Der vises en meddelelse nederst på siden med filnavnet og placeringen i filen. Husk linjenummeret til trin 3. -BEM�RK: Du ser muligvis mark�rplaceringen nederst i h�jre hj�rne af sk�rmen. - Det sker n�r 'ruler'-valgmuligheden er sat (se :help 'ruler' ) +BEMÆRK: Du ser muligvis markørplaceringen nederst i højre hjørne af skærmen. + Det sker når 'ruler'-valgmuligheden er sat (se :help 'ruler' ) - 2. Tryk p� G for at flytte dig nederst i filen. - Skriv gg for at flytte dig �verst i filen. + 2. Tryk på G for at flytte dig nederst i filen. + Skriv gg for at flytte dig øverst i filen. - 3. Skriv nummeret p� den linje du var p�, og s� G . Det - returnerer dig til den linje du var p� da du f�rste trykkede p� CTRL-G. + 3. Skriv nummeret på den linje du var på, og så G . Det + returnerer dig til den linje du var på da du første trykkede på CTRL-G. - 4. Hvis du f�ler dig klar til at g�re det, s� udf�re trin 1 til 3. + 4. Hvis du føler dig klar til at gøre det, så udføre trin 1 til 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.2: S�G-KOMMANDOEN + Lektion 1.4.2: SØG-KOMMANDOEN - ** Skriv / efterfulgt af en frase for at s�ge efter frasen. ** + ** Skriv / efterfulgt af en frase for at søge efter frasen. ** - 1. I normal tilstand, skriv /-tegnet . Bem�rk at det og mark�ren - vises i bunden af sk�rmen som med :-kommandoen . + 1. I normal tilstand, skriv /-tegnet . Bemærk at det og markøren + vises i bunden af skærmen som med :-kommandoen . - 2. Skriv nu 'feeejjl' . Det er ordet du vil s�ge efter. + 2. Skriv nu 'feeejjl' . Det er ordet du vil søge efter. - 3. S�g efter den samme frase igen, ved blot at skrive n . - S�g efter den samme frase i den anden retning, ved at skrive N . + 3. Søg efter den samme frase igen, ved blot at skrive n . + Søg efter den samme frase i den anden retning, ved at skrive N . - 4. S�g efter en frase i den modsatte retning, ved at bruge ? i stedet for / . + 4. Søg efter en frase i den modsatte retning, ved at bruge ? i stedet for / . - 5. G� tilbage hvor du kom fra, ved at trykke p� CTRL-O (Hold Ctrl nede mens - der trykkes p� bogstavet o). Gentag for at g� l�ngere tilbage. CTRL-I g�r fremad. + 5. Gå tilbage hvor du kom fra, ved at trykke på CTRL-O (Hold Ctrl nede mens + der trykkes på bogstavet o). Gentag for at gå længere tilbage. CTRL-I går fremad. ----> "feeejjl" er den forkerte m�de at stave til fejl; feeejjl er en fejl. -BEM�RK: N�r s�gningen n�r slutningen af filen, s� forts�tter den ved - begyndelsen, men mindre 'wrapscan'-valgmuligheden er blevet sl�et fra. +---> "feeejjl" er den forkerte måde at stave til fejl; feeejjl er en fejl. +BEMÆRK: Når søgningen når slutningen af filen, så fortsætter den ved + begyndelsen, men mindre 'wrapscan'-valgmuligheden er blevet slået fra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.3: S�G EFTER MODSVARENDE PARENTESER + Lektion 1.4.3: SØG EFTER MODSVARENDE PARENTESER ** Skriv % for at finde en modsvarende ),], eller } . ** - 1. Placer mark�ren p� (, [, eller { p� linjen nedenfor med --->. + 1. Placer markøren på (, [, eller { på linjen nedenfor med --->. 2. Skriv nu %-tegnet . - 3. Mark�ren flytter til den modsvarende parentes eller klamme. + 3. Markøren flytter til den modsvarende parentes eller klamme. - 4. Skriv % for at flytte mark�ren til den anden modsvarende klamme. + 4. Skriv % for at flytte markøren til den anden modsvarende klamme. - 5. Flyt mark�ren til en anden (,),[,],{ eller } og se hvad % g�r. + 5. Flyt markøren til en anden (,),[,],{ eller } og se hvad % gør. ---> Dette ( er en testlinje med ('er, ['er ] og {'er }. )) -BEM�RK: Det er meget nyttigt ved fejlretning af et program som mangler +BEMÆRK: Det er meget nyttigt ved fejlretning af et program som mangler modsvarende parenteser! @@ -556,20 +556,20 @@ BEM ** Skriv :s/gammel/ny/g for at udskifte 'gammel' med 'ny'. ** - 1. Flyt mark�ren ned til linjen med --->. + 1. Flyt markøren ned til linjen med --->. - 2. Skriv :s/dett/det . Bem�rk at kommandoen kun �ndre den - f�rste forekomst af "dett" p� linjen. + 2. Skriv :s/dett/det . Bemærk at kommandoen kun ændre den + første forekomst af "dett" på linjen. - 3. Skriv nu :s/dett/det/g . N�r g-flaget tilf�jes, s� udskiftes der - globalt p� linjen, alts� �ndre alle forekomster af "dett" p� linjen. + 3. Skriv nu :s/dett/det/g . Når g-flaget tilføjes, så udskiftes der + globalt på linjen, altså ændre alle forekomster af "dett" på linjen. ----> dett siges at dett er bedst at se p� blomster n�r dett er for�r. +---> dett siges at dett er bedst at se på blomster når dett er forår. - 4. �ndr hver forekomst af en tegnstreng mellem to linjer, - ved at skrive :#,#s/gammel/ny/g hvor #,# er linjenumrene over omr�det + 4. Ændr hver forekomst af en tegnstreng mellem to linjer, + ved at skrive :#,#s/gammel/ny/g hvor #,# er linjenumrene over området af linjer hvor udskiftningen skal ske. - Skriv :%s/gammel/ny/g for at �ndre hver forekomst i hele filen. + Skriv :%s/gammel/ny/g for at ændre hver forekomst i hele filen. Skriv :%s/gammel/ny/gc for at finde hver forekomst i hele filen, med en prompt om hvorvidt der skal udskiftes eller ej. @@ -580,293 +580,293 @@ BEM 1. CTRL-G viser din placering i filen og filstatussen. G flytter til slutningen af filen. nummer G flytter til linjenummeret. - gg flytter til den f�rste linje. + gg flytter til den første linje. - 2. N�r der skrives / efterfulgt af en frase, s� s�ges der FREMAD efter frasen. - N�r der skrives ? efterfulgt af en frase, s� s�ges der BAGL�NS efter frasen. - Skriv n efter en s�gning, for at finde den n�ste forekomst i den samme retning, - eller N for at s�ge i den modsatte retning. - CTRL-O tager dig tilbage til �ldre placeringer, CTRL-I til nyere placeringer. + 2. Når der skrives / efterfulgt af en frase, så søges der FREMAD efter frasen. + Når der skrives ? efterfulgt af en frase, så søges der BAGLÆNS efter frasen. + Skriv n efter en søgning, for at finde den næste forekomst i den samme retning, + eller N for at søge i den modsatte retning. + CTRL-O tager dig tilbage til ældre placeringer, CTRL-I til nyere placeringer. - 3. N�r der skrives % mens mark�ren er p� et (,),[,],{, eller }, s� g�r den til dens match. + 3. Når der skrives % mens markøren er på et (,),[,],{, eller }, så går den til dens match. - 4. Udskift den f�rste f�rste gammel med ny p� en linje, ved at skrive :s/gammel/ny - Udskift alle gammel med ny p� en linje, ved at skrive :s/gammel/ny/g + 4. Udskift den første første gammel med ny på en linje, ved at skrive :s/gammel/ny + Udskift alle gammel med ny på en linje, ved at skrive :s/gammel/ny/g Udskift fraser mellem to linenumre, ved at skrive :#,#s/gammel/ny/g Udskift alle forekomster i filen, ved at skrive :%s/gammel/ny/g - Sp�rg om bekr�ftelse hver gang, ved at tilf�je 'c' :%s/gammel/ny/gc + Spørg om bekræftelse hver gang, ved at tilføje 'c' :%s/gammel/ny/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.1: UDF�R EN EKSTERN KOMMANDO + Lektion 1.5.1: UDFØR EN EKSTERN KOMMANDO - ** Skriv :! efterfulgt af en ekstern kommando, for at udf�re kommandoen. ** + ** Skriv :! efterfulgt af en ekstern kommando, for at udføre kommandoen. ** - 1. Skriv den velkendte kommando : for at s�tte mark�ren nederst p� - sk�rmen. Det giver dig mulighed for at indtaste en kommandolinjekommando. + 1. Skriv den velkendte kommando : for at sætte markøren nederst på + skærmen. Det giver dig mulighed for at indtaste en kommandolinjekommando. - 2. Skriv nu !-tegnet (udr�bstegn). Det giver dig mulighed - for at udf�re enhver ekstern skalkommando. + 2. Skriv nu !-tegnet (udråbstegn). Det giver dig mulighed + for at udføre enhver ekstern skalkommando. - 3. Skriv f.eks. ls efter ! og tryk s� p� . Det + 3. Skriv f.eks. ls efter ! og tryk så på . Det viser dig en liste over din mappe, ligesom hvis du var ved skalprompten. Eller brug :!dir hvis ikke ls virker. -BEM�RK: Det er muligt at udf�re enhver ekstern kommando p� denne m�de, - ogs� med argumenter. +BEMÆRK: Det er muligt at udføre enhver ekstern kommando på denne måde, + også med argumenter. -BEM�RK: Alle :-kommandoer skal afsluttes ved at trykke p� . - Vi n�vner det ikke altid herefter. +BEMÆRK: Alle :-kommandoer skal afsluttes ved at trykke på . + Vi nævner det ikke altid herefter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.5.2: MERE OM AT SKRIVE FILER - ** Gem �ndringerne som er foretaget til teksten, ved at skrive :w FILNAVN. ** + ** Gem ændringerne som er foretaget til teksten, ved at skrive :w FILNAVN. ** - 1. Skriv :!dir eller :!ls for at f� en liste over din mappe. - Du ved allerede at du skal trykke p� bagefter. + 1. Skriv :!dir eller :!ls for at få en liste over din mappe. + Du ved allerede at du skal trykke på bagefter. - 2. V�lg et filnavn som ikke findes endnu, s�som TEST. + 2. Vælg et filnavn som ikke findes endnu, såsom TEST. - 3. Skriv nu: :w TEST (hvor TEST er filnavnet som du v�lger.) + 3. Skriv nu: :w TEST (hvor TEST er filnavnet som du vælger.) 4. Det gemmer hele filen (Vim-vejledningen) under navnet TEST. - Bekr�ft det, ved igen at skrive :!dir eller :!ls for at se din mappe. + Bekræft det, ved igen at skrive :!dir eller :!ls for at se din mappe. -BEM�RK: Hvis du afslutter Vim og starter den igen med vim TEST , s� vil - filen v�re en n�jagtig kopi af vejledningen da du gemte den. +BEMÆRK: Hvis du afslutter Vim og starter den igen med vim TEST , så vil + filen være en nøjagtig kopi af vejledningen da du gemte den. 5. Fjern nu filen, ved at skrive (MS-DOS): :!del TEST eller (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.3: MARK�R TEKST SOM SKAL SKRIVES + Lektion 1.5.3: MARKÉR TEKST SOM SKAL SKRIVES - ** Gem en del af en fil, ved at skrive v bev�gelse :w FILNAVN ** + ** Gem en del af en fil, ved at skrive v bevægelse :w FILNAVN ** - 1. Flyt mark�ren til denne linje. + 1. Flyt markøren til denne linje. - 2. Tryk p� v og flyt mark�ren til the femte punkt nedenfor. Bem�rk at - teksten er fremh�vet. + 2. Tryk på v og flyt markøren til the femte punkt nedenfor. Bemærk at + teksten er fremhævet. - 3. Tryk p� :-tegnet . Nederst p� sk�rmen vises :'<,'>. + 3. Tryk på :-tegnet . Nederst på skærmen vises :'<,'>. - 4. Skriv w TEST , hvor TEST er filnavnet som endnu ikke findes. Bekr�ft - at du ser :'<,'>w TEST inden du trykker p� . + 4. Skriv w TEST , hvor TEST er filnavnet som endnu ikke findes. Bekræft + at du ser :'<,'>w TEST inden du trykker på . 5. Vim skriver de markerede linjer til filen TEST. Brug :!dir eller :!ls - for at se den. Fjern den ikke endnu! Vi bruger den i den n�ste lektion. + for at se den. Fjern den ikke endnu! Vi bruger den i den næste lektion. -BEM�RK: N�r der trykkes p� v startes visuel markering. Du kan flytte mark�ren - rundt for at g�re markeringen st�rre eller mindre. Du kan s� bruge en - operator til at g�re noget med teksten. F.eks. vil d slette teksten. +BEMÆRK: Når der trykkes på v startes visuel markering. Du kan flytte markøren + rundt for at gøre markeringen større eller mindre. Du kan så bruge en + operator til at gøre noget med teksten. F.eks. vil d slette teksten. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.4: INDHENT OG SAMMENL�G FILER + Lektion 1.5.4: INDHENT OG SAMMENLÆG FILER - ** Inds�t indholdet af en fil, ved at skrive :r FILNAVN ** + ** Indsæt indholdet af en fil, ved at skrive :r FILNAVN ** - 1. Placer mark�ren lige ovenover denne linje. + 1. Placer markøren lige ovenover denne linje. -BEM�RK: N�r trin 2 er udf�rt vil du se teksten fra lektion 5.3. Flyt s� +BEMÆRK: Når trin 2 er udført vil du se teksten fra lektion 5.3. Flyt så NED for at se denne lektion igen. 2. Indhent nu din TEST-fil med kommandoen :r TEST , hvor TEST er - navnet p� filen som du brugte. - Filen som du indhenter placeres under mark�rens linje. + navnet på filen som du brugte. + Filen som du indhenter placeres under markørens linje. - 3. Bekr�ft at en fil blev indhentet, ved at flytte mark�ren tilbage og bem�rk + 3. Bekræft at en fil blev indhentet, ved at flytte markøren tilbage og bemærk at der nu er to kopier af lektion 5.3, den originale og filversionen. -BEM�RK: Du kan ogs� l�se outputtet fra en ekstern kommando. F.eks. l�ser - :r !ls outputtet fra ls-kommandoen og inds�tter det under - mark�ren. +BEMÆRK: Du kan også læse outputtet fra en ekstern kommando. F.eks. læser + :r !ls outputtet fra ls-kommandoen og indsætter det under + markøren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 5 OPSUMMERING - 1. :!kommando udf�rer en ekstern kommando. + 1. :!kommando udfører en ekstern kommando. Nogle nyttige eksempler er: (MS-DOS) (Unix) :!dir :!ls - viser en liste over mapper. :!del FILNAVN :!rm FILNAVN - fjerner filen FILNAVN. - 2. :w FILNAVN skriver den nuv�rende Vim-fil til disken med navnet FILNAVN. + 2. :w FILNAVN skriver den nuværende Vim-fil til disken med navnet FILNAVN. - 3. v bev�gelse :w FILNAVN gemmer de visuelt markerede linjer i filen + 3. v bevægelse :w FILNAVN gemmer de visuelt markerede linjer i filen FILNAVN. - 4. :r FILNAVN indhenter diskfilen FILNAVN og inds�tter den under - mark�rens placering. + 4. :r FILNAVN indhenter diskfilen FILNAVN og indsætter den under + markørens placering. - 5. :r !dir l�ser outputtet fra dir-kommandoen og inds�tter det under - mark�rens placering. + 5. :r !dir læser outputtet fra dir-kommandoen og indsætter det under + markørens placering. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.1: �BN-KOMMANDOEN + Lektion 1.6.1: ÅBN-KOMMANDOEN - ** Skriv o for at �bne en linje under mark�ren og stille dig i inds�t-tilstand. ** + ** Skriv o for at åbne en linje under markøren og stille dig i indsæt-tilstand. ** - 1. Flyt mark�ren ned til linjen med --->. + 1. Flyt markøren ned til linjen med --->. - 2. Skriv bogstavet o med sm�t, for at �bne en linje UNDER mark�ren og stille - dig i inds�t-tilstand. + 2. Skriv bogstavet o med småt, for at åbne en linje UNDER markøren og stille + dig i indsæt-tilstand. - 3. Skriv nu noget tekst og tryk p� for at afslutte inds�t-tilstand. + 3. Skriv nu noget tekst og tryk på for at afslutte indsæt-tilstand. ----> Efter o er blevet skrevet, placeres mark�ren p� den �bne linje i inds�t-tilstand. +---> Efter o er blevet skrevet, placeres markøren på den åbne linje i indsæt-tilstand. 4. Skriv blot et stort O , i stedet for et lille o , for at - �bne en linje OVENOVER mark�ren. Pr�v det p� linjen nedenfor. + åbne en linje OVENOVER markøren. Prøv det på linjen nedenfor. ----> �bn en line ovenover denne, ved at skrive O mens mark�ren er p� denne linje. +---> Åbn en line ovenover denne, ved at skrive O mens markøren er på denne linje. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.2: VEDH�FT-KOMMANDOEN + Lektion 1.6.2: VEDHÆFT-KOMMANDOEN - ** Skriv a for at inds�tte tekst EFTER mark�ren. ** + ** Skriv a for at indsætte tekst EFTER markøren. ** - 1. Flyt mark�ren ned til begyndelsen af linjen med --->. + 1. Flyt markøren ned til begyndelsen af linjen med --->. - 2. Tryk p� e indtil mark�ren er p� slutningen af lin . + 2. Tryk på e indtil markøren er på slutningen af lin . - 3. Skriv et a (med sm�t) for at vedh�fte tekst EFTER mark�ren. + 3. Skriv et a (med småt) for at vedhæfte tekst EFTER markøren. - 4. Fuldf�r ordet ligesom linjen under det. Tryk p� for at afslutte - inds�t-tilstand. + 4. Fuldfør ordet ligesom linjen under det. Tryk på for at afslutte + indsæt-tilstand. - 5. Brug e til at flytte til det n�ste uf�rdige ord og gentag trin 3 og 4. + 5. Brug e til at flytte til det næste ufærdige ord og gentag trin 3 og 4. ----> Lin giver dig mulighed for at �v vedh�ftnin af tekst til en linje. ----> Linjen giver dig mulighed for at �ve vedh�ftning af tekst til en linje. +---> Lin giver dig mulighed for at øv vedhæftnin af tekst til en linje. +---> Linjen giver dig mulighed for at øve vedhæftning af tekst til en linje. -BEM�RK: a, i og A g�r alle til den samme inds�t-tilstand, - den eneste forskel er hvor tegnene inds�ttes. +BEMÆRK: a, i og A går alle til den samme indsæt-tilstand, + den eneste forskel er hvor tegnene indsættes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.3: AN ANDEN M�DE AT ERSTATTE + Lektion 1.6.3: AN ANDEN MÅDE AT ERSTATTE - ** Skriv et stort R for at erstatte flere end �t tegn. ** + ** Skriv et stort R for at erstatte flere end ét tegn. ** - 1. Flyt mark�ren ned til den f�rste linje med --->. Flyt mark�ren til - begyndelsen af den f�rste xxx . + 1. Flyt markøren ned til den første linje med --->. Flyt markøren til + begyndelsen af den første xxx . - 2. Tryk nu p� R og skriv nummeret som er under det p� den anden linje, - s� det erstatter xxx . + 2. Tryk nu på R og skriv nummeret som er under det på den anden linje, + så det erstatter xxx . - 3. Tryk p� for at forlade erstat-tilstand. Bem�rk at resten af linjen - forbliver u�ndret. + 3. Tryk på for at forlade erstat-tilstand. Bemærk at resten af linjen + forbliver uændret. 4. Gentag trinnene for at erstatte det sidste xxx. ----> N�r 123 l�gges sammen med xxx giver det xxx. ----> N�r 123 l�gges sammen med 456 giver det 579. +---> Når 123 lægges sammen med xxx giver det xxx. +---> Når 123 lægges sammen med 456 giver det 579. -BEM�RK: Erstat-tilstand er ligesom inds�t-tilstand, men hvert indtastede +BEMÆRK: Erstat-tilstand er ligesom indsæt-tilstand, men hvert indtastede tegn sletter et eksisterende tegn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.4: KOP�ER OG INDS�T TEKST + Lektion 1.6.4: KOPÍER OG INDSÆT TEKST - ** Brug y-operatoren til at kopiere tekst og p til at inds�tte den ** + ** Brug y-operatoren til at kopiere tekst og p til at indsætte den ** - 1. G� ned til linjen med ---> og placer mark�ren efter "a)". + 1. Gå ned til linjen med ---> og placer markøren efter "a)". - 2. Start visuel tilstand med v og flyt mark�ren til lige inden "f�rste". + 2. Start visuel tilstand med v og flyt markøren til lige inden "første". - 3. Skriv y for at yank-udtr�kke (kopiere) den fremh�vede tekst. + 3. Skriv y for at yank-udtrække (kopiere) den fremhævede tekst. - 4. Flyt mark�ren til slutningen af den n�ste linje: j$ + 4. Flyt markøren til slutningen af den næste linje: j$ - 5. Skriv p for at put-inds�tte (inds�tte) teksten. Skriv s�: a andet . + 5. Skriv p for at put-indsætte (indsætte) teksten. Skriv så: a andet . - 6. Brug visuel tilstand til at markere " punkt.", yank-udtr�k med y , flyt - til slutningen af n�ste linje med j$ og put-inds�t teksten der med p . + 6. Brug visuel tilstand til at markere " punkt.", yank-udtræk med y , flyt + til slutningen af næste linje med j$ og put-indsæt teksten der med p . ----> a) dette er det f�rste punkt. +---> a) dette er det første punkt. b) - BEM�RK: du kan ogs� bruge y som en operator; yw yank-udtr�kker et ord. + BEMÆRK: du kan også bruge y som en operator; yw yank-udtrækker et ord. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.5: S�T VALGMULIGHED + Lektion 1.6.5: SÆT VALGMULIGHED - ** S�t en valgmulighed s� en s�gning eller udskiftning ignorerer forskelle p� store/sm� bogstaver ** + ** Sæt en valgmulighed så en søgning eller udskiftning ignorerer forskelle på store/små bogstaver ** - 1. S�g efter 'ignorer', ved at skrive: /ignorer - Gentag flere gange ved at trykke p� n . + 1. Søg efter 'ignorer', ved at skrive: /ignorer + Gentag flere gange ved at trykke på n . - 2. S�t 'ic'-valgmuligheden (Ignorer forskelle p� store/sm� bogstaver), ved at skrive: :set ic + 2. Sæt 'ic'-valgmuligheden (Ignorer forskelle på store/små bogstaver), ved at skrive: :set ic - 3. S�g nu efter 'ignorer' igen, ved at trykke p� n - Bem�rk at Ignorer og IGNORER nu ogs� bliver fundet. + 3. Søg nu efter 'ignorer' igen, ved at trykke på n + Bemærk at Ignorer og IGNORER nu også bliver fundet. - 4. S�t 'hlsearch'- og 'incsearch'-valgmulighederne: :set hls is + 4. Sæt 'hlsearch'- og 'incsearch'-valgmulighederne: :set hls is - 5. Skriv nu s�g-kommandoen igen og se hvad der sker: /ignorer + 5. Skriv nu søg-kommandoen igen og se hvad der sker: /ignorer - 6. Deaktiv�r ignorering af forskelle p� store/sm� bogstaver, ved at skrive: :set noic + 6. Deaktivér ignorering af forskelle på store/små bogstaver, ved at skrive: :set noic -BEM�RK: Fjern fremh�vningen af matches, ved at skrive: :nohlsearch -BEM�RK: Hvis du vil ignorere case for en enkelt s�g-kommando, s� brug \c +BEMÆRK: Fjern fremhævningen af matches, ved at skrive: :nohlsearch +BEMÆRK: Hvis du vil ignorere case for en enkelt søg-kommando, så brug \c i frasen: /ignorer\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 6 OPSUMMERING - 1. Skriv o for at �bne en linje NEDENUNDER mark�ren og starte inds�t-tilstand. - Skriv O for at �bne en linje OVENOVER mark�ren. + 1. Skriv o for at åbne en linje NEDENUNDER markøren og starte indsæt-tilstand. + Skriv O for at åbne en linje OVENOVER markøren. - 2. Skriv a for at inds�tte tekst EFTER mark�ren. - Skriv A for at inds�tte tekst efter slutningen af linjen. + 2. Skriv a for at indsætte tekst EFTER markøren. + Skriv A for at indsætte tekst efter slutningen af linjen. 3. e-kommandoen flytter til slutningen af et ord. - 4. y-operatoren yank-udtr�kker (kopierer) tekst, p put-inds�tter (inds�tter) den. + 4. y-operatoren yank-udtrækker (kopierer) tekst, p put-indsætter (indsætter) den. - 5. N�r der skrives et stort R stilles du i erstat-tilstand indtil der trykkes p� . + 5. Når der skrives et stort R stilles du i erstat-tilstand indtil der trykkes på . - 6. N�r der skrives ":set xxx", s� s�ttes valgmuligheden "xxx". Nogle valgmuligheder er: - 'ic' 'ignorecase' ignorer forskelle p� store/sm� bogstaver n�r der s�ges - 'is' 'incsearch' vis delvise match for en s�gefrase - 'hls' 'hlsearch' fremh�v alle fraser som matcher + 6. Når der skrives ":set xxx", så sættes valgmuligheden "xxx". Nogle valgmuligheder er: + 'ic' 'ignorecase' ignorer forskelle på store/små bogstaver når der søges + 'is' 'incsearch' vis delvise match for en søgefrase + 'hls' 'hlsearch' fremhæv alle fraser som matcher Du kan enten bruge det lange eller korte valgmulighedsnavn. - 7. Vedh�ft "no" i begyndelsen, for at sl� en valgmulighed fra: :set noic + 7. Vedhæft "no" i begyndelsen, for at slå en valgmulighed fra: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.1: F� HJ�LP + Lektion 1.7.1: FÅ HJÆLP - ** Brug online-hj�lpesystemet ** + ** Brug online-hjælpesystemet ** - Vim har et omfattende online-hj�lpesystem. Pr�v en af disse tre, + Vim har et omfattende online-hjælpesystem. Prøv en af disse tre, for at komme i gang: - - tryk p� -tasten (hvis du har en) - - tryk p� -tasten (hvis du har en) + - tryk på -tasten (hvis du har en) + - tryk på -tasten (hvis du har en) - skriv :help - L�s teksten i hj�lpevinduet for at finde ud af hvordan hj�lpen virker. + Læs teksten i hjælpevinduet for at finde ud af hvordan hjælpen virker. Skriv CTRL-W CTRL-W for at hoppe fra et vindue til et andet. - Skriv :q for at lukke hj�lpevinduet. + Skriv :q for at lukke hjælpevinduet. - Du kan finde hj�lp om n�sten alle emner, ved at give et argument til - ":help"-kommandoen. Pr�v disse (husk at trykke p� ): + Du kan finde hjælp om næsten alle emner, ved at give et argument til + ":help"-kommandoen. Prøv disse (husk at trykke på ): :help w :help c_CTRL-D @@ -876,64 +876,64 @@ BEM Lektion 1.7.2: OPRET ET OPSTARTS-SCRIPT - ** Aktiv�r Vim-funktionaliteter ** + ** Aktivér Vim-funktionaliteter ** Vim har mange flere funktionaliteter end Vi, men de fleste er deaktiveret som standard. For at bruge flere funktionaliteter skal du oprette en "vimrc"-fil. - 1. Begynd at redigere "vimrc"-filen. Det afh�nger af dit system: + 1. Begynd at redigere "vimrc"-filen. Det afhænger af dit system: :e ~/.vimrc i Unix :e ~/_vimrc i MS-Windows - 2. L�s nu indholdet af eksempel "vimrc"-filen: + 2. Læs nu indholdet af eksempel "vimrc"-filen: :r $VIMRUNTIME/vimrc_example.vim 3. Skriv filen med: :w - N�ste gang du starter Vim bruger den syntaksfremh�vning. - Du kan tilf�je alle dine foretrukne indstillinger til "vimrc"-filen. - F� mere information, ved at skrive :help vimrc-intro + Næste gang du starter Vim bruger den syntaksfremhævning. + Du kan tilføje alle dine foretrukne indstillinger til "vimrc"-filen. + Få mere information, ved at skrive :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.3: FULDF�RELSE + Lektion 1.7.3: FULDFØRELSE - ** Kommandolinjefuldf�relse med CTRL-D og ** + ** Kommandolinjefuldførelse med CTRL-D og ** - 1. S�rg for at Vim ikke er i kompatibel tilstand: :set nocp + 1. Sørg for at Vim ikke er i kompatibel tilstand: :set nocp 2. Se hvilke filer der er i mappen: :!ls eller :!dir 3. Skriv begyndelsen af en kommando: :e - 4. Tryk p� CTRL-D og Vim viser en liste over kommandoer der begynder med "e". + 4. Tryk på CTRL-D og Vim viser en liste over kommandoer der begynder med "e". - 5. Tryk p� og Vim vil fuldf�re kommandonavnet til ":edit". + 5. Tryk på og Vim vil fuldføre kommandonavnet til ":edit". - 6. Tilf�j nu et mellemrum og begyndelsen af et eksisterende filnavn: :edit FIL + 6. Tilføj nu et mellemrum og begyndelsen af et eksisterende filnavn: :edit FIL - 7. Tryk p� . Vim fuldf�rer navnet (hvis det er unikt). + 7. Tryk på . Vim fuldfører navnet (hvis det er unikt). -BEM�RK: Fuldf�relse virker til mange kommandoer. Pr�v blot at trykke p� - CTRL-D og . Det er s�rligt nyttigt til :help . +BEMÆRK: Fuldførelse virker til mange kommandoer. Prøv blot at trykke på + CTRL-D og . Det er særligt nyttigt til :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 7 OPSUMMERING - 1. Skriv :help eller tryk p� eller for at �bne et hj�lpevindue. + 1. Skriv :help eller tryk på eller for at åbne et hjælpevindue. - 2. Skriv :help kommando for at finde hj�lp om kommando . + 2. Skriv :help kommando for at finde hjælp om kommando . 3. Skriv CTRL-W CTRL-W for at hoppe til et andet vindue - 4. Skriv :q for at lukke hj�lpevinduet + 4. Skriv :q for at lukke hjælpevinduet 5. Opret et vimrc-opstarts-script for at bevare dine foretrukne indstillinger. - 6. N�r der skrives en :-kommando , s� tryk p� CTRL-D for at se - mulige fuldf�relser. Tryk p� for at bruge en fuldf�relse. + 6. Når der skrives en :-kommando , så tryk på CTRL-D for at se + mulige fuldførelser. Tryk på for at bruge en fuldførelse. @@ -946,26 +946,26 @@ BEM Det afslutter Vim-vejledningen. Det var meningen den skulle give et kortfattet overblik af Vim-editoren, lige nok til at du kan bruge editoren nogenlunde let. Den er langt fra komplet, da Vim har mange mange flere - kommandoer. L�s brugermanualen som det n�ste: ":help user-manual". + kommandoer. Læs brugermanualen som det næste: ":help user-manual". - Denne bog anbefales, til yderligere l�sning og studering: + Denne bog anbefales, til yderligere læsning og studering: Vim - Vi Improved - af Steve Oualline Forlag: New Riders - Den f�rste bog som helt er tilegnet Vim. Specielt nyttig for begyndere. + Den første bog som helt er tilegnet Vim. Specielt nyttig for begyndere. Der er mange eksempler og billeder. Se https://iccf-holland.org/click5.html - Denne bog er �ldre og mere om Vi end Vim, men anbefales ogs�: + Denne bog er ældre og mere om Vi end Vim, men anbefales også: Learning the Vi Editor - af Linda Lamb Forlag: O'Reilly & Associates Inc. - Det er en god bog til at komme til kende n�sten alt hvad du vil g�re med Vi. - Den sjette udgave inkluderer ogs� information om Vim. + Det er en god bog til at komme til kende næsten alt hvad du vil gøre med Vi. + Den sjette udgave inkluderer også information om Vim. Vejledningen blev skrevet af Michael C. Pierce og Robert K. Ware, Colorado School of Mines med ideer af Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. - �ndret til Vim af Bram Moolenaar. + Ændret til Vim af Bram Moolenaar. Oversat af scootergrisen. diff --git a/runtime/tutor/tutor1.da.utf-8 b/runtime/tutor/tutor1.da.utf-8 deleted file mode 100644 index c7b1ef7c12..0000000000 --- a/runtime/tutor/tutor1.da.utf-8 +++ /dev/null @@ -1,972 +0,0 @@ -=============================================================================== -= V e l k o m m e n t i l V I M - v e j l e d n i n g e n - Version 1.7 = -=============================================================================== - - Vim er en meget kraftfuld editor med mange kommandoer, for mange til - at forklare i en vejledning som denne. Vejledningen er designet til at - beskrive nok af kommandoerne til at du vil være i stand til let at bruge - Vim som en alsidig editor. - - Det tager cirka 25-30 minutter at fuldføre vejledningen, - afhængig af hvor meget tid der bruges på at eksperimentere. - - VÆR OPMÆRKSOM PÅ AT: - Kommandoerne i lektionerne ændrer teksten. Opret en kopi af filen - til at øve på (hvis du startede "vimtutor", så er det allerede en kopi). - - Det er vigtigt at huske på at vejledningen er sat op til at lære ved at - bruge. Det betyder at du skal udføre kommandoerne for at lære at bruge - dem ordentligt. Læser du kun teksten, så glemmer du kommandoerne! - - Sørg for at din Caps-Lock-tast IKKE er aktiveret og tryk - på j-tasten nok gange til at flytte markøren så lektion 1.1 - fylder hele skærmen. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.1: FLYT MARKØREN - - - ** Tryk på h-,j-,k-,l-tasterne som vist, for at flytte markøren. ** - ^ - k Fif: H-tasten er til venstre og flytter til venstre. - < h l > L-tasten er til højre og flytter til højre. - j J-tasten ligner en ned-pil. - v - 1. Flyt markøren rundt på skærmen indtil du er fortrolig med det. - - 2. Hold ned-tasten (j) nede, indtil den gentager. - Nu ved du hvordan du flytter til den næste lektion. - - 3. Brug ned-tasten til at flytte til lektion 1.2. - -BEMÆRK: Hvis du nogensinde bliver i tvivl om noget du skrev, så tryk på - for at stille dig i normal tilstand. Skriv så kommandoen igen. - -BEMÆRK: Piletasterne bør også virke. Men med hjkl kan du flytte rundt - meget hurtigere, når du har vænnet dig til det. Seriøst! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.2: AFSLUT VIM - - - !! BEMÆRK: Læs hele lektionen, inden trinnene nedenfor udføres!! - - 1. Tryk på -tasten (for at være sikker på, at du er i normal tilstand). - - 2. Skriv: :q! . - Det afslutter editoren, hvorved ændringer som du har foretaget forkastes. - - 3. Vend tilbage hertil ved at udføre kommandoen som fik dig ind i - vejledningen. Det var muligvis: vimtutor - - 4. Hvis du har lært trinnene udenad og er klar, så udfør trin - 1 til 3 for at afslutte og komme ind i editoren igen. - -BEMÆRK: :q! forkaster ændringer som du har foretaget. Om få lektioner - vil du lære at gemme ændringerne til en fil. - - 5. Flyt markøren ned til lektion 1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.3: TEKSTREDIGERING - SLET - - - ** Tryk på x for at slette tegnet som markøren er ovenpå. ** - - 1. Flyt markøren ned til linjen med --->. - - 2. Ret fejlene ved at flytte markøren indtil den er ovenpå - tegnet som skal slettes. - - 3. Tryk på x-tasten for at slette det uønskede tegn. - - 4. Gentag trin 2 til 4 indtil sætningen er korrekt. - ----> Kkoen sprangg ovverr måånen. - - 5. Gå videre til lektion 1.4, nu hvor linjen er korrekt. - -BEMÆRK: Efterhånden som du gennemgår vejledningen, så lær det ikke udenad, - lær det ved at gøre det. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.4: TEKSTREDIGERING - INDSÆT - - - ** Tryk på i for at indsætte tekst. ** - - 1. Flyt markøren ned til den første linje med --->. - - 2. For at gøre den første linje magen til den anden, skal markøren flyttes - ovenpå det først tegn EFTER der hvor teksten skal indsættes. - - 3. Tryk på i og skriv de nødvendige tilføjelser. - - 4. Efterhånden som hver fejl rettes, så tryk på for at vende tilbage - til normal tilstand. Gentag trin 2 til 4 for at rette sætningen. - ----> Der mangler tekst dene . ----> Der mangler noget tekst på denne linje. - - 5. Når du fortrolig med at indsætte tekst, så flyt til lektion 1.5. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.5: TEKSTREDIGERING - VEDHÆFT - - - ** Tryk på A for at vedhæfte tekst. ** - - 1. Flyt markøren ned til den første linje med --->. - Det er lige meget hvilket tegn markøren er på, på linjen. - - 2. Tryk på A og skriv de nødvendige tilføjelser. - - 3. Tryk på når teksten er blevet vedhæftet for at vende tilbage til normal tilstand. - - 4. Flyt markøren til den anden linje med ---> og gentag - trin 2 og 3 for at rette sætningen. - ----> Der mangler noget tekst på den - Der mangler noget tekst på denne linje. ----> Der mangler også noget tek - Der mangler også noget tekst her. - - 5. Når du er fortrolig med at vedhæfte tekst, så flyt til lektion 1.6. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.6: REDIGER EN FIL - - ** Brug :wq til at gemme en fil og afslutte. ** - - !! BEMÆRK: Læs hele lektionen, inden trinnene nedenfor udføres!! - - 1. Afslut vejledningen som du gjorde i lektion 1.1.2: :q! - Eller gør følgende i en anden terminal, hvis du har adgang til en. - - 2. Skriv denne kommando i skalprompten: vim tutor - 'vim' er kommandoen til at starte Vim-editoren, 'tutor' er navnet på - filen som du vil redigere. Brug en fil som kan ændres. - - 3. Indsæt og slet tekst, som du lærte vi de forrige lektioner. - - 4. Gem filen med ændringer og afslut Vim med: :wq - - 5. Hvis du afsluttede vimtutor i trin 1, så genstart vimtutor og flyt ned - til følgende opsummering. - - 6. Udfør trinnene ovenfor, når du har læst og forstået dem. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1 OPSUMMERING - - - 1. Markøren flyttes enten med piletasterne eller hjkl-tasterne. - h (venstre) j (ned) k (op) l (højre) - - 2. Vim startes fra skalprompten, ved at skrive: vim FILNAVN - - 3. Vim afsluttes, ved at skrive: :q! for at forkaste alle ændringer. - ELLER, ved at skrive: :wq for at gemme ændringerne. - - 4. Slet tegn ved markøren, ved at skrive: x - - 5. Indsæt eller vedhæft tekst, ved at skrive: - i skriv indsat tekst indsæt inden markøren - A skriv vedhæftet tekst vedhæft efter linjen - -BEMÆRK: Når der trykkes på , så stilles du i normal tilstand eller også - annulleres en uønsket og delvist fuldført kommando. - -Fortsæt nu med lektion 2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.1: SLETTEKOMMANDOER - - - ** Skriv dw for at slette et ord. ** - - 1. Tryk på for at være sikker på, at du er i normal tilstand. - - 2. Flyt markøren ned til linjen med --->. - - 3. Flyt markøren til begyndelsen af et ord som skal slettes. - - 4. Skriv dw for at få ordet til at forsvinde. - - BEMÆRK: Bogstavet d vises på den sidste linje på den skærm du skrev - det på. Vim venter på at du skriver w . Hvis du ser et andet tegn - end d , så skrev du forkert; tryk på og start forfra. - ----> Der er regnorm nogle ord som sjovt ikke hører til papir i sætningen. - - 5. Gentag trin 3 og 4 indtil sætningen er korrekt og gå til lektion 2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.2: FLERE SLETTEKOMMANDOER - - - ** Skriv d$ for at slette til slutningen af linjen. ** - - 1. Tryk på for at være sikker på, at du er i normal tilstand. - - 2. Flyt markøren ned til linjen med --->. - - 3. Flyt markøren til slutningen af den rette linje (EFTER det første . ). - - 4. Skriv d$ for at slette til slutningen af linjen. - ----> Nogen skrev slutningen af linjen to gange. slutningen af linjen to gange. - - - 5. Flyt videre til lektion 2.3 for at forstå hvad der sker. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.3: OM OPERATORER OG BEVÆGELSER - - - Mange kommandoer som ændre tekst skabes fra en operator og en bevægelse. - Formatet til en slettekommando med sletteoperatoren d er som følger: - - d bevægelse - - Hvor: - d - er sletteoperatoren. - bevægelse - er hvad operatoren skal arbejde på (oplistet nedenfor). - - En kort liste over bevægelser: - w - indtil begyndelsen af det næste ord, EKSKLUSIV dets første tegn. - e - til slutningen af det nuværende ord, INKLUSIV det sidste tegn. - $ - til slutningen af linjen, INKLUSIV det sidste tegn. - - Så når der skrives de så slettes der fra markøren til slutningen af ordet. - -BEMÆRK: Når kun bevægelsen trykkes i normal tilstand, uden en operator, - så flyttes markøren som angivet. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.4: BRUG TÆLLER TIL EN BEVÆGELSE - - - ** Når der skrives et nummer inden en bevægelse, så gentages den det antal gange. ** - - 1. Flyt markøren ned til begyndelsen af linjen med --->. - - 2. Skriv 2w for at flytte markøren fremad to ord. - - 3. Skriv 3e for at flytte markøren fremad til slutningen af det tredje ord. - - 4. Skriv 0 (nul) for at flytte til begyndelsen af linjen. - - 5. Gentag trin 2 og 3 med forskellige numre. - ----> Dette er blot en linje med ord som du kan flytte rundt i. - - 6. Flyt videre til lektion 2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.5: BRUG TÆLLER TIL AT SLETTE FLERE - - - ** Når der skrives et nummer med en operator, så gentages den det antal gange. ** - - I kombinationen med sletteoperatoren og en bevægelse nævnt ovenfor kan du - indsætte en tæller inden bevægelsen for at slette flere: - d nummer bevægelse - - 1. Flyt markøren til det første ord MED STORT på linjen med --->. - - 2. Skriv d2w for at slette de to ord MED STORT - - 3. Gentag trin 1 og 2 med en anden tæller for at slette de efterfølgende - ord MED STORT med én kommando - ----> denne ABC DE linje FGHI JK LMN OP med ord er Q RS TUV renset. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.6: ARBEJD PÅ LINJER - - - ** Skriv dd for at slette en hel linje. ** - - Pga. at sletning af linjer bruges så ofte, så besluttede designerne af Vi - at det ville være lettere bare at skrive to d'er for at slette en linje. - - 1. Flyt markøren til den anden linje i frasen nedenfor. - 2. Skriv dd for at slette linjen. - 3. Flyt nu til den fjerde linje. - 4. Skriv 2dd for at slette to linjer. - ----> 1) Roser er røde, ----> 2) Mudder er sjovt, ----> 3) Violer er blå, ----> 4) Jeg har en scooter, ----> 5) Ure viser tiden, ----> 6) Sukker er sødt ----> 7) Og du er lige så. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.7: FORTRYD-KOMMANDOEN - - - ** Tryk på u for at fortryde de sidste kommandoer, U for at rette en hel linje. ** - - 1. Flyt markøren ned til linjen med ---> og placer den på - den første fejl. - 2. Skriv x for at slette det første uønskede tegn. - 3. Skriv nu u for at fortryde den sidste kommando der blev udført. - 4. Ret denne gang alle fejlene på linjen med x-kommadoen. - 5. Skriv nu et stort U for at få linjen tilbage til dens oprindelige tilstand. - 6. Skriv nu u nogle få gange for at fortryde U'et og forudgående kommandoer. - 7. Skriv nu CTRL-R (hold CTRL-tasten nede mens der trykkes på R) nogle få gange - for at omgøre kommandoerne (fortryd fortrydelserne). - ----> Rett fejlene ppå liinjen og errstat dem meed fortryd. - - 8. Det er meget nyttige kommandoer. Flyt nu til lektion 2 opsummering. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 2 OPSUMMERING - - - 1. Slet fra markøren op til det næste ord, ved at skrive: dw - 2. Slet fra markøren til slutningen af en linje, ved at skrive: d$ - 3. Slet en hel linje, ved at skrive: dd - - 4. Gentag en bevægelse ved at vedhæfte et nummer i begyndelsen: 2w - 5. Formatet til en ændr-kommando er: - operator [nummer] bevægelse - hvor: - operator - er hvad der skal gøres, såsom d for at slette - [nummer] - er en valgfri tæller til at gentage bevægelsen - bevægelse - flytter over teksten som der skal arbejde på, såsom w (ord), - $ (til slutningen af linjen), osv. - - 6. Flyt til begyndelsen af linjen med et nul: 0 - - 7. Fortryd tidligere handlinger, ved at skrive: u (lille u) - Fortryd alle ændringerne på en linje, ved at skrive: U (stort U) - Fortryd fortrydelserne, ved at skrive: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.1: PUT-INDSÆTTE-KOMMANDOEN - - - ** Skriv p for at put-indsætte tidligere slettede tekst efter markøren. ** - - 1. Flyt markøren ned til den første linje med --->. - - 2. Skriv dd for at slette linjen og gemme den i et Vim-register. - - 3. Flyt markøren til c)-linjen, OVER hvor den slettede linje skal være. - - 4. Skriv p for at put-indsætte linjen nedenunder markøren. - - 5. Gentag trin 2 til 4 for at put-indsætte alle linjerne i den rigtige rækkefølge. - ----> d) Kan du lære lige så? ----> b) Violer er blå, ----> c) Intelligens skal læres, ----> a) Roser er røde, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.2: ERSTAT-KOMMANDOEN - - - ** Skriv rx for at erstatte tegnet ved markøren med x . ** - - 1. Flyt markøren ned til den første linje med --->. - - 2. Flyt markøren så den er ovenpå den første fejl. - - 3. Skriv r og så tegnet som skal være der. - - 4. Gentag trin 2 og 3 indtil den første linje er magen til den anden. - ----> Def var nohen der trukkede på de forkerge taster, da linjem blev skrevet! ----> Der var nogen der trykkede på de forkerte taster, da linjen blev skrevet! - - 5. Flyt nu videre til lektion 3.3. - -BEMÆRK: Husk på at du skal lære ved at gøre det, ikke ved at lære det udenad. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.3: ÆNDRINGSOPERATOREN - - - ** Ændr indtil slutningen af et ord, ved at skrive ce . ** - - 1. Flyt markøren ned til den første linje med --->. - - 2. Placer markøren på k'et i likibj. - - 3. Skriv ce og det korrekte ord (i dette tilfælde skrives njen ). - - 4. Tryk på og flyt til det næste tegn der skal ændres. - - 5. Gentag trin 3 og 4 indtil den første sætning er magen til den anden. - ----> Likibj har nogle få ndo som vnes ændres vrf ændringsoperatoren. ----> Linjen har nogle få ord som skal ændres med ændringsoperatoren. - -Bemærk at ce sletter ordet og stiller dig i indsæt-tilstand. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.4: FLERE ÆNDRINGER MED c - - - ** ÆNDRINGSOPERATOREN bruges med de samme bevægelser som slet. ** - - 1. Ændringsoperatoren virker på samme måde som slet. Formatet er: - - c [nummer] bevægelse - - 2. Bevægelserne er de samme, såsom w (ord) og $ (slutningen af linjen). - - 3. Flyt ned til den første linje med --->. - - 4. Flyt markøren til den første fejl. - - 5. Skriv c$ og skriv resten af linjen som den anden linje og tryk på . - ----> Slutningen af linjen har brug for lidt hjælp til at blive ligesom den anden. ----> Slutningen af linjen skal rettes med c$-kommandoen. - -BEMÆRK: Du kan bruge backspace-tasten til at rette fejl når du skriver. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 3 OPSUMMERING - - - 1. Put-indsæt tekst tilbage som lige er blevet slettet, ved at skrive p . - Det put-indsætter den slettede tekst EFTER markøren (hvis en linje blev - slettet, så vil den være på linjen nedenunder markøren). - - 2. Erstat tegnet under markøren, ved at skrive r og så - tegnet som du vil have der. - - 3. Ændringsoperatoren giver dig mulighed for at ændre fra markøren til hvor - bevægelsen tager dig hen. Skriv f.eks. ce for at ændre fra markøren til - slutningen af ordet, c$ for at ændre til slutningen af en linjen. - - 4. Formatet til at ændre er: - - c [nummer] bevægelse - -Gå nu videre til den næste lektion. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.1: MARKØRPLACERING OG FILSTATUS - - ** Skriv CTRL-G for at vise din placering i filen og filstatussen. - Skriv G for at flytte til en linje i filen. ** - - BEMÆRK: Læs hele lektionen, inden trinnene udføres!! - - 1. Hold Ctrl-tasten nede og tryk på g . Vi kalder det CTRL-G. - Der vises en meddelelse nederst på siden med filnavnet og - placeringen i filen. Husk linjenummeret til trin 3. - -BEMÆRK: Du ser muligvis markørplaceringen nederst i højre hjørne af skærmen. - Det sker når 'ruler'-valgmuligheden er sat (se :help 'ruler' ) - - 2. Tryk på G for at flytte dig nederst i filen. - Skriv gg for at flytte dig øverst i filen. - - 3. Skriv nummeret på den linje du var på, og så G . Det - returnerer dig til den linje du var på da du første trykkede på CTRL-G. - - 4. Hvis du føler dig klar til at gøre det, så udføre trin 1 til 3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.2: SØG-KOMMANDOEN - - - ** Skriv / efterfulgt af en frase for at søge efter frasen. ** - - 1. I normal tilstand, skriv /-tegnet . Bemærk at det og markøren - vises i bunden af skærmen som med :-kommandoen . - - 2. Skriv nu 'feeejjl' . Det er ordet du vil søge efter. - - 3. Søg efter den samme frase igen, ved blot at skrive n . - Søg efter den samme frase i den anden retning, ved at skrive N . - - 4. Søg efter en frase i den modsatte retning, ved at bruge ? i stedet for / . - - 5. Gå tilbage hvor du kom fra, ved at trykke på CTRL-O (Hold Ctrl nede mens - der trykkes på bogstavet o). Gentag for at gå længere tilbage. CTRL-I går fremad. - ----> "feeejjl" er den forkerte måde at stave til fejl; feeejjl er en fejl. -BEMÆRK: Når søgningen når slutningen af filen, så fortsætter den ved - begyndelsen, men mindre 'wrapscan'-valgmuligheden er blevet slået fra. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.3: SØG EFTER MODSVARENDE PARENTESER - - - ** Skriv % for at finde en modsvarende ),], eller } . ** - - 1. Placer markøren på (, [, eller { på linjen nedenfor med --->. - - 2. Skriv nu %-tegnet . - - 3. Markøren flytter til den modsvarende parentes eller klamme. - - 4. Skriv % for at flytte markøren til den anden modsvarende klamme. - - 5. Flyt markøren til en anden (,),[,],{ eller } og se hvad % gør. - ----> Dette ( er en testlinje med ('er, ['er ] og {'er }. )) - - -BEMÆRK: Det er meget nyttigt ved fejlretning af et program som mangler - modsvarende parenteser! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.4: UDSKIFT-KOMMANDOEN - - - ** Skriv :s/gammel/ny/g for at udskifte 'gammel' med 'ny'. ** - - 1. Flyt markøren ned til linjen med --->. - - 2. Skriv :s/dett/det . Bemærk at kommandoen kun ændre den - første forekomst af "dett" på linjen. - - 3. Skriv nu :s/dett/det/g . Når g-flaget tilføjes, så udskiftes der - globalt på linjen, altså ændre alle forekomster af "dett" på linjen. - ----> dett siges at dett er bedst at se på blomster når dett er forår. - - 4. Ændr hver forekomst af en tegnstreng mellem to linjer, - ved at skrive :#,#s/gammel/ny/g hvor #,# er linjenumrene over området - af linjer hvor udskiftningen skal ske. - Skriv :%s/gammel/ny/g for at ændre hver forekomst i hele filen. - Skriv :%s/gammel/ny/gc for at finde hver forekomst i hele filen, - med en prompt om hvorvidt der skal udskiftes eller ej. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 4 OPSUMMERING - - - 1. CTRL-G viser din placering i filen og filstatussen. - G flytter til slutningen af filen. - nummer G flytter til linjenummeret. - gg flytter til den første linje. - - 2. Når der skrives / efterfulgt af en frase, så søges der FREMAD efter frasen. - Når der skrives ? efterfulgt af en frase, så søges der BAGLÆNS efter frasen. - Skriv n efter en søgning, for at finde den næste forekomst i den samme retning, - eller N for at søge i den modsatte retning. - CTRL-O tager dig tilbage til ældre placeringer, CTRL-I til nyere placeringer. - - 3. Når der skrives % mens markøren er på et (,),[,],{, eller }, så går den til dens match. - - 4. Udskift den første første gammel med ny på en linje, ved at skrive :s/gammel/ny - Udskift alle gammel med ny på en linje, ved at skrive :s/gammel/ny/g - Udskift fraser mellem to linenumre, ved at skrive :#,#s/gammel/ny/g - Udskift alle forekomster i filen, ved at skrive :%s/gammel/ny/g - Spørg om bekræftelse hver gang, ved at tilføje 'c' :%s/gammel/ny/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.1: UDFØR EN EKSTERN KOMMANDO - - - ** Skriv :! efterfulgt af en ekstern kommando, for at udføre kommandoen. ** - - 1. Skriv den velkendte kommando : for at sætte markøren nederst på - skærmen. Det giver dig mulighed for at indtaste en kommandolinjekommando. - - 2. Skriv nu !-tegnet (udråbstegn). Det giver dig mulighed - for at udføre enhver ekstern skalkommando. - - 3. Skriv f.eks. ls efter ! og tryk så på . Det - viser dig en liste over din mappe, ligesom hvis du var ved - skalprompten. Eller brug :!dir hvis ikke ls virker. - -BEMÆRK: Det er muligt at udføre enhver ekstern kommando på denne måde, - også med argumenter. - -BEMÆRK: Alle :-kommandoer skal afsluttes ved at trykke på . - Vi nævner det ikke altid herefter. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.2: MERE OM AT SKRIVE FILER - - - ** Gem ændringerne som er foretaget til teksten, ved at skrive :w FILNAVN. ** - - 1. Skriv :!dir eller :!ls for at få en liste over din mappe. - Du ved allerede at du skal trykke på bagefter. - - 2. Vælg et filnavn som ikke findes endnu, såsom TEST. - - 3. Skriv nu: :w TEST (hvor TEST er filnavnet som du vælger.) - - 4. Det gemmer hele filen (Vim-vejledningen) under navnet TEST. - Bekræft det, ved igen at skrive :!dir eller :!ls for at se din mappe. - -BEMÆRK: Hvis du afslutter Vim og starter den igen med vim TEST , så vil - filen være en nøjagtig kopi af vejledningen da du gemte den. - - 5. Fjern nu filen, ved at skrive (MS-DOS): :!del TEST - eller (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.3: MARKÉR TEKST SOM SKAL SKRIVES - - - ** Gem en del af en fil, ved at skrive v bevægelse :w FILNAVN ** - - 1. Flyt markøren til denne linje. - - 2. Tryk på v og flyt markøren til the femte punkt nedenfor. Bemærk at - teksten er fremhævet. - - 3. Tryk på :-tegnet . Nederst på skærmen vises :'<,'>. - - 4. Skriv w TEST , hvor TEST er filnavnet som endnu ikke findes. Bekræft - at du ser :'<,'>w TEST inden du trykker på . - - 5. Vim skriver de markerede linjer til filen TEST. Brug :!dir eller :!ls - for at se den. Fjern den ikke endnu! Vi bruger den i den næste lektion. - -BEMÆRK: Når der trykkes på v startes visuel markering. Du kan flytte markøren - rundt for at gøre markeringen større eller mindre. Du kan så bruge en - operator til at gøre noget med teksten. F.eks. vil d slette teksten. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.4: INDHENT OG SAMMENLÆG FILER - - - ** Indsæt indholdet af en fil, ved at skrive :r FILNAVN ** - - 1. Placer markøren lige ovenover denne linje. - -BEMÆRK: Når trin 2 er udført vil du se teksten fra lektion 5.3. Flyt så - NED for at se denne lektion igen. - - 2. Indhent nu din TEST-fil med kommandoen :r TEST , hvor TEST er - navnet på filen som du brugte. - Filen som du indhenter placeres under markørens linje. - - 3. Bekræft at en fil blev indhentet, ved at flytte markøren tilbage og bemærk - at der nu er to kopier af lektion 5.3, den originale og filversionen. - -BEMÆRK: Du kan også læse outputtet fra en ekstern kommando. F.eks. læser - :r !ls outputtet fra ls-kommandoen og indsætter det under - markøren. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 5 OPSUMMERING - - - 1. :!kommando udfører en ekstern kommando. - - Nogle nyttige eksempler er: - (MS-DOS) (Unix) - :!dir :!ls - viser en liste over mapper. - :!del FILNAVN :!rm FILNAVN - fjerner filen FILNAVN. - - 2. :w FILNAVN skriver den nuværende Vim-fil til disken med navnet FILNAVN. - - 3. v bevægelse :w FILNAVN gemmer de visuelt markerede linjer i filen - FILNAVN. - - 4. :r FILNAVN indhenter diskfilen FILNAVN og indsætter den under - markørens placering. - - 5. :r !dir læser outputtet fra dir-kommandoen og indsætter det under - markørens placering. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.1: ÅBN-KOMMANDOEN - - - ** Skriv o for at åbne en linje under markøren og stille dig i indsæt-tilstand. ** - - 1. Flyt markøren ned til linjen med --->. - - 2. Skriv bogstavet o med småt, for at åbne en linje UNDER markøren og stille - dig i indsæt-tilstand. - - 3. Skriv nu noget tekst og tryk på for at afslutte indsæt-tilstand. - ----> Efter o er blevet skrevet, placeres markøren på den åbne linje i indsæt-tilstand. - - 4. Skriv blot et stort O , i stedet for et lille o , for at - åbne en linje OVENOVER markøren. Prøv det på linjen nedenfor. - ----> Åbn en line ovenover denne, ved at skrive O mens markøren er på denne linje. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.2: VEDHÆFT-KOMMANDOEN - - - ** Skriv a for at indsætte tekst EFTER markøren. ** - - 1. Flyt markøren ned til begyndelsen af linjen med --->. - - 2. Tryk på e indtil markøren er på slutningen af lin . - - 3. Skriv et a (med småt) for at vedhæfte tekst EFTER markøren. - - 4. Fuldfør ordet ligesom linjen under det. Tryk på for at afslutte - indsæt-tilstand. - - 5. Brug e til at flytte til det næste ufærdige ord og gentag trin 3 og 4. - ----> Lin giver dig mulighed for at øv vedhæftnin af tekst til en linje. ----> Linjen giver dig mulighed for at øve vedhæftning af tekst til en linje. - -BEMÆRK: a, i og A går alle til den samme indsæt-tilstand, - den eneste forskel er hvor tegnene indsættes. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.3: AN ANDEN MÅDE AT ERSTATTE - - - ** Skriv et stort R for at erstatte flere end ét tegn. ** - - 1. Flyt markøren ned til den første linje med --->. Flyt markøren til - begyndelsen af den første xxx . - - 2. Tryk nu på R og skriv nummeret som er under det på den anden linje, - så det erstatter xxx . - - 3. Tryk på for at forlade erstat-tilstand. Bemærk at resten af linjen - forbliver uændret. - - 4. Gentag trinnene for at erstatte det sidste xxx. - ----> Når 123 lægges sammen med xxx giver det xxx. ----> Når 123 lægges sammen med 456 giver det 579. - -BEMÆRK: Erstat-tilstand er ligesom indsæt-tilstand, men hvert indtastede - tegn sletter et eksisterende tegn. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.4: KOPÍER OG INDSÆT TEKST - - - ** Brug y-operatoren til at kopiere tekst og p til at indsætte den ** - - 1. Gå ned til linjen med ---> og placer markøren efter "a)". - - 2. Start visuel tilstand med v og flyt markøren til lige inden "første". - - 3. Skriv y for at yank-udtrække (kopiere) den fremhævede tekst. - - 4. Flyt markøren til slutningen af den næste linje: j$ - - 5. Skriv p for at put-indsætte (indsætte) teksten. Skriv så: a andet . - - 6. Brug visuel tilstand til at markere " punkt.", yank-udtræk med y , flyt - til slutningen af næste linje med j$ og put-indsæt teksten der med p . - ----> a) dette er det første punkt. - b) - - BEMÆRK: du kan også bruge y som en operator; yw yank-udtrækker et ord. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.5: SÆT VALGMULIGHED - - - ** Sæt en valgmulighed så en søgning eller udskiftning ignorerer forskelle på store/små bogstaver ** - - 1. Søg efter 'ignorer', ved at skrive: /ignorer - Gentag flere gange ved at trykke på n . - - 2. Sæt 'ic'-valgmuligheden (Ignorer forskelle på store/små bogstaver), ved at skrive: :set ic - - 3. Søg nu efter 'ignorer' igen, ved at trykke på n - Bemærk at Ignorer og IGNORER nu også bliver fundet. - - 4. Sæt 'hlsearch'- og 'incsearch'-valgmulighederne: :set hls is - - 5. Skriv nu søg-kommandoen igen og se hvad der sker: /ignorer - - 6. Deaktivér ignorering af forskelle på store/små bogstaver, ved at skrive: :set noic - -BEMÆRK: Fjern fremhævningen af matches, ved at skrive: :nohlsearch -BEMÆRK: Hvis du vil ignorere case for en enkelt søg-kommando, så brug \c - i frasen: /ignorer\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 6 OPSUMMERING - - 1. Skriv o for at åbne en linje NEDENUNDER markøren og starte indsæt-tilstand. - Skriv O for at åbne en linje OVENOVER markøren. - - 2. Skriv a for at indsætte tekst EFTER markøren. - Skriv A for at indsætte tekst efter slutningen af linjen. - - 3. e-kommandoen flytter til slutningen af et ord. - - 4. y-operatoren yank-udtrækker (kopierer) tekst, p put-indsætter (indsætter) den. - - 5. Når der skrives et stort R stilles du i erstat-tilstand indtil der trykkes på . - - 6. Når der skrives ":set xxx", så sættes valgmuligheden "xxx". Nogle valgmuligheder er: - 'ic' 'ignorecase' ignorer forskelle på store/små bogstaver når der søges - 'is' 'incsearch' vis delvise match for en søgefrase - 'hls' 'hlsearch' fremhæv alle fraser som matcher - Du kan enten bruge det lange eller korte valgmulighedsnavn. - - 7. Vedhæft "no" i begyndelsen, for at slå en valgmulighed fra: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.1: FÅ HJÆLP - - - ** Brug online-hjælpesystemet ** - - Vim har et omfattende online-hjælpesystem. Prøv en af disse tre, - for at komme i gang: - - tryk på -tasten (hvis du har en) - - tryk på -tasten (hvis du har en) - - skriv :help - - Læs teksten i hjælpevinduet for at finde ud af hvordan hjælpen virker. - Skriv CTRL-W CTRL-W for at hoppe fra et vindue til et andet. - Skriv :q for at lukke hjælpevinduet. - - Du kan finde hjælp om næsten alle emner, ved at give et argument til - ":help"-kommandoen. Prøv disse (husk at trykke på ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.2: OPRET ET OPSTARTS-SCRIPT - - - ** Aktivér Vim-funktionaliteter ** - - Vim har mange flere funktionaliteter end Vi, men de fleste er deaktiveret som - standard. For at bruge flere funktionaliteter skal du oprette en "vimrc"-fil. - - 1. Begynd at redigere "vimrc"-filen. Det afhænger af dit system: - :e ~/.vimrc i Unix - :e ~/_vimrc i MS-Windows - - 2. Læs nu indholdet af eksempel "vimrc"-filen: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Skriv filen med: - :w - - Næste gang du starter Vim bruger den syntaksfremhævning. - Du kan tilføje alle dine foretrukne indstillinger til "vimrc"-filen. - Få mere information, ved at skrive :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.3: FULDFØRELSE - - - ** Kommandolinjefuldførelse med CTRL-D og ** - - 1. Sørg for at Vim ikke er i kompatibel tilstand: :set nocp - - 2. Se hvilke filer der er i mappen: :!ls eller :!dir - - 3. Skriv begyndelsen af en kommando: :e - - 4. Tryk på CTRL-D og Vim viser en liste over kommandoer der begynder med "e". - - 5. Tryk på og Vim vil fuldføre kommandonavnet til ":edit". - - 6. Tilføj nu et mellemrum og begyndelsen af et eksisterende filnavn: :edit FIL - - 7. Tryk på . Vim fuldfører navnet (hvis det er unikt). - -BEMÆRK: Fuldførelse virker til mange kommandoer. Prøv blot at trykke på - CTRL-D og . Det er særligt nyttigt til :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 7 OPSUMMERING - - - 1. Skriv :help eller tryk på eller for at åbne et hjælpevindue. - - 2. Skriv :help kommando for at finde hjælp om kommando . - - 3. Skriv CTRL-W CTRL-W for at hoppe til et andet vindue - - 4. Skriv :q for at lukke hjælpevinduet - - 5. Opret et vimrc-opstarts-script for at bevare dine foretrukne indstillinger. - - 6. Når der skrives en :-kommando , så tryk på CTRL-D for at se - mulige fuldførelser. Tryk på for at bruge en fuldførelse. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Det afslutter Vim-vejledningen. Det var meningen den skulle give et - kortfattet overblik af Vim-editoren, lige nok til at du kan bruge editoren - nogenlunde let. Den er langt fra komplet, da Vim har mange mange flere - kommandoer. Læs brugermanualen som det næste: ":help user-manual". - - Denne bog anbefales, til yderligere læsning og studering: - Vim - Vi Improved - af Steve Oualline - Forlag: New Riders - Den første bog som helt er tilegnet Vim. Specielt nyttig for begyndere. - Der er mange eksempler og billeder. - Se https://iccf-holland.org/click5.html - - Denne bog er ældre og mere om Vi end Vim, men anbefales også: - Learning the Vi Editor - af Linda Lamb - Forlag: O'Reilly & Associates Inc. - Det er en god bog til at komme til kende næsten alt hvad du vil gøre med Vi. - Den sjette udgave inkluderer også information om Vim. - - Vejledningen blev skrevet af Michael C. Pierce og Robert K. Ware, - Colorado School of Mines med ideer af Charles Smith, - Colorado State University. E-mail: bware@mines.colorado.edu. - - Ændret til Vim af Bram Moolenaar. - - Oversat af scootergrisen. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.de b/runtime/tutor/tutor1.de index f7cee3e8f7..f2157d9cd6 100644 --- a/runtime/tutor/tutor1.de +++ b/runtime/tutor/tutor1.de @@ -2,130 +2,130 @@ = W i l l k o m m e n im V I M T u t o r - Version 1.7.de.1 = =============================================================================== - Vim ist ein sehr m�chtiger Editor, der viele Befehle bereitstellt; zu viele, - um alle in einem Tutor wie diesem zu erkl�ren. Dieser Tutor ist so - gestaltet, um genug Befehle vorzustellen, dass Du die F�higkeit erlangst, + Vim ist ein sehr mächtiger Editor, der viele Befehle bereitstellt; zu viele, + um alle in einem Tutor wie diesem zu erklären. Dieser Tutor ist so + gestaltet, um genug Befehle vorzustellen, dass Du die Fähigkeit erlangst, Vim mit Leichtigkeit als einen Allzweck-Editor zu verwenden. - Die Zeit f�r das Durcharbeiten dieses Tutors betr�gt ca. 25-30 Minuten, - abh�ngig davon, wie viel Zeit Du mit Experimentieren verbringst. + Die Zeit für das Durcharbeiten dieses Tutors beträgt ca. 25-30 Minuten, + abhängig davon, wie viel Zeit Du mit Experimentieren verbringst. ACHTUNG: Die in den Lektionen angewendeten Kommandos werden den Text modifizieren. - Erstelle eine Kopie dieser Datei, in der Du �ben willst (falls Du "vimtutor" + Erstelle eine Kopie dieser Datei, in der Du üben willst (falls Du "vimtutor" aufgerufen hast, ist dies bereits eine Kopie). - Es ist wichtig, sich zu vergegenw�rtigen, dass dieser Tutor f�r das Anwenden + Es ist wichtig, sich zu vergegenwärtigen, dass dieser Tutor für das Anwenden konzipiert ist. Das bedeutet, dass Du die Befehle anwenden musst, um sie richtig zu lernen. Wenn Du nur den Text liest, vergisst Du die Befehle! - Jetzt stelle sicher, dass deine Umstelltaste NICHT gedr�ckt ist und bet�tige - die j Taste gen�gend Mal, um den Cursor nach unten zu bewegen, so dass - Lektion 1.1.1 den Bildschirm vollkommen ausf�llt. + Jetzt stelle sicher, dass deine Umstelltaste NICHT gedrückt ist und betätige + die j Taste genügend Mal, um den Cursor nach unten zu bewegen, so dass + Lektion 1.1.1 den Bildschirm vollkommen ausfüllt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1.1: BEWEGEN DES CURSORS - ** Um den Cursor zu bewegen, dr�cke die h,j,k,l Tasten wie unten gezeigt. ** + ** Um den Cursor zu bewegen, drücke die h,j,k,l Tasten wie unten gezeigt. ** ^ Hilfestellung: k Die h Taste befindet sich links und bewegt nach links. < h l > Die l Taste liegt rechts und bewegt nach rechts. - j Die j Taste �hnelt einem Pfeil nach unten. + j Die j Taste ähnelt einem Pfeil nach unten. v - 1. Bewege den Cursor auf dem Bildschirm umher, bis Du Dich sicher f�hlst. + 1. Bewege den Cursor auf dem Bildschirm umher, bis Du Dich sicher fühlst. - 2. Halte die Nach-Unten-Taste (j) gedr�ckt, bis sie sich wiederholt. - Jetzt wei�t Du, wie Du Dich zur n�chsten Lektion bewegen kannst. + 2. Halte die Nach-Unten-Taste (j) gedrückt, bis sie sich wiederholt. + Jetzt weißt Du, wie Du Dich zur nächsten Lektion bewegen kannst. 3. Benutze die Nach-Unten-Taste, um Dich zu Lektion 1.1.2 zu bewegen. -Anmerkung: Immer, wenn Du Dir unsicher bist �ber das, was Du getippt hast, - dr�cke , um Dich in den Normalmodus zu begeben. - Dann gib das gew�nschte Kommando noch einmal ein. +Anmerkung: Immer, wenn Du Dir unsicher bist über das, was Du getippt hast, + drücke , um Dich in den Normalmodus zu begeben. + Dann gib das gewünschte Kommando noch einmal ein. Anmerkung: Die Cursor-Tasten sollten ebenfalls funktionieren. Aber wenn Du hjkl benutzt, wirst Du in der Lage sein, Dich sehr viel schneller - umherzubewegen, wenn Du Dich einmal daran gew�hnt hast. Wirklich! + umherzubewegen, wenn Du Dich einmal daran gewöhnt hast. Wirklich! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1.2: VIM BEENDEN - !! Hinweis: Bevor Du einen der unten aufgef�hrten Schritte ausf�hrst, lies + !! Hinweis: Bevor Du einen der unten aufgeführten Schritte ausführst, lies diese gesamte Lektion!! - 1. Dr�cke die Taste (um sicherzustellen, dass Du im Normalmodus bist). + 1. Drücke die Taste (um sicherzustellen, dass Du im Normalmodus bist). 2. Tippe: :q! . - Dies beendet den Editor und VERWIRFT alle �nderungen, die Du gemacht hast. + Dies beendet den Editor und VERWIRFT alle Änderungen, die Du gemacht hast. 3. Wenn Du die Eingabeaufforderung siehst, gib das Kommando ein, das Dich zu - diesem Tutor gef�hrt hat. Dies w�re: vimtutor + diesem Tutor geführt hat. Dies wäre: vimtutor - 4. Wenn Du Dir diese Schritte eingepr�gt hast und Du Dich sicher f�hlst, - f�hre Schritte 1 bis 3 aus, um den Editor zu verlassen und wieder + 4. Wenn Du Dir diese Schritte eingeprägt hast und Du Dich sicher fühlst, + führe Schritte 1 bis 3 aus, um den Editor zu verlassen und wieder hineinzugelangen. -Anmerkung: :q! verwirft alle �nderungen, die Du gemacht hast. Einige - Lektionen sp�ter lernst Du, die �nderungen in einer Datei zu speichern. +Anmerkung: :q! verwirft alle Änderungen, die Du gemacht hast. Einige + Lektionen später lernst Du, die Änderungen in einer Datei zu speichern. - 5. Bewege den Cursor abw�rts zu Lektion 1.1.3. + 5. Bewege den Cursor abwärts zu Lektion 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.3: TEXT EDITIEREN - L�SCHEN + Lektion 1.1.3: TEXT EDITIEREN - LÖSCHEN - ** Dr�cke x , um das Zeichen unter dem Cursor zu l�schen. ** + ** Drücke x , um das Zeichen unter dem Cursor zu löschen. ** 1. Bewege den Cursor zu der mit ---> markierten Zeile unten. - 2. Um die Fehler zu beheben, bewege den Cursor, bis er �ber dem Zeichen steht, - das gel�scht werden soll. + 2. Um die Fehler zu beheben, bewege den Cursor, bis er über dem Zeichen steht, + das gelöscht werden soll. - 3. Dr�cke die x Taste, um das unerw�nschte Zeichen zu l�schen. + 3. Drücke die x Taste, um das unerwünschte Zeichen zu löschen. 4. Wiederhole die Schritte 2 bis 4, bis der Satz korrekt ist. ----> Die Kkuh sprangg �bberr deen Moond. +---> Die Kkuh sprangg übberr deen Moond. 5. Nun, da die Zeile korrekt ist, gehe weiter zur Lektion 1.1.4. -Anmerkung: W�hrend Du durch diesen Tutor gehst, versuche nicht, auswendig zu +Anmerkung: Während Du durch diesen Tutor gehst, versuche nicht, auswendig zu lernen, lerne vielmehr durch Anwenden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.4: TEXT EDITIEREN - EINF�GEN + Lektion 1.1.4: TEXT EDITIEREN - EINFÜGEN - ** Dr�cke i , um Text einzuf�gen. ** + ** Drücke i , um Text einzufügen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. 2. Um die erste Zeile mit der zweiten gleichzumachen, bewege den Cursor auf - das erste Zeichen NACH der Stelle, an der Text eingef�gt werden soll. + das erste Zeichen NACH der Stelle, an der Text eingefügt werden soll. - 3. Dr�cke i und gib die n�tigen Erg�nzungen ein. + 3. Drücke i und gib die nötigen Ergänzungen ein. - 4. Wenn jeweils ein Fehler beseitigt ist, dr�cke , um zum Normalmodus - zur�ckzukehren. + 4. Wenn jeweils ein Fehler beseitigt ist, drücke , um zum Normalmodus + zurückzukehren. Wiederhole Schritte 2 bis 4, um den Satz zu korrigieren. ---> In dieser ft etwas . ---> In dieser Zeile fehlt etwas Text. - 5. Wenn Du Dich mit dem Einf�gen von Text sicher f�hlst, gehe zu Lektion 1.1.5. + 5. Wenn Du Dich mit dem Einfügen von Text sicher fühlst, gehe zu Lektion 1.1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.5: TEXT EDITIEREN - ANF�GEN + Lektion 1.1.5: TEXT EDITIEREN - ANFÜGEN - ** Dr�cke A , um Text anzuf�gen. ** + ** Drücke A , um Text anzufügen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. - Dabei ist gleichg�ltig, auf welchem Zeichen der Zeile der Cursor steht. + Dabei ist gleichgültig, auf welchem Zeichen der Zeile der Cursor steht. - 2. Dr�cke A und gib die erforderlichen Erg�nzungen ein. + 2. Drücke A und gib die erforderlichen Ergänzungen ein. - 3. Wenn das Anf�gen abgeschlossen ist, dr�cke , um in den Normalmodus - zur�ckzukehren. + 3. Wenn das Anfügen abgeschlossen ist, drücke , um in den Normalmodus + zurückzukehren. 4. Bewege den Cursor zur zweiten mit ---> markierten Zeile und wiederhole die Schritte 2 und 3, um den Satz zu auszubessern. @@ -133,92 +133,92 @@ Anmerkung: W ---> In dieser Zeile feh In dieser Zeile fehlt etwas Text. ---> Auch hier steh - Auch hier steht etwas Unvollst�ndiges. + Auch hier steht etwas Unvollständiges. - 5. Wenn Du dich mit dem Anf�gen von Text sicher f�hlst, gehe zu Lektion 1.1.6. + 5. Wenn Du dich mit dem Anfügen von Text sicher fühlst, gehe zu Lektion 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1.6: EINE DATEI EDITIEREN ** Benutze :wq , um eine Datei zu speichern und Vim zu verlassen. ** - !! Hinweis: Bevor Du einen der unten aufgef�hrten Schritte ausf�hrst, lies + !! Hinweis: Bevor Du einen der unten aufgeführten Schritte ausführst, lies diese gesamte Lektion!! 1. Verlasse den Editor so wie in Lektion 1.1.2: :q! - Oder, falls du Zugriff zu einem anderen Terminal hast, f�hre das + Oder, falls du Zugriff zu einem anderen Terminal hast, führe das Folgende dort aus. 2. Gib dieses Kommando in die Eingabeaufforderung ein: vim tutor 'vim' ist der Aufruf des Editors, 'tutor' ist die zu editierende Datei. - Benutze eine Datei, die ge�ndert werden darf. + Benutze eine Datei, die geändert werden darf. - 3. F�ge Text ein oder l�sche ihn, wie Du in den vorangehenden Lektionen + 3. Füge Text ein oder lösche ihn, wie Du in den vorangehenden Lektionen gelernt hast. - 4. Speichere die ge�nderte Datei und verlasse Vim mit: :wq + 4. Speichere die geänderte Datei und verlasse Vim mit: :wq 5. Falls Du in Schritt 1 den vimtutor beendet hast, starte vimtutor neu und - bewege dich abw�rts bis zur folgenden Zusammenfassung. + bewege dich abwärts bis zur folgenden Zusammenfassung. - 6. Nachdem Du obige Schritte gelesen und verstanden hast: f�hre sie durch. + 6. Nachdem Du obige Schritte gelesen und verstanden hast: führe sie durch. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 1.1 1. Der Cursor wird mit den Pfeiltasten oder den Tasten hjkl bewegt. - h (links) j (unten) k (aufw�rts) l (rechts) + h (links) j (unten) k (aufwärts) l (rechts) 2. Um Vim aus der Eingabeaufforderung zu starten, tippe: vim DATEI - 3. Um Vim zu verlassen und alle �nderungen zu verwerfen, tippe: + 3. Um Vim zu verlassen und alle Änderungen zu verwerfen, tippe: :q! . - 4. Um das Zeichen unter dem Cursor zu l�schen, tippe: x + 4. Um das Zeichen unter dem Cursor zu löschen, tippe: x - 5. Um Text einzuf�gen oder anzuf�gen, tippe: - i Einzuf�genden Text eingeben Einf�gen vor dem Cursor - A Anzuf�genden Text eingeben Anf�gen nach dem Zeilenende + 5. Um Text einzufügen oder anzufügen, tippe: + i Einzufügenden Text eingeben Einfügen vor dem Cursor + A Anzufügenden Text eingeben Anfügen nach dem Zeilenende -Anmerkung: Dr�cken von bringt Dich in den Normalmodus oder bricht ein +Anmerkung: Drücken von bringt Dich in den Normalmodus oder bricht ein ungewolltes, erst teilweise eingegebenes Kommando ab. Nun fahre mit Lektion 1.2 fort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.1: L�SCHKOMMANDOS + Lektion 1.2.1: LÖSCHKOMMANDOS - ** Tippe dw , um ein Wort zu l�schen. ** + ** Tippe dw , um ein Wort zu löschen. ** - 1. Dr�cke , um sicherzustellen, dass Du im Normalmodus bist. + 1. Drücke , um sicherzustellen, dass Du im Normalmodus bist. 2. Bewege den Cursor zu der mit ---> markierten Zeile unten. - 3. Bewege den Cursor zum Anfang eines Wortes, das gel�scht werden soll. + 3. Bewege den Cursor zum Anfang eines Wortes, das gelöscht werden soll. 4. Tippe dw , um das Wort zu entfernen. Anmerkung: Der Buchstabe d erscheint auf der untersten Zeile des Schirms, wenn Du ihn eingibst. Vim wartet darauf, dass Du w eingibst. Falls Du ein anderes Zeichen als d siehst, hast Du etwas Falsches getippt; - dr�cke und beginne noch einmal. + drücke und beginne noch einmal. ----> Einige W�rter lustig geh�ren nicht Papier in diesen Satz. +---> Einige Wörter lustig gehören nicht Papier in diesen Satz. 5. Wiederhole die Schritte 3 und 4, bis der Satz korrekt ist und gehe zur Lektion 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.2: WEITERE L�SCHKOMMANDOS + Lektion 1.2.2: WEITERE LÖSCHKOMMANDOS - ** Tippe d$ , um bis zum Ende der Zeile zu l�schen. ** + ** Tippe d$ , um bis zum Ende der Zeile zu löschen. ** - 1. Dr�cke , um sicherzustellen, dass Du im Normalmodus bist. + 1. Drücke , um sicherzustellen, dass Du im Normalmodus bist. 2. Bewege den Cursor zu der mit ---> markierten Zeile unten. 3. Bewege den Cursor zum Ende der korrekten Zeile (NACH dem ersten . ). - 4. Tippe d$ , um bis zum Zeilenende zu l�schen. + 4. Tippe d$ , um bis zum Zeilenende zu löschen. ---> Jemand hat das Ende der Zeile doppelt eingegeben. doppelt eingegeben. @@ -230,37 +230,37 @@ Anmerkung: Dr ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.3: �BER OPERATOREN UND BEWEGUNGSZ�GE + Lektion 1.2.3: ÜBER OPERATOREN UND BEWEGUNGSZÜGE - Viele Kommandos, die Text �ndern, setzen sich aus einem Operator und einer - Bewegung zusammen. Das Format f�r ein L�schkommando mit dem L�schoperator d + Viele Kommandos, die Text ändern, setzen sich aus einem Operator und einer + Bewegung zusammen. Das Format für ein Löschkommando mit dem Löschoperator d lautet wie folgt: d Bewegung wobei: - d - der L�schoperator - Bewegung - worauf der L�schoperator angewandt wird (unten aufgef�hrt). + d - der Löschoperator + Bewegung - worauf der Löschoperator angewandt wird (unten aufgeführt). Eine kleine Auflistung von Bewegungen: - w - bis zum Beginn des n�chsten Wortes OHNE dessen erstes Zeichen. + w - bis zum Beginn des nächsten Wortes OHNE dessen erstes Zeichen. e - zum Ende des aktuellen Wortes MIT dessen letztem Zeichen. $ - zum Ende der Zeile MIT dem letzten Zeichen. - Dementsprechend l�scht die Eingabe von de vom Cursor an bis zum Wortende. + Dementsprechend löscht die Eingabe von de vom Cursor an bis zum Wortende. Anmerkung: Die Eingabe lediglich des Bewegungsteils im Normalmodus bewegt den Cursor entsprechend. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.4: ANWENDUNG EINES Z�HLERS F�R EINEN BEWEGUNGSSCHRITT + Lektion 1.2.4: ANWENDUNG EINES ZÄHLERS FÜR EINEN BEWEGUNGSSCHRITT ** Die Eingabe einer Zahl vor einem Bewegungsschritt wiederholt diesen. ** 1. Bewege den Cursor zum Beginn der mit ---> markierten Zeile unten. - 2. Tippe 2w , um den Cursor zwei W�rter vorw�rts zu bewegen. + 2. Tippe 2w , um den Cursor zwei Wörter vorwärts zu bewegen. 3. Tippe 3e , um den Cursor zum Ende des dritten Wortes zu bewegen. @@ -268,7 +268,7 @@ Anmerkung: Die Eingabe lediglich des Bewegungsteils im Normalmodus bewegt den 5. Wiederhole Schritte 2 und 3 mit verschiedenen Nummern. - ---> Dies ist nur eine Zeile aus W�rtern, um sich darin herumzubewegen. + ---> Dies ist nur eine Zeile aus Wörtern, um sich darin herumzubewegen. 6. Gehe weiter zu Lektion 1.2.5. @@ -276,24 +276,24 @@ Anmerkung: Die Eingabe lediglich des Bewegungsteils im Normalmodus bewegt den ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.5: ANWENDUNG EINES Z�HLERS F�R MEHRERE L�SCHVORG�NGE + Lektion 1.2.5: ANWENDUNG EINES ZÄHLERS FÜR MEHRERE LÖSCHVORGÄNGE ** Die Eingabe einer Zahl mit einem Operator wiederholt diesen mehrfach. ** - In der Kombination aus L�schoperator und Bewegungsschritt (siehe oben) - stellt man, um mehr zu l�schen dem Schritt einen Z�hler voran: + In der Kombination aus Löschoperator und Bewegungsschritt (siehe oben) + stellt man, um mehr zu löschen dem Schritt einen Zähler voran: d Nummer Bewegungsschritt 1. Bewege den Cursor zum ersten Wort in GROSSBUCHSTABEN in der mit ---> markieren Zeile. - 2. Tippe d2w , um die zwei W�rter in GROSSBUCHSTABEN zu l�schen. + 2. Tippe d2w , um die zwei Wörter in GROSSBUCHSTABEN zu löschen. - 3. Wiederhole Schritte 1 und 2 mit einem anderen Z�hler, um die darauffol- - genden W�rter in GROSSBUCHSTABEN mit einem einzigen Kommando zu l�schen. + 3. Wiederhole Schritte 1 und 2 mit einem anderen Zähler, um die darauffol- + genden Wörter in GROSSBUCHSTABEN mit einem einzigen Kommando zu löschen. ----> Diese ABC DE Zeile FGHI JK LMN OP mit W�rtern ist Q RS TUV bereinigt. +---> Diese ABC DE Zeile FGHI JK LMN OP mit Wörtern ist Q RS TUV bereinigt. @@ -301,83 +301,83 @@ Anmerkung: Die Eingabe lediglich des Bewegungsteils im Normalmodus bewegt den Lektion 1.2.6: ARBEITEN AUF ZEILEN - ** Tippe dd , um eine ganze Zeile zu l�schen. ** + ** Tippe dd , um eine ganze Zeile zu löschen. ** - Wegen der H�ufigkeit, dass man ganze Zeilen l�scht, kamen die Entwickler von - Vi darauf, dass es leichter w�re, einfach zwei d's einzugeben, um eine Zeile - zu l�schen. + Wegen der Häufigkeit, dass man ganze Zeilen löscht, kamen die Entwickler von + Vi darauf, dass es leichter wäre, einfach zwei d's einzugeben, um eine Zeile + zu löschen. 1. Bewege den Cursor zur zweiten Zeile in der unten stehenden Redewendung. - 2. Tippe dd , um die Zeile zu l�schen. + 2. Tippe dd , um die Zeile zu löschen. 3. Nun bewege Dich zur vierten Zeile. - 4. Tippe 2dd , um zwei Zeilen zu l�schen. + 4. Tippe 2dd , um zwei Zeilen zu löschen. ---> 1) Rosen sind rot, ---> 2) Matsch ist lustig, ---> 3) Veilchen sind blau, ---> 4) Ich habe ein Auto, ---> 5) Die Uhr sagt die Zeit, ----> 6) Zucker ist s��, +---> 6) Zucker ist süß, ---> 7) So wie Du auch. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.7: R�CKG�NGIG MACHEN (UNDO) + Lektion 1.2.7: RÜCKGÄNGIG MACHEN (UNDO) - ** Tippe u , um die letzten Kommandos r�ckg�ngig zu machen ** + ** Tippe u , um die letzten Kommandos rückgängig zu machen ** ** oder U , um eine ganze Zeile wiederherzustellen. ** 1. Bewege den Cursor zu der mit ---> markierten Zeile unten und setze ihn auf den ersten Fehler. - 2. Tippe x , um das erste unerw�nschte Zeichen zu l�schen. - 3. Nun tippe u , um das soeben ausgef�hrte Kommando r�ckg�ngig zu machen. + 2. Tippe x , um das erste unerwünschte Zeichen zu löschen. + 3. Nun tippe u , um das soeben ausgeführte Kommando rückgängig zu machen. 4. Jetzt behebe alle Fehler auf der Zeile mit Hilfe des x Kommandos. - 5. Nun tippe ein gro�es U , um die Zeile in ihren Ursprungszustand + 5. Nun tippe ein großes U , um die Zeile in ihren Ursprungszustand wiederherzustellen. 6. Nun tippe u einige Male, um das U und die vorhergehenden Kommandos - r�ckg�ngig zu machen. - 7. Nun tippe CTRL-R (halte CTRL gedr�ckt und dr�cke R) mehrere Male, um die - Kommandos wiederherzustellen (die R�ckg�ngigmachungen r�ckg�ngig machen). + rückgängig zu machen. + 7. Nun tippe CTRL-R (halte CTRL gedrückt und drücke R) mehrere Male, um die + Kommandos wiederherzustellen (die Rückgängigmachungen rückgängig machen). ---> Beehebe die Fehller diesser Zeile und sttelle sie mitt 'undo' wieder her. - 8. Dies sind sehr n�tzliche Kommandos. Nun gehe weiter zur Zusammenfassung + 8. Dies sind sehr nützliche Kommandos. Nun gehe weiter zur Zusammenfassung von Lektion 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 1.2 - 1. Um vom Cursor bis zum n�chsten Wort zu l�schen, tippe: dw - 2. Um vom Cursor bis zum Ende einer Zeile zu l�schen, tippe: d$ - 3. Um eine ganze Zeile zu l�schen, tippe: dd + 1. Um vom Cursor bis zum nächsten Wort zu löschen, tippe: dw + 2. Um vom Cursor bis zum Ende einer Zeile zu löschen, tippe: d$ + 3. Um eine ganze Zeile zu löschen, tippe: dd 4. Um eine Bewegung zu wiederholen, stelle eine Nummer voran: 2w - 5. Das Format f�r ein �nderungskommando ist: + 5. Das Format für ein Änderungskommando ist: Operator [Anzahl] Bewegungsschritt wobei: - Operator - gibt an, was getan werden soll, zum Beispiel d f�r delete - [Anzahl] - ein optionaler Z�hler, um den Bewegungsschritt zu wiederholen - Bewegungsschritt - Bewegung �ber den zu �ndernden Text, wie + Operator - gibt an, was getan werden soll, zum Beispiel d für delete + [Anzahl] - ein optionaler Zähler, um den Bewegungsschritt zu wiederholen + Bewegungsschritt - Bewegung über den zu ändernden Text, wie w (Wort), $ (zum Ende der Zeile), etc. 6. Um Dich zum Anfang der Zeile zu begeben, benutze die Null: 0 - 7. Um vorherige Aktionen r�ckg�ngig zu machen, tippe: u (kleines u) - Um alle �nderungen auf einer Zeile r�ckg�ngig zu machen: U (gro�es U) - Um die R�ckg�ngigmachungen r�ckg�ngig zu machen, tippe: CTRL-R + 7. Um vorherige Aktionen rückgängig zu machen, tippe: u (kleines u) + Um alle Änderungen auf einer Zeile rückgängig zu machen: U (großes U) + Um die Rückgängigmachungen rückgängig zu machen, tippe: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.1: ANF�GEN (PUT) + Lektion 1.3.1: ANFÜGEN (PUT) - ** Tippe p , um vorher gel�schten Text nach dem Cursor anzuf�gen. ** + ** Tippe p , um vorher gelöschten Text nach dem Cursor anzufügen. ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. - 2. Tippe dd , um die Zeile zu l�schen und sie in einem Vim-Register zu + 2. Tippe dd , um die Zeile zu löschen und sie in einem Vim-Register zu speichern. - 3. Bewege den Cursor zur Zeile c), �BER derjenigen, wo die gel�schte Zeile + 3. Bewege den Cursor zur Zeile c), ÜBER derjenigen, wo die gelöschte Zeile platziert werden soll. 4. Tippe p , um die Zeile unterhalb des Cursors zu platzieren. @@ -399,7 +399,7 @@ Anmerkung: Die Eingabe lediglich des Bewegungsteils im Normalmodus bewegt den 2. Bewege den Cursor, bis er sich auf dem ersten Fehler befindet. - 3. Tippe r und anschlie�end das Zeichen, welches dort stehen sollte. + 3. Tippe r und anschließend das Zeichen, welches dort stehen sollte. 4. Wiederhole Schritte 2 und 3, bis die erste Zeile gleich der zweiten ist. @@ -413,30 +413,30 @@ Anmerkung: Erinnere Dich daran, dass Du durch Anwenden lernen solltest, nicht ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.3: �NDERN (CHANGE) + Lektion 1.3.3: ÄNDERN (CHANGE) - ** Um eine �nderung bis zum Wortende durchzuf�hren, tippe ce . ** + ** Um eine Änderung bis zum Wortende durchzuführen, tippe ce . ** 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. 2. Platziere den Cursor auf das s von Wstwr. - 3. Tippe ce und die Wortkorrektur ein (in diesem Fall tippe �rter ). + 3. Tippe ce und die Wortkorrektur ein (in diesem Fall tippe örter ). - 4. Dr�cke und bewege den Cursor zum n�chsten zu �ndernden Zeichen. + 4. Drücke und bewege den Cursor zum nächsten zu ändernden Zeichen. 5. Wiederhole Schritte 3 und 4 bis der erste Satz gleich dem zweiten ist. ----> Einige Wstwr dieser Zlaww lasdjlaf mit dem �ndern-Operator gaaauu werden. ----> Einige W�rter dieser Zeile sollen mit dem �ndern-Operator ge�ndert werden. +---> Einige Wstwr dieser Zlaww lasdjlaf mit dem Ändern-Operator gaaauu werden. +---> Einige Wörter dieser Zeile sollen mit dem Ändern-Operator geändert werden. -Beachte, dass ce das Wort l�scht und Dich in den Eingabemodus versetzt. +Beachte, dass ce das Wort löscht und Dich in den Eingabemodus versetzt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.4: MEHR �NDERUNGEN MITTELS c + Lektion 1.3.4: MEHR ÄNDERUNGEN MITTELS c ** Das change-Kommando arbeitet mit denselben Bewegungen wie delete. ** @@ -452,32 +452,32 @@ Beachte, dass ce das Wort l 4. Bewege den Cursor zum ersten Fehler. - 5. Tippe c$ , gib den Rest der Zeile wie in der zweiten ein, dr�cke . + 5. Tippe c$ , gib den Rest der Zeile wie in der zweiten ein, drücke . ---> Das Ende dieser Zeile soll an die zweite Zeile angeglichen werden. ---> Das Ende dieser Zeile soll mit dem c$ Kommando korrigiert werden. -Anmerkung: Du kannst die R�cktaste benutzen, um Tippfehler zu korrigieren. +Anmerkung: Du kannst die Rücktaste benutzen, um Tippfehler zu korrigieren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 1.3 - 1. Um einen vorher gel�schten Text anzuf�gen, tippe p . Dies f�gt den - gel�schten Text NACH dem Cursor an (wenn eine ganze Zeile gel�scht wurde, - wird diese in die Zeile unter dem Cursor eingef�gt). + 1. Um einen vorher gelöschten Text anzufügen, tippe p . Dies fügt den + gelöschten Text NACH dem Cursor an (wenn eine ganze Zeile gelöscht wurde, + wird diese in die Zeile unter dem Cursor eingefügt). 2. Um das Zeichen unter dem Cursor zu ersetzen, tippe r und danach das an dieser Stelle gewollte Zeichen. - 3. Der �nderungs- (change) Operator erlaubt, vom Cursor bis zum Ende des - Bewegungsschrittes zu �ndern. Tippe ce , um eine �nderung vom Cursor bis + 3. Der Änderungs- (change) Operator erlaubt, vom Cursor bis zum Ende des + Bewegungsschrittes zu ändern. Tippe ce , um eine Änderung vom Cursor bis zum Ende des Wortes vorzunehmen; c$ bis zum Ende einer Zeile. - 4. Das Format f�r change ist: + 4. Das Format für change ist: c [Anzahl] Bewegungsschritt - Nun fahre mit der n�chsten Lektion fort. + Nun fahre mit der nächsten Lektion fort. @@ -487,24 +487,24 @@ Anmerkung: Du kannst die R ** Tippe CTRL-G , um deine Dateiposition sowie den Dateistatus anzuzeigen. ** ** Tippe G , um Dich zu einer Zeile in der Datei zu begeben. ** -Anmerkung: Lies diese gesamte Lektion, bevor Du irgendeinen Schritt ausf�hrst!! +Anmerkung: Lies diese gesamte Lektion, bevor Du irgendeinen Schritt ausführst!! - 1. Halte die Ctrl Taste unten und dr�cke g . Dies nennen wir CTRL-G. - Eine Statusmeldung am Fu� der Seite erscheint mit dem Dateinamen und der - Position innerhalb der Datei. Merke Dir die Zeilennummer f�r Schritt 3. + 1. Halte die Ctrl Taste unten und drücke g . Dies nennen wir CTRL-G. + Eine Statusmeldung am Fuß der Seite erscheint mit dem Dateinamen und der + Position innerhalb der Datei. Merke Dir die Zeilennummer für Schritt 3. -Anmerkung: M�glicherweise siehst Du die Cursorposition in der unteren rechten +Anmerkung: Möglicherweise siehst Du die Cursorposition in der unteren rechten Bildschirmecke. Dies ist Auswirkung der 'ruler' Option (siehe :help 'ruler') - 2. Dr�cke G , um Dich zum Ende der Datei zu begeben. + 2. Drücke G , um Dich zum Ende der Datei zu begeben. Tippe gg , um Dich zum Anfang der Datei zu begeben. 3. Gib die Nummer der Zeile ein, auf der Du vorher warst, gefolgt von G . - Dies bringt Dich zur�ck zu der Zeile, auf der Du gestanden hast, als Du - das erste Mal CTRL-G gedr�ckt hast. + Dies bringt Dich zurück zu der Zeile, auf der Du gestanden hast, als Du + das erste Mal CTRL-G gedrückt hast. - 4. Wenn Du Dich sicher genug f�hlst, f�hre die Schritte 1 bis 3 aus. + 4. Wenn Du Dich sicher genug fühlst, führe die Schritte 1 bis 3 aus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.4.2: DAS SUCHEN - KOMMANDO @@ -512,18 +512,18 @@ Anmerkung: M ** Tippe / gefolgt von einem Ausdruck, um nach dem Ausdruck zu suchen. ** 1. Im Normalmodus, tippe das / Zeichen. Beachte, dass das / und der - Cursor am Fu� des Schirms erscheinen, so wie beim : Kommando. + Cursor am Fuß des Schirms erscheinen, so wie beim : Kommando. 2. Nun tippe 'Fehhler' . Dies ist das Wort, nach dem Du suchen willst. - 3. Um nach demselben Ausdruck weiterzusuchen, tippe einfach n (f�r next). + 3. Um nach demselben Ausdruck weiterzusuchen, tippe einfach n (für next). Um nach demselben Ausdruck in der Gegenrichtung zu suchen, tippe N . - 4. Um nach einem Ausdruck r�ckw�rts zu suchen , benutze ? statt / . + 4. Um nach einem Ausdruck rückwärts zu suchen , benutze ? statt / . - 5. Um dahin zur�ckzukehren, von wo Du gekommen bist, dr�cke CTRL-O (Halte - Ctrl unten und dr�cke den Buchstaben o). Wiederhole dies, um noch weiter - zur�ckzugehen. CTRL-I geht vorw�rts. + 5. Um dahin zurückzukehren, von wo Du gekommen bist, drücke CTRL-O (Halte + Ctrl unten und drücke den Buchstaben o). Wiederhole dies, um noch weiter + zurückzugehen. CTRL-I geht vorwärts. ---> Fehler schreibt sich nicht "Fehhler"; Fehhler ist ein Fehler Anmerkung: Wenn die Suche das Dateiende erreicht hat, wird sie am Anfang @@ -532,14 +532,14 @@ Anmerkung: Wenn die Suche das Dateiende erreicht hat, wird sie am Anfang Lektion 1.4.3: PASSENDE KLAMMERN FINDEN - ** Tippe % , um eine gegen�berliegenden Klammer ),], oder } zu finden. ** + ** Tippe % , um eine gegenüberliegenden Klammer ),], oder } zu finden. ** 1. Platziere den Cursor auf irgendeinem der Zeichen (, [, oder { in der unten stehenden Zeile, die mit ---> markiert ist. 2. Nun tippe das % Zeichen. - 3. Der Cursor bewegt sich zur passenden gegen�berliegenden Klammer. + 3. Der Cursor bewegt sich zur passenden gegenüberliegenden Klammer. 4. Tippe % , um den Cursor zur passenden anderen Klammer zu bewegen. @@ -547,7 +547,7 @@ Anmerkung: Wenn die Suche das Dateiende erreicht hat, wird sie am Anfang ---> Dies ( ist eine Testzeile ( mit [ verschiedenen ] { Klammern } darin. )) -Anmerkung: Diese Funktionalit�t ist sehr n�tzlich bei der Fehlersuche in einem +Anmerkung: Diese Funktionalität ist sehr nützlich bei der Fehlersuche in einem Programmtext, in dem passende Klammern fehlen! @@ -562,16 +562,16 @@ Anmerkung: Diese Funktionalit 2. Tippe :s/diee/die . Beachte, dass der Befehl nur das erste Vorkommen von "diee" ersetzt. - 3. Nun tippe :s/diee/die/g . Das Zuf�gen des Flags g bedeutet, eine - globale Ersetzung �ber die Zeile durchzuf�hren, dies ersetzt alle + 3. Nun tippe :s/diee/die/g . Das Zufügen des Flags g bedeutet, eine + globale Ersetzung über die Zeile durchzuführen, dies ersetzt alle Vorkommen von "diee" auf der Zeile. ----> diee sch�nste Zeit, um diee Blumen anzuschauen, ist diee Fr�hlingszeit. +---> diee schönste Zeit, um diee Blumen anzuschauen, ist diee Frühlingszeit. - 4. Um alle Vorkommen einer Zeichenkette innerhalb zweier Zeilen zu �ndern, + 4. Um alle Vorkommen einer Zeichenkette innerhalb zweier Zeilen zu ändern, tippe :#,#s/alt/neu/g wobei #,# die Zeilennummern des Bereiches sind, - in dem die Ersetzung durchgef�hrt werden soll. - Tippe :%s/alt/neu/g um alle Vorkommen in der gesamten Datei zu �ndern. + in dem die Ersetzung durchgeführt werden soll. + Tippe :%s/alt/neu/g um alle Vorkommen in der gesamten Datei zu ändern. Tippe :%s/alt/neu/gc um alle Vorkommen in der gesamten Datei zu finden mit einem Fragedialog, ob ersetzt werden soll oder nicht. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -582,11 +582,11 @@ Anmerkung: Diese Funktionalit Nummer G bringt Dich zur entsprechenden Zeilennummer. gg bringt Dich zur ersten Zeile. - 2. Die Eingabe von / plus einem Ausdruck sucht VORW�RTS nach dem Ausdruck. - Die Eingabe von ? plus einem Ausdruck sucht R�CKW�RTS nach dem Ausdruck. - Tippe nach einer Suche n , um das n�chste Vorkommen in der gleichen + 2. Die Eingabe von / plus einem Ausdruck sucht VORWÄRTS nach dem Ausdruck. + Die Eingabe von ? plus einem Ausdruck sucht RÜCKWÄRTS nach dem Ausdruck. + Tippe nach einer Suche n , um das nächste Vorkommen in der gleichen Richtung zu finden; oder N , um in der Gegenrichtung zu suchen. - CTRL-O bringt Dich zur�ck zu �lteren Positionen, CTRL-I zu neueren. + CTRL-O bringt Dich zurück zu älteren Positionen, CTRL-I zu neueren. 3. Die Eingabe von % , wenn der Cursor sich auf (,),[,],{, oder } befindet, bringt Dich zur Gegenklammer. @@ -594,97 +594,97 @@ Anmerkung: Diese Funktionalit 4. Um das erste Vorkommen von "alt" in einer Zeile durch "neu" zu ersetzen, tippe :s/alt/neu Um alle Vorkommen von "alt" in der Zeile ersetzen, tippe :s/alt/neu/g - Um Ausdr�cke innerhalb zweier Zeilen # zu ersetzen :#,#s/alt/neu/g + Um Ausdrücke innerhalb zweier Zeilen # zu ersetzen :#,#s/alt/neu/g Um alle Vorkommen in der ganzen Datei zu ersetzen, tippe :%s/alt/neu/g - F�r eine jedesmalige Best�tigung, addiere 'c' (confirm) :%s/alt/neu/gc + Für eine jedesmalige Bestätigung, addiere 'c' (confirm) :%s/alt/neu/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.1: AUSF�HREN EINES EXTERNEN KOMMANDOS + Lektion 1.5.1: AUSFÜHREN EINES EXTERNEN KOMMANDOS - ** Gib :! , gefolgt von einem externen Kommando ein, um es auszuf�hren. ** + ** Gib :! , gefolgt von einem externen Kommando ein, um es auszuführen. ** - 1. Tippe das vertraute Kommando : , um den Cursor auf den Fu� des Schirms + 1. Tippe das vertraute Kommando : , um den Cursor auf den Fuß des Schirms zu setzen. Dies erlaubt Dir, ein Kommandozeilen-Kommando einzugeben. - 2. Nun tippe ein ! (Ausrufezeichen). Dies erm�glicht Dir, ein beliebiges, - externes Shellkommando auszuf�hren. + 2. Nun tippe ein ! (Ausrufezeichen). Dies ermöglicht Dir, ein beliebiges, + externes Shellkommando auszuführen. - 3. Als Beispiel tippe ls nach dem ! und dr�cke . Dies liefert + 3. Als Beispiel tippe ls nach dem ! und drücke . Dies liefert eine Auflistung deines Verzeichnisses; genauso, als wenn Du in der - Eingabeaufforderung w�rst. Oder verwende :!dir , falls ls nicht geht. + Eingabeaufforderung wärst. Oder verwende :!dir , falls ls nicht geht. Anmerkung: Mit dieser Methode kann jedes beliebige externe Kommando - ausgef�hrt werden, auch mit Argumenten. + ausgeführt werden, auch mit Argumenten. -Anmerkung: Alle : Kommandos m�ssen durch Eingabe von - abgeschlossen werden. Von jetzt an erw�hnen wir dies nicht jedesmal. +Anmerkung: Alle : Kommandos müssen durch Eingabe von + abgeschlossen werden. Von jetzt an erwähnen wir dies nicht jedesmal. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.2: MEHR �BER DAS SCHREIBEN VON DATEIEN + Lektion 1.5.2: MEHR ÜBER DAS SCHREIBEN VON DATEIEN -** Um am Text durchgef�hrte �nderungen zu speichern, tippe :w DATEINAME. ** +** Um am Text durchgeführte Änderungen zu speichern, tippe :w DATEINAME. ** 1. Tippe :!dir oder :!ls , um eine Auflistung deines Verzeichnisses zu - erhalten. Du wei�t nun bereits, dass Du danach eingeben musst. + erhalten. Du weißt nun bereits, dass Du danach eingeben musst. - 2. W�hle einen Dateinamen, der noch nicht existiert, z.B. TEST. + 2. Wähle einen Dateinamen, der noch nicht existiert, z.B. TEST. - 3. Nun tippe: :w TEST (wobei TEST der gew�hlte Dateiname ist). + 3. Nun tippe: :w TEST (wobei TEST der gewählte Dateiname ist). 4. Dies speichert die ganze Datei (den Vim Tutor) unter dem Namen TEST. - Um dies zu �berpr�fen, tippe nochmals :!ls bzw. !dir, um deinen + Um dies zu überprüfen, tippe nochmals :!ls bzw. !dir, um deinen Verzeichnisinhalt zu sehen. -Anmerkung: W�rdest Du Vim jetzt beenden und danach wieder mit vim TEST - starten, dann w�re diese Datei eine exakte Kopie des Tutors zu dem +Anmerkung: Würdest Du Vim jetzt beenden und danach wieder mit vim TEST + starten, dann wäre diese Datei eine exakte Kopie des Tutors zu dem Zeitpunkt, als Du ihn gespeichert hast. 5. Nun entferne die Datei durch Eingabe von (MS-DOS): :!del TEST oder (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.3: AUSW�HLEN VON TEXT ZUM SCHREIBEN + Lektion 1.5.3: AUSWÄHLEN VON TEXT ZUM SCHREIBEN ** Um einen Abschnitt der Datei zu speichern, tippe v Bewegung :w DATEI ** 1. Bewege den Cursor zu dieser Zeile. - 2. Tippe v und bewege den Cursor zum f�nften Auflistungspunkt unten. + 2. Tippe v und bewege den Cursor zum fünften Auflistungspunkt unten. Beachte, dass der Text hervorgehoben wird. - 3. Dr�cke das Zeichen : . Am Fu� des Schirms erscheint :'<,'> . + 3. Drücke das Zeichen : . Am Fuß des Schirms erscheint :'<,'> . 4. Tippe w TEST , wobei TEST ein noch nicht vorhandener Dateiname ist. - Vergewissere Dich, dass Du :'<,'>w TEST siehst, bevor Du dr�ckst. + Vergewissere Dich, dass Du :'<,'>w TEST siehst, bevor Du drückst. - 5. Vim schreibt die ausgew�hlten Zeilen in die Datei TEST. Benutze :!dir - oder :!ls , um sie zu sehen. L�sche sie noch nicht! Wir werden sie in - der n�chsten Lektion benutzen. + 5. Vim schreibt die ausgewählten Zeilen in die Datei TEST. Benutze :!dir + oder :!ls , um sie zu sehen. Lösche sie noch nicht! Wir werden sie in + der nächsten Lektion benutzen. -Hinweis: Dr�cken von v startet die Visuelle Auswahl. Du kannst den Cursor - umherbewegen, um die Auswahl zu vergr��ern oder zu verkleinern. Anschlie�end - l�sst sich ein Operator anwenden, um mit dem Text etwas zu tun. Zum Beispiel - l�scht d den Text. +Hinweis: Drücken von v startet die Visuelle Auswahl. Du kannst den Cursor + umherbewegen, um die Auswahl zu vergrößern oder zu verkleinern. Anschließend + lässt sich ein Operator anwenden, um mit dem Text etwas zu tun. Zum Beispiel + löscht d den Text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.4: EINLESEN UND ZUSAMMENF�HREN VON DATEIEN + Lektion 1.5.4: EINLESEN UND ZUSAMMENFÜHREN VON DATEIEN ** Um den Inhalt einer Datei einzulesen, tippe :r DATEINAME ** - 1. Platziere den Cursor direkt �ber dieser Zeile. + 1. Platziere den Cursor direkt über dieser Zeile. -BEACHTE: Nachdem Du Schritt 2 ausgef�hrt hast, wirst Du Text aus Lektion 1.5.3 - sehen. Dann bewege Dich wieder ABW�RTS, Lektion 1.5.4 wiederzusehen. +BEACHTE: Nachdem Du Schritt 2 ausgeführt hast, wirst Du Text aus Lektion 1.5.3 + sehen. Dann bewege Dich wieder ABWÄRTS, Lektion 1.5.4 wiederzusehen. - 2. Nun lies deine Datei TEST ein indem Du das Kommando :r TEST ausf�hrst, + 2. Nun lies deine Datei TEST ein indem Du das Kommando :r TEST ausführst, wobei TEST der von Dir verwendete Dateiname ist. - Die eingelesene Datei wird unterhalb der Cursorzeile eingef�gt. + Die eingelesene Datei wird unterhalb der Cursorzeile eingefügt. - 3. Um zu �berpr�fen, dass die Datei eingelesen wurde, gehe zur�ck und + 3. Um zu überprüfen, dass die Datei eingelesen wurde, gehe zurück und beachte, dass es jetzt zwei Kopien von Lektion 1.5.3 gibt, das Original und - die eingef�gte Dateiversion. + die eingefügte Dateiversion. Anmerkung: Du kannst auch die Ausgabe eines externen Kommandos einlesen. Zum Beispiel liest :r !ls die Ausgabe des Kommandos ls ein und platziert @@ -694,98 +694,98 @@ Anmerkung: Du kannst auch die Ausgabe eines externen Kommandos einlesen. Zum ZUSAMMENFASSUNG VON LEKTION 1.5 - 1. :!Kommando f�hrt ein externes Kommando aus. + 1. :!Kommando führt ein externes Kommando aus. - Einige n�tzliche Beispiele sind + Einige nützliche Beispiele sind (MS-DOS) (Unix) :!dir :!ls - zeigt eine Verzeichnisauflistung. :!del DATEINAME :!rm DATEINAME - entfernt Datei DATEINAME. 2. :w DATEINAME speichert die aktuelle Vim-Datei unter dem Namen DATEINAME. - 3. v Bewegung :w DATEINAME schreibt die Visuell ausgew�hlten Zeilen in + 3. v Bewegung :w DATEINAME schreibt die Visuell ausgewählten Zeilen in die Datei DATEINAME. - 4. :r DATEINAME l�dt die Datei DATEINAME und f�gt sie unterhalb der + 4. :r DATEINAME lädt die Datei DATEINAME und fügt sie unterhalb der Cursorposition ein. - 5. :r !dir liest die Ausgabe des Kommandos dir und f�gt sie unterhalb der + 5. :r !dir liest die Ausgabe des Kommandos dir und fügt sie unterhalb der Cursorposition ein. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.1: ZEILEN �FFNEN (OPEN) + Lektion 1.6.1: ZEILEN ÖFFNEN (OPEN) - ** Tippe o , um eine Zeile unterhalb des Cursors zu �ffnen und Dich in ** - ** den Einf�gemodus zu begeben. ** + ** Tippe o , um eine Zeile unterhalb des Cursors zu öffnen und Dich in ** + ** den Einfügemodus zu begeben. ** 1. Bewege den Cursor zu der ersten mit ---> markierten Zeile unten. - 2. Tippe o (klein geschrieben), um eine Zeile UNTERHALB des Cursors zu �ffnen - und Dich in den Einf�gemodus zu begeben. + 2. Tippe o (klein geschrieben), um eine Zeile UNTERHALB des Cursors zu öffnen + und Dich in den Einfügemodus zu begeben. - 3. Nun tippe etwas Text und dr�cke , um den Einf�gemodus zu verlassen. + 3. Nun tippe etwas Text und drücke , um den Einfügemodus zu verlassen. ----> Mit o wird der Cursor auf der offenen Zeile im Einf�gemodus platziert. +---> Mit o wird der Cursor auf der offenen Zeile im Einfügemodus platziert. - 4. Um eine Zeile �BERHALB des Cursors aufzumachen, gib einfach ein gro�es O + 4. Um eine Zeile ÜBERHALB des Cursors aufzumachen, gib einfach ein großes O statt einem kleinen o ein. Versuche dies auf der unten stehenden Zeile. ----> �ffne eine Zeile �ber dieser mit O , wenn der Cursor auf dieser Zeile ist. +---> Öffne eine Zeile über dieser mit O , wenn der Cursor auf dieser Zeile ist. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.2: TEXT ANF�GEN (APPEND) + Lektion 1.6.2: TEXT ANFÜGEN (APPEND) - ** Tippe a , um Text NACH dem Cursor einzuf�gen. ** + ** Tippe a , um Text NACH dem Cursor einzufügen. ** - 1. Bewege den Cursor zum Anfang der ersten �bungszeile mit ---> unten. + 1. Bewege den Cursor zum Anfang der ersten Übungszeile mit ---> unten. - 2. Dr�cke e , bis der Cursor am Ende von Zei steht. + 2. Drücke e , bis der Cursor am Ende von Zei steht. - 3. Tippe ein kleines a , um Text NACH dem Cursor anzuf�gen. + 3. Tippe ein kleines a , um Text NACH dem Cursor anzufügen. - 4. Vervollst�ndige das Wort so wie in der Zeile darunter. Dr�cke , - um den Einf�gemodus zu verlassen. + 4. Vervollständige das Wort so wie in der Zeile darunter. Drücke , + um den Einfügemodus zu verlassen. - 5. Bewege Dich mit e zum n�chsten unvollst�ndigen Wort und wiederhole + 5. Bewege Dich mit e zum nächsten unvollständigen Wort und wiederhole Schritte 3 und 4. ----> Diese Zei bietet Gelegen , Text in einer Zeile anzuf�. ----> Diese Zeile bietet Gelegenheit, Text in einer Zeile anzuf�gen. +---> Diese Zei bietet Gelegen , Text in einer Zeile anzufü. +---> Diese Zeile bietet Gelegenheit, Text in einer Zeile anzufügen. -Anmerkung: a, i und A gehen alle gleicherma�en in den Einf�gemodus; der - einzige Unterschied ist, wo die Zeichen eingef�gt werden. +Anmerkung: a, i und A gehen alle gleichermaßen in den Einfügemodus; der + einzige Unterschied ist, wo die Zeichen eingefügt werden. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.6.3: EINE ANDERE ART DES ERSETZENS (REPLACE) - ** Tippe ein gro�es R , um mehr als ein Zeichen zu ersetzen. ** + ** Tippe ein großes R , um mehr als ein Zeichen zu ersetzen. ** 1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile. Bewege den Cursor zum Anfang des ersten xxx . - 2. Nun dr�cke R und tippe die Nummer, die darunter in der zweiten Zeile + 2. Nun drücke R und tippe die Nummer, die darunter in der zweiten Zeile steht, so dass diese das xxx ersetzt. - 3. Dr�cke , um den Ersetzungsmodus zu verlassen. Beachte, dass der Rest - der Zeile unver�ndert bleibt. + 3. Drücke , um den Ersetzungsmodus zu verlassen. Beachte, dass der Rest + der Zeile unverändert bleibt. 4. Wiederhole die Schritte, um das verbliebene xxx zu ersetzen. ---> Das Addieren von 123 zu xxx ergibt xxx. ---> Das Addieren von 123 zu 456 ergibt 579. -Anmerkung: Der Ersetzungsmodus ist wie der Einf�gemodus, aber jedes eingetippte - Zeichen l�scht ein vorhandenes Zeichen. +Anmerkung: Der Ersetzungsmodus ist wie der Einfügemodus, aber jedes eingetippte + Zeichen löscht ein vorhandenes Zeichen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.4: TEXT KOPIEREN UND EINF�GEN + Lektion 1.6.4: TEXT KOPIEREN UND EINFÜGEN - ** Benutze den y Operator, um Text zu kopieren; p , um ihn einzuf�gen ** + ** Benutze den y Operator, um Text zu kopieren; p , um ihn einzufügen ** 1. Gehe zu der mit ---> markierten Zeile unten; setze den Cursor hinter "a)". @@ -793,12 +793,12 @@ Anmerkung: Der Ersetzungsmodus ist wie der Einf 3. Tippe y , um den hervorgehoben Text zu kopieren. - 4. Bewege den Cursor zum Ende der n�chsten Zeile: j$ + 4. Bewege den Cursor zum Ende der nächsten Zeile: j$ - 5. Tippe p , um den Text einzuf�gen und anschlie�end: a zweite . + 5. Tippe p , um den Text einzufügen und anschließend: a zweite . - 6. Benutze den Visuellen Modus, um " Eintrag." auszuw�hlen, kopiere mittels - y , bewege Dich zum Ende der n�chsten Zeile mit j$ und f�ge den Text + 6. Benutze den Visuellen Modus, um " Eintrag." auszuwählen, kopiere mittels + y , bewege Dich zum Ende der nächsten Zeile mit j$ und füge den Text dort mit p an. ---> a) dies ist der erste Eintrag. @@ -808,11 +808,11 @@ Anmerkung: Du kannst y auch als Operator verwenden; yw kopiert ein Wort. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.6.5: OPTIONEN SETZEN - ** Setze eine Option so, dass eine Suche oder Ersetzung Gro�- ** + ** Setze eine Option so, dass eine Suche oder Ersetzung Groß- ** ** und Kleinschreibung ignoriert ** 1. Suche nach 'ignoriere', indem Du /ignoriere eingibst. - Wiederhole die Suche einige Male, indem Du die n - Taste dr�ckst. + Wiederhole die Suche einige Male, indem Du die n - Taste drückst. 2. Setze die 'ic' (Ignore case) - Option, indem Du :set ic eingibst. @@ -823,31 +823,31 @@ Anmerkung: Du kannst y auch als Operator verwenden; yw kopiert ein Wort. 5. Wiederhole die Suche und beobachte, was passiert: /ignoriere - 6. Um das Ignorieren von Gro�/Kleinschreibung abzuschalten, tippe: :set noic + 6. Um das Ignorieren von Groß/Kleinschreibung abzuschalten, tippe: :set noic Anmerkung: Um die Hervorhebung der Treffer zu entfernen, gib ein: :nohlsearch -Anmerkung: Um die Schreibweise f�r eine einzige Suche zu ignorieren, benutze \c +Anmerkung: Um die Schreibweise für eine einzige Suche zu ignorieren, benutze \c im Suchausdruck: /ignoriere\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 1.6 - 1. Tippe o , um eine Zeile UNTER dem Cursor zu �ffnen und den Einf�gemodus + 1. Tippe o , um eine Zeile UNTER dem Cursor zu öffnen und den Einfügemodus zu starten - Tippe O , um eine Zeile �BER dem Cursor zu �ffnen. + Tippe O , um eine Zeile ÜBER dem Cursor zu öffnen. - 2. Tippe a , um Text NACH dem Cursor anzuf�gen. - Tippe A , um Text nach dem Zeilenende anzuf�gen. + 2. Tippe a , um Text NACH dem Cursor anzufügen. + Tippe A , um Text nach dem Zeilenende anzufügen. 3. Das Kommando e bringt Dich zum Ende eines Wortes. - 4. Der Operator y (yank) kopiert Text, p (put) f�gt ihn ein. + 4. Der Operator y (yank) kopiert Text, p (put) fügt ihn ein. - 5. Ein gro�es R geht in den Ersetzungsmodus bis zum Dr�cken von . + 5. Ein großes R geht in den Ersetzungsmodus bis zum Drücken von . 6. Die Eingabe von ":set xxx" setzt die Option "xxx". Einige Optionen sind: - 'ic' 'ignorecase' Ignoriere Gro�/Kleinschreibung bei einer Suche - 'is' 'incsearch' Zeige Teil�bereinstimmungen f�r einen Suchausdruck - 'hls' 'hlsearch' Hebe alle passenden Ausdr�cke hervor + 'ic' 'ignorecase' Ignoriere Groß/Kleinschreibung bei einer Suche + 'is' 'incsearch' Zeige Teilübereinstimmungen für einen Suchausdruck + 'hls' 'hlsearch' Hebe alle passenden Ausdrücke hervor Der Optionsname kann in der Kurz- oder der Langform angegeben werden. 7. Stelle einer Option "no" voran, um sie abzuschalten: :set noic @@ -857,15 +857,15 @@ Anmerkung: Um die Schreibweise f ** Nutze das eingebaute Hilfesystem ** - Vim besitzt ein umfassendes eingebautes Hilfesystem. F�r den Anfang probiere + Vim besitzt ein umfassendes eingebautes Hilfesystem. Für den Anfang probiere eins der drei folgenden Dinge aus: - - Dr�cke die - Taste (falls Du eine besitzt) - - Dr�cke die Taste (falls Du eine besitzt) + - Drücke die - Taste (falls Du eine besitzt) + - Drücke die Taste (falls Du eine besitzt) - Tippe :help Lies den Text im Hilfefenster, um zu verstehen wie die Hilfe funktioniert. Tippe CTRL-W CTRL-W , um von einem Fenster zum anderen zu springen. - Tippe :q , um das Hilfefenster zu schlie�en. + Tippe :q , um das Hilfefenster zu schließen. Du kannst Hilfe zu praktisch jedem Thema finden, indem Du dem ":help"- Kommando ein Argument gibst. Probiere folgendes ( nicht vergessen): @@ -880,13 +880,13 @@ Anmerkung: Um die Schreibweise f ** Aktiviere die Features von Vim ** - Vim besitzt viele Funktionalit�ten, die �ber Vi hinausgehen, aber die meisten - von ihnen sind standardm��ig deaktiviert. Um mehr Funktionalit�ten zu nutzen, + Vim besitzt viele Funktionalitäten, die über Vi hinausgehen, aber die meisten + von ihnen sind standardmäßig deaktiviert. Um mehr Funktionalitäten zu nutzen, musst Du eine "vimrc" - Datei erstellen. - 1. Starte das Editieren der "vimrc"-Datei, abh�ngig von deinem System: - :e ~/.vimrc f�r Unix - :e ~/_vimrc f�r MS-Windows + 1. Starte das Editieren der "vimrc"-Datei, abhängig von deinem System: + :e ~/.vimrc für Unix + :e ~/_vimrc für MS-Windows 2. Nun lies den Inhalt der Beispiel-"vimrc"-Datei ein: :r $VIMRUNTIME/vimrc_example.vim @@ -894,49 +894,49 @@ Anmerkung: Um die Schreibweise f 3. Speichere die Datei mit: :w - Beim n�chsten Start von Vim wird die Syntaxhervorhebung aktiviert sein. - Du kannst all deine bevorzugten Optionen zu dieser "vimrc"-Datei zuf�gen. - F�r mehr Informationen tippe :help vimrc-intro + Beim nächsten Start von Vim wird die Syntaxhervorhebung aktiviert sein. + Du kannst all deine bevorzugten Optionen zu dieser "vimrc"-Datei zufügen. + Für mehr Informationen tippe :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.3: VERVOLLST�NDIGEN + Lektion 1.7.3: VERVOLLSTÄNDIGEN - ** Kommandozeilenvervollst�ndigung mit CTRL-D und ** + ** Kommandozeilenvervollständigung mit CTRL-D und ** - 1. Stelle sicher, dass Vim nicht im Vi-Kompatibilit�tsmodus ist: :set nocp + 1. Stelle sicher, dass Vim nicht im Vi-Kompatibilitätsmodus ist: :set nocp 2. Siehe nach, welche Dateien im Verzeichnis existieren: :!ls oder :!dir 3. Tippe den Beginn eines Kommandos: :e - 4. Dr�cke CTRL-D und Vim zeigt eine Liste mit "e" beginnender Kommandos. + 4. Drücke CTRL-D und Vim zeigt eine Liste mit "e" beginnender Kommandos. - 5. Dr�cke und Vim vervollst�ndigt den Kommandonamen zu ":edit". + 5. Drücke und Vim vervollständigt den Kommandonamen zu ":edit". - 6. Nun f�ge ein Leerzeichen und den Anfang einer existierenden Datei an: + 6. Nun füge ein Leerzeichen und den Anfang einer existierenden Datei an: :edit DAT - 7. Dr�cke . Vim vervollst�ndigt den Namen (falls er eindeutig ist). + 7. Drücke . Vim vervollständigt den Namen (falls er eindeutig ist). -Anmerkung: Vervollst�ndigung funktioniert f�r viele Kommandos. Probiere - einfach CTRL-D und . Dies ist insbesondere n�tzlich f�r :help . +Anmerkung: Vervollständigung funktioniert für viele Kommandos. Probiere + einfach CTRL-D und . Dies ist insbesondere nützlich für :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZUSAMMENFASSUNG VON LEKTION 1.7 - 1. Tippe :help oder dr�cke oder , um ein Hilfefenster zu �ffnen. + 1. Tippe :help oder drücke oder , um ein Hilfefenster zu öffnen. - 2. Tippe :help Kommando , um Hilfe �ber Kommando zu erhalten. + 2. Tippe :help Kommando , um Hilfe über Kommando zu erhalten. 3. Tippe CTRL-W CTRL-W , um zum anderen Fenster zu springen. - 4. Tippe :q , um das Hilfefenster zu schlie�en. + 4. Tippe :q , um das Hilfefenster zu schließen. 5. Erstelle ein vimrc - Startskript mit deinen bevorzugter Einstellungen. - 6. Dr�cke CTRL-D nach dem Tippen eines : Kommandos, um m�gliche - Vervollst�ndigungen anzusehen. - Dr�cke , um eine Vervollst�ndigung zu anzuwenden. + 6. Drücke CTRL-D nach dem Tippen eines : Kommandos, um mögliche + Vervollständigungen anzusehen. + Drücke , um eine Vervollständigung zu anzuwenden. @@ -946,37 +946,37 @@ Anmerkung: Vervollst ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Damit ist der Vim Tutor beendet. Seine Intention war, einen kurzen und - b�ndigen �berblick �ber den Vim Editor zu geben; gerade genug, um relativ - leicht mit ihm umgehen zu k�nnen. Der Vim Tutor hat nicht den geringsten - Anspruch auf Vollst�ndigkeit; Vim hat noch weitaus mehr Kommandos. Lies als - n�chstes das User Manual: ":help user-manual". + bündigen Überblick über den Vim Editor zu geben; gerade genug, um relativ + leicht mit ihm umgehen zu können. Der Vim Tutor hat nicht den geringsten + Anspruch auf Vollständigkeit; Vim hat noch weitaus mehr Kommandos. Lies als + nächstes das User Manual: ":help user-manual". - F�r weiteres Lesen und Lernen ist folgendes Buch empfehlenswert : + Für weiteres Lesen und Lernen ist folgendes Buch empfehlenswert : Vim - Vi Improved - von Steve Oualline Verlag: New Riders - Das erste Buch, welches durchg�ngig Vim gewidmet ist. Besonders n�tzlich - f�r Anf�nger. Viele Beispiele und Bilder sind enthalten. + Das erste Buch, welches durchgängig Vim gewidmet ist. Besonders nützlich + für Anfänger. Viele Beispiele und Bilder sind enthalten. Siehe https://iccf-holland.org/click5.html - Folgendes Buch ist �lter und mehr �ber Vi als Vim, aber auch empfehlenswert: + Folgendes Buch ist älter und mehr über Vi als Vim, aber auch empfehlenswert: Textbearbeitung mit dem Vi-Editor - von Linda Lamb und Arnold Robbins Verlag O'Reilly - ISBN: 3897211262 - In diesem Buch kann man fast alles finden, was man mit Vi tun m�chte. - Die sechste Ausgabe enth�lt auch Informationen �ber Vim. + In diesem Buch kann man fast alles finden, was man mit Vi tun möchte. + Die sechste Ausgabe enthält auch Informationen über Vim. - Als aktuelle Referenz f�r Version 6.2 und knappe Einf�hrung dient das + Als aktuelle Referenz für Version 6.2 und knappe Einführung dient das folgende Buch: vim ge-packt von Reinhard Wobst mitp-Verlag, ISBN 3-8266-1425-9 - Trotz der kompakten Darstellung ist es durch viele n�tzliche Beispiele auch - f�r Einsteiger empfehlenswert. Probekapitel und die Beispielskripte sind - online erh�ltlich. Siehe https://iccf-holland.org/click5.html + Trotz der kompakten Darstellung ist es durch viele nützliche Beispiele auch + für Einsteiger empfehlenswert. Probekapitel und die Beispielskripte sind + online erhältlich. Siehe https://iccf-holland.org/click5.html Dieses Tutorial wurde geschrieben von Michael C. Pierce und Robert K. Ware, Colorado School of Mines. Es benutzt Ideen, die Charles Smith, Colorado State - University, zur Verf�gung stellte. E-Mail: bware@mines.colorado.edu. + University, zur Verfügung stellte. E-Mail: bware@mines.colorado.edu. - Bearbeitet f�r Vim von Bram Moolenaar. - Deutsche �bersetzung von Joachim Hofmann 2015. E-Mail: Joachim.Hof@gmx.de + Bearbeitet für Vim von Bram Moolenaar. + Deutsche Übersetzung von Joachim Hofmann 2015. E-Mail: Joachim.Hof@gmx.de ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.de.utf-8 b/runtime/tutor/tutor1.de.utf-8 deleted file mode 100644 index f2157d9cd6..0000000000 --- a/runtime/tutor/tutor1.de.utf-8 +++ /dev/null @@ -1,982 +0,0 @@ -=============================================================================== -= W i l l k o m m e n im V I M T u t o r - Version 1.7.de.1 = -=============================================================================== - - Vim ist ein sehr mächtiger Editor, der viele Befehle bereitstellt; zu viele, - um alle in einem Tutor wie diesem zu erklären. Dieser Tutor ist so - gestaltet, um genug Befehle vorzustellen, dass Du die Fähigkeit erlangst, - Vim mit Leichtigkeit als einen Allzweck-Editor zu verwenden. - Die Zeit für das Durcharbeiten dieses Tutors beträgt ca. 25-30 Minuten, - abhängig davon, wie viel Zeit Du mit Experimentieren verbringst. - - ACHTUNG: - Die in den Lektionen angewendeten Kommandos werden den Text modifizieren. - Erstelle eine Kopie dieser Datei, in der Du üben willst (falls Du "vimtutor" - aufgerufen hast, ist dies bereits eine Kopie). - - Es ist wichtig, sich zu vergegenwärtigen, dass dieser Tutor für das Anwenden - konzipiert ist. Das bedeutet, dass Du die Befehle anwenden musst, um sie - richtig zu lernen. Wenn Du nur den Text liest, vergisst Du die Befehle! - - Jetzt stelle sicher, dass deine Umstelltaste NICHT gedrückt ist und betätige - die j Taste genügend Mal, um den Cursor nach unten zu bewegen, so dass - Lektion 1.1.1 den Bildschirm vollkommen ausfüllt. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.1: BEWEGEN DES CURSORS - - ** Um den Cursor zu bewegen, drücke die h,j,k,l Tasten wie unten gezeigt. ** - ^ Hilfestellung: - k Die h Taste befindet sich links und bewegt nach links. - < h l > Die l Taste liegt rechts und bewegt nach rechts. - j Die j Taste ähnelt einem Pfeil nach unten. - v - 1. Bewege den Cursor auf dem Bildschirm umher, bis Du Dich sicher fühlst. - - 2. Halte die Nach-Unten-Taste (j) gedrückt, bis sie sich wiederholt. - Jetzt weißt Du, wie Du Dich zur nächsten Lektion bewegen kannst. - - 3. Benutze die Nach-Unten-Taste, um Dich zu Lektion 1.1.2 zu bewegen. - -Anmerkung: Immer, wenn Du Dir unsicher bist über das, was Du getippt hast, - drücke , um Dich in den Normalmodus zu begeben. - Dann gib das gewünschte Kommando noch einmal ein. - -Anmerkung: Die Cursor-Tasten sollten ebenfalls funktionieren. Aber wenn Du - hjkl benutzt, wirst Du in der Lage sein, Dich sehr viel schneller - umherzubewegen, wenn Du Dich einmal daran gewöhnt hast. Wirklich! -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.2: VIM BEENDEN - - - !! Hinweis: Bevor Du einen der unten aufgeführten Schritte ausführst, lies - diese gesamte Lektion!! - - 1. Drücke die Taste (um sicherzustellen, dass Du im Normalmodus bist). - - 2. Tippe: :q! . - Dies beendet den Editor und VERWIRFT alle Änderungen, die Du gemacht hast. - - 3. Wenn Du die Eingabeaufforderung siehst, gib das Kommando ein, das Dich zu - diesem Tutor geführt hat. Dies wäre: vimtutor - - 4. Wenn Du Dir diese Schritte eingeprägt hast und Du Dich sicher fühlst, - führe Schritte 1 bis 3 aus, um den Editor zu verlassen und wieder - hineinzugelangen. - -Anmerkung: :q! verwirft alle Änderungen, die Du gemacht hast. Einige - Lektionen später lernst Du, die Änderungen in einer Datei zu speichern. - - 5. Bewege den Cursor abwärts zu Lektion 1.1.3. - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.3: TEXT EDITIEREN - LÖSCHEN - - - ** Drücke x , um das Zeichen unter dem Cursor zu löschen. ** - - 1. Bewege den Cursor zu der mit ---> markierten Zeile unten. - - 2. Um die Fehler zu beheben, bewege den Cursor, bis er über dem Zeichen steht, - das gelöscht werden soll. - - 3. Drücke die x Taste, um das unerwünschte Zeichen zu löschen. - - 4. Wiederhole die Schritte 2 bis 4, bis der Satz korrekt ist. - ----> Die Kkuh sprangg übberr deen Moond. - - 5. Nun, da die Zeile korrekt ist, gehe weiter zur Lektion 1.1.4. - -Anmerkung: Während Du durch diesen Tutor gehst, versuche nicht, auswendig zu - lernen, lerne vielmehr durch Anwenden. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.4: TEXT EDITIEREN - EINFÜGEN - - - ** Drücke i , um Text einzufügen. ** - - 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. - - 2. Um die erste Zeile mit der zweiten gleichzumachen, bewege den Cursor auf - das erste Zeichen NACH der Stelle, an der Text eingefügt werden soll. - - 3. Drücke i und gib die nötigen Ergänzungen ein. - - 4. Wenn jeweils ein Fehler beseitigt ist, drücke , um zum Normalmodus - zurückzukehren. - Wiederhole Schritte 2 bis 4, um den Satz zu korrigieren. - ----> In dieser ft etwas . ----> In dieser Zeile fehlt etwas Text. - - 5. Wenn Du Dich mit dem Einfügen von Text sicher fühlst, gehe zu Lektion 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.5: TEXT EDITIEREN - ANFÜGEN - - - ** Drücke A , um Text anzufügen. ** - - 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. - Dabei ist gleichgültig, auf welchem Zeichen der Zeile der Cursor steht. - - 2. Drücke A und gib die erforderlichen Ergänzungen ein. - - 3. Wenn das Anfügen abgeschlossen ist, drücke , um in den Normalmodus - zurückzukehren. - - 4. Bewege den Cursor zur zweiten mit ---> markierten Zeile und wiederhole - die Schritte 2 und 3, um den Satz zu auszubessern. - ----> In dieser Zeile feh - In dieser Zeile fehlt etwas Text. ----> Auch hier steh - Auch hier steht etwas Unvollständiges. - - 5. Wenn Du dich mit dem Anfügen von Text sicher fühlst, gehe zu Lektion 1.1.6. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.6: EINE DATEI EDITIEREN - - ** Benutze :wq , um eine Datei zu speichern und Vim zu verlassen. ** - - !! Hinweis: Bevor Du einen der unten aufgeführten Schritte ausführst, lies - diese gesamte Lektion!! - - 1. Verlasse den Editor so wie in Lektion 1.1.2: :q! - Oder, falls du Zugriff zu einem anderen Terminal hast, führe das - Folgende dort aus. - - 2. Gib dieses Kommando in die Eingabeaufforderung ein: vim tutor - 'vim' ist der Aufruf des Editors, 'tutor' ist die zu editierende Datei. - Benutze eine Datei, die geändert werden darf. - - 3. Füge Text ein oder lösche ihn, wie Du in den vorangehenden Lektionen - gelernt hast. - - 4. Speichere die geänderte Datei und verlasse Vim mit: :wq - - 5. Falls Du in Schritt 1 den vimtutor beendet hast, starte vimtutor neu und - bewege dich abwärts bis zur folgenden Zusammenfassung. - - 6. Nachdem Du obige Schritte gelesen und verstanden hast: führe sie durch. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZUSAMMENFASSUNG VON LEKTION 1.1 - - - 1. Der Cursor wird mit den Pfeiltasten oder den Tasten hjkl bewegt. - h (links) j (unten) k (aufwärts) l (rechts) - - 2. Um Vim aus der Eingabeaufforderung zu starten, tippe: vim DATEI - - 3. Um Vim zu verlassen und alle Änderungen zu verwerfen, tippe: - :q! . - - 4. Um das Zeichen unter dem Cursor zu löschen, tippe: x - - 5. Um Text einzufügen oder anzufügen, tippe: - i Einzufügenden Text eingeben Einfügen vor dem Cursor - A Anzufügenden Text eingeben Anfügen nach dem Zeilenende - -Anmerkung: Drücken von bringt Dich in den Normalmodus oder bricht ein - ungewolltes, erst teilweise eingegebenes Kommando ab. - - Nun fahre mit Lektion 1.2 fort. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.1: LÖSCHKOMMANDOS - - - ** Tippe dw , um ein Wort zu löschen. ** - - 1. Drücke , um sicherzustellen, dass Du im Normalmodus bist. - - 2. Bewege den Cursor zu der mit ---> markierten Zeile unten. - - 3. Bewege den Cursor zum Anfang eines Wortes, das gelöscht werden soll. - - 4. Tippe dw , um das Wort zu entfernen. - - Anmerkung: Der Buchstabe d erscheint auf der untersten Zeile des Schirms, - wenn Du ihn eingibst. Vim wartet darauf, dass Du w eingibst. Falls Du - ein anderes Zeichen als d siehst, hast Du etwas Falsches getippt; - drücke und beginne noch einmal. - ----> Einige Wörter lustig gehören nicht Papier in diesen Satz. - - 5. Wiederhole die Schritte 3 und 4, bis der Satz korrekt ist und gehe - zur Lektion 1.2.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.2: WEITERE LÖSCHKOMMANDOS - - - ** Tippe d$ , um bis zum Ende der Zeile zu löschen. ** - - 1. Drücke , um sicherzustellen, dass Du im Normalmodus bist. - - 2. Bewege den Cursor zu der mit ---> markierten Zeile unten. - - 3. Bewege den Cursor zum Ende der korrekten Zeile (NACH dem ersten . ). - - 4. Tippe d$ , um bis zum Zeilenende zu löschen. - ----> Jemand hat das Ende der Zeile doppelt eingegeben. doppelt eingegeben. - - - 5. Gehe weiter zur Lektion 1.2.3 , um zu verstehen, was hierbei vorgeht. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.3: ÜBER OPERATOREN UND BEWEGUNGSZÜGE - - - Viele Kommandos, die Text ändern, setzen sich aus einem Operator und einer - Bewegung zusammen. Das Format für ein Löschkommando mit dem Löschoperator d - lautet wie folgt: - - d Bewegung - - wobei: - d - der Löschoperator - Bewegung - worauf der Löschoperator angewandt wird (unten aufgeführt). - - Eine kleine Auflistung von Bewegungen: - w - bis zum Beginn des nächsten Wortes OHNE dessen erstes Zeichen. - e - zum Ende des aktuellen Wortes MIT dessen letztem Zeichen. - $ - zum Ende der Zeile MIT dem letzten Zeichen. - - Dementsprechend löscht die Eingabe von de vom Cursor an bis zum Wortende. - -Anmerkung: Die Eingabe lediglich des Bewegungsteils im Normalmodus bewegt den - Cursor entsprechend. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.4: ANWENDUNG EINES ZÄHLERS FÜR EINEN BEWEGUNGSSCHRITT - - - ** Die Eingabe einer Zahl vor einem Bewegungsschritt wiederholt diesen. ** - - 1. Bewege den Cursor zum Beginn der mit ---> markierten Zeile unten. - - 2. Tippe 2w , um den Cursor zwei Wörter vorwärts zu bewegen. - - 3. Tippe 3e , um den Cursor zum Ende des dritten Wortes zu bewegen. - - 4. Tippe 0 (Null) , um zum Anfang der Zeile zu gelangen. - - 5. Wiederhole Schritte 2 und 3 mit verschiedenen Nummern. - - ---> Dies ist nur eine Zeile aus Wörtern, um sich darin herumzubewegen. - - 6. Gehe weiter zu Lektion 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.5: ANWENDUNG EINES ZÄHLERS FÜR MEHRERE LÖSCHVORGÄNGE - - - ** Die Eingabe einer Zahl mit einem Operator wiederholt diesen mehrfach. ** - - In der Kombination aus Löschoperator und Bewegungsschritt (siehe oben) - stellt man, um mehr zu löschen dem Schritt einen Zähler voran: - d Nummer Bewegungsschritt - - 1. Bewege den Cursor zum ersten Wort in GROSSBUCHSTABEN in der mit ---> - markieren Zeile. - - 2. Tippe d2w , um die zwei Wörter in GROSSBUCHSTABEN zu löschen. - - 3. Wiederhole Schritte 1 und 2 mit einem anderen Zähler, um die darauffol- - genden Wörter in GROSSBUCHSTABEN mit einem einzigen Kommando zu löschen. - ----> Diese ABC DE Zeile FGHI JK LMN OP mit Wörtern ist Q RS TUV bereinigt. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.6: ARBEITEN AUF ZEILEN - - - ** Tippe dd , um eine ganze Zeile zu löschen. ** - - Wegen der Häufigkeit, dass man ganze Zeilen löscht, kamen die Entwickler von - Vi darauf, dass es leichter wäre, einfach zwei d's einzugeben, um eine Zeile - zu löschen. - - 1. Bewege den Cursor zur zweiten Zeile in der unten stehenden Redewendung. - 2. Tippe dd , um die Zeile zu löschen. - 3. Nun bewege Dich zur vierten Zeile. - 4. Tippe 2dd , um zwei Zeilen zu löschen. - ----> 1) Rosen sind rot, ----> 2) Matsch ist lustig, ----> 3) Veilchen sind blau, ----> 4) Ich habe ein Auto, ----> 5) Die Uhr sagt die Zeit, ----> 6) Zucker ist süß, ----> 7) So wie Du auch. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.7: RÜCKGÄNGIG MACHEN (UNDO) - - - ** Tippe u , um die letzten Kommandos rückgängig zu machen ** - ** oder U , um eine ganze Zeile wiederherzustellen. ** - - 1. Bewege den Cursor zu der mit ---> markierten Zeile unten - und setze ihn auf den ersten Fehler. - 2. Tippe x , um das erste unerwünschte Zeichen zu löschen. - 3. Nun tippe u , um das soeben ausgeführte Kommando rückgängig zu machen. - 4. Jetzt behebe alle Fehler auf der Zeile mit Hilfe des x Kommandos. - 5. Nun tippe ein großes U , um die Zeile in ihren Ursprungszustand - wiederherzustellen. - 6. Nun tippe u einige Male, um das U und die vorhergehenden Kommandos - rückgängig zu machen. - 7. Nun tippe CTRL-R (halte CTRL gedrückt und drücke R) mehrere Male, um die - Kommandos wiederherzustellen (die Rückgängigmachungen rückgängig machen). - ----> Beehebe die Fehller diesser Zeile und sttelle sie mitt 'undo' wieder her. - - 8. Dies sind sehr nützliche Kommandos. Nun gehe weiter zur Zusammenfassung - von Lektion 1.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZUSAMMENFASSUNG VON LEKTION 1.2 - - - 1. Um vom Cursor bis zum nächsten Wort zu löschen, tippe: dw - 2. Um vom Cursor bis zum Ende einer Zeile zu löschen, tippe: d$ - 3. Um eine ganze Zeile zu löschen, tippe: dd - - 4. Um eine Bewegung zu wiederholen, stelle eine Nummer voran: 2w - 5. Das Format für ein Änderungskommando ist: - Operator [Anzahl] Bewegungsschritt - wobei: - Operator - gibt an, was getan werden soll, zum Beispiel d für delete - [Anzahl] - ein optionaler Zähler, um den Bewegungsschritt zu wiederholen - Bewegungsschritt - Bewegung über den zu ändernden Text, wie - w (Wort), $ (zum Ende der Zeile), etc. - - 6. Um Dich zum Anfang der Zeile zu begeben, benutze die Null: 0 - - 7. Um vorherige Aktionen rückgängig zu machen, tippe: u (kleines u) - Um alle Änderungen auf einer Zeile rückgängig zu machen: U (großes U) - Um die Rückgängigmachungen rückgängig zu machen, tippe: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.1: ANFÜGEN (PUT) - - - ** Tippe p , um vorher gelöschten Text nach dem Cursor anzufügen. ** - - 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. - - 2. Tippe dd , um die Zeile zu löschen und sie in einem Vim-Register zu - speichern. - - 3. Bewege den Cursor zur Zeile c), ÜBER derjenigen, wo die gelöschte Zeile - platziert werden soll. - - 4. Tippe p , um die Zeile unterhalb des Cursors zu platzieren. - - 5. Wiederhole die Schritte 2 bis 4, um alle Zeilen in die richtige - Reihenfolge zu bringen. - ----> d) Kannst Du das auch? ----> b) Veilchen sind blau, ----> c) Intelligenz ist lernbar, ----> a) Rosen sind rot, -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.2: ERSETZEN (REPLACE) - - - ** Tippe rx , um das Zeichen unter dem Cursor durch x zu ersetzen. ** - - 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. - - 2. Bewege den Cursor, bis er sich auf dem ersten Fehler befindet. - - 3. Tippe r und anschließend das Zeichen, welches dort stehen sollte. - - 4. Wiederhole Schritte 2 und 3, bis die erste Zeile gleich der zweiten ist. - ----> Alf diese Zeite eingegoben wurde, wurden einike falsche Tasten gelippt! ----> Als diese Zeile eingegeben wurde, wurden einige falsche Tasten getippt! - - 5. Nun fahre fort mit Lektion 1.3.2. - -Anmerkung: Erinnere Dich daran, dass Du durch Anwenden lernen solltest, nicht - durch Auswendiglernen. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.3: ÄNDERN (CHANGE) - - - ** Um eine Änderung bis zum Wortende durchzuführen, tippe ce . ** - - 1. Bewege den Cursor zur ersten unten stehenden mit ---> markierten Zeile. - - 2. Platziere den Cursor auf das s von Wstwr. - - 3. Tippe ce und die Wortkorrektur ein (in diesem Fall tippe örter ). - - 4. Drücke und bewege den Cursor zum nächsten zu ändernden Zeichen. - - 5. Wiederhole Schritte 3 und 4 bis der erste Satz gleich dem zweiten ist. - ----> Einige Wstwr dieser Zlaww lasdjlaf mit dem Ändern-Operator gaaauu werden. ----> Einige Wörter dieser Zeile sollen mit dem Ändern-Operator geändert werden. - -Beachte, dass ce das Wort löscht und Dich in den Eingabemodus versetzt. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.4: MEHR ÄNDERUNGEN MITTELS c - - - ** Das change-Kommando arbeitet mit denselben Bewegungen wie delete. ** - - 1. Der change Operator arbeitet in gleicher Weise wie delete. Das Format ist: - - c [Anzahl] Bewegungsschritt - - 2. Die Bewegungsschritte sind die gleichen , so wie w (Wort) und $ - (Zeilenende). - - 3. Bewege Dich zur ersten unten stehenden mit ---> markierten Zeile. - - 4. Bewege den Cursor zum ersten Fehler. - - 5. Tippe c$ , gib den Rest der Zeile wie in der zweiten ein, drücke . - ----> Das Ende dieser Zeile soll an die zweite Zeile angeglichen werden. ----> Das Ende dieser Zeile soll mit dem c$ Kommando korrigiert werden. - -Anmerkung: Du kannst die Rücktaste benutzen, um Tippfehler zu korrigieren. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZUSAMMENFASSUNG VON LEKTION 1.3 - - - 1. Um einen vorher gelöschten Text anzufügen, tippe p . Dies fügt den - gelöschten Text NACH dem Cursor an (wenn eine ganze Zeile gelöscht wurde, - wird diese in die Zeile unter dem Cursor eingefügt). - - 2. Um das Zeichen unter dem Cursor zu ersetzen, tippe r und danach das - an dieser Stelle gewollte Zeichen. - - 3. Der Änderungs- (change) Operator erlaubt, vom Cursor bis zum Ende des - Bewegungsschrittes zu ändern. Tippe ce , um eine Änderung vom Cursor bis - zum Ende des Wortes vorzunehmen; c$ bis zum Ende einer Zeile. - - 4. Das Format für change ist: - - c [Anzahl] Bewegungsschritt - - Nun fahre mit der nächsten Lektion fort. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.1: CURSORPOSITION UND DATEISTATUS - - ** Tippe CTRL-G , um deine Dateiposition sowie den Dateistatus anzuzeigen. ** - ** Tippe G , um Dich zu einer Zeile in der Datei zu begeben. ** - -Anmerkung: Lies diese gesamte Lektion, bevor Du irgendeinen Schritt ausführst!! - - 1. Halte die Ctrl Taste unten und drücke g . Dies nennen wir CTRL-G. - Eine Statusmeldung am Fuß der Seite erscheint mit dem Dateinamen und der - Position innerhalb der Datei. Merke Dir die Zeilennummer für Schritt 3. - -Anmerkung: Möglicherweise siehst Du die Cursorposition in der unteren rechten - Bildschirmecke. Dies ist Auswirkung der 'ruler' Option - (siehe :help 'ruler') - - 2. Drücke G , um Dich zum Ende der Datei zu begeben. - Tippe gg , um Dich zum Anfang der Datei zu begeben. - - 3. Gib die Nummer der Zeile ein, auf der Du vorher warst, gefolgt von G . - Dies bringt Dich zurück zu der Zeile, auf der Du gestanden hast, als Du - das erste Mal CTRL-G gedrückt hast. - - 4. Wenn Du Dich sicher genug fühlst, führe die Schritte 1 bis 3 aus. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.2: DAS SUCHEN - KOMMANDO - - - ** Tippe / gefolgt von einem Ausdruck, um nach dem Ausdruck zu suchen. ** - - 1. Im Normalmodus, tippe das / Zeichen. Beachte, dass das / und der - Cursor am Fuß des Schirms erscheinen, so wie beim : Kommando. - - 2. Nun tippe 'Fehhler' . Dies ist das Wort, nach dem Du suchen willst. - - 3. Um nach demselben Ausdruck weiterzusuchen, tippe einfach n (für next). - Um nach demselben Ausdruck in der Gegenrichtung zu suchen, tippe N . - - 4. Um nach einem Ausdruck rückwärts zu suchen , benutze ? statt / . - - 5. Um dahin zurückzukehren, von wo Du gekommen bist, drücke CTRL-O (Halte - Ctrl unten und drücke den Buchstaben o). Wiederhole dies, um noch weiter - zurückzugehen. CTRL-I geht vorwärts. - ----> Fehler schreibt sich nicht "Fehhler"; Fehhler ist ein Fehler -Anmerkung: Wenn die Suche das Dateiende erreicht hat, wird sie am Anfang - fortgesetzt, es sei denn, die 'wrapscan' Option wurde abgeschaltet. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.3: PASSENDE KLAMMERN FINDEN - - - ** Tippe % , um eine gegenüberliegenden Klammer ),], oder } zu finden. ** - - 1. Platziere den Cursor auf irgendeinem der Zeichen (, [, oder { in der unten - stehenden Zeile, die mit ---> markiert ist. - - 2. Nun tippe das % Zeichen. - - 3. Der Cursor bewegt sich zur passenden gegenüberliegenden Klammer. - - 4. Tippe % , um den Cursor zur passenden anderen Klammer zu bewegen. - - 5. Setze den Cursor auf ein anderes (,),[,],{ oder } und probiere % aus. - ----> Dies ( ist eine Testzeile ( mit [ verschiedenen ] { Klammern } darin. )) - -Anmerkung: Diese Funktionalität ist sehr nützlich bei der Fehlersuche in einem - Programmtext, in dem passende Klammern fehlen! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.4: DAS ERSETZUNGSKOMMANDO (SUBSTITUTE) - - - ** Tippe :s/alt/neu/g , um 'alt' durch 'neu' zu ersetzen. ** - - 1. Bewege den Cursor zu der unten stehenden mit ---> markierten Zeile. - - 2. Tippe :s/diee/die . Beachte, dass der Befehl nur das erste - Vorkommen von "diee" ersetzt. - - 3. Nun tippe :s/diee/die/g . Das Zufügen des Flags g bedeutet, eine - globale Ersetzung über die Zeile durchzuführen, dies ersetzt alle - Vorkommen von "diee" auf der Zeile. - ----> diee schönste Zeit, um diee Blumen anzuschauen, ist diee Frühlingszeit. - - 4. Um alle Vorkommen einer Zeichenkette innerhalb zweier Zeilen zu ändern, - tippe :#,#s/alt/neu/g wobei #,# die Zeilennummern des Bereiches sind, - in dem die Ersetzung durchgeführt werden soll. - Tippe :%s/alt/neu/g um alle Vorkommen in der gesamten Datei zu ändern. - Tippe :%s/alt/neu/gc um alle Vorkommen in der gesamten Datei zu finden - mit einem Fragedialog, ob ersetzt werden soll oder nicht. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZUSAMMENFASSUNG VON LEKTION 1.4 - - 1. CTRL-G zeigt die aktuelle Dateiposition sowie den Dateistatus. - G bringt Dich zum Ende der Datei. - Nummer G bringt Dich zur entsprechenden Zeilennummer. - gg bringt Dich zur ersten Zeile. - - 2. Die Eingabe von / plus einem Ausdruck sucht VORWÄRTS nach dem Ausdruck. - Die Eingabe von ? plus einem Ausdruck sucht RÜCKWÄRTS nach dem Ausdruck. - Tippe nach einer Suche n , um das nächste Vorkommen in der gleichen - Richtung zu finden; oder N , um in der Gegenrichtung zu suchen. - CTRL-O bringt Dich zurück zu älteren Positionen, CTRL-I zu neueren. - - 3. Die Eingabe von % , wenn der Cursor sich auf (,),[,],{, oder } - befindet, bringt Dich zur Gegenklammer. - - 4. Um das erste Vorkommen von "alt" in einer Zeile durch "neu" zu ersetzen, - tippe :s/alt/neu - Um alle Vorkommen von "alt" in der Zeile ersetzen, tippe :s/alt/neu/g - Um Ausdrücke innerhalb zweier Zeilen # zu ersetzen :#,#s/alt/neu/g - Um alle Vorkommen in der ganzen Datei zu ersetzen, tippe :%s/alt/neu/g - Für eine jedesmalige Bestätigung, addiere 'c' (confirm) :%s/alt/neu/gc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.1: AUSFÜHREN EINES EXTERNEN KOMMANDOS - - - ** Gib :! , gefolgt von einem externen Kommando ein, um es auszuführen. ** - - 1. Tippe das vertraute Kommando : , um den Cursor auf den Fuß des Schirms - zu setzen. Dies erlaubt Dir, ein Kommandozeilen-Kommando einzugeben. - - 2. Nun tippe ein ! (Ausrufezeichen). Dies ermöglicht Dir, ein beliebiges, - externes Shellkommando auszuführen. - - 3. Als Beispiel tippe ls nach dem ! und drücke . Dies liefert - eine Auflistung deines Verzeichnisses; genauso, als wenn Du in der - Eingabeaufforderung wärst. Oder verwende :!dir , falls ls nicht geht. - -Anmerkung: Mit dieser Methode kann jedes beliebige externe Kommando - ausgeführt werden, auch mit Argumenten. - -Anmerkung: Alle : Kommandos müssen durch Eingabe von - abgeschlossen werden. Von jetzt an erwähnen wir dies nicht jedesmal. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.2: MEHR ÜBER DAS SCHREIBEN VON DATEIEN - - -** Um am Text durchgeführte Änderungen zu speichern, tippe :w DATEINAME. ** - - 1. Tippe :!dir oder :!ls , um eine Auflistung deines Verzeichnisses zu - erhalten. Du weißt nun bereits, dass Du danach eingeben musst. - - 2. Wähle einen Dateinamen, der noch nicht existiert, z.B. TEST. - - 3. Nun tippe: :w TEST (wobei TEST der gewählte Dateiname ist). - - 4. Dies speichert die ganze Datei (den Vim Tutor) unter dem Namen TEST. - Um dies zu überprüfen, tippe nochmals :!ls bzw. !dir, um deinen - Verzeichnisinhalt zu sehen. - -Anmerkung: Würdest Du Vim jetzt beenden und danach wieder mit vim TEST - starten, dann wäre diese Datei eine exakte Kopie des Tutors zu dem - Zeitpunkt, als Du ihn gespeichert hast. - - 5. Nun entferne die Datei durch Eingabe von (MS-DOS): :!del TEST - oder (Unix): :!rm TEST -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.3: AUSWÄHLEN VON TEXT ZUM SCHREIBEN - -** Um einen Abschnitt der Datei zu speichern, tippe v Bewegung :w DATEI ** - - 1. Bewege den Cursor zu dieser Zeile. - - 2. Tippe v und bewege den Cursor zum fünften Auflistungspunkt unten. - Beachte, dass der Text hervorgehoben wird. - - 3. Drücke das Zeichen : . Am Fuß des Schirms erscheint :'<,'> . - - 4. Tippe w TEST , wobei TEST ein noch nicht vorhandener Dateiname ist. - Vergewissere Dich, dass Du :'<,'>w TEST siehst, bevor Du drückst. - - 5. Vim schreibt die ausgewählten Zeilen in die Datei TEST. Benutze :!dir - oder :!ls , um sie zu sehen. Lösche sie noch nicht! Wir werden sie in - der nächsten Lektion benutzen. - -Hinweis: Drücken von v startet die Visuelle Auswahl. Du kannst den Cursor - umherbewegen, um die Auswahl zu vergrößern oder zu verkleinern. Anschließend - lässt sich ein Operator anwenden, um mit dem Text etwas zu tun. Zum Beispiel - löscht d den Text. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.4: EINLESEN UND ZUSAMMENFÜHREN VON DATEIEN - - - ** Um den Inhalt einer Datei einzulesen, tippe :r DATEINAME ** - - 1. Platziere den Cursor direkt über dieser Zeile. - -BEACHTE: Nachdem Du Schritt 2 ausgeführt hast, wirst Du Text aus Lektion 1.5.3 - sehen. Dann bewege Dich wieder ABWÄRTS, Lektion 1.5.4 wiederzusehen. - - 2. Nun lies deine Datei TEST ein indem Du das Kommando :r TEST ausführst, - wobei TEST der von Dir verwendete Dateiname ist. - Die eingelesene Datei wird unterhalb der Cursorzeile eingefügt. - - 3. Um zu überprüfen, dass die Datei eingelesen wurde, gehe zurück und - beachte, dass es jetzt zwei Kopien von Lektion 1.5.3 gibt, das Original und - die eingefügte Dateiversion. - -Anmerkung: Du kannst auch die Ausgabe eines externen Kommandos einlesen. Zum - Beispiel liest :r !ls die Ausgabe des Kommandos ls ein und platziert - sie unterhalb des Cursors. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZUSAMMENFASSUNG VON LEKTION 1.5 - - - 1. :!Kommando führt ein externes Kommando aus. - - Einige nützliche Beispiele sind - (MS-DOS) (Unix) - :!dir :!ls - zeigt eine Verzeichnisauflistung. - :!del DATEINAME :!rm DATEINAME - entfernt Datei DATEINAME. - - 2. :w DATEINAME speichert die aktuelle Vim-Datei unter dem Namen DATEINAME. - - 3. v Bewegung :w DATEINAME schreibt die Visuell ausgewählten Zeilen in - die Datei DATEINAME. - - 4. :r DATEINAME lädt die Datei DATEINAME und fügt sie unterhalb der - Cursorposition ein. - - 5. :r !dir liest die Ausgabe des Kommandos dir und fügt sie unterhalb der - Cursorposition ein. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.1: ZEILEN ÖFFNEN (OPEN) - - - ** Tippe o , um eine Zeile unterhalb des Cursors zu öffnen und Dich in ** - ** den Einfügemodus zu begeben. ** - - 1. Bewege den Cursor zu der ersten mit ---> markierten Zeile unten. - - 2. Tippe o (klein geschrieben), um eine Zeile UNTERHALB des Cursors zu öffnen - und Dich in den Einfügemodus zu begeben. - - 3. Nun tippe etwas Text und drücke , um den Einfügemodus zu verlassen. - ----> Mit o wird der Cursor auf der offenen Zeile im Einfügemodus platziert. - - 4. Um eine Zeile ÜBERHALB des Cursors aufzumachen, gib einfach ein großes O - statt einem kleinen o ein. Versuche dies auf der unten stehenden Zeile. - ----> Öffne eine Zeile über dieser mit O , wenn der Cursor auf dieser Zeile ist. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.2: TEXT ANFÜGEN (APPEND) - - - ** Tippe a , um Text NACH dem Cursor einzufügen. ** - - 1. Bewege den Cursor zum Anfang der ersten Übungszeile mit ---> unten. - - 2. Drücke e , bis der Cursor am Ende von Zei steht. - - 3. Tippe ein kleines a , um Text NACH dem Cursor anzufügen. - - 4. Vervollständige das Wort so wie in der Zeile darunter. Drücke , - um den Einfügemodus zu verlassen. - - 5. Bewege Dich mit e zum nächsten unvollständigen Wort und wiederhole - Schritte 3 und 4. - ----> Diese Zei bietet Gelegen , Text in einer Zeile anzufü. ----> Diese Zeile bietet Gelegenheit, Text in einer Zeile anzufügen. - -Anmerkung: a, i und A gehen alle gleichermaßen in den Einfügemodus; der - einzige Unterschied ist, wo die Zeichen eingefügt werden. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.3: EINE ANDERE ART DES ERSETZENS (REPLACE) - - - ** Tippe ein großes R , um mehr als ein Zeichen zu ersetzen. ** - - 1. Bewege den Cursor zur ersten unten stehenden, mit ---> markierten Zeile. - Bewege den Cursor zum Anfang des ersten xxx . - - 2. Nun drücke R und tippe die Nummer, die darunter in der zweiten Zeile - steht, so dass diese das xxx ersetzt. - - 3. Drücke , um den Ersetzungsmodus zu verlassen. Beachte, dass der Rest - der Zeile unverändert bleibt. - - 4. Wiederhole die Schritte, um das verbliebene xxx zu ersetzen. - ----> Das Addieren von 123 zu xxx ergibt xxx. ----> Das Addieren von 123 zu 456 ergibt 579. - -Anmerkung: Der Ersetzungsmodus ist wie der Einfügemodus, aber jedes eingetippte - Zeichen löscht ein vorhandenes Zeichen. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.4: TEXT KOPIEREN UND EINFÜGEN - - ** Benutze den y Operator, um Text zu kopieren; p , um ihn einzufügen ** - - 1. Gehe zu der mit ---> markierten Zeile unten; setze den Cursor hinter "a)". - - 2. Starte den Visuellen Modus mit v , bewege den Cursor genau vor "erste". - - 3. Tippe y , um den hervorgehoben Text zu kopieren. - - 4. Bewege den Cursor zum Ende der nächsten Zeile: j$ - - 5. Tippe p , um den Text einzufügen und anschließend: a zweite . - - 6. Benutze den Visuellen Modus, um " Eintrag." auszuwählen, kopiere mittels - y , bewege Dich zum Ende der nächsten Zeile mit j$ und füge den Text - dort mit p an. - ----> a) dies ist der erste Eintrag. - b) - -Anmerkung: Du kannst y auch als Operator verwenden; yw kopiert ein Wort. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.5: OPTIONEN SETZEN - - ** Setze eine Option so, dass eine Suche oder Ersetzung Groß- ** - ** und Kleinschreibung ignoriert ** - - 1. Suche nach 'ignoriere', indem Du /ignoriere eingibst. - Wiederhole die Suche einige Male, indem Du die n - Taste drückst. - - 2. Setze die 'ic' (Ignore case) - Option, indem Du :set ic eingibst. - - 3. Nun suche wieder nach 'ignoriere', indem Du n tippst. - Beachte, dass jetzt Ignoriere und auch IGNORIERE gefunden wird. - - 4. Setze die 'hlsearch' und 'incsearch' - Optionen: :set hls is - - 5. Wiederhole die Suche und beobachte, was passiert: /ignoriere - - 6. Um das Ignorieren von Groß/Kleinschreibung abzuschalten, tippe: :set noic - -Anmerkung: Um die Hervorhebung der Treffer zu entfernen, gib ein: :nohlsearch -Anmerkung: Um die Schreibweise für eine einzige Suche zu ignorieren, benutze \c - im Suchausdruck: /ignoriere\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZUSAMMENFASSUNG VON LEKTION 1.6 - - 1. Tippe o , um eine Zeile UNTER dem Cursor zu öffnen und den Einfügemodus - zu starten - Tippe O , um eine Zeile ÜBER dem Cursor zu öffnen. - - 2. Tippe a , um Text NACH dem Cursor anzufügen. - Tippe A , um Text nach dem Zeilenende anzufügen. - - 3. Das Kommando e bringt Dich zum Ende eines Wortes. - - 4. Der Operator y (yank) kopiert Text, p (put) fügt ihn ein. - - 5. Ein großes R geht in den Ersetzungsmodus bis zum Drücken von . - - 6. Die Eingabe von ":set xxx" setzt die Option "xxx". Einige Optionen sind: - 'ic' 'ignorecase' Ignoriere Groß/Kleinschreibung bei einer Suche - 'is' 'incsearch' Zeige Teilübereinstimmungen für einen Suchausdruck - 'hls' 'hlsearch' Hebe alle passenden Ausdrücke hervor - Der Optionsname kann in der Kurz- oder der Langform angegeben werden. - - 7. Stelle einer Option "no" voran, um sie abzuschalten: :set noic -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.1: AUFRUFEN VON HILFE - - - ** Nutze das eingebaute Hilfesystem ** - - Vim besitzt ein umfassendes eingebautes Hilfesystem. Für den Anfang probiere - eins der drei folgenden Dinge aus: - - Drücke die - Taste (falls Du eine besitzt) - - Drücke die Taste (falls Du eine besitzt) - - Tippe :help - - Lies den Text im Hilfefenster, um zu verstehen wie die Hilfe funktioniert. - Tippe CTRL-W CTRL-W , um von einem Fenster zum anderen zu springen. - Tippe :q , um das Hilfefenster zu schließen. - - Du kannst Hilfe zu praktisch jedem Thema finden, indem Du dem ":help"- - Kommando ein Argument gibst. Probiere folgendes ( nicht vergessen): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.2: ERSTELLE EIN START-SKRIPT - - - ** Aktiviere die Features von Vim ** - - Vim besitzt viele Funktionalitäten, die über Vi hinausgehen, aber die meisten - von ihnen sind standardmäßig deaktiviert. Um mehr Funktionalitäten zu nutzen, - musst Du eine "vimrc" - Datei erstellen. - - 1. Starte das Editieren der "vimrc"-Datei, abhängig von deinem System: - :e ~/.vimrc für Unix - :e ~/_vimrc für MS-Windows - - 2. Nun lies den Inhalt der Beispiel-"vimrc"-Datei ein: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Speichere die Datei mit: - :w - - Beim nächsten Start von Vim wird die Syntaxhervorhebung aktiviert sein. - Du kannst all deine bevorzugten Optionen zu dieser "vimrc"-Datei zufügen. - Für mehr Informationen tippe :help vimrc-intro -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.7.3: VERVOLLSTÄNDIGEN - - - ** Kommandozeilenvervollständigung mit CTRL-D und ** - - 1. Stelle sicher, dass Vim nicht im Vi-Kompatibilitätsmodus ist: :set nocp - - 2. Siehe nach, welche Dateien im Verzeichnis existieren: :!ls oder :!dir - - 3. Tippe den Beginn eines Kommandos: :e - - 4. Drücke CTRL-D und Vim zeigt eine Liste mit "e" beginnender Kommandos. - - 5. Drücke und Vim vervollständigt den Kommandonamen zu ":edit". - - 6. Nun füge ein Leerzeichen und den Anfang einer existierenden Datei an: - :edit DAT - - 7. Drücke . Vim vervollständigt den Namen (falls er eindeutig ist). - -Anmerkung: Vervollständigung funktioniert für viele Kommandos. Probiere - einfach CTRL-D und . Dies ist insbesondere nützlich für :help . -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZUSAMMENFASSUNG VON LEKTION 1.7 - - - 1. Tippe :help oder drücke oder , um ein Hilfefenster zu öffnen. - - 2. Tippe :help Kommando , um Hilfe über Kommando zu erhalten. - - 3. Tippe CTRL-W CTRL-W , um zum anderen Fenster zu springen. - - 4. Tippe :q , um das Hilfefenster zu schließen. - - 5. Erstelle ein vimrc - Startskript mit deinen bevorzugter Einstellungen. - - 6. Drücke CTRL-D nach dem Tippen eines : Kommandos, um mögliche - Vervollständigungen anzusehen. - Drücke , um eine Vervollständigung zu anzuwenden. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Damit ist der Vim Tutor beendet. Seine Intention war, einen kurzen und - bündigen Überblick über den Vim Editor zu geben; gerade genug, um relativ - leicht mit ihm umgehen zu können. Der Vim Tutor hat nicht den geringsten - Anspruch auf Vollständigkeit; Vim hat noch weitaus mehr Kommandos. Lies als - nächstes das User Manual: ":help user-manual". - - Für weiteres Lesen und Lernen ist folgendes Buch empfehlenswert : - Vim - Vi Improved - von Steve Oualline - Verlag: New Riders - Das erste Buch, welches durchgängig Vim gewidmet ist. Besonders nützlich - für Anfänger. Viele Beispiele und Bilder sind enthalten. - Siehe https://iccf-holland.org/click5.html - - Folgendes Buch ist älter und mehr über Vi als Vim, aber auch empfehlenswert: - Textbearbeitung mit dem Vi-Editor - von Linda Lamb und Arnold Robbins - Verlag O'Reilly - ISBN: 3897211262 - In diesem Buch kann man fast alles finden, was man mit Vi tun möchte. - Die sechste Ausgabe enthält auch Informationen über Vim. - - Als aktuelle Referenz für Version 6.2 und knappe Einführung dient das - folgende Buch: - vim ge-packt von Reinhard Wobst - mitp-Verlag, ISBN 3-8266-1425-9 - Trotz der kompakten Darstellung ist es durch viele nützliche Beispiele auch - für Einsteiger empfehlenswert. Probekapitel und die Beispielskripte sind - online erhältlich. Siehe https://iccf-holland.org/click5.html - - Dieses Tutorial wurde geschrieben von Michael C. Pierce und Robert K. Ware, - Colorado School of Mines. Es benutzt Ideen, die Charles Smith, Colorado State - University, zur Verfügung stellte. E-Mail: bware@mines.colorado.edu. - - Bearbeitet für Vim von Bram Moolenaar. - Deutsche Übersetzung von Joachim Hofmann 2015. E-Mail: Joachim.Hof@gmx.de - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.el b/runtime/tutor/tutor1.el index ede8f00ea1..a2e1ee896b 100644 --- a/runtime/tutor/tutor1.el +++ b/runtime/tutor/tutor1.el @@ -1,180 +1,180 @@ =============================================================================== -= � �� � � � � � � � � � � � V I M T u t o r - ������ 1.5 = += Κ αλ ω σ ή ρ θ α τ ε σ τ ο V I M T u t o r - Έκδοση 1.5 = =============================================================================== - � Vim ����� ���� ���������� ��������� ��� ���� ������ �������, ���� - ������ ��� �� ���������� �� ��� ��������� ���� ����. ���� � ��������� - ����������� ��� �� ���������� ������������� ��� ������� ��� �� ��� - ������ �� �������������� ������ ��� Vim ��� ���� ������� ������ ��������. + Ο Vim είναι ένας πανίσχυρος συντάκτης που έχει πολλές εντολές, πάρα + πολλές για να εξηγήσουμε σε μία περιήγηση όπως αυτή. Αυτή η περιήγηση + σχεδιάστηκε για να περιγράψει ικανοποιητικά τις εντολές που θα σας + κάνουν να χρησιμοποιείτε εύκολα τον Vim σαν έναν γενικής χρήσης συντάκτη. - � ���� ���������� ������ ��� ���������� ��� �� ������������ ��� ��������� - ����� 25-30 �����, ���������� ��� �� ���� ����� �� �������� ��� - ��������������. + Ο κατά προσέγγιση χρόνος που απαιτείται για να ολοκληρώσετε την περιήγηση + είναι 25-30 λεπτά, εξαρτώντας από το πόσο χρόνο θα ξοδέψετε για + πειραματισμούς. - �� ������� ��� �������� �� ������������� �� �������. ������������ ��� - ��������� ����� ��� ������� ��� �� ����������� (�� ���������� �� - "Vimtutor" ���� ����� ��� ��� ���������). + Οι εντολές στα μαθήματα θα τροποποιήσουν το κείμενο. Δημιουργήστε ένα + αντίγραφο αυτού του αρχείου για να εξασκηθείτε (αν ξεκινήσατε το + "Vimtutor" αυτό είναι ήδη ένα αντίγραφο). - ����� ��������� �� ������� ��� ���� � ��������� ����� ���������� ���� - ���� �� �������� ���� ��� ������. ���� �������� ��� ���������� �� - ��������� ��� ������� ��� �� ��� ������ �����. �� ��������� ���� �� - �������, �� ��� ��������! + Είναι σημαντικό να θυμάστε ότι αυτή η περιήγηση είναι οργανωμένη έτσι + ώστε να διδάσκει μέσω της χρήσης. Αυτό σημαίνει ότι χρειάζεται να + εκτελείτε τις εντολές για να τις μάθετε σωστά. Αν διαβάζετε μόνο το + κείμενο, θα τις ξεχάσετε! - ����, ����������� ��� �� ������� Caps-Lock ��� ����� �������� ��� - ������� �� ������� j ������� ����� ��� �� ������������ ��� ������ ���� - ���� �� ������ 1.1.1 �� ������� ������ ��� �����. + Τώρα, βεβαιωθείτε ότι το πλήκτρο Caps-Lock ΔΕΝ είναι πατημένο και + πατήστε το πλήκτρο j αρκετές φορές για να μετακινήσετε τον δρομέα έτσι + ώστε το Μάθημα 1.1.1 να γεμίσει πλήρως την οθόνη. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.1.1: ������������ ��� ������ + Μάθημα 1.1.1: ΜΕΤΑΚΙΝΟΝΤΑΣ ΤΟΝ ΔΡΟΜΕΑ - ** ��� �� �������� ��� ������, ������� �� ������� h,j,k,l ���� ���������. ** + ** Για να κινήσετε τον δρομέα, πατήστε τα πλήκτρα h,j,k,l όπως δείχνεται. ** ^ - k Hint: �� ������� h ����� �������� ��� ����� ��' ��������. - < h l > �� ������� l ����� ����� ��� ����� ��� �����. - j �� ������� j ������� �� ������ ���� �� ����. + k Hint: Το πλήκτρο h είναι αριστερά και κινεί στ' αριστερά. + < h l > Το πλήκτρο l είναι δεξιά και κινεί στα δεξιά. + j Το πλήκτρο j μοιάζει με βελάκι προς τα κάτω. v - 1. ������������ ��� ������ ������� ���� ����� ����� �� �������� �����. + 1. Μετακινείστε τον δρομέα τριγύρω στην οθόνη μέχρι να νοιώθετε άνετα. - 2. �������� �������� �� ���� ������� (j) ����� �� �����������. ----> ���� ������ ��� �� ������������� ��� ������� ������. + 2. Κρατήστε πατημένο το κάτω πλήκτρο (j) μέχρι να επαναληφθεί. +---> Τώρα ξέρετε πώς να μετακινηθείτε στο επόμενο μάθημα. - 3. ��������������� �� ���� �������, ������������� ��� ������ 1.1.2. + 3. Χρησιμοποιώντας το κάτω πλήκτρο, μετακινηθείτε στο Μάθημα 1.1.2. -��������: �� ����������� ��� ���� ��� ��������, ������� ��� �� �������� - ���� �������� ���������. ���� ������� ���� ��� ������ ��� ������. +Σημείωση: Αν αμφιβάλλετε για κάτι που πατήσατε, πατήστε για να βρεθείτε + στην Κανονική Κατάσταση. Μετά πατήστε ξανά την εντολή που θέλατε. -��������: �� ������� ��� ������ �� ������ ������ �� ���������. ���� �� �� hjkl - �� �������� �� ��������� ���� �����������, ����� �� ����������. +Σημείωση: Τα πλήκτρα του δρομέα θα πρέπει επίσης να δουλεύουν. Αλλά με τα hjkl + θα μπορείτε να κινηθείτε πολύ γρηγορότερα, μόλις τα συνηθίσετε. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.1.2: ���������� ��� ���������� ���� VIM + Μάθημα 1.1.2: ΜΠΑΙΝΟΝΤΑΣ ΚΑΙ ΒΓΑΙΝΟΝΤΑΣ ΣΤΟΝ VIM - !! ��������: ���� ���������� ������ ��� �� ������, �������� ��� �� ������!! + !! ΣΗΜΕΙΩΣΗ: Πριν εκτελέσετε κάποιο από τα βήματα, διαβάστε όλο το μάθημα!! - 1. ������� �� ������� (��� �� ����� ������� ���� �������� ���������). + 1. Πατήστε το πλήκτρο (για να είστε σίγουρα στην Κανονική Κατάσταση). - 2. ��������������: :q! . + 2. Πληκτρολογήστε: :q! . ----> ���� ��������� ��� ��� �������� ����� �� ����� ������ ������� ����� �����. - �� ������ �� ������ ��� ������� ��� �� �������� ��������������: +---> Αυτό εξέρχεται από τον συντάκτη ΧΩΡΙΣ να σώσει όποιες αλλαγές έχετε κάνει. + Αν θέλετε να σώσετε τις αλλαγές και να εξέρθετε πληκτρολογήστε: :wq - 3. ���� ����� ��� �������� ��� ������, �������������� ��� ������ �� ��� ����� - ������� �� ����� ��� ���������. ������ �� �����: vimtutor - �������� �� ����������������: vim tutor + 3. Όταν δείτε την προτροπή του φλοιού, πληκτρολογήστε την εντολή με την οποία + μπήκατε σε αυτήν την περιήγηση. Μπορεί να είναι: vimtutor + Κανονικά θα χρησιμοποιούσατε: vim tutor ----> 'vim' �������� �������� ���� �������� vim, 'tutor' ����� �� ������ ��� - ������� �� �����������. +---> 'vim' σημαίνει εισαγωγή στον συντάκτη vim, 'tutor' είναι το αρχείο που + θέλουμε να διορθώσουμε. - 4. �� ����� �������������� ���� �� ������ ��� ����� �������������, ��������� - �� ������ 1 ��� 3 ��� �� ������ ��� �� ������ ���� ���� ��������. ���� - ����������� ��� ������ ���� ��� ������ 1.1.3. + 4. Αν έχετε απομνημονεύσει αυτά τα βήματα και έχετε αυτοπεποίθηση, εκτελέστε + τα βήματα 1 έως 3 για να βγείτε και να μπείτε ξανά στον συντάκτη. Μετά + μετακινήστε τον δρομέα κάτω στο Μάθημα 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.1.3: �������� �������� - �������� + Μάθημα 1.1.3: ΔΙΟΡΘΩΣΗ ΚΕΙΜΕΝΟΥ - ΔΙΑΓΡΑΦΗ - ** ��� ����� ���� �������� ��������� ������� x ��� �� ���������� ��� - ��������� ���� ��� ��� ������. ** + ** Όσο είστε στην Κανονική Κατάσταση πατήστε x για να διαγράψετε τον + χαρακτήρα κάτω από τον δρομέα. ** - 1. ������������ ��� ������ ���� �������� ������ ���������� �� --->. + 1. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - 2. ��� �� ���������� �� ����, �������� ��� ������ ����� �� ����� ���� ��� - ��� ��������� ��� �� ���������. + 2. Για να διορθώσετε τα λάθη, κινείστε τον δρομέα μέχρι να είναι πάνω από + τον χαρακτήρα που θα διαγραφεί. - 3. ������� �� ������� x ��� �� ���������� ��� ����������� ���������. + 3. Πατήστε το πλήκτρο x για να διαγράψετε τον ανεπιθύμητο χαρακτήρα. - 4. ����������� �� ������ 2 ����� 4 ����� � ������� �� ����� �����. + 4. Επαναλάβετε τα βήματα 2 μέχρι 4 μέχρι η πρόταση να είναι σωστή. ---> The ccow jumpedd ovverr thhe mooon. - 5. ���� ��� � ������ ����� �����, �������� ��� ������ 1.1.4. + 5. Τώρα που η γραμμή είναι σωστή, πηγαίντε στο Μάθημα 1.1.4. -��������: ����� ���������� ����� ��� ���������, ����������� �� ��� - ��������������, ��������� �� �� �����. +ΣΗΜΕΙΩΣΗ: Καθώς διατρέχετε αυτήν την περιήγηση, προσπαθήστε να μην + απομνημονεύετε, μαθαίνετε με τη χρήση. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.1.4: �������� �������� - ��������� + Μάθημα 1.1.4: ΔΙΟΡΘΩΣΗ ΚΕΙΜΕΝΟΥ - ΠΑΡΕΜΒΟΛΗ - ** ��� ����� �� �������� ��������� ������� i ��� �� ������������ �������. ** + ** Όσο είστε σε Κανονική Κατάσταση πατήστε i για να παρεμβάλλετε κείμενο. ** - 1. ������������ ��� ������ ����� ��� ����� ������ �������� ���������� �� --->. + 1. Μετακινείστε τον δρομέα μέχρι την πρώτη γραμμή παρακάτω σημειωμένη με --->. - 2. ��� �� ������ ��� ����� ������ ���� �� ��� �������, ������������ ��� - ������ ���� ���� ����� ��������� ���� ��� ���� �� ����������� �� �������. + 2. Για να κάνετε την πρώτη γραμμή ίδια με την δεύτερη, μετακινείστε τον + δρομέα πάνω στον πρώτο χαρακτήρα ΜΕΤΑ από όπου θα παρεμβληθεί το κείμενο. - 3. ������� �� i ��� �������������� ��� ����������� ���������. + 3. Πατήστε το i και πληκτρολογήστε τις απαραίτητες προσθήκες. - 4. ����� ���������� ���� ����� ������� ��� �� ����������� ���� - �������� ���������. ����������� �� ������ 2 ����� 4 ��� �� ���������� - ��� �������. + 4. Καθώς διορθώνετε κάθε λάθος πατήστε για να επιστρέψετε στην + Κανονική Κατάσταση. Επαναλάβετε τα βήματα 2 μέχρι 4 για να διορθώσετε + την πρόταση. ---> There is text misng this . ---> There is some text missing from this line. - 5. ���� ����� ������ �� ��� ��������� �������� ������������� ���� - �������� ��������. + 5. Όταν είστε άνετοι με την παρεμβολή κειμένου μετακινηθείτε στην + παρακάτω περίληψη. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.1 �������� + ΜΑΘΗΜΑ 1.1 ΠΕΡΙΛΗΨΗ - 1. � ������� �������� ��������������� ���� �� ������� ������ � �� hjkl. - h (��������) j (����) k (����) l (�����) + 1. Ο δρομέας κινείται χρησιμοποιώντας είτε τα πλήκτρα δρομέα ή τα hjkl. + h (αριστέρα) j (κάτω) k (πάνω) l (δεξιά) - 2. ��� �� ������ ���� Vim (��� ��� �������� %) ������: vim ������ + 2. Για να μπείτε στον Vim (από την προτροπή %) γράψτε: vim ΑΡΧΕΙΟ - 3. ��� �� ������ ������: :q! ��� �������� ��� �������. - � ������: :wq ��� ���������� ��� �������. + 3. Για να βγείτε γράψτε: :q! για απόρριψη των αλλαγών. + Ή γράψτε: :wq για αποθήκευση των αλλαγών. - 4. ��� �� ���������� ���� ��������� ���� ��� ��� ������ �� - �������� ��������� �������: x + 4. Για να διαγράψετε έναν χαρακτήρα κάτω από τον δρομέα σε + Κανονική Κατάσταση πατήστε: x - 5. ��� �� �������� ������� ���� ������ ��� ����� �� �������� ��������� ������: - i �������������� �� ������� + 5. Για να εισάγετε κείμενο στον δρομέα όσο είστε σε Κανονική Κατάσταση γράψτε: + i πληκτρολογήστε το κείμενο -��������: �������� �� ������������� ���� �������� ��������� � �� - ��������� ��� ����������� ��� ������� ������������ ������. +ΣΗΜΕΙΩΣΗ: Πατώντας θα τοποθετηθείτε στην Κανονική Κατάσταση ή θα + ακυρώσετε μία ανεπιθύμητη και μερικώς ολοκληρωμένη εντολή. -���� ��������� �� �� ������ 1.2. +Τώρα συνεχίστε με το Μάθημα 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.2.1: ������� ��������� + Μάθημα 1.2.1: ΕΝΤΟΛΕΣ ΔΙΑΓΡΑΦΗΣ - ** ������ dw ��� �� ���������� ����� �� ����� ���� �����. ** + ** Γράψτε dw για να διαγράψετε μέχρι το τέλος μίας λέξης. ** - 1. ������� ��� �� ����������� ��� ����� ���� �������� ���������. + 1. Πατήστε για να βεβαιωθείτε ότι είστε στην Κανονική Κατάσταση. - 2. ������������ ��� ������ ���� �������� ������ ���������� �� --->. + 2. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - 3. ��������� ��� ������ ���� ���� ��� ����� ��� ������ �� ���������. + 3. Πηγαίνετε τον δρομέα στην αρχή της λέξης που πρέπει να διαγραφεί. - 4. ������ dw ��� �� ������ ��� ���� �� �����������. + 4. Γράψτε dw για να κάνετε την λέξη να εξαφανιστεί. -��������: �� �������� dw �� ����������� ���� ��������� ������ ��� ������ ��� - �� ��������������. �� ������� ���� �����, ������� ��� - ��������� ��� ��� ����. +ΣΗΜΕΙΩΣΗ: Τα γράμματα dw θα εμφανιστούν στην τελευταία γραμμή της οθόνης όσο + τα πληκτρολογείτε. Αν γράψατε κάτι λάθος, πατήστε και + ξεκινήστε από την αρχή. ---> There are a some words fun that don't belong paper in this sentence. - 5. ����������� �� ������ 3 ��� 4 ����� � ������� �� ����� ����� ��� - ��������� ��� ������ 1.2.2. + 5. Επαναλάβετε τα βήματα 3 και 4 μέχρι η πρόταση να είναι σωστή και + πηγαίνετε στο Μάθημα 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.2.2: ������������ ������� ��������� + Μάθημα 1.2.2: ΠΕΡΙΣΣΟΤΕΡΕΣ ΕΝΤΟΛΕΣ ΔΙΑΓΡΑΦΗΣ - ** �������������� d$ ��� �� ���������� ����� �� ����� ��� �������. ** + ** Πληκτρολογήστε d$ για να διαγράψετε μέχρι το τέλος της γραμμής. ** - 1. ������� ��� �� ����������� ��� ����� ���� �������� ���������. + 1. Πατήστε για να βεβαιωθείτε ότι είστε στην Κανονική Κατάσταση. - 2. ������������ ��� ������ ���� �������� ������ ���������� �� --->. + 2. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - 3. ������������ ��� ������ ��� ����� ��� ������ ������� (���� ��� ����� . ). + 3. Μετακινείστε τον δρομέα στο τέλος της σωστής γραμμής (ΜΕΤΑ την πρώτη . ). - 4. ������� d$ ��� �� ���������� ����� �� ����� ��� �������. + 4. Πατήστε d$ για να διαγράψετε μέχρι το τέλος της γραμμής. ---> Somebody typed the end of this line twice. end of this line twice. - 5. ��������� ��� ������ 1.2.3 ��� �� ���������� �� ���������. + 5. Πηγαίνετε στο Μάθημα 1.2.3 για να καταλάβετε τι συμβαίνει. @@ -183,42 +183,42 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.2.3: ���� ������� ��� ������������ + Μάθημα 1.2.3: ΠΕΡΙ ΕΝΤΟΛΩΝ ΚΑΙ ΑΝΤΙΚΕΙΜΕΝΩΝ -� ����� ��� ������� ��������� d ����� �� ����: +Η μορφή της εντολής διαγραφής d είναι ως εξής: - [�������] d ����������� � d [�������] ����������� - ����: - ������� - ����� ����� �� ���������� � ������ (�����������, ��' �������=1). - d - � ������ ��� ���������. - ����������� - ���� �� �� �� ������������ � ������ (�������� �����). + [αριθμός] d αντικείμενο Ή d [αριθμός] αντικείμενο + Όπου: + αριθμός - πόσες φορές θα εκτελεστεί η εντολή (προαιρετικό, εξ' ορισμού=1). + d - η εντολή της διαγραφής. + αντικείμενο - πάνω σε τι θα λειτουργήσει η εντολή (παρακάτω λίστα). - ��� ����� ����� ��� �����������: - w - ��� ��� ������ ����� �� ����� ��� �����, ��������������� �� ��������. - e - ��� ��� ������ ����� �� ����� ��� �����, ����� �� ��������. - $ - ��� ��� ������ ����� �� ����� ��� �������. + Μία μικρή λίστα από αντικείμενα: + w - από τον δρομέα μέχρι το τέλος της λέξης, περιλαμβάνοντας το διάστημα. + e - από τον δρομέα μέχρι το τέλος της λέξης, ΧΩΡΙΣ το διάστημα. + $ - από τον δρομέα μέχρι το τέλος της γραμμής. -��������: ��� ���� ������ ��� �����������, �������� ����� �� ����������� ��� - ����� ���� �������� ��������� ����� ������ ������ �� ������������ - ��� ������ ���� ����������� ���� ����� ������������. +ΣΗΜΕΙΩΣΗ: Για τους τύπους της περιπέτειας, πατώντας απλώς το αντικείμενο όσο + είστε στην Κανονική Κατάσταση χωρίς κάποια εντολή θα μετακινήσετε + τον δρομέα όπως καθορίζεται στην λίστα αντικειμένων. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.2.4: ��� �������� ���� '������-�����������' + Μάθημα 1.2.4: ΜΙΑ ΕΞΑΙΡΕΣΗ ΣΤΗΝ 'ΕΝΤΟΛΗ-ΑΝΤΙΚΕΙΜΕΝΟ' - ** �������������� dd ��� �� ���������� ��� �� ������. ** + ** Πληκτρολογήστε dd για να διαγράψετε όλη τη γραμμή. ** - �������� ��� ���������� ��� ��������� ��������� �������, �� ���������� - ��� Vim ���������� ��� �� ���� ���������� �� ������� ����� ��� d ��� - ����� ��� �� ���������� ��� ������. + Εξαιτίας της συχνότητας της διαγραφής ολόκληρης γραμμής, οι σχεδιαστές + του Vim αποφάσισαν ότι θα ήταν ευκολότερο να γράφετε απλώς δύο d στη + σειρά για να διαγράψετε μία γραμμή. - 1. ������������ ��� ������ ��� ������� ������ ��� �������� ������. - 2. ������ dd ��� �� ���������� �� ������. - 3. ���� ������������� ���� ������� ������. - 4. ������ 2dd (��������� �������-������-�����������) ��� �� - ���������� ��� �������. + 1. Μετακινείστε τον δρομέα στη δεύτερη γραμμή της παρακάτω φράσης. + 2. Γράψτε dd για να διαγράψετε τη γραμμή. + 3. Τώρα μετακινηθείτε στην τέταρτη γραμμή. + 4. Γράψτε 2dd (θυμηθείτε αριθμός-εντολή-αντικείμενο) για να + διαγράψετε δύο γραμμές. 1) Roses are red, 2) Mud is fun, @@ -229,69 +229,69 @@ 7) And so are you. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.2.5: � ������ ��������� + Μάθημα 1.2.5: Η ΕΝΤΟΛΗ ΑΝΑΙΡΕΣΗΣ - ** ������� u ��� �� ���������� ��� ���������� �������, - U ��� �� ���������� ��� �� ������. ** + ** Πατήστε u για να αναιρέσετε τις τελευταίες εντολές, + U για να διορθώσετε όλη τη γραμμή. ** - 1. ������������ ��� ������ ���� �������� ������ ���������� �� ---> ��� - ����������� ��� ���� ��� ����� �����. - 2. ������� x ��� �� ���������� ��� ����� ����������� ���������. - 3. ���� ������� u ��� �� ���������� ��� ��������� ����������� ������. - 4. ���� �� ���� ��������� ��� �� ���� ��� ������ ��������������� ��� ������ x. - 5. ���� ������� ��� �������� U ��� �� ����������� �� ������ ���� ������ - ��� ���������. - 6. ���� ������� u ������� ����� ��� �� ���������� ��� U ��� - ������������ �������. - 7. ���� ������� CTRL-R (��������� �������� �� ������� CTRL ����� ������ �� R) - ������� ����� ��� �� ����������� ��� ������� (�������� ��� ����������). + 1. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με ---> και + τοποθετήστε τον πάνω στο πρώτο λάθος. + 2. Πατήστε x για να διαγράψετε τον πρώτο ανεπιθύμητο χαρακτήρα. + 3. Τώρα πατήστε u για να αναιρέσετε την τελευταία εκτελεσμένη εντολή. + 4. Αυτή τη φορά διορθώστε όλα τα λάθη στη γραμμή χρησιμοποιώντας την εντολή x. + 5. Τώρα πατήστε ένα κεφαλαίο U για να επιστρέψετε τη γραμμή στην αρχική + της κατάσταση. + 6. Τώρα πατήστε u μερικές φορές για να αναιρέσετε την U και + προηγούμενες εντολές. + 7. Τώρα πατήστε CTRL-R (κρατώντας πατημένο το πλήκτρο CTRL καθώς πατάτε το R) + μερικές φορές για να επαναφέρετε τις εντολές (αναίρεση των αναιρέσεων). ---> Fiix the errors oon thhis line and reeplace them witth undo. - 8. ����� ����� ���� �������� �������. ���� ��������� ���� - �������� ��� ��������� 1.2. + 8. Αυτές είναι πολύ χρήσιμες εντολές. Τώρα πηγαίνετε στην + Περίληψη του Μαθήματος 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.2 �������� + ΜΑΘΗΜΑ 1.2 ΠΕΡΙΛΗΨΗ - 1. ��� �� ���������� ��� ��� ������ ����� �� ����� ����� ������: dw + 1. Για να διαγράψετε από τον δρομέα μέχρι το τέλος λέξης γράψτε: dw - 2. ��� �� ���������� ��� ��� ������ ����� �� ����� ������� ������: d$ + 2. Για να διαγράψετε από τον δρομέα μέχρι το τέλος γραμμής γράψτε: d$ - 3. ��� �� ���������� �������� �� ������ ������: dd + 3. Για να διαγράψετε ολόκληρη τη γραμμή γράψτε: dd - 4. � ����� ��� ��� ������ ���� �������� ��������� �����: + 4. Η μορφή για μία εντολή στην Κανονική Κατάσταση είναι: - [�������] ������ ����������� � ������ [�������] ����������� - ����: - ������� - ����� ����� �� ����������� � ������ - ������ - �� �� �����, ���� � d ��� �������� - ����������� - ���� �� �� �� ��������� � ������, ���� w (����), - $ (����� ��� �������), ���. + [αριθμός] εντολή αντικείμενο Ή εντολή [αριθμός] αντικείμενο + όπου: + αριθμός - πόσες φορές να επαναληφθεί η εντολή + εντολή - τι να γίνει, όπως η d για διαγραφή + αντικείμενο - πάνω σε τι να ενεργήσει η εντολή, όπως w (λέξη), + $ (τέλος της γραμμής), κτλ. - 5. ��� �� ���������� ������������ ���������, �������: u (���� u) - ��� �� ���������� ���� ��� ������� ��� ������, �������: U (�������� U) - ��� �� ���������� ��� ����������, �������: CTRL-R + 5. Για να αναιρέσετε προηγούμενες ενέργειες, πατήστε: u (πεζό u) + Για να αναιρέσετε όλες τις αλλαγές στη γραμμή, πατήστε: U (κεφαλαίο U) + Για να αναιρέσετε τις αναιρέσεις, πατήστε: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.3.1: � ������ ����������� + Μάθημα 1.3.1: Η ΕΝΤΟΛΗ ΤΟΠΟΘΕΤΗΣΗΣ - ** ������� p ��� �� ������������ ��� ��������� �������� ���� ��� ������. ** + ** Πατήστε p για να τοποθετήσετε την τελευταία διαγραφή μετά τον δρομέα. ** - 1. ������������ ��� ������ ���� ����� ������ ��� �������� ������. + 1. Μετακινείστε τον δρομέα στην πρώτη γραμμή της παρακάτω ομάδας. - 2. ������� dd ��� �� ���������� �� ������ ��� �� ��� ������������ �� - ��������� ����� ��� Vim. + 2. Πατήστε dd για να διαγράψετε τη γραμμή και να την αποθηκεύσετε σε + προσωρινή μνήμη του Vim. - 3. ������������ ��� ������ ��� ������ ���� ��� ���� ��� �� ������ �� ���� - � ����������� ������. + 3. Μετακινείστε τον δρομέα στη γραμμή ΠΑΝΩ από εκεί που θα πρέπει να πάει + η διαγραμμένη γραμμή. - 4. ��� ����� �� �������� ���������, ������� p ��� �� ������ �� ������. + 4. Όσο είστε σε Κανονική Κατάσταση, πατήστε p για να βάλετε τη γραμμή. - 5. ����������� �� ������ 2 ��� 4 ��� �� ������ ���� ��� ������� ��� - ����� �����. + 5. Επαναλάβετε τα βήματα 2 έως 4 για να βάλετε όλες τις γραμμές στη + σωστή σειρά. d) Can you learn too? b) Violets are blue, @@ -299,320 +299,320 @@ a) Roses are red, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.3.2: � ������ �������������� + Μάθημα 1.3.2: Η ΕΝΤΟΛΗ ΑΝΤΙΚΑΤΑΣΤΑΣΗΣ - ** ������� r ��� ��������� ��� �� �������� ����� ��� ����� - ���� ��� ��� ������. ** + ** Πατήστε r και χαρακτήρα για να αλλάξετε αυτόν που είναι + κάτω από τον δρομέα. ** - 1. ������������ ��� ������ ���� ����� ������ �������� ���������� �� --->. + 1. Μετακινείστε τον δρομέα στην πρώτη γραμμή παρακάτω σημειωμένη με --->. - 2. ������������ ��� ������ ���� ���� �� ����� ���� ��� ����� �����. + 2. Μετακινείστε τον δρομέα έτσι ώστε να είναι πάνω στο πρώτο λάθος. - 3. ������� r ��� ���� ��� ��������� � ������ ��������� �� �����. + 3. Πατήστε r και μετά τον χαρακτήρα ο οποίος διορθώνει το λάθος. - 4. ����������� �� ������ 2 ��� 3 ����� �� ����� ����� � ����� ������. + 4. Επαναλάβετε τα βήματα 2 και 3 μέχρι να είναι σωστή η πρώτη γραμμή. ---> Whan this lime was tuoed in, someone presswd some wrojg keys! ---> When this line was typed in, someone pressed some wrong keys! - 5. ���� ��������� ��� ������ 1.3.2. + 5. Τώρα πηγαίνετε στο Μάθημα 1.3.2. -��������: �� ������� ��� ������ �� ��������� �� �� �����, ��� ��� �� - ��� �������������. +ΣΗΜΕΙΩΣΗ: Να θυμάστε ότι πρέπει να μαθαίνετε με τη χρήση, και όχι με + την απομνημόνευση. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.3.3: � ������ ������� + Μάθημα 1.3.3: Η ΕΝΤΟΛΗ ΑΛΛΑΓΗΣ - ** ��� �� �������� ����� � ��� �� ����, ������� cw . ** + ** Για να αλλάξετε τμήμα ή όλη τη λέξη, πατήστε cw . ** - 1. ������������ ��� ������ ���� ����� ������ �������� ���������� �� --->. + 1. Μετακινείστε τον δρομέα στην πρώτη γραμμή παρακάτω σημειωμένη με --->. - 2. ����������� ��� ������ ���� ��� u ��� ����� lubw. + 2. Τοποθετήστε τον δρομέα πάνω στο u της λέξης lubw. - 3. ������� cw ��� �� ����� ���� (���� ��������� ����, ������ 'ine'.) + 3. Πατήστε cw και τη σωστή λέξη (στην περίπτωση αυτή, γράψτε 'ine'.) - 4. ������� ��� ��������� ��� ������� ����� (���� ����� - ��������� ���� ������). + 4. Πατήστε και πηγαίνετε στο επόμενο λάθος (στον πρώτο + χαρακτήρα προς αλλαγή). - 5. ����������� �� ������ 3 ��� 4 ������ ���� � ����� ������� �� ����� - ���� �� �� �������. + 5. Επαναλάβετε τα βήματα 3 και 4 μέχρις ότου η πρώτη πρόταση να είναι + ίδια με τη δεύτερη. ---> This lubw has a few wptfd that mrrf changing usf the change command. ---> This line has a few words that need changing using the change command. -������������ ��� � cw ��� ���� ������������� �� ����, ���� ��� ������� -������ �� ���������. +Παρατηρείστε ότι η cw όχι μόνο αντικαθιστάει τη λέξη, αλλά σας εισάγει +επίσης σε παρεμβολή. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.3.4: ������������ ������� �� c + Μάθημα 1.3.4: ΠΕΡΙΣΣΟΤΕΡΕΣ ΑΛΛΑΓΕΣ ΜΕ c - ** � ������ ������� ��������������� �� �� ���� ����������� ��� ���������. ** + ** Η εντολή αλλαγής χρησιμοποιείται με τα ίδια αντικείμενα της διαγραφής. ** - 1. � ������ ������� �������� �� ��� ���� ����� ���� � ��������. � ����� �����: + 1. Η εντολή αλλαγής δουλεύει με τον ίδιο τρόπο όπως η διαγραφή. Η μορφή είναι: - [�������] c ����������� � c [�������] ����������� + [αριθμός] c αντικείμενο Ή c [αριθμός] αντικείμενο - 2. �� ����������� ����� ���� �� ����, ���� w (����), $ (����� �������), ���. + 2. Τα αντικείμενα είναι πάλι τα ίδια, όπως w (λέξη), $ (τέλος γραμμής), κτλ. - 3. ������������� ���� ����� ������ �������� ���������� �� --->. + 3. Μετακινηθείτε στην πρώτη γραμμή παρακάτω σημειωμένη με --->. - 4. ������������ ��� ������ ��� ����� �����. + 4. Μετακινείστε τον δρομέα στο πρώτο λάθος. - 5. ������ c$ ��� �� ������ �� �������� ��� ������� ���� �� �� ������� - ��� ������� . + 5. Γράψτε c$ για να κάνετε το υπόλοιπο της γραμμής ίδιο με τη δεύτερη + και πατήστε . ---> The end of this line needs some help to make it like the second. ---> The end of this line needs to be corrected using the c$ command. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.3 �������� + ΜΑΘΗΜΑ 1.3 ΠΕΡΙΛΗΨΗ - 1. ��� �� ������������ ������� ��� ����� ���� ���������, ������� p . - ���� ��������� �� ����������� ������� ���� ��� ������ (�� ����������� - ������ �� ���� ���� ��� ������ ���� ��� ��� ������. + 1. Για να τοποθετήσετε κείμενο που μόλις έχει διαγραφεί, πατήστε p . + Αυτό τοποθετεί το διαγραμμένο κείμενο ΜΕΤΑ τον δρομέα (αν διαγράφτηκε + γραμμή θα πάει μετά στη γραμμή κάτω από τον δρομέα. - 2. ��� �� ��������������� ��� ��������� ���� ��� ��� ������, ������� r - ��� ���� ��� ��������� ��� �� �������������� ��� ������. + 2. Για να αντικαταστήσετε τον χαρακτήρα κάτω από τον δρομέα, πατήστε r + και μετά τον χαρακτήρα που θα αντικαταστήσει τον αρχικό. - 3. � ������ ������� ��� ��������� �� �������� �� ����������� ����������� - ��� ��� ������ ����� �� ����� ��� �����������. �.�. ������ cw ��� �� - �������� ��� ��� ������ ����� �� ����� ��� �����, c$ ��� �� �������� - ����� �� ����� �������. + 3. Η εντολή αλλαγής σας επιτρέπει να αλλάξετε το καθορισμένο αντικείμενο + από τον δρομέα μέχρι το τέλος του αντικείμενο. Π.χ. γράψτε cw για να + αλλάξετε από τον δρομέα μέχρι το τέλος της λέξης, c$ για να αλλάξετε + μέχρι το τέλος γραμμής. - 4. � ����� ��� ��� ������ �����: + 4. Η μορφή για την αλλαγή είναι: - [�������] c ����������� � c [�������] ����������� + [αριθμός] c αντικείμενο Ή c [αριθμός] αντικείμενο -���� ��������� �� �� ������� ������. +Τώρα συνεχίστε με το επόμενο μάθημα. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.4.1: ���� ��� ��������� ������� + Μάθημα 1.4.1: ΘΕΣΗ ΚΑΙ ΚΑΤΑΣΤΑΣΗ ΑΡΧΕΙΟΥ - ** ������� CTRL-g ��� �� ���������� � ���� ��� ��� ������ ��� � ��������� ���. - ������� SHIFT-G ��� �� ���� �� ��� ������ ��� ������. ** + ** Πατήστε CTRL-g για να εμφανιστεί η θέση σας στο αρχείο και η κατάστασή του. + Πατήστε SHIFT-G για να πάτε σε μία γραμμή στο αρχείο. ** - ��������: �������� �������� �� ������ ���� ���������� ������ ��� �� ������!! + Σημείωση: Διαβάστε ολόκληρο το μάθημα πριν εκτελέσετε κάποιο από τα βήματα!! - 1. �������� �������� �� ������� Ctrl ��� ������� g . ��� ������ ���������� - �� ���������� ��� ���� ����� ��� ������� �� �� ����� ������� ��� �� - ������ ��� �����. ��������� ��� ������ ������� ��� �� ���� 3. + 1. Κρατήστε πατημένο το πλήκτρο Ctrl και πατήστε g . Μία γραμμή κατάστασης + θα εμφανιστεί στο κάτω μέρος της σελίδας με το όνομα αρχείου και τη + γραμμή που είστε. Θυμηθείτε τον αριθμό γραμμής για το Βήμα 3. - 2. ������� shift-G ��� �� ������������� ��� ����� ��� �������. + 2. Πατήστε shift-G για να μετακινηθείτε στο τέλος του αρχείου. - 3. ������� ��� ������ ��� ������� ��� ������� ��� ���� shift-G. ���� �� - ��� ���������� ��� ������ ��� ������� ���� �������� ��� ����� ���� Ctrl-g. - (���� �������������� ���� ��������, ��� �� ������������ ���� �����). + 3. Πατήστε τον αριθμό της γραμμής που ήσασταν και μετά shift-G. Αυτό θα + σας επιστρέψει στη γραμμή που ήσασταν πριν πατήσετε για πρώτη φορά Ctrl-g. + (Όταν πληκτρολογείτε τους αριθμούς, ΔΕΝ θα εμφανίζονται στην οθόνη). - 4. �� �������� �������� ��� ����, ��������� �� ������ 1 ��� 3. + 4. Αν νοιώθετε σίγουρος για αυτό, εκτελέστε τα βήματα 1 έως 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.4.2: � ������ ���������� + Μάθημα 1.4.2: Η ΕΝΤΟΛΗ ΑΝΑΖΗΤΗΣΗΣ - ** ������� / ������������� ��� �� ����� ��� �������. ** + ** Πατήστε / ακολουθούμενο από τη φράση που ψάχνετε. ** - 1. �� �������� ��������� ������� ��� ��������� / . ����������� ��� ����� ��� - � ������� ������������ ��� ���� ����� ��� ������ ���� �� ��� ������ : . + 1. Σε Κανονική Κατάσταση πατήστε τον χαρακτήρα / . Παρατηρήστε ότι αυτός και + ο δρομέας εμφανίζονται στο κάτω μέρος της οθόνης όπως με την εντολή : . - 2. ���� ������ 'errroor' . ���� ����� � ���� ��� ������ �� ������. + 2. Τώρα γράψτε 'errroor' . Αυτή είναι η λέξη που θέλετε να ψάξετε. - 3. ��� �� ������ ���� ��� ��� ���� �����, ������� ����� n . - ��� �� ������ ��� ���� ����� ���� �������� ����������, ������� Shift-N . + 3. Για να ψάξετε ξανά για την ίδια φράση, πατήστε απλώς n . + Για να ψάξετε την ίδια φράση στην αντίθετη κατεύθυνση, πατήστε Shift-N . - 4. �� ������ �� ������ ��� ��� ����� ���� �� ����, �������������� ��� ������ ? ���� ��� / . + 4. Αν θέλετε να ψάξετε για μία φράση προς τα πίσω, χρησιμοποιήστε την εντολή ? αντί της / . ----> ���� � ��������� ������ ��� ����� ��� ������� �� ��������� ��� ��� ����. +---> Όταν η αναζήτηση φτάσει στο τέλος του αρχείου θα συνεχίσει από την αρχή. "errroor" is not the way to spell error; errroor is an error. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.4.3: ������ ���������� ����������� + Μάθημα 1.4.3: ΕΥΡΕΣΗ ΤΑΙΡΙΑΣΤΩΝ ΠΑΡΕΝΘΕΣΕΩΝ - ** ������� % ��� �� ������ ��� ���������� ), ], � } . ** + ** Πατήστε % για να βρείτε την αντίστοιχη ), ], ή } . ** - 1. ����������� ��� ������ �� ������ (, [, � { ���� �������� ������ - ���������� �� --->. + 1. Τοποθετήστε τον δρομέα σε κάποια (, [, ή { στην παρακάτω γραμμή + σημειωμένη με --->. - 2. ���� ������� ��� ��������� % . + 2. Τώρα πατήστε τον χαρακτήρα % . - 3. � ������� �� ������ �� ����� ���� ���������� ��������� � ������. + 3. Ο δρομέας θα πρέπει να είναι στην αντίστοιχη παρένθεση ή αγκύλη. - 4. ������� % ��� �� ������������ ��� ������ ���� ���� ����� ������ - (��� ���������). + 4. Πατήστε % για να μετακινήσετε τον δρομέα πίσω στην πρώτη αγκύλη + (του ζευγαριού). ---> This ( is a test line with ('s, ['s ] and {'s } in it. )) -��������: ���� ����� ���� ������� ���� ������������� ���� ������������ - �� �� ���������� �����������! +ΣΗΜΕΙΩΣΗ: Αυτό είναι πολύ χρήσιμο στην αποσφαλμάτωση ενός προγράμματος + με μη ταιριαστές παρενθέσεις! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.4.4: ���� ������ ��� ������ ����� + Μάθημα 1.4.4: ΕΝΑΣ ΤΡΟΠΟΣ ΓΙΑ ΑΛΛΑΓΗ ΛΑΘΩΝ - ** ������ :s/old/new/g ��� �� �������� �� 'new' �� �� 'old'. ** + ** Γράψτε :s/old/new/g για να αλλάξετε το 'new' με το 'old'. ** - 1. ������������ ��� ������ ���� �������� ������ ���������� �� --->. + 1. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - 2. ������ :s/thee/the . ��������� ��� ���� � ������ ������� ���� - ��� ����� �������� ��� ������. + 2. Γράψτε :s/thee/the . Σημειώστε ότι αυτή η εντολή αλλάζει μόνο + την πρώτη εμφάνιση στη γραμμή. - 3. ���� ������ :s/thee/the/g ��������� ������ ������������� ��� - ������. ���� ������� ���� ��� ���������� ��� ��� �������. + 3. Τώρα γράψτε :s/thee/the/g εννοώντας γενική αντικατάσταση στη + γραμμή. Αυτό αλλάζει όλες τις εμφανίσεις επί της γραμμής. ---> thee best time to see thee flowers is in thee spring. - 4. ��� �� �������� ���� �������� ���� ������������� ������ ��� �������, - ������ :#,#s/old/new/g ���� #,# �� ������� ��� ��� �������. - ������ :%s/old/new/g ��� �� �������� ���� �������� �� ��� �� ������. + 4. Για να αλλάξετε κάθε εμφάνιση μίας συμβολοσειράς μεταξύ δύο γραμμών, + γράψτε :#,#s/old/new/g όπου #,# οι αριθμοί των δύο γραμμών. + Γράψτε :%s/old/new/g για να αλλάξετε κάθε εμφάνιση σε όλο το αρχείο. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.4 �������� + ΜΑΘΗΜΑ 1.4 ΠΕΡΙΛΗΨΗ - 1. �� Ctrl-g ��������� �� ���� ��� ��� ������ ��� ��� ��������� ���. - �� Shift-G �������� ��� ����� ��� �������. ���� ������� ������� - �������������� ��� Shift-G �������� �� ������ �� ������. + 1. Το Ctrl-g εμφανίζει τη θέση σας στο αρχείο και την κατάστασή του. + Το Shift-G πηγαίνει στο τέλος του αρχείου. Ένας αριθμός γραμμής + ακολουθούμενος από Shift-G πηγαίνει σε εκείνη τη γραμμή. - 2. ��������� / ������������� ��� ��� ����� ������ ���� �� ������� ��� - �� �����. ��������� ? ������������� ��� ��� ����� ������ ���� �� ���� - ��� �� �����. ���� ��� ��� ��������� ������� n ��� �� ������ ��� - ������� �������� ���� ��� ���� ���������� � Shift-N ��� �� ������ - ���� ��� �������� ����������. + 2. Γράφοντας / ακολουθούμενο από μία φράση ψάχνει προς τα ΜΠΡΟΣΤΑ για + τη φράση. Γράφοντας ? ακολουθούμενο από μία φράση ψάχνει προς τα ΠΙΣΩ + για τη φράση. Μετά από μία αναζήτηση πατήστε n για να βρείτε την + επόμενη εμφάνιση προς την ίδια κατεύθυνση ή Shift-N για να ψάξετε + προς την αντίθετη κατεύθυνση. - 3. �������� % ��� � ������� ����� ���� �� ��� (,),[,],{, � } ��������� - �� ���������� ����� ��� ���������. + 3. Πατώντας % όσο ο δρομέας είναι πάνω σε μία (,),[,],{, ή } εντοπίζει + το αντίστοιχο ταίρι του ζευγαριού. - 4. ��� ������������� �� new ��� ������ old ��� ������ ������ :s/old/new - ��� ������������� �� new ���� ��� 'old' ��� ������ ������ :s/old/new/g - ��� ������������� ������� ������ ��� # ������� ������ :#,#s/old/new/g - ��� ������������� ���� ��� ���������� ��� ������ ������ :%s/old/new/g - ��� ������� ������������ ���� ���� ��������� ��� 'c' "%s/old/new/gc + 4. Για αντικατάσταση με new του πρώτου old στη γραμμή γράψτε :s/old/new + Για αντικατάσταση με new όλων των 'old' στη γραμμή γράψτε :s/old/new/g + Για αντικατάσταση φράσεων μεταξύ δύο # γραμμών γράψτε :#,#s/old/new/g + Για αντικατάσταση όλων των εμφανίσεων στο αρχείο γράψτε :%s/old/new/g + Για ερώτηση επιβεβαίωσης κάθε φορά προσθέστε ένα 'c' "%s/old/new/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.5.1: ��� ������ ��� ��������� ������ + Μάθημα 1.5.1: ΠΩΣ ΕΚΤΕΛΩ ΜΙΑ ΕΞΩΤΕΡΙΚΗ ΕΝΤΟΛΗ -** ������ :! ������������� ��� ��� ��������� ������ ��� �� ��� ����������. ** +** Γράψτε :! ακολουθούμενο από μία εξωτερική εντολή για να την εκτελέσετε. ** - 1. ������� ��� ������ ������ : ��� �� ������ ��� ������ ��� ���� ����� - ��� ������. ���� ��� ��������� �� ������ ��� ������. + 1. Πατήστε την οικεία εντολή : για να θέσετε τον δρομέα στο κάτω μέρος + της οθόνης. Αυτό σας επιτρέπει να δώσετε μία εντολή. - 2. ���� ������� �� ! (����������). ���� ��� ��������� �� ���������� - ����������� ��������� ������ ��� ������. + 2. Τώρα πατήστε το ! (θαυμαστικό). Αυτό σας επιτρέπει να εκτελέσετε + οποιαδήποτε εξωτερική εντολή του φλοιού. - 3. ��� ���������� ������ ls ���� ��� �� ! ��� ������� . ���� �� - ��� ��������� ��� ����� ��� ��������� ���, ������� ��� �� ������� ���� - �������� ��� ������. � �������������� :!dir �� �� ls ��� ��������. + 3. Σαν παράδειγμα γράψτε ls μετά από το ! και πατήστε . Αυτό θα + σας εμφανίσει μία λίστα του καταλόγου σας, ακριβώς σαν να ήσασταν στην + προτροπή του φλοιού. Ή χρησιμοποιήστε :!dir αν το ls δεν δουλεύει. ----> ��������: ����� ������� �� ���������� ����������� ��������� ������ - �� ����� ��� �����. +---> Σημείωση: Είναι δυνατόν να εκτελέσετε οποιαδήποτε εξωτερική εντολή + με αυτόν τον τρόπο. ----> ��������: ���� �� ������� : ������ �� ������������� �������� �� . +---> Σημείωση: Όλες οι εντολές : πρέπει να τερματίζονται πατώντας το . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.5.2: ����������� ���� �������� ������� + Μάθημα 1.5.2: ΠΕΡΙΣΣΟΤΕΡΑ ΠΕΡΙ ΕΓΓΡΑΦΗΣ ΑΡΧΕΙΩΝ - ** ��� �� ������ ��� ������� ��� ������ ��� ������, ������ :w ������. ** + ** Για να σώσετε τις αλλάγες που κάνατε στο αρχείο, γράψτε :w ΑΡΧΕΙΟ. ** - 1. ������ :!dir � :!ls ��� �� ������ ��� ����� ��� ��������� ���. - ��� ������ ��� ������ �� �������� ���� ��� ����. + 1. Γράψτε :!dir ή :!ls για να πάρετε μία λίστα του καταλόγου σας. + Ήδη ξέρετε ότι πρέπει να πατήσετε μετά από αυτό. - 2. �������� ��� ����� ������� ��� ��� ������� �����, ���� �� TEST. + 2. Διαλέξτε ένα όνομα αρχείου που δεν υπάρχει ακόμα, όπως το TEST. - 3. ���� ������: :w TEST (���� TEST ����� �� ����� ������� ��� ���������). + 3. Τώρα γράψτε: :w TEST (όπου TEST είναι το όνομα αρχείου που διαλέξατε). - 4. ���� ����� ��� �� ������ (vim Tutor) �� �� ����� TEST. ��� �� �� - ������������, ������ ���� :!dir ��� �� ����� ��� �������� ���. + 4. Αυτό σώζει όλο το αρχείο (vim Tutor) με το όνομα TEST. Για να το + επαληθεύσετε, γράψτε ξανά :!dir για να δείτε τον κατάλογό σας. ----> ��������� ��� �� �������� ��� ��� Vim ��� �������� ���� �� �� ����� - ������� TEST, �� ������ �� ���� ������� ��������� ��� tutor ���� �� ������. +---> Σημειώστε ότι αν βγαίνατε από τον Vim και μπαίνατε ξανά με το όνομα + αρχείου TEST, το αρχείο θα ήταν ακριβές αντίγραφο του tutor όταν το σώσατε. - 5. ���� ��������� �� ������ ��������� (MS-DOS): :!del TEST + 5. Τώρα διαγράψτε το αρχείο γράφοντας (MS-DOS): :!del TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.5.3: ���������� ������ �������� + Μάθημα 1.5.3: ΕΠΙΛΕΚΤΙΚΗ ΕΝΤΟΛΗ ΕΓΓΡΑΦΗΣ - ** ��� �� ������ ����� ��� �������, ������ :#,# w ������ ** + ** Για να σώσετε τμήμα του αρχείου, γράψτε :#,# w ΑΡΧΕΙΟ ** - 1. ���� ��� ����, ������ :!dir � :!ls ��� �� ������ ��� ����� ��� ��� - �������� ��� ��� �������� ��� ��������� ����� ������� ���� �� TEST. + 1. Άλλη μια φορά, γράψτε :!dir ή :!ls για να πάρετε μία λίστα από τον + κατάλογό σας και διαλέξτε ένα κατάλληλο όνομα αρχείου όπως το TEST. - 2. ������������ ��� ������ ��� ���� ����� ����� ��� ������� ��� ������� - Ctrl-g ��� �� ������ ��� ������ ����� ��� �������. - �� ������� ����� ��� ������! + 2. Μετακινείστε τον δρομέα στο πάνω μέρος αυτής της σελίδας και πατήστε + Ctrl-g για να βρείτε τον αριθμό αυτής της γραμμής. + ΝΑ ΘΥΜΑΣΤΕ ΑΥΤΟΝ ΤΟΝ ΑΡΙΘΜΟ! - 3. ���� ��������� ��� ���� ����� ��� ������� ��� ������� Ctrl-g ����. - �� ������� ��� ����� ��� ������! + 3. Τώρα πηγαίνετε στο κάτω μέρος της σελίδας και πατήστε Ctrl-g ξανά. + ΝΑ ΘΥΜΑΣΤΕ ΚΑΙ ΑΥΤΟΝ ΤΟΝ ΑΡΙΘΜΟ! - 4. ��� �� ������ ���� ��� ����� �� ������, ������ :#,# w TEST - ���� #,# �� ��� ������� ��� ��������������� (����,����) ��� TEST �� - ����� ��� ������� ���. + 4. Για να σώσετε ΜΟΝΟ ένα τμήμα σε αρχείο, γράψτε :#,# w TEST + όπου #,# οι δύο αριθμοί που απομνημονεύσατε (πάνω,κάτω) και TEST το + όνομα του αρχείου σας. - 5. ����, ����� ��� �� ������ ����� ���� �� ��� :!dir ���� ��� �� ����������. + 5. Ξανά, δείτε ότι το αρχείο είναι εκεί με την :!dir αλλά ΜΗΝ το διαγράψετε. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.5.4: ���������� ��� ��������� ������ + Μάθημα 1.5.4: ΑΝΑΚΤΩΝΤΑΣ ΚΑΙ ΕΝΩΝΟΝΤΑΣ ΑΡΧΕΙΑ - ** ��� �� �������� �� ����������� ���� �������, ������ :r ������ ** + ** Για να εισάγετε τα περιεχόμενα ενός αρχείου, γράψτε :r ΑΡΧΕΙΟ ** - 1. ������ :!dir ��� �� ����������� ��� �� TEST ������� ��� ����. + 1. Γράψτε :!dir για να βεβαιωθείτε ότι το TEST υπάρχει από πριν. - 2. ����������� ��� ������ ��� ���� ����� ��� �������. + 2. Τοποθετήστε τον δρομέα στο πάνω μέρος της σελίδας. -��������: ������ ���������� �� ���� 3 �� ����� �� ������ 1.5.3. - ���� ��������� ���� ���� ���� �� ������ ����. +ΣΗΜΕΙΩΣΗ: Αφότου εκτελέσετε το Βήμα 3 θα δείτε το Μάθημα 1.5.3. + Μετά κινηθείτε ΚΑΤΩ ξανά προς το μάθημα αυτό. - 3. ���� ��������� �� ������ ��� TEST ��������������� ��� ������ :r TEST - ���� TEST ����� �� ����� ��� �������. + 3. Τώρα ανακτήστε το αρχείο σας TEST χρησιμοποιώντας την εντολή :r TEST + όπου TEST είναι το όνομα του αρχείου. -��������: �� ������ ��� �������� ������������ ���������� ���� ��� ��������� - � �������. +ΣΗΜΕΙΩΣΗ: Το αρχείο που ανακτάτε τοποθετείται ξεκινώντας εκεί που βρίσκεται + ο δρομέας. - 4. ��� �� ������������ ��� �� ������ ����������, ���� ��� ������ ��� - ����������� ��� �������� ���� ��� ��������� ��� ��������� 1.5.3, �� - ������ ��� � ������ ��� �������. + 4. Για να επαληθεύσετε ότι το αρχείο ανακτήθηκε, πίσω τον δρομέα και + παρατηρήστε ότι υπάρχουν τώρα δύο αντίγραφα του Μαθήματος 1.5.3, το + αρχικό και η έκδοση του αρχείου. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.5 �������� + ΜΑΘΗΜΑ 1.5 ΠΕΡΙΛΗΨΗ - 1. :!������ ������� ��� ��������� ������. + 1. :!εντολή εκτελεί μία εξωτερική εντολή. - ������ ������� ������������ ����� (MS-DOS): - :!dir - �������� ������ ���� ���������. - :!del ������ - ��������� �� ������. + Μερικά χρήσιμα παραδείγματα είναι (MS-DOS): + :!dir - εμφάνιση λίστας ενός καταλόγου. + :!del ΑΡΧΕΙΟ - διαγράφει το ΑΡΧΕΙΟ. - 2. :w ������ ������ �� ������ ������ ��� Vim ��� ����� �� ����� ������. + 2. :w ΑΡΧΕΙΟ γράφει το τρέχων αρχείο του Vim στο δίσκο με όνομα ΑΡΧΕΙΟ. - 3. :#,#w ������ ����� ��� ������� ��� # ����� # ��� ������. + 3. :#,#w ΑΡΧΕΙΟ σώζει τις γραμμές από # μέχρι # στο ΑΡΧΕΙΟ. - 4. :r ������ ������� �� ������ ������ ������ ��� �� ����������� ���� - ��� ������ ������ ���� ��� �� ���� ��� ������. + 4. :r ΑΡΧΕΙΟ ανακτεί το αρχείο δίσκου ΑΡΧΕΙΟ και το παρεμβάλλει μέσα + στο τρέχον αρχείο μετά από τη θέση του δρομέα. @@ -621,112 +621,112 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.6.1: � ������ ���������� + Μάθημα 1.6.1: Η ΕΝΤΟΛΗ ΑΝΟΙΓΜΑΤΟΣ - ** ������� o ��� �� �������� ��� ������ ���� ��� ��� ������ ��� �� - �������� �� ��������� ��������. ** + ** Πατήστε o για να ανοίξετε μία γραμμή κάτω από τον δρομέα και να + βρεθείτε σε Κατάσταση Κειμένου. ** - 1. ������������ ��� ������ ���� �������� ������ ���������� �� --->. + 1. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - 2. ������� o (����) ��� �� �������� ��� ������ ���� ��� ��� ������ ��� �� - �������� �� ��������� ��������. + 2. Πατήστε o (πεζό) για να ανοίξετε μία γραμμή ΚΑΤΩ από τον δρομέα και να + βρεθείτε σε Κατάσταση Κειμένου. - 3. ���� ���������� �� ���������� �� ---> ������ ��� ������� ��� �� - ������ ��� ��� ��������� ��������. + 3. Τώρα αντιγράψτε τη σημειωμένη με ---> γραμμή και πατήστε για να + βγείτε από την Κατάσταση Κειμένου. ---> After typing o the cursor is placed on the open line in Insert mode. - 4. ��� �� �������� ��� ������ ���� ��� ��� ������, ������� ���� ��� �������� - O, ���� ��� ��� ���� o. ��������� �� ���� �������� ������. -�������� ������ ���� ��� ����� �������� Shift-O ��� � ������� ����� ��� ������ + 4. Για να ανοίξετε μία γραμμή ΠΑΝΩ από τον δρομέα, πατήστε απλά ένα κεφαλαίο + O, αντί για ένα πεζό o. Δοκιμάστε το στην παρακάτω γραμμή. +Ανοίγετε γραμμή πάνω από αυτήν πατώντας Shift-O όσο ο δρομέας είναι στη γραμμή ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.6.2: � ������ ��������� + Μάθημα 1.6.2: Η ΕΝΤΟΛΗ ΠΡΟΣΘΗΚΗΣ - ** ������� a ��� �� �������� ������� ���� ��� ������. ** + ** Πατήστε a για να εισάγετε κείμενο ΜΕΤΑ τον δρομέα. ** - 1. ������������ ��� ������ ��� ����� ��� ������ ������� �������� - ���������� �� ---> �������� $ ���� �������� ���������. + 1. Μετακινείστε τον δρομέα στο τέλος της πρώτης γραμμής παρακάτω + σημειωμένη με ---> πατώντας $ στην Κανονική Κατάσταση. - 2. ������� ��� a (����) ��� �� ���������� ������� ���� ��� ��� ��������� - ��� ����� ���� ��� ��� ������. (�� �������� A ��������� ��� ����� - ��� �������). + 2. Πατήστε ένα a (πεζό) για να προσθέσετε κείμενο ΜΕΤΑ από τον χαρακτήρα + που είναι κάτω από τον δρομέα. (Το κεφαλαίο A προσθέτει στο τέλος + της γραμμής). -��������: ���� ��������� �� ������ ��� i , ��� ��������� ���������, �� - ������� ��� ���������, , ������-�����, ��� �����, x, ���� ��� - ���� ��� �� ���������� ��� ����� ��� �������! +Σημείωση: Αυτό αποφεύγει το πάτημα του i , τον τελευταίο χαρακτήρα, το + κείμενο της εισαγωγής, , δρομέα-δεξιά, και τέλος, x, μόνο και + μόνο για να προσθέσετε στο τέλος της γραμμής! - 3. ����������� ���� ��� ����� ������. ��������� ������ ��� � �������� ����� - ������� ���� ���� ��������� �������� �� ��� ��������� ���������, ����� - ��� �� ���� ��� ��������� �� �������. + 3. Συμπληρώστε τώρα την πρώτη γραμμή. Σημειώστε επίσης ότι η προσθήκη είναι + ακριβώς ίδια στην Κατάσταση Κειμένου με την Κατάσταση Εισαγωγής, εκτός + από τη θέση που εισάγεται το κείμενο. ---> This line will allow you to practice ---> This line will allow you to practice appending text to the end of a line. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.6.3: ���� ������ ��� �������������� + Μάθημα 1.6.3: ΑΛΛΗ ΕΚΔΟΣΗ ΤΗΣ ΑΝΤΙΚΑΤΑΣΤΑΣΗΣ - ** ������� �������� R ��� �� �������� ������������� ��� ���� ����������. ** + ** Πατήστε κεφαλαίο R για να αλλάξετε περισσότερους από έναν χαρακτήρες. ** - 1. ������������ ��� ������ ���� ����� ������ �������� ���������� �� --->. + 1. Μετακινείστε τον δρομέα στην πρώτη γραμμή παρακάτω σημειωμένη με --->. - 2. ����������� ��� ������ ���� ���� ��� ������ ����� ��� ����� ����������� - ��� �� ������� ������ ���������� �� ---> (� ���� 'last'). + 2. Τοποθετήστε τον δρομέα στην αρχή της πρώτης λέξης που είναι διαφορετική + από τη δεύτερη γραμμή σημειωμένη με ---> (η λέξη 'last'). - 3. ������� ���� R ��� ������� �� �������� ��� �������� ���� ����� ������ - ��������� ���� ��� �� ����� ������� ���� �� ������ ��� ����� ������ ���� - �� �� �������. + 3. Πατήστε τώρα R και αλλάξτε το υπόλοιπο του κειμένου στην πρώτη γραμμή + γράφοντας πάνω από το παλιό κείμενο ώστε να κάνετε την πρώτη γραμμή ίδια + με τη δεύτερη. ---> To make the first line the same as the last on this page use the keys. ---> To make the first line the same as the second, type R and the new text. - 4. ��������� ��� ���� ������ ��� �� ������, ��������� ����������� - ���������� �������. + 4. Σημειώστε ότι όταν πατάτε για να βγείτε, παραμένει οποιοδήποτε + αναλλοίωτο κείμενο. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.6.4: ������� �������� + Μάθημα 1.6.4: ΡΥΘΜΙΣΗ ΕΠΙΛΟΓΗΣ - ** �������� ��� ������� ���� ���� � ��������� � � ������������� �� ������ - �� ������� �����-��������� ** + ** Ρυθμίστε μία επιλογή έτσι ώστε η αναζήτηση ή η αντικατάσταση να αγνοεί + τη διαφορά πεζών-κεφαλαίων ** - 1. ����� ��� 'ignore' ����������: + 1. Ψάξτε για 'ignore' εισάγοντας: /ignore - ��������� ������� ����� �������� �� ������� n. + Συνεχίστε αρκετές φορές πατώντας το πλήκτρο n. - 2. ����� ��� ������� 'ic' (Ignore case) ���������: + 2. Θέστε την επιλογή 'ic' (Ignore case) γράφοντας: :set ic - 3. ����� ���� ���� ��� 'ignore' ��������: n - ��������� ��� ��������� ������� ����� ����� �������� �� ������� n + 3. Ψάξτε τώρα ξανά για 'ignore' πατώντας: n + Συνεχίστε την αναζήτηση μερικές ακόμα φορές πατώντας το πλήκτρο n - 4. ����� ��� �������� 'hlsearch' ��� 'incsearch': + 4. Θέστε τις επιλογές 'hlsearch' και 'incsearch': :set hls is - 5. �������� ���� ���� ��� ������ ����������, ��� ����� �� ��������� + 5. Εισάγετε τώρα ξανά την εντολή αναζήτησης, και δείτε τι συμβαίνει /ignore ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.6 �������� + ΜΑΘΗΜΑ 1.6 ΠΕΡΙΛΗΨΗ - 1. �������� o ������� ��� ������ ���� ��� ��� ������ ��� ��������� ��� - ������ ���� ������� ������ �� ��������� ��������. + 1. Πατώντας o ανοίγει μία γραμμή ΚΑΤΩ από τον δρομέα και τοποθετεί τον + δρομέα στην ανοιχτή γραμμή σε Κατάσταση Κειμένου. - 2. ������� a ��� �� �������� ������� ���� ��� ��������� ���� ����� ����� - � �������. �������� �������� A �������� ��������� ������� ��� ����� - ��� �������. + 2. Πατήστε a για να εισάγετε κείμενο ΜΕΤΑ τον χαρακτήρα στον οποίο είναι + ο δρομέας. Πατώντας κεφαλαίο A αυτόματα προσθέτει κείμενο στο τέλος + της γραμμής. - 3. �������� �������� R ���������� ���� �������� �������������� ����� �� - ������� �� ��� �� �������. + 3. Πατώντας κεφαλαίο R εισέρχεται στην Κατάσταη Αντικατάστασης μέχρι να + πατηθεί το και να εξέλθει. - 4. ��������� ":set xxx" �������� ��� ������� "xxx". + 4. Γράφοντας ":set xxx" ρυθμίζει την επιλογή "xxx". @@ -736,21 +736,21 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.7: ON-LINE ������� �������� + ΜΑΘΗΜΑ 1.7: ON-LINE ΕΝΤΟΛΕΣ ΒΟΗΘΕΙΑΣ - ** �������������� �� on-line ������� �������� ** + ** Χρησιμοποιήστε το on-line σύστημα βοήθειας ** - � Vim ���� ��� ���������� on-line ������� ��������. ��� �� ���������, - ��������� ������ ��� �� ����: - - ������� �� ������� (�� ����� ������) - - ������� �� ������� (�� ����� ������) - - ������ :help + Ο Vim έχει ένα περιεκτικό on-line σύστημα βοήθειας. Για να ξεκινήσει, + δοκιμάστε κάποιο από τα τρία: + - πατήστε το πλήκτρο (αν έχετε κάποιο) + - πατήστε το πλήκτρο (αν έχετε κάποιο) + - γράψτε :help - ������ :q ��� �� �������� �� �������� ��� ��������. + Γράψτε :q για να κλείσετε το παράθυρο της βοήθειας. - �������� �� ������ ������� ���� �� ���� �����������, �������� ��� ��������� - ���� ������ ":help". ��������� ���� (��� ������� �� ������ ): + Μπορείτε να βρείτε βοήθεια πάνω σε κάθε αντικείμενο, δίνοντας μία παράμετρο + στην εντολή ":help". Δοκιμάστε αυτά (μην ξεχνάτε να πατάτε ): :help w :help c_ �� ��㡫�� l �夘� ����� ��� ����� ��� �����. - j �� ��㡫�� j ���᝜� �� ���ᡠ ���� �� ���. - v - - 1. ��������婫� ��� ����� ������ ���� ��椞 �⮨� �� ���韜�� ᤜ��. - - 2. ����㩫� �����⤦ �� ��� ��㡫�� (j) �⮨� �� �����������. ----> �騘 �⨜�� �� �� ����������嫜 ��� ��棜�� �៞��. - - 3. ����������餫�� �� ��� ��㡫��, ����������嫜 ��� �៞�� 1.1.2. - -�����ਫ਼: �� �����ᢢ��� ��� �᫠ ��� ���㩘��, ���㩫� ��� �� �����嫜 - ���� �������� ���ᩫ���. ���� ���㩫� ���� ��� ������ ��� �⢘��. - -�����ਫ਼: �� ��㡫�� ��� ����� �� ��⧜� ��婞� �� �����禬�. ���� �� �� hjkl - �� �����嫜 �� ������嫜 ���� ������櫜��, �梠� �� �����婜��. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.1.2: ���������� ��� ���������� ���� VIM - - !! ��������: ���� �����⩜�� �᧦�� ��� �� �㣘��, ����ᩫ� 梦 �� �៞��!! - - 1. ���㩫� �� ��㡫�� (��� �� �婫� �嚦��� ���� �������� ���ᩫ���). - - 2. ����������㩫�: :q! . - ----> ���� ��⨮���� ��� ��� ����ᡫ� ����� �� �驜� 槦��� ������ ⮜�� �ᤜ�. - �� �⢜�� �� �驜�� ��� ������ ��� �� ��⨟��� ����������㩫�: - :wq - - 3. � ��嫜 ��� �������� ��� ������, ����������㩫� ��� ������ �� ��� ���� - ��㡘�� �� ���� ��� ����㚞��. ������ �� �夘�: vimtutor - �������� �� �����������穘��: vim tutor - ----> 'vim' ����夜� �������� ���� ����ᡫ� vim, 'tutor' �夘� �� ����� ��� - �⢦��� �� �����驦���. - - 4. �� ⮜�� ����������穜� ���� �� �㣘�� ��� ⮜�� ��������埞��, �����⩫� - �� �㣘�� 1 �� 3 ��� �� ���嫜 ��� �� ���嫜 ���� ���� ����ᡫ�. ���� - �������㩫� ��� ����� ��� ��� �៞�� 1.1.3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.1.3: �������� �������� - �������� - - **  �婫� ���� �������� ���ᩫ��� ���㩫� x ��� �� �����ᯜ�� ��� - ������㨘 ��� ��� ��� �����. ** - - 1. ��������婫� ��� ����� ���� ������� ������ ������⤞ �� --->. - - 2. ��� �� �����驜�� �� �៞, ����婫� ��� ����� �⮨� �� �夘� ��� ��� - ��� ������㨘 ��� �� ���������. - - 3. ���㩫� �� ��㡫�� x ��� �� �����ᯜ�� ��� ������磞�� ������㨘. - - 4. ������ᙜ�� �� �㣘�� 2 �⮨� 4 �⮨� � ��櫘�� �� �夘� �੫�. - ----> The ccow jumpedd ovverr thhe mooon. - - 5. �騘 ��� � ������ �夘� �੫�, ����夫� ��� �៞�� 1.1.4. - -��������: ���� �����⮜�� ���� ��� ����㚞��, �������㩫� �� ��� - ����������眫�, ����夜�� �� �� ��㩞. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.1.4: �������� �������� - ��������� - - **  �婫� �� �������� ���ᩫ��� ���㩫� i ��� �� ������ᢢ��� ��壜��. ** - - 1. ��������婫� ��� ����� �⮨� ��� ��髞 ������ ������� ������⤞ �� --->. - - 2. ��� �� �ᤜ�� ��� ��髞 ������ 因� �� ��� ��竜��, ��������婫� ��� - ����� ��� ���� ��髦 ������㨘 ���� ��� 槦� �� ����������� �� ��壜��. - - 3. ���㩫� �� i ��� ����������㩫� ��� �����嫞��� �����㡜�. - - 4. ���� �����餜�� �ៜ �៦� ���㩫� ��� �� ������⯜�� ���� - �������� ���ᩫ���. ������ᙜ�� �� �㣘�� 2 �⮨� 4 ��� �� �����驜�� - ��� ��櫘��. - ----> There is text misng this . ----> There is some text missing from this line. - - 5. � �婫� ᤜ��� �� ��� ��������� ����⤦� ����������嫜 ���� - ������� ���增��. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.1 �������� - - - 1. � ����☪ ����嫘� ����������餫�� �嫜 �� ��㡫�� ����� � �� hjkl. - h (�����⨘) j (���) k (���) l (�����) - - 2. ��� �� ���嫜 ���� Vim (��� ��� �������� %) ��ᯫ�: vim ������ - - 3. ��� �� ���嫜 ��ᯫ�: :q! ��� ��樨��� �� ������. - � ��ᯫ�: :wq ��� ����㡜��� �� ������. - - 4. ��� �� �����ᯜ�� ⤘� ������㨘 ��� ��� ��� ����� �� - �������� ���ᩫ��� ���㩫�: x - - 5. ��� �� ���᚜�� ��壜�� ���� ����� 橦 �婫� �� �������� ���ᩫ��� ��ᯫ�: - i ����������㩫� �� ��壜�� - -��������: ���餫�� �� ����������嫜 ���� �������� ���ᩫ��� � �� - ����驜�� �� ������磞�� ��� ������ ��������⤞ ������. - -�騘 �����婫� �� �� �៞�� 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.2.1: ������� ��������� - - ** ��ᯫ� dw ��� �� �����ᯜ�� �⮨� �� �⢦� �嘪 �⥞�. ** - - 1. ���㩫� ��� �� ��������嫜 櫠 �婫� ���� �������� ���ᩫ���. - - 2. ��������婫� ��� ����� ���� ������� ������ ������⤞ �� --->. - - 3. ����夜�� ��� ����� ���� ���� ��� �⥞� ��� ��⧜� �� ���������. - - 4. ��ᯫ� dw ��� �� �ᤜ�� ��� �⥞ �� �����������. - -��������: �� ��ᣣ��� dw �� ���������� ���� �������� ������ ��� ��椞� 橦 - �� �����������嫜. �� ��ᯘ�� �᫠ �៦�, ���㩫� ��� - �����㩫� ��� ��� ����. - ----> There are a some words fun that don't belong paper in this sentence. - - 5. ������ᙜ�� �� �㣘�� 3 ��� 4 �⮨� � ��櫘�� �� �夘� �੫� ��� - ����夜�� ��� �៞�� 1.2.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.2.2: ������������ ������� ��������� - - ** ����������㩫� d$ ��� �� �����ᯜ�� �⮨� �� �⢦� ��� ������. ** - - 1. ���㩫� ��� �� ��������嫜 櫠 �婫� ���� �������� ���ᩫ���. - - 2. ��������婫� ��� ����� ���� ������� ������ ������⤞ �� --->. - - 3. ��������婫� ��� ����� ��� �⢦� ��� �੫� ������ (���� ��� ��髞 . ). - - 4. ���㩫� d$ ��� �� �����ᯜ�� �⮨� �� �⢦� ��� ������. - ----> Somebody typed the end of this line twice. end of this line twice. - - 5. ����夜�� ��� �៞�� 1.2.3 ��� �� �����ᙜ�� �� �����夜�. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.2.3: ���� ������� ��� ������������ - - -� ����� ��� ������ �������� d �夘� � ���: - - [������] d ������壜�� � d [������] ������壜�� - �: - ������ - �橜� ���� �� ���������� � ������ (�����������, ��' �������=1). - d - � ������ ��� ��������. - ������壜�� - ��� �� �� �� ��������㩜� � ������ (������� �婫�). - - �� ����� �婫� ��� ������壜��: - w - ��� ��� ����� �⮨� �� �⢦� ��� �⥞�, ��������ᤦ���� �� ��ᩫ���. - e - ��� ��� ����� �⮨� �� �⢦� ��� �⥞�, ����� �� ��ᩫ���. - $ - ��� ��� ����� �⮨� �� �⢦� ��� ������. - -��������: ��� ���� �秦�� ��� �����⫝̸���, ���餫�� ���� �� ������壜�� 橦 - �婫� ���� �������� ���ᩫ��� ��� �᧦�� ������ �� �������㩜�� - ��� ����� �� �����坜��� ���� �婫� ����������. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.2.4: ��� �������� ���� '������-�����������' - - ** ����������㩫� dd ��� �� �����ᯜ�� 梞 �� ������. ** - - �����嘪 ��� ����櫞��� ��� �������� ��桢���� ������, �� ��������� - ��� Vim ����᩠��� 櫠 �� 㫘� �����櫜�� �� ��᭜�� ���� �� d ��� - ����� ��� �� �����ᯜ�� �� ������. - - 1. ��������婫� ��� ����� ��� ��竜�� ������ ��� ������� ��ᩞ�. - 2. ��ᯫ� dd ��� �� �����ᯜ�� �� ������. - 3. �騘 ����������嫜 ���� �⫘��� ������. - 4. ��ᯫ� 2dd (������嫜 ������-������-������壜��) ��� �� - �����ᯜ�� �� ������. - - 1) Roses are red, - 2) Mud is fun, - 3) Violets are blue, - 4) I have a car, - 5) Clocks tell time, - 6) Sugar is sweet - 7) And so are you. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.2.5: � ������ ��������� - - ** ���㩫� u ��� �� �����⩜�� ��� �������圪 ������, - U ��� �� �����驜�� 梞 �� ������. ** - - 1. ��������婫� ��� ����� ���� ������� ������ ������⤞ �� ---> ��� - �������㩫� ��� ��� ��� ��髦 �៦�. - 2. ���㩫� x ��� �� �����ᯜ�� ��� ��髦 ������磞�� ������㨘. - 3. �騘 ���㩫� u ��� �� �����⩜�� ��� �������� ��������⤞ ������. - 4. ���� �� ���� �����驫� 梘 �� �៞ ��� ������ ����������餫�� ��� ������ x. - 5. �騘 ���㩫� ⤘ ������� U ��� �� ������⯜�� �� ������ ���� ������ - ��� ���ᩫ���. - 6. �騘 ���㩫� u ������ ���� ��� �� �����⩜�� ��� U ��� - ������磜��� ������. - 7. �騘 ���㩫� CTRL-R (����餫�� �����⤦ �� ��㡫�� CTRL ���� ���᫜ �� R) - ������ ���� ��� �� ������⨜�� ��� ������ (���娜�� �� �����⩜�). - ----> Fiix the errors oon thhis line and reeplace them witth undo. - - 8. ���� �夘� ���� ��㩠��� ������. �騘 ����夜�� ���� - ���增�� ��� ���㣘��� 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.2 �������� - - - 1. ��� �� �����ᯜ�� ��� ��� ����� �⮨� �� �⢦� �⥞� ��ᯫ�: dw - - 2. ��� �� �����ᯜ�� ��� ��� ����� �⮨� �� �⢦� ������ ��ᯫ�: d$ - - 3. ��� �� �����ᯜ�� ��桢��� �� ������ ��ᯫ�: dd - - 4. � ����� ��� �� ������ ���� �������� ���ᩫ��� �夘�: - - [������] ������ ������壜�� � ������ [������] ������壜�� - 槦�: - ������ - �橜� ���� �� ����������� � ������ - ������ - �� �� �夜�, �� � d ��� �������� - ������壜�� - ��� �� �� �� �����㩜� � ������, �� w (�⥞), - $ (�⢦� ��� ������), ���. - - 5. ��� �� �����⩜�� ������磜��� ��⨚����, ���㩫�: u (���� u) - ��� �� �����⩜�� 梜� ��� ������ ��� ������, ���㩫�: U (������� U) - ��� �� �����⩜�� ��� �����⩜��, ���㩫�: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.3.1: � ������ ����������� - - - ** ���㩫� p ��� �� �������㩜�� ��� �������� �������� ���� ��� �����. ** - - 1. ��������婫� ��� ����� ���� ��髞 ������ ��� ������� ��ᛘ�. - - 2. ���㩫� dd ��� �� �����ᯜ�� �� ������ ��� �� ��� �������穜�� �� - ����ਠ�� ��㣞 ��� Vim. - - 3. ��������婫� ��� ����� ��� ������ ���� ��� ���� ��� �� ��⧜� �� �ᜠ - � ��������⤞ ������. - - 4.  �婫� �� �������� ���ᩫ���, ���㩫� p ��� �� �ᢜ�� �� ������. - - 5. ������ᙜ�� �� �㣘�� 2 �� 4 ��� �� �ᢜ�� 梜� ��� ������ ��� - �੫� �����. - - d) Can you learn too? - b) Violets are blue, - c) Intelligence is learned, - a) Roses are red, - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.3.2: � ������ �������������� - - - ** ���㩫� r ��� ������㨘 ��� �� ���ᥜ�� ���� ��� �夘� - ��� ��� ��� �����. ** - - 1. ��������婫� ��� ����� ���� ��髞 ������ ������� ������⤞ �� --->. - - 2. ��������婫� ��� ����� ⫩� 驫� �� �夘� ��� ��� ��髦 �៦�. - - 3. ���㩫� r ��� ���� ��� ������㨘 � ���妪 �����餜� �� �៦�. - - 4. ������ᙜ�� �� �㣘�� 2 ��� 3 �⮨� �� �夘� �੫� � ��髞 ������. - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. �騘 ����夜�� ��� �៞�� 1.3.2. - -��������: �� ���ᩫ� 櫠 ��⧜� �� ����夜�� �� �� ��㩞, ��� 殠 �� - ��� �������検���. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.3.3: � ������ ������� - - ** ��� �� ���ᥜ�� ��㣘 � 梞 �� �⥞, ���㩫� cw . ** - - 1. ��������婫� ��� ����� ���� ��髞 ������ ������� ������⤞ �� --->. - - 2. �������㩫� ��� ����� ��� ��� u ��� �⥞� lubw. - - 3. ���㩫� cw ��� �� �੫� �⥞ (���� ���姫ਫ਼ ����, ��ᯫ� 'ine'.) - - 4. ���㩫� ��� ����夜�� ��� ��棜�� �៦� (���� ��髦 - ������㨘 ���� ������). - - 5. ������ᙜ�� �� �㣘�� 3 ��� 4 �⮨�� 櫦� � ��髞 ��櫘�� �� �夘� - 因� �� �� ��竜��. - ----> This lubw has a few wptfd that mrrf changing usf the change command. ----> This line has a few words that need changing using the change command. - -��������婫� 櫠 � cw 殠 �椦 ����������ᜠ �� �⥞, ���� ��� ���᚜� -��婞� �� ���������. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.3.4: ������������ ������� �� c - - - ** � ������ ������ �����������嫘� �� �� 因� ������壜�� ��� ��������. ** - - - 1. � ������ ������ �����眠 �� ��� 因� ��槦 �� � ��������. � ����� �夘�: - - [������] c ������壜�� � c [������] ������壜�� - - 2. �� ������壜�� �夘� �ᢠ �� 因�, �� w (�⥞), $ (�⢦� ������), ���. - - 3. ����������嫜 ���� ��髞 ������ ������� ������⤞ �� --->. - - 4. ��������婫� ��� ����� ��� ��髦 �៦�. - - 5. ��ᯫ� c$ ��� �� �ᤜ�� �� ��梦��� ��� ������ 因� �� �� ��竜�� - ��� ���㩫� . - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.3 �������� - - - 1. ��� �� �������㩜�� ��壜�� ��� �梠� ⮜� ���������, ���㩫� p . - ���� ��������� �� ��������⤦ ��壜�� ���� ��� ����� (�� �����᭫��� - ������ �� �ᜠ ���� ��� ������ ��� ��� ��� �����. - - 2. ��� �� ����������㩜�� ��� ������㨘 ��� ��� ��� �����, ���㩫� r - ��� ���� ��� ������㨘 ��� �� ����������㩜� ��� ������. - - 3. � ������ ������ ��� �����⧜� �� ���ᥜ�� �� ��������⤦ ������壜�� - ��� ��� ����� �⮨� �� �⢦� ��� ������壜��. �.�. ��ᯫ� cw ��� �� - ���ᥜ�� ��� ��� ����� �⮨� �� �⢦� ��� �⥞�, c$ ��� �� ���ᥜ�� - �⮨� �� �⢦� ������. - - 4. � ����� ��� ��� ������ �夘�: - - [������] c ������壜�� � c [������] ������壜�� - -�騘 �����婫� �� �� ��棜�� �៞��. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.4.1: ���� ��� ��������� ������� - - - ** ���㩫� CTRL-g ��� �� ���������� � �⩞ ��� ��� ����� ��� � ���ᩫ��� ���. - ���㩫� SHIFT-G ��� �� �᫜ �� �� ������ ��� �����. ** - - �����ਫ਼: ����ᩫ� ��桢��� �� �៞�� ���� �����⩜�� �᧦�� ��� �� �㣘��!! - - 1. ����㩫� �����⤦ �� ��㡫�� Ctrl ��� ���㩫� g . �� ������ ���ᩫ���� - �� ���������� ��� ��� �⨦� ��� ���囘� �� �� 椦�� ����妬 ��� �� - ������ ��� �婫�. ������嫜 ��� ������ ������ ��� �� �㣘 3. - - 2. ���㩫� shift-G ��� �� ����������嫜 ��� �⢦� ��� ����妬. - - 3. ���㩫� ��� ������ ��� ������ ��� 㩘���� ��� ���� shift-G. ���� �� - ��� ������⯜� ��� ������ ��� 㩘���� ���� ���㩜�� ��� ��髞 ���� Ctrl-g. - (� �����������嫜 ���� �������, ��� �� �����坦���� ���� ��椞). - - 4. �� ���韜�� �嚦���� ��� ����, �����⩫� �� �㣘�� 1 �� 3. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.4.2: � ������ ���������� - - - ** ���㩫� / ��������磜�� ��� �� ��ᩞ ��� �ᮤ���. ** - - 1. �� �������� ���ᩫ��� ���㩫� ��� ������㨘 / . �������㩫� 櫠 ���� ��� - � ����☪ �����坦���� ��� ��� �⨦� ��� ��椞� �� �� ��� ������ : . - - 2. �騘 ��ᯫ� 'errroor' . ���� �夘� � �⥞ ��� �⢜�� �� �ᥜ��. - - 3. ��� �� �ᥜ�� ���� ��� ��� 因� ��ᩞ, ���㩫� ���� n . - ��� �� �ᥜ�� ��� 因� ��ᩞ ���� ���埜�� ����矬���, ���㩫� Shift-N . - - 4. �� �⢜�� �� �ᥜ�� ��� �� ��ᩞ ���� �� ���, ����������㩫� ��� ������ ? ���� ��� / . - ----> � � ����㫞�� ��ᩜ� ��� �⢦� ��� ����妬 �� �����婜� ��� ��� ����. - - "errroor" is not the way to spell error; errroor is an error. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.4.3: ������ ���������� ����������� - - - ** ���㩫� % ��� �� ���嫜 ��� ���婫���� ), ], � } . ** - - 1. �������㩫� ��� ����� �� �᧦�� (, [, � { ���� ������� ������ - ������⤞ �� --->. - - 2. �騘 ���㩫� ��� ������㨘 % . - - 3. � ����☪ �� ��⧜� �� �夘� ���� ���婫���� ���⤟��� � ���碞. - - 4. ���㩫� % ��� �� �������㩜�� ��� ����� ��� ���� ��髞 ���碞 - (��� ���������). - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - -��������: ���� �夘� ���� ��㩠�� ���� ���������ਫ਼ ��� �����ᣣ���� - �� �� ��������� ������⩜��! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.4.4: ���� ������ ��� ������ ����� - - - ** ��ᯫ� :s/old/new/g ��� �� ���ᥜ�� �� 'new' �� �� 'old'. ** - - 1. ��������婫� ��� ����� ���� ������� ������ ������⤞ �� --->. - - 2. ��ᯫ� :s/thee/the . �����驫� 櫠 ���� � ������ ���᝜� �椦 - ��� ��髞 ���ᤠ�� ��� ������. - - 3. �騘 ��ᯫ� :s/thee/the/g ����餫�� ������ �������ᩫ��� ��� - ������. ���� ���᝜� 梜� ��� �����婜�� ��� ��� ������. - ----> thee best time to see thee flowers is in thee spring. - - 4. ��� �� ���ᥜ�� �ៜ ���ᤠ�� �嘪 ������������ ������ �� ������, - ��ᯫ� :#,#s/old/new/g 槦� #,# �� ������� �� �� ������. - ��ᯫ� :%s/old/new/g ��� �� ���ᥜ�� �ៜ ���ᤠ�� �� 梦 �� �����. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.4 �������� - - - 1. �� Ctrl-g �����坜� �� �⩞ ��� ��� ����� ��� ��� ���ᩫ��� ���. - �� Shift-G ����夜� ��� �⢦� ��� ����妬. 뤘� ������ ������ - ��������磜��� ��� Shift-G ����夜� �� ���夞 �� ������. - - 2. ��᭦���� / ��������磜�� ��� �� ��ᩞ �ᮤ�� ���� �� ������� ��� - �� ��ᩞ. ��᭦���� ? ��������磜�� ��� �� ��ᩞ �ᮤ�� ���� �� ���� - ��� �� ��ᩞ. ���� ��� �� ����㫞�� ���㩫� n ��� �� ���嫜 ��� - ��棜�� ���ᤠ�� ���� ��� 因� ����矬��� � Shift-N ��� �� �ᥜ�� - ���� ��� ���埜�� ����矬���. - - 3. ���餫�� % 橦 � ����☪ �夘� ��� �� �� (,),[,],{, � } �����坜� - �� ���婫���� ��娠 ��� ���������. - - 4. ��� �������ᩫ��� �� new ��� ��髦� old ��� ������ ��ᯫ� :s/old/new - ��� �������ᩫ��� �� new �� �� 'old' ��� ������ ��ᯫ� :s/old/new/g - ��� �������ᩫ��� ��ᩜ� ������ �� # ������ ��ᯫ� :#,#s/old/new/g - ��� �������ᩫ��� �� �� �����婜� ��� ����� ��ᯫ� :%s/old/new/g - ��� ��髞�� ��������ਫ਼� �ៜ ���� �����⩫� ⤘ 'c' "%s/old/new/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.5.1: ��� ������ ��� ��������� ������ - - -** ��ᯫ� :! ��������磜�� ��� �� ��૜���� ������ ��� �� ��� �����⩜��. ** - - 1. ���㩫� ��� ����� ������ : ��� �� �⩜�� ��� ����� ��� ��� �⨦� - ��� ��椞�. ���� ��� �����⧜� �� �驜�� �� ������. - - 2. �騘 ���㩫� �� ! (����������). ���� ��� �����⧜� �� �����⩜�� - ������㧦�� ��૜���� ������ ��� ������. - - 3. ��� ���ᛜ���� ��ᯫ� ls ���� ��� �� ! ��� ���㩫� . ���� �� - ��� �����婜� �� �婫� ��� �����暦� ���, ������ ��� �� 㩘���� ���� - �������� ��� ������. � ����������㩫� :!dir �� �� ls ��� �����眠. - ----> �����ਫ਼: �夘� ������ �� �����⩜�� ������㧦�� ��૜���� ������ - �� ���� ��� ��槦. - ----> �����ਫ਼: � �� ������ : ��⧜� �� ������坦���� ���餫�� �� . - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.5.2: ����������� ���� �������� ������� - - - ** ��� �� �驜�� ��� ���᚜� ��� �ᤘ�� ��� �����, ��ᯫ� :w ������. ** - - 1. ��ᯫ� :!dir � :!ls ��� �� �᨜�� �� �婫� ��� �����暦� ���. - 웞 �⨜�� 櫠 ��⧜� �� ���㩜�� ���� ��� ����. - - 2. ����⥫� ⤘ 椦�� ����妬 ��� ��� ��ᨮ�� ��棘, �� �� TEST. - - 3. �騘 ��ᯫ�: :w TEST (槦� TEST �夘� �� 椦�� ����妬 ��� ����⥘��). - - 4. ���� �靜� 梦 �� ����� (vim Tutor) �� �� 椦�� TEST. ��� �� �� - �������穜��, ��ᯫ� ���� :!dir ��� �� ��嫜 ��� ���ᢦ�� ���. - ----> �����驫� 櫠 �� ���夘�� ��� ��� Vim ��� ���夘�� ���� �� �� 椦�� - ����妬 TEST, �� ����� �� 㫘� ������ ���嚨��� ��� tutor 櫘� �� �驘��. - - 5. �騘 �����ᯫ� �� ����� ��᭦���� (MS-DOS): :!del TEST - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.5.3: ���������� ������ �������� - - - ** ��� �� �驜�� ��㣘 ��� ����妬, ��ᯫ� :#,# w ������ ** - - 1. ꢢ� ��� ����, ��ᯫ� :!dir � :!ls ��� �� �᨜�� �� �婫� ��� ��� - ���ᢦ�� ��� ��� ����⥫� ⤘ ���ᢢ��� 椦�� ����妬 �� �� TEST. - - 2. ��������婫� ��� ����� ��� ��� �⨦� ���� ��� ���囘� ��� ���㩫� - Ctrl-g ��� �� ���嫜 ��� ������ ���� ��� ������. - �� ������� ����� ��� ������! - - 3. �騘 ����夜�� ��� ��� �⨦� ��� ���囘� ��� ���㩫� Ctrl-g ����. - �� ������� ��� ����� ��� ������! - - 4. ��� �� �驜�� ���� ⤘ ��㣘 �� �����, ��ᯫ� :#,# w TEST - 槦� #,# �� �� ������� ��� ����������穘�� (���,���) ��� TEST �� - 椦�� ��� ����妬 ���. - - 5. ����, ��嫜 櫠 �� ����� �夘� ���� �� ��� :!dir ���� ��� �� �����ᯜ��. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.5.4: ���������� ��� ��������� ������ - - - ** ��� �� ���᚜�� �� ������棜�� ��� ����妬, ��ᯫ� :r ������ ** - - 1. ��ᯫ� :!dir ��� �� ��������嫜 櫠 �� TEST ��ᨮ�� ��� ����. - - 2. �������㩫� ��� ����� ��� ��� �⨦� ��� ���囘�. - -��������: ��櫦� �����⩜�� �� �㣘 3 �� ��嫜 �� �៞�� 1.5.3. - ���� ������嫜 ���� ���� ���� �� �៞�� ����. - - 3. �騘 �����㩫� �� ����� ��� TEST ����������餫�� ��� ������ :r TEST - 槦� TEST �夘� �� 椦�� ��� ����妬. - -��������: �� ����� ��� �����᫜ ��������嫘� �����餫�� ���� ��� ��婡���� - � ����☪. - - 4. ��� �� �������穜�� 櫠 �� ����� �����㟞��, ��� ��� ����� ��� - �������㩫� 櫠 ��ᨮ��� �騘 �� ���嚨��� ��� ���㣘��� 1.5.3, �� - ������ ��� � ⡛��� ��� ����妬. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.5 �������� - - - 1. :!������ ������� �� ��૜���� ������. - - ������ ��㩠�� ������嚣��� �夘� (MS-DOS): - :!dir - ���ᤠ�� �婫�� ��� �����暦�. - :!del ������ - �����᭜� �� ������. - - 2. :w ������ ��᭜� �� ���� ����� ��� Vim ��� �婡� �� 椦�� ������. - - 3. :#,#w ������ �靜� ��� ������ ��� # �⮨� # ��� ������. - - 4. :r ������ ������� �� ����� �婡�� ������ ��� �� ������ᢢ�� �⩘ - ��� ��⮦� ����� ���� ��� �� �⩞ ��� �����. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.6.1: � ������ ���������� - - - ** ���㩫� o ��� �� ���奜�� �� ������ ��� ��� ��� ����� ��� �� - �����嫜 �� ���ᩫ��� ����⤦�. ** - - 1. ��������婫� ��� ����� ���� ������� ������ ������⤞ �� --->. - - 2. ���㩫� o (����) ��� �� ���奜�� �� ������ ���� ��� ��� ����� ��� �� - �����嫜 �� ���ᩫ��� ����⤦�. - - 3. �騘 ������ᯫ� �� ������⤞ �� ---> ������ ��� ���㩫� ��� �� - ���嫜 ��� ��� ���ᩫ��� ����⤦�. - ----> After typing o the cursor is placed on the open line in Insert mode. - - 4. ��� �� ���奜�� �� ������ ���� ��� ��� �����, ���㩫� ���� ⤘ ������� - O, ���� ��� ⤘ ���� o. �����ᩫ� �� ���� ������� ������. -���嚜�� ������ ��� ��� ���� ���餫�� Shift-O 橦 � ����☪ �夘� ��� ������ - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.6.2: � ������ ��������� - - ** ���㩫� a ��� �� ���᚜�� ��壜�� ���� ��� �����. ** - - 1. ��������婫� ��� ����� ��� �⢦� ��� ��髞� ������ ������� - ������⤞ �� ---> ���餫�� $ ���� �������� ���ᩫ���. - - 2. ���㩫� ⤘ a (����) ��� �� �����⩜�� ��壜�� ���� ��� ��� ������㨘 - ��� �夘� ��� ��� ��� �����. (�� ������� A �����⫝̸� ��� �⢦� - ��� ������). - -�����ਫ਼: ���� �����皜� �� �᫞�� ��� i , ��� �������� ������㨘, �� - ��壜�� ��� ��������, , �����-�����, ��� �⢦�, x, �椦 ��� - �椦 ��� �� �����⩜�� ��� �⢦� ��� ������! - - 3. �������驫� �騘 ��� ��髞 ������. �����驫� ��婞� 櫠 � �����㡞 �夘� - ������ 因� ���� ���ᩫ��� ����⤦� �� ��� ���ᩫ��� ��������, ���� - ��� �� �⩞ ��� ���᚜��� �� ��壜��. - ----> This line will allow you to practice ----> This line will allow you to practice appending text to the end of a line. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.6.3: ���� ������ ��� �������������� - - - ** ���㩫� ������� R ��� �� ���ᥜ�� ������櫜���� ��� ⤘� ������㨜�. ** - - 1. ��������婫� ��� ����� ���� ��髞 ������ ������� ������⤞ �� --->. - - 2. �������㩫� ��� ����� ���� ���� ��� ��髞� �⥞� ��� �夘� ����������� - ��� �� ��竜�� ������ ������⤞ �� ---> (� �⥞ 'last'). - - 3. ���㩫� �騘 R ��� ���ᥫ� �� ��梦��� ��� ����⤦� ���� ��髞 ������ - ��᭦���� ��� ��� �� ����� ��壜�� 驫� �� �ᤜ�� ��� ��髞 ������ 因� - �� �� ��竜��. - ----> To make the first line the same as the last on this page use the keys. ----> To make the first line the same as the second, type R and the new text. - - 4. �����驫� 櫠 櫘� ���᫜ ��� �� ���嫜, �����⤜� ������㧦�� - �������૦ ��壜��. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �៞�� 1.6.4: ������� �������� - - - ** ����婫� �� ������� ⫩� 驫� � ����㫞�� � � �������ᩫ��� �� ������ - �� ������� ����-�������� ** - - 1. �ᥫ� ��� 'ignore' ���ᚦ����: - /ignore - �����婫� ������ ���� ���餫�� �� ��㡫�� n. - - 2. �⩫� ��� ������� 'ic' (Ignore case) ��᭦����: - :set ic - - 3. �ᥫ� �騘 ���� ��� 'ignore' ���餫��: n - �����婫� ��� ����㫞�� ������ ��棘 ���� ���餫�� �� ��㡫�� n - - 4. �⩫� ��� ������� 'hlsearch' ��� 'incsearch': - :set hls is - - 5. ���᚜�� �騘 ���� ��� ������ ����㫞���, ��� ��嫜 �� �����夜� - /ignore - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.6 �������� - - - 1. ���餫�� o ���嚜� �� ������ ���� ��� ��� ����� ��� ��������� ��� - ����� ���� ������� ������ �� ���ᩫ��� ����⤦�. - - 2. ���㩫� a ��� �� ���᚜�� ��壜�� ���� ��� ������㨘 ���� ���� �夘� - � ����☪. ���餫�� ������� A ���棘�� �����⫝̸� ��壜�� ��� �⢦� - ��� ������. - - 3. ���餫�� ������� R ���⨮���� ���� ���ᩫ�� �������ᩫ���� �⮨� �� - ������� �� ��� �� ��⢟��. - - 4. ��᭦���� ":set xxx" ����坜� ��� ������� "xxx". - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ 1.7: ON-LINE ������� �������� - - - ** ����������㩫� �� on-line �穫��� ��㟜��� ** - - � Vim ⮜� ⤘ ���������� on-line �穫��� ��㟜���. ��� �� �����㩜�, - �����ᩫ� �᧦�� ��� �� ���: - - ���㩫� �� ��㡫�� (�� ⮜�� �᧦��) - - ���㩫� �� ��㡫�� (�� ⮜�� �᧦��) - - ��ᯫ� :help - - ��ᯫ� :q ��� �� ���婜�� �� ���៬�� ��� ��㟜���. - - �����嫜 �� ���嫜 ��㟜�� ��� �� �ៜ ������壜��, �夦���� �� ���ᣜ��� - ���� ������ ":help". �����ᩫ� ���� (��� ����᫜ �� ���᫜ ): - - :help w - :help c_ Το πλήκτρο l είναι δεξιά και κινεί στα δεξιά. - j Το πλήκτρο j μοιάζει με βελάκι προς τα κάτω. - v - - 1. Μετακινείστε τον δρομέα τριγύρω στην οθόνη μέχρι να νοιώθετε άνετα. - - 2. Κρατήστε πατημένο το κάτω πλήκτρο (j) μέχρι να επαναληφθεί. ----> Τώρα ξέρετε πώς να μετακινηθείτε στο επόμενο μάθημα. - - 3. Χρησιμοποιώντας το κάτω πλήκτρο, μετακινηθείτε στο Μάθημα 1.1.2. - -Σημείωση: Αν αμφιβάλλετε για κάτι που πατήσατε, πατήστε για να βρεθείτε - στην Κανονική Κατάσταση. Μετά πατήστε ξανά την εντολή που θέλατε. - -Σημείωση: Τα πλήκτρα του δρομέα θα πρέπει επίσης να δουλεύουν. Αλλά με τα hjkl - θα μπορείτε να κινηθείτε πολύ γρηγορότερα, μόλις τα συνηθίσετε. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.1.2: ΜΠΑΙΝΟΝΤΑΣ ΚΑΙ ΒΓΑΙΝΟΝΤΑΣ ΣΤΟΝ VIM - - !! ΣΗΜΕΙΩΣΗ: Πριν εκτελέσετε κάποιο από τα βήματα, διαβάστε όλο το μάθημα!! - - 1. Πατήστε το πλήκτρο (για να είστε σίγουρα στην Κανονική Κατάσταση). - - 2. Πληκτρολογήστε: :q! . - ----> Αυτό εξέρχεται από τον συντάκτη ΧΩΡΙΣ να σώσει όποιες αλλαγές έχετε κάνει. - Αν θέλετε να σώσετε τις αλλαγές και να εξέρθετε πληκτρολογήστε: - :wq - - 3. Όταν δείτε την προτροπή του φλοιού, πληκτρολογήστε την εντολή με την οποία - μπήκατε σε αυτήν την περιήγηση. Μπορεί να είναι: vimtutor - Κανονικά θα χρησιμοποιούσατε: vim tutor - ----> 'vim' σημαίνει εισαγωγή στον συντάκτη vim, 'tutor' είναι το αρχείο που - θέλουμε να διορθώσουμε. - - 4. Αν έχετε απομνημονεύσει αυτά τα βήματα και έχετε αυτοπεποίθηση, εκτελέστε - τα βήματα 1 έως 3 για να βγείτε και να μπείτε ξανά στον συντάκτη. Μετά - μετακινήστε τον δρομέα κάτω στο Μάθημα 1.1.3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.1.3: ΔΙΟΡΘΩΣΗ ΚΕΙΜΕΝΟΥ - ΔΙΑΓΡΑΦΗ - - ** Όσο είστε στην Κανονική Κατάσταση πατήστε x για να διαγράψετε τον - χαρακτήρα κάτω από τον δρομέα. ** - - 1. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - - 2. Για να διορθώσετε τα λάθη, κινείστε τον δρομέα μέχρι να είναι πάνω από - τον χαρακτήρα που θα διαγραφεί. - - 3. Πατήστε το πλήκτρο x για να διαγράψετε τον ανεπιθύμητο χαρακτήρα. - - 4. Επαναλάβετε τα βήματα 2 μέχρι 4 μέχρι η πρόταση να είναι σωστή. - ----> The ccow jumpedd ovverr thhe mooon. - - 5. Τώρα που η γραμμή είναι σωστή, πηγαίντε στο Μάθημα 1.1.4. - -ΣΗΜΕΙΩΣΗ: Καθώς διατρέχετε αυτήν την περιήγηση, προσπαθήστε να μην - απομνημονεύετε, μαθαίνετε με τη χρήση. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.1.4: ΔΙΟΡΘΩΣΗ ΚΕΙΜΕΝΟΥ - ΠΑΡΕΜΒΟΛΗ - - ** Όσο είστε σε Κανονική Κατάσταση πατήστε i για να παρεμβάλλετε κείμενο. ** - - 1. Μετακινείστε τον δρομέα μέχρι την πρώτη γραμμή παρακάτω σημειωμένη με --->. - - 2. Για να κάνετε την πρώτη γραμμή ίδια με την δεύτερη, μετακινείστε τον - δρομέα πάνω στον πρώτο χαρακτήρα ΜΕΤΑ από όπου θα παρεμβληθεί το κείμενο. - - 3. Πατήστε το i και πληκτρολογήστε τις απαραίτητες προσθήκες. - - 4. Καθώς διορθώνετε κάθε λάθος πατήστε για να επιστρέψετε στην - Κανονική Κατάσταση. Επαναλάβετε τα βήματα 2 μέχρι 4 για να διορθώσετε - την πρόταση. - ----> There is text misng this . ----> There is some text missing from this line. - - 5. Όταν είστε άνετοι με την παρεμβολή κειμένου μετακινηθείτε στην - παρακάτω περίληψη. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ΜΑΘΗΜΑ 1.1 ΠΕΡΙΛΗΨΗ - - - 1. Ο δρομέας κινείται χρησιμοποιώντας είτε τα πλήκτρα δρομέα ή τα hjkl. - h (αριστέρα) j (κάτω) k (πάνω) l (δεξιά) - - 2. Για να μπείτε στον Vim (από την προτροπή %) γράψτε: vim ΑΡΧΕΙΟ - - 3. Για να βγείτε γράψτε: :q! για απόρριψη των αλλαγών. - Ή γράψτε: :wq για αποθήκευση των αλλαγών. - - 4. Για να διαγράψετε έναν χαρακτήρα κάτω από τον δρομέα σε - Κανονική Κατάσταση πατήστε: x - - 5. Για να εισάγετε κείμενο στον δρομέα όσο είστε σε Κανονική Κατάσταση γράψτε: - i πληκτρολογήστε το κείμενο - -ΣΗΜΕΙΩΣΗ: Πατώντας θα τοποθετηθείτε στην Κανονική Κατάσταση ή θα - ακυρώσετε μία ανεπιθύμητη και μερικώς ολοκληρωμένη εντολή. - -Τώρα συνεχίστε με το Μάθημα 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.2.1: ΕΝΤΟΛΕΣ ΔΙΑΓΡΑΦΗΣ - - ** Γράψτε dw για να διαγράψετε μέχρι το τέλος μίας λέξης. ** - - 1. Πατήστε για να βεβαιωθείτε ότι είστε στην Κανονική Κατάσταση. - - 2. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - - 3. Πηγαίνετε τον δρομέα στην αρχή της λέξης που πρέπει να διαγραφεί. - - 4. Γράψτε dw για να κάνετε την λέξη να εξαφανιστεί. - -ΣΗΜΕΙΩΣΗ: Τα γράμματα dw θα εμφανιστούν στην τελευταία γραμμή της οθόνης όσο - τα πληκτρολογείτε. Αν γράψατε κάτι λάθος, πατήστε και - ξεκινήστε από την αρχή. - ----> There are a some words fun that don't belong paper in this sentence. - - 5. Επαναλάβετε τα βήματα 3 και 4 μέχρι η πρόταση να είναι σωστή και - πηγαίνετε στο Μάθημα 1.2.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.2.2: ΠΕΡΙΣΣΟΤΕΡΕΣ ΕΝΤΟΛΕΣ ΔΙΑΓΡΑΦΗΣ - - ** Πληκτρολογήστε d$ για να διαγράψετε μέχρι το τέλος της γραμμής. ** - - 1. Πατήστε για να βεβαιωθείτε ότι είστε στην Κανονική Κατάσταση. - - 2. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - - 3. Μετακινείστε τον δρομέα στο τέλος της σωστής γραμμής (ΜΕΤΑ την πρώτη . ). - - 4. Πατήστε d$ για να διαγράψετε μέχρι το τέλος της γραμμής. - ----> Somebody typed the end of this line twice. end of this line twice. - - 5. Πηγαίνετε στο Μάθημα 1.2.3 για να καταλάβετε τι συμβαίνει. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.2.3: ΠΕΡΙ ΕΝΤΟΛΩΝ ΚΑΙ ΑΝΤΙΚΕΙΜΕΝΩΝ - - -Η μορφή της εντολής διαγραφής d είναι ως εξής: - - [αριθμός] d αντικείμενο Ή d [αριθμός] αντικείμενο - Όπου: - αριθμός - πόσες φορές θα εκτελεστεί η εντολή (προαιρετικό, εξ' ορισμού=1). - d - η εντολή της διαγραφής. - αντικείμενο - πάνω σε τι θα λειτουργήσει η εντολή (παρακάτω λίστα). - - Μία μικρή λίστα από αντικείμενα: - w - από τον δρομέα μέχρι το τέλος της λέξης, περιλαμβάνοντας το διάστημα. - e - από τον δρομέα μέχρι το τέλος της λέξης, ΧΩΡΙΣ το διάστημα. - $ - από τον δρομέα μέχρι το τέλος της γραμμής. - -ΣΗΜΕΙΩΣΗ: Για τους τύπους της περιπέτειας, πατώντας απλώς το αντικείμενο όσο - είστε στην Κανονική Κατάσταση χωρίς κάποια εντολή θα μετακινήσετε - τον δρομέα όπως καθορίζεται στην λίστα αντικειμένων. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.2.4: ΜΙΑ ΕΞΑΙΡΕΣΗ ΣΤΗΝ 'ΕΝΤΟΛΗ-ΑΝΤΙΚΕΙΜΕΝΟ' - - ** Πληκτρολογήστε dd για να διαγράψετε όλη τη γραμμή. ** - - Εξαιτίας της συχνότητας της διαγραφής ολόκληρης γραμμής, οι σχεδιαστές - του Vim αποφάσισαν ότι θα ήταν ευκολότερο να γράφετε απλώς δύο d στη - σειρά για να διαγράψετε μία γραμμή. - - 1. Μετακινείστε τον δρομέα στη δεύτερη γραμμή της παρακάτω φράσης. - 2. Γράψτε dd για να διαγράψετε τη γραμμή. - 3. Τώρα μετακινηθείτε στην τέταρτη γραμμή. - 4. Γράψτε 2dd (θυμηθείτε αριθμός-εντολή-αντικείμενο) για να - διαγράψετε δύο γραμμές. - - 1) Roses are red, - 2) Mud is fun, - 3) Violets are blue, - 4) I have a car, - 5) Clocks tell time, - 6) Sugar is sweet - 7) And so are you. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.2.5: Η ΕΝΤΟΛΗ ΑΝΑΙΡΕΣΗΣ - - ** Πατήστε u για να αναιρέσετε τις τελευταίες εντολές, - U για να διορθώσετε όλη τη γραμμή. ** - - 1. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με ---> και - τοποθετήστε τον πάνω στο πρώτο λάθος. - 2. Πατήστε x για να διαγράψετε τον πρώτο ανεπιθύμητο χαρακτήρα. - 3. Τώρα πατήστε u για να αναιρέσετε την τελευταία εκτελεσμένη εντολή. - 4. Αυτή τη φορά διορθώστε όλα τα λάθη στη γραμμή χρησιμοποιώντας την εντολή x. - 5. Τώρα πατήστε ένα κεφαλαίο U για να επιστρέψετε τη γραμμή στην αρχική - της κατάσταση. - 6. Τώρα πατήστε u μερικές φορές για να αναιρέσετε την U και - προηγούμενες εντολές. - 7. Τώρα πατήστε CTRL-R (κρατώντας πατημένο το πλήκτρο CTRL καθώς πατάτε το R) - μερικές φορές για να επαναφέρετε τις εντολές (αναίρεση των αναιρέσεων). - ----> Fiix the errors oon thhis line and reeplace them witth undo. - - 8. Αυτές είναι πολύ χρήσιμες εντολές. Τώρα πηγαίνετε στην - Περίληψη του Μαθήματος 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ΜΑΘΗΜΑ 1.2 ΠΕΡΙΛΗΨΗ - - - 1. Για να διαγράψετε από τον δρομέα μέχρι το τέλος λέξης γράψτε: dw - - 2. Για να διαγράψετε από τον δρομέα μέχρι το τέλος γραμμής γράψτε: d$ - - 3. Για να διαγράψετε ολόκληρη τη γραμμή γράψτε: dd - - 4. Η μορφή για μία εντολή στην Κανονική Κατάσταση είναι: - - [αριθμός] εντολή αντικείμενο Ή εντολή [αριθμός] αντικείμενο - όπου: - αριθμός - πόσες φορές να επαναληφθεί η εντολή - εντολή - τι να γίνει, όπως η d για διαγραφή - αντικείμενο - πάνω σε τι να ενεργήσει η εντολή, όπως w (λέξη), - $ (τέλος της γραμμής), κτλ. - - 5. Για να αναιρέσετε προηγούμενες ενέργειες, πατήστε: u (πεζό u) - Για να αναιρέσετε όλες τις αλλαγές στη γραμμή, πατήστε: U (κεφαλαίο U) - Για να αναιρέσετε τις αναιρέσεις, πατήστε: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.3.1: Η ΕΝΤΟΛΗ ΤΟΠΟΘΕΤΗΣΗΣ - - - ** Πατήστε p για να τοποθετήσετε την τελευταία διαγραφή μετά τον δρομέα. ** - - 1. Μετακινείστε τον δρομέα στην πρώτη γραμμή της παρακάτω ομάδας. - - 2. Πατήστε dd για να διαγράψετε τη γραμμή και να την αποθηκεύσετε σε - προσωρινή μνήμη του Vim. - - 3. Μετακινείστε τον δρομέα στη γραμμή ΠΑΝΩ από εκεί που θα πρέπει να πάει - η διαγραμμένη γραμμή. - - 4. Όσο είστε σε Κανονική Κατάσταση, πατήστε p για να βάλετε τη γραμμή. - - 5. Επαναλάβετε τα βήματα 2 έως 4 για να βάλετε όλες τις γραμμές στη - σωστή σειρά. - - d) Can you learn too? - b) Violets are blue, - c) Intelligence is learned, - a) Roses are red, - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.3.2: Η ΕΝΤΟΛΗ ΑΝΤΙΚΑΤΑΣΤΑΣΗΣ - - - ** Πατήστε r και χαρακτήρα για να αλλάξετε αυτόν που είναι - κάτω από τον δρομέα. ** - - 1. Μετακινείστε τον δρομέα στην πρώτη γραμμή παρακάτω σημειωμένη με --->. - - 2. Μετακινείστε τον δρομέα έτσι ώστε να είναι πάνω στο πρώτο λάθος. - - 3. Πατήστε r και μετά τον χαρακτήρα ο οποίος διορθώνει το λάθος. - - 4. Επαναλάβετε τα βήματα 2 και 3 μέχρι να είναι σωστή η πρώτη γραμμή. - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. Τώρα πηγαίνετε στο Μάθημα 1.3.2. - -ΣΗΜΕΙΩΣΗ: Να θυμάστε ότι πρέπει να μαθαίνετε με τη χρήση, και όχι με - την απομνημόνευση. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.3.3: Η ΕΝΤΟΛΗ ΑΛΛΑΓΗΣ - - ** Για να αλλάξετε τμήμα ή όλη τη λέξη, πατήστε cw . ** - - 1. Μετακινείστε τον δρομέα στην πρώτη γραμμή παρακάτω σημειωμένη με --->. - - 2. Τοποθετήστε τον δρομέα πάνω στο u της λέξης lubw. - - 3. Πατήστε cw και τη σωστή λέξη (στην περίπτωση αυτή, γράψτε 'ine'.) - - 4. Πατήστε και πηγαίνετε στο επόμενο λάθος (στον πρώτο - χαρακτήρα προς αλλαγή). - - 5. Επαναλάβετε τα βήματα 3 και 4 μέχρις ότου η πρώτη πρόταση να είναι - ίδια με τη δεύτερη. - ----> This lubw has a few wptfd that mrrf changing usf the change command. ----> This line has a few words that need changing using the change command. - -Παρατηρείστε ότι η cw όχι μόνο αντικαθιστάει τη λέξη, αλλά σας εισάγει -επίσης σε παρεμβολή. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.3.4: ΠΕΡΙΣΣΟΤΕΡΕΣ ΑΛΛΑΓΕΣ ΜΕ c - - - ** Η εντολή αλλαγής χρησιμοποιείται με τα ίδια αντικείμενα της διαγραφής. ** - - - 1. Η εντολή αλλαγής δουλεύει με τον ίδιο τρόπο όπως η διαγραφή. Η μορφή είναι: - - [αριθμός] c αντικείμενο Ή c [αριθμός] αντικείμενο - - 2. Τα αντικείμενα είναι πάλι τα ίδια, όπως w (λέξη), $ (τέλος γραμμής), κτλ. - - 3. Μετακινηθείτε στην πρώτη γραμμή παρακάτω σημειωμένη με --->. - - 4. Μετακινείστε τον δρομέα στο πρώτο λάθος. - - 5. Γράψτε c$ για να κάνετε το υπόλοιπο της γραμμής ίδιο με τη δεύτερη - και πατήστε . - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ΜΑΘΗΜΑ 1.3 ΠΕΡΙΛΗΨΗ - - - 1. Για να τοποθετήσετε κείμενο που μόλις έχει διαγραφεί, πατήστε p . - Αυτό τοποθετεί το διαγραμμένο κείμενο ΜΕΤΑ τον δρομέα (αν διαγράφτηκε - γραμμή θα πάει μετά στη γραμμή κάτω από τον δρομέα. - - 2. Για να αντικαταστήσετε τον χαρακτήρα κάτω από τον δρομέα, πατήστε r - και μετά τον χαρακτήρα που θα αντικαταστήσει τον αρχικό. - - 3. Η εντολή αλλαγής σας επιτρέπει να αλλάξετε το καθορισμένο αντικείμενο - από τον δρομέα μέχρι το τέλος του αντικείμενο. Π.χ. γράψτε cw για να - αλλάξετε από τον δρομέα μέχρι το τέλος της λέξης, c$ για να αλλάξετε - μέχρι το τέλος γραμμής. - - 4. Η μορφή για την αλλαγή είναι: - - [αριθμός] c αντικείμενο Ή c [αριθμός] αντικείμενο - -Τώρα συνεχίστε με το επόμενο μάθημα. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.4.1: ΘΕΣΗ ΚΑΙ ΚΑΤΑΣΤΑΣΗ ΑΡΧΕΙΟΥ - - - ** Πατήστε CTRL-g για να εμφανιστεί η θέση σας στο αρχείο και η κατάστασή του. - Πατήστε SHIFT-G για να πάτε σε μία γραμμή στο αρχείο. ** - - Σημείωση: Διαβάστε ολόκληρο το μάθημα πριν εκτελέσετε κάποιο από τα βήματα!! - - 1. Κρατήστε πατημένο το πλήκτρο Ctrl και πατήστε g . Μία γραμμή κατάστασης - θα εμφανιστεί στο κάτω μέρος της σελίδας με το όνομα αρχείου και τη - γραμμή που είστε. Θυμηθείτε τον αριθμό γραμμής για το Βήμα 3. - - 2. Πατήστε shift-G για να μετακινηθείτε στο τέλος του αρχείου. - - 3. Πατήστε τον αριθμό της γραμμής που ήσασταν και μετά shift-G. Αυτό θα - σας επιστρέψει στη γραμμή που ήσασταν πριν πατήσετε για πρώτη φορά Ctrl-g. - (Όταν πληκτρολογείτε τους αριθμούς, ΔΕΝ θα εμφανίζονται στην οθόνη). - - 4. Αν νοιώθετε σίγουρος για αυτό, εκτελέστε τα βήματα 1 έως 3. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.4.2: Η ΕΝΤΟΛΗ ΑΝΑΖΗΤΗΣΗΣ - - - ** Πατήστε / ακολουθούμενο από τη φράση που ψάχνετε. ** - - 1. Σε Κανονική Κατάσταση πατήστε τον χαρακτήρα / . Παρατηρήστε ότι αυτός και - ο δρομέας εμφανίζονται στο κάτω μέρος της οθόνης όπως με την εντολή : . - - 2. Τώρα γράψτε 'errroor' . Αυτή είναι η λέξη που θέλετε να ψάξετε. - - 3. Για να ψάξετε ξανά για την ίδια φράση, πατήστε απλώς n . - Για να ψάξετε την ίδια φράση στην αντίθετη κατεύθυνση, πατήστε Shift-N . - - 4. Αν θέλετε να ψάξετε για μία φράση προς τα πίσω, χρησιμοποιήστε την εντολή ? αντί της / . - ----> Όταν η αναζήτηση φτάσει στο τέλος του αρχείου θα συνεχίσει από την αρχή. - - "errroor" is not the way to spell error; errroor is an error. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.4.3: ΕΥΡΕΣΗ ΤΑΙΡΙΑΣΤΩΝ ΠΑΡΕΝΘΕΣΕΩΝ - - - ** Πατήστε % για να βρείτε την αντίστοιχη ), ], ή } . ** - - 1. Τοποθετήστε τον δρομέα σε κάποια (, [, ή { στην παρακάτω γραμμή - σημειωμένη με --->. - - 2. Τώρα πατήστε τον χαρακτήρα % . - - 3. Ο δρομέας θα πρέπει να είναι στην αντίστοιχη παρένθεση ή αγκύλη. - - 4. Πατήστε % για να μετακινήσετε τον δρομέα πίσω στην πρώτη αγκύλη - (του ζευγαριού). - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - -ΣΗΜΕΙΩΣΗ: Αυτό είναι πολύ χρήσιμο στην αποσφαλμάτωση ενός προγράμματος - με μη ταιριαστές παρενθέσεις! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.4.4: ΕΝΑΣ ΤΡΟΠΟΣ ΓΙΑ ΑΛΛΑΓΗ ΛΑΘΩΝ - - - ** Γράψτε :s/old/new/g για να αλλάξετε το 'new' με το 'old'. ** - - 1. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - - 2. Γράψτε :s/thee/the . Σημειώστε ότι αυτή η εντολή αλλάζει μόνο - την πρώτη εμφάνιση στη γραμμή. - - 3. Τώρα γράψτε :s/thee/the/g εννοώντας γενική αντικατάσταση στη - γραμμή. Αυτό αλλάζει όλες τις εμφανίσεις επί της γραμμής. - ----> thee best time to see thee flowers is in thee spring. - - 4. Για να αλλάξετε κάθε εμφάνιση μίας συμβολοσειράς μεταξύ δύο γραμμών, - γράψτε :#,#s/old/new/g όπου #,# οι αριθμοί των δύο γραμμών. - Γράψτε :%s/old/new/g για να αλλάξετε κάθε εμφάνιση σε όλο το αρχείο. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ΜΑΘΗΜΑ 1.4 ΠΕΡΙΛΗΨΗ - - - 1. Το Ctrl-g εμφανίζει τη θέση σας στο αρχείο και την κατάστασή του. - Το Shift-G πηγαίνει στο τέλος του αρχείου. Ένας αριθμός γραμμής - ακολουθούμενος από Shift-G πηγαίνει σε εκείνη τη γραμμή. - - 2. Γράφοντας / ακολουθούμενο από μία φράση ψάχνει προς τα ΜΠΡΟΣΤΑ για - τη φράση. Γράφοντας ? ακολουθούμενο από μία φράση ψάχνει προς τα ΠΙΣΩ - για τη φράση. Μετά από μία αναζήτηση πατήστε n για να βρείτε την - επόμενη εμφάνιση προς την ίδια κατεύθυνση ή Shift-N για να ψάξετε - προς την αντίθετη κατεύθυνση. - - 3. Πατώντας % όσο ο δρομέας είναι πάνω σε μία (,),[,],{, ή } εντοπίζει - το αντίστοιχο ταίρι του ζευγαριού. - - 4. Για αντικατάσταση με new του πρώτου old στη γραμμή γράψτε :s/old/new - Για αντικατάσταση με new όλων των 'old' στη γραμμή γράψτε :s/old/new/g - Για αντικατάσταση φράσεων μεταξύ δύο # γραμμών γράψτε :#,#s/old/new/g - Για αντικατάσταση όλων των εμφανίσεων στο αρχείο γράψτε :%s/old/new/g - Για ερώτηση επιβεβαίωσης κάθε φορά προσθέστε ένα 'c' "%s/old/new/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.5.1: ΠΩΣ ΕΚΤΕΛΩ ΜΙΑ ΕΞΩΤΕΡΙΚΗ ΕΝΤΟΛΗ - - -** Γράψτε :! ακολουθούμενο από μία εξωτερική εντολή για να την εκτελέσετε. ** - - 1. Πατήστε την οικεία εντολή : για να θέσετε τον δρομέα στο κάτω μέρος - της οθόνης. Αυτό σας επιτρέπει να δώσετε μία εντολή. - - 2. Τώρα πατήστε το ! (θαυμαστικό). Αυτό σας επιτρέπει να εκτελέσετε - οποιαδήποτε εξωτερική εντολή του φλοιού. - - 3. Σαν παράδειγμα γράψτε ls μετά από το ! και πατήστε . Αυτό θα - σας εμφανίσει μία λίστα του καταλόγου σας, ακριβώς σαν να ήσασταν στην - προτροπή του φλοιού. Ή χρησιμοποιήστε :!dir αν το ls δεν δουλεύει. - ----> Σημείωση: Είναι δυνατόν να εκτελέσετε οποιαδήποτε εξωτερική εντολή - με αυτόν τον τρόπο. - ----> Σημείωση: Όλες οι εντολές : πρέπει να τερματίζονται πατώντας το . - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.5.2: ΠΕΡΙΣΣΟΤΕΡΑ ΠΕΡΙ ΕΓΓΡΑΦΗΣ ΑΡΧΕΙΩΝ - - - ** Για να σώσετε τις αλλάγες που κάνατε στο αρχείο, γράψτε :w ΑΡΧΕΙΟ. ** - - 1. Γράψτε :!dir ή :!ls για να πάρετε μία λίστα του καταλόγου σας. - Ήδη ξέρετε ότι πρέπει να πατήσετε μετά από αυτό. - - 2. Διαλέξτε ένα όνομα αρχείου που δεν υπάρχει ακόμα, όπως το TEST. - - 3. Τώρα γράψτε: :w TEST (όπου TEST είναι το όνομα αρχείου που διαλέξατε). - - 4. Αυτό σώζει όλο το αρχείο (vim Tutor) με το όνομα TEST. Για να το - επαληθεύσετε, γράψτε ξανά :!dir για να δείτε τον κατάλογό σας. - ----> Σημειώστε ότι αν βγαίνατε από τον Vim και μπαίνατε ξανά με το όνομα - αρχείου TEST, το αρχείο θα ήταν ακριβές αντίγραφο του tutor όταν το σώσατε. - - 5. Τώρα διαγράψτε το αρχείο γράφοντας (MS-DOS): :!del TEST - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.5.3: ΕΠΙΛΕΚΤΙΚΗ ΕΝΤΟΛΗ ΕΓΓΡΑΦΗΣ - - - ** Για να σώσετε τμήμα του αρχείου, γράψτε :#,# w ΑΡΧΕΙΟ ** - - 1. Άλλη μια φορά, γράψτε :!dir ή :!ls για να πάρετε μία λίστα από τον - κατάλογό σας και διαλέξτε ένα κατάλληλο όνομα αρχείου όπως το TEST. - - 2. Μετακινείστε τον δρομέα στο πάνω μέρος αυτής της σελίδας και πατήστε - Ctrl-g για να βρείτε τον αριθμό αυτής της γραμμής. - ΝΑ ΘΥΜΑΣΤΕ ΑΥΤΟΝ ΤΟΝ ΑΡΙΘΜΟ! - - 3. Τώρα πηγαίνετε στο κάτω μέρος της σελίδας και πατήστε Ctrl-g ξανά. - ΝΑ ΘΥΜΑΣΤΕ ΚΑΙ ΑΥΤΟΝ ΤΟΝ ΑΡΙΘΜΟ! - - 4. Για να σώσετε ΜΟΝΟ ένα τμήμα σε αρχείο, γράψτε :#,# w TEST - όπου #,# οι δύο αριθμοί που απομνημονεύσατε (πάνω,κάτω) και TEST το - όνομα του αρχείου σας. - - 5. Ξανά, δείτε ότι το αρχείο είναι εκεί με την :!dir αλλά ΜΗΝ το διαγράψετε. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.5.4: ΑΝΑΚΤΩΝΤΑΣ ΚΑΙ ΕΝΩΝΟΝΤΑΣ ΑΡΧΕΙΑ - - - ** Για να εισάγετε τα περιεχόμενα ενός αρχείου, γράψτε :r ΑΡΧΕΙΟ ** - - 1. Γράψτε :!dir για να βεβαιωθείτε ότι το TEST υπάρχει από πριν. - - 2. Τοποθετήστε τον δρομέα στο πάνω μέρος της σελίδας. - -ΣΗΜΕΙΩΣΗ: Αφότου εκτελέσετε το Βήμα 3 θα δείτε το Μάθημα 1.5.3. - Μετά κινηθείτε ΚΑΤΩ ξανά προς το μάθημα αυτό. - - 3. Τώρα ανακτήστε το αρχείο σας TEST χρησιμοποιώντας την εντολή :r TEST - όπου TEST είναι το όνομα του αρχείου. - -ΣΗΜΕΙΩΣΗ: Το αρχείο που ανακτάτε τοποθετείται ξεκινώντας εκεί που βρίσκεται - ο δρομέας. - - 4. Για να επαληθεύσετε ότι το αρχείο ανακτήθηκε, πίσω τον δρομέα και - παρατηρήστε ότι υπάρχουν τώρα δύο αντίγραφα του Μαθήματος 1.5.3, το - αρχικό και η έκδοση του αρχείου. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ΜΑΘΗΜΑ 1.5 ΠΕΡΙΛΗΨΗ - - - 1. :!εντολή εκτελεί μία εξωτερική εντολή. - - Μερικά χρήσιμα παραδείγματα είναι (MS-DOS): - :!dir - εμφάνιση λίστας ενός καταλόγου. - :!del ΑΡΧΕΙΟ - διαγράφει το ΑΡΧΕΙΟ. - - 2. :w ΑΡΧΕΙΟ γράφει το τρέχων αρχείο του Vim στο δίσκο με όνομα ΑΡΧΕΙΟ. - - 3. :#,#w ΑΡΧΕΙΟ σώζει τις γραμμές από # μέχρι # στο ΑΡΧΕΙΟ. - - 4. :r ΑΡΧΕΙΟ ανακτεί το αρχείο δίσκου ΑΡΧΕΙΟ και το παρεμβάλλει μέσα - στο τρέχον αρχείο μετά από τη θέση του δρομέα. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.6.1: Η ΕΝΤΟΛΗ ΑΝΟΙΓΜΑΤΟΣ - - - ** Πατήστε o για να ανοίξετε μία γραμμή κάτω από τον δρομέα και να - βρεθείτε σε Κατάσταση Κειμένου. ** - - 1. Μετακινείστε τον δρομέα στην παρακάτω γραμμή σημειωμένη με --->. - - 2. Πατήστε o (πεζό) για να ανοίξετε μία γραμμή ΚΑΤΩ από τον δρομέα και να - βρεθείτε σε Κατάσταση Κειμένου. - - 3. Τώρα αντιγράψτε τη σημειωμένη με ---> γραμμή και πατήστε για να - βγείτε από την Κατάσταση Κειμένου. - ----> After typing o the cursor is placed on the open line in Insert mode. - - 4. Για να ανοίξετε μία γραμμή ΠΑΝΩ από τον δρομέα, πατήστε απλά ένα κεφαλαίο - O, αντί για ένα πεζό o. Δοκιμάστε το στην παρακάτω γραμμή. -Ανοίγετε γραμμή πάνω από αυτήν πατώντας Shift-O όσο ο δρομέας είναι στη γραμμή - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.6.2: Η ΕΝΤΟΛΗ ΠΡΟΣΘΗΚΗΣ - - ** Πατήστε a για να εισάγετε κείμενο ΜΕΤΑ τον δρομέα. ** - - 1. Μετακινείστε τον δρομέα στο τέλος της πρώτης γραμμής παρακάτω - σημειωμένη με ---> πατώντας $ στην Κανονική Κατάσταση. - - 2. Πατήστε ένα a (πεζό) για να προσθέσετε κείμενο ΜΕΤΑ από τον χαρακτήρα - που είναι κάτω από τον δρομέα. (Το κεφαλαίο A προσθέτει στο τέλος - της γραμμής). - -Σημείωση: Αυτό αποφεύγει το πάτημα του i , τον τελευταίο χαρακτήρα, το - κείμενο της εισαγωγής, , δρομέα-δεξιά, και τέλος, x, μόνο και - μόνο για να προσθέσετε στο τέλος της γραμμής! - - 3. Συμπληρώστε τώρα την πρώτη γραμμή. Σημειώστε επίσης ότι η προσθήκη είναι - ακριβώς ίδια στην Κατάσταση Κειμένου με την Κατάσταση Εισαγωγής, εκτός - από τη θέση που εισάγεται το κείμενο. - ----> This line will allow you to practice ----> This line will allow you to practice appending text to the end of a line. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.6.3: ΑΛΛΗ ΕΚΔΟΣΗ ΤΗΣ ΑΝΤΙΚΑΤΑΣΤΑΣΗΣ - - - ** Πατήστε κεφαλαίο R για να αλλάξετε περισσότερους από έναν χαρακτήρες. ** - - 1. Μετακινείστε τον δρομέα στην πρώτη γραμμή παρακάτω σημειωμένη με --->. - - 2. Τοποθετήστε τον δρομέα στην αρχή της πρώτης λέξης που είναι διαφορετική - από τη δεύτερη γραμμή σημειωμένη με ---> (η λέξη 'last'). - - 3. Πατήστε τώρα R και αλλάξτε το υπόλοιπο του κειμένου στην πρώτη γραμμή - γράφοντας πάνω από το παλιό κείμενο ώστε να κάνετε την πρώτη γραμμή ίδια - με τη δεύτερη. - ----> To make the first line the same as the last on this page use the keys. ----> To make the first line the same as the second, type R and the new text. - - 4. Σημειώστε ότι όταν πατάτε για να βγείτε, παραμένει οποιοδήποτε - αναλλοίωτο κείμενο. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Μάθημα 1.6.4: ΡΥΘΜΙΣΗ ΕΠΙΛΟΓΗΣ - - - ** Ρυθμίστε μία επιλογή έτσι ώστε η αναζήτηση ή η αντικατάσταση να αγνοεί - τη διαφορά πεζών-κεφαλαίων ** - - 1. Ψάξτε για 'ignore' εισάγοντας: - /ignore - Συνεχίστε αρκετές φορές πατώντας το πλήκτρο n. - - 2. Θέστε την επιλογή 'ic' (Ignore case) γράφοντας: - :set ic - - 3. Ψάξτε τώρα ξανά για 'ignore' πατώντας: n - Συνεχίστε την αναζήτηση μερικές ακόμα φορές πατώντας το πλήκτρο n - - 4. Θέστε τις επιλογές 'hlsearch' και 'incsearch': - :set hls is - - 5. Εισάγετε τώρα ξανά την εντολή αναζήτησης, και δείτε τι συμβαίνει - /ignore - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ΜΑΘΗΜΑ 1.6 ΠΕΡΙΛΗΨΗ - - - 1. Πατώντας o ανοίγει μία γραμμή ΚΑΤΩ από τον δρομέα και τοποθετεί τον - δρομέα στην ανοιχτή γραμμή σε Κατάσταση Κειμένου. - - 2. Πατήστε a για να εισάγετε κείμενο ΜΕΤΑ τον χαρακτήρα στον οποίο είναι - ο δρομέας. Πατώντας κεφαλαίο A αυτόματα προσθέτει κείμενο στο τέλος - της γραμμής. - - 3. Πατώντας κεφαλαίο R εισέρχεται στην Κατάσταη Αντικατάστασης μέχρι να - πατηθεί το και να εξέλθει. - - 4. Γράφοντας ":set xxx" ρυθμίζει την επιλογή "xxx". - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ΜΑΘΗΜΑ 1.7: ON-LINE ΕΝΤΟΛΕΣ ΒΟΗΘΕΙΑΣ - - - ** Χρησιμοποιήστε το on-line σύστημα βοήθειας ** - - Ο Vim έχει ένα περιεκτικό on-line σύστημα βοήθειας. Για να ξεκινήσει, - δοκιμάστε κάποιο από τα τρία: - - πατήστε το πλήκτρο (αν έχετε κάποιο) - - πατήστε το πλήκτρο (αν έχετε κάποιο) - - γράψτε :help - - Γράψτε :q για να κλείσετε το παράθυρο της βοήθειας. - - Μπορείτε να βρείτε βοήθεια πάνω σε κάθε αντικείμενο, δίνοντας μία παράμετρο - στην εντολή ":help". Δοκιμάστε αυτά (μην ξεχνάτε να πατάτε ): - - :help w - :help c_ La klavo l estas la plej dekstra kaj movas dekstren. j La klavo j aspektas kiel malsuprena sago. v - 1. Movu la kursoron sur la ekrano �is kiam vi sentas vin komforta. + 1. Movu la kursoron sur la ekrano ĝis kiam vi sentas vin komforta. - 2. Premu la klavon (j) �is kiam �i ripetas. - Vi nun scias, kiel movi�i al la sekvanta leciono + 2. Premu la klavon (j) ĝis kiam ĝi ripetas. + Vi nun scias, kiel moviĝi al la sekvanta leciono - 3. Uzante la malsuprenan klavon, movi�u al la leciono 1.2. + 3. Uzante la malsuprenan klavon, moviĝu al la leciono 1.2. RIMARKO: Se vi dubas pri tio, kion vi premis, premu por reiri al - la normala re�imo. Tiam repremu la deziratan komandon. + la normala reĝimo. Tiam repremu la deziratan komandon. -RIMARKO: La klavoj de la kursoro devus anka� funkcii. Sed uzante hjkl, - vi kapablos movi�i pli rapide post kiam vi kutimi�os. +RIMARKO: La klavoj de la kursoro devus ankaŭ funkcii. Sed uzante hjkl, + vi kapablos moviĝi pli rapide post kiam vi kutimiĝos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.1.2: ELIRI EL VIM - !! RIMARKO: Anta� ol plenumi iujn subajn pa�ojn ajn, legu la tutan lecionon!! + !! RIMARKO: Antaŭ ol plenumi iujn subajn paŝojn ajn, legu la tutan lecionon!! - 1. Premu la klavon (por certigi, ke vi estas en normala re�imo). + 1. Premu la klavon (por certigi, ke vi estas en normala reĝimo). 2. Tajpu: :q! . - Tio eliras el la rekdaktilo, SEN konservi la �an�ojn, kiujn vi faris. + Tio eliras el la rekdaktilo, SEN konservi la ŝanĝojn, kiujn vi faris. - 3. Kiam vi vidas la �elinviton, tajpu la komandon kiun vi uzis por eniri - en �i tiu instruilo. Tio estus: vimtutor + 3. Kiam vi vidas la ŝelinviton, tajpu la komandon kiun vi uzis por eniri + en ĉi tiu instruilo. Tio estus: vimtutor - 4. Se vi memoris tiujn pa�ojn kaj sentas vin memfida, plenumu la pa�ojn - 1 �is 3 por eliri kaj reeniri la redaktilon. + 4. Se vi memoris tiujn paŝojn kaj sentas vin memfida, plenumu la paŝojn + 1 ĝis 3 por eliri kaj reeniri la redaktilon. -RIMARKO: :q! eliras sen konservi la �an�ojn, kiujn vi faris. - Post kelkaj lecionoj, vi lernos kiel konservi la �an�ojn al dosiero. +RIMARKO: :q! eliras sen konservi la ŝanĝojn, kiujn vi faris. + Post kelkaj lecionoj, vi lernos kiel konservi la ŝanĝojn al dosiero. - 5. Movu la kursoron suben �is la leciono 1.3. + 5. Movu la kursoron suben ĝis la leciono 1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.1.3: REDAKTO DE TEKSTO - FORVI�O + Leciono 1.1.3: REDAKTO DE TEKSTO - FORVIŜO - ** Premu x por forvi�i la signon sub la kursoro. ** + ** Premu x por forviŝi la signon sub la kursoro. ** 1. Movu la kursoron al la suba linio markita per --->. - 2. Por korekti la erarojn, movu la kursoron �is kiam �i estas sur la - forvi�enda signo. + 2. Por korekti la erarojn, movu la kursoron ĝis kiam ĝi estas sur la + forviŝenda signo. - 3. Premu la klavon x por forvi�i la nedeziratan signon. + 3. Premu la klavon x por forviŝi la nedeziratan signon. - 4. Ripetu pa�ojn 2 �is 4 �is kiam la frazo estas �usta. + 4. Ripetu paŝojn 2 ĝis 4 ĝis kiam la frazo estas ĝusta. ---> La boovinno saaltiss ssur laa luuno. - 5. Post kiam la linio estas �usta, iru al la leciono 1.4 + 5. Post kiam la linio estas ĝusta, iru al la leciono 1.4 RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. @@ -100,17 +100,17 @@ RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. 1. Movu la kursoron al la unua suba linio markita per --->. 2. Por igi la unuan linion sama kiel la dua, movu la kursoron sur la unuan - signon anta� kie la teksto estas enmetenda. + signon antaŭ kie la teksto estas enmetenda. 3. Premu i kaj tajpu la bezonatajn aldonojn. 4. Premu kiam la eraroj estas korektitaj por reiri al la normala - re�imo. Ripetu la pa�ojn 2 �is 4 por korekti la frazon. + reĝimo. Ripetu la paŝojn 2 ĝis 4 por korekti la frazon. ----> Mank en �i linio. ----> Mankas teksto en �i tiu linio. +---> Mank en ĉi linio. +---> Mankas teksto en ĉi tiu linio. - 5. Kiam vi sentas vin komforta pri enmeto de teksto, movi�u al la + 5. Kiam vi sentas vin komforta pri enmeto de teksto, moviĝu al la leciono 1.5. @@ -127,17 +127,17 @@ RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. 2. Premu majusklan A kaj tajpu la bezonatajn aldonojn. 3. Post kiam la teksto estas aldonita, premu por reiri al la normala - re�imo. + reĝimo. 4. Movu la kursoron al la dua linio markita per ---> kaj ripetu la - pa�ojn 2 kaj 3 por korekti la frazon. + paŝojn 2 kaj 3 por korekti la frazon. ---> Mankas teksto el ti Mankas teksto el tiu linio. ----> Mankas anka� teks - Mankas anka� teksto �i tie. +---> Mankas ankaŭ teks + Mankas ankaŭ teksto ĉi tie. - 5 Kiam vi sentas vin komforta pri postaldono de teksto, movi�u al la + 5 Kiam vi sentas vin komforta pri postaldono de teksto, moviĝu al la leciono 1.6 @@ -146,95 +146,95 @@ RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. ** Uzu :wq por konservi dosieron kaj eliri. ** - !! RIMARKO: Anta� ol plenumi iun suban pa�on ajn, legu la tutan lecionon!! + !! RIMARKO: Antaŭ ol plenumi iun suban paŝon ajn, legu la tutan lecionon!! 1. Eliru el la instruilo kiel vi faris en la leciono 1.1.2: :q! - A�, se vi havas atingon al alia terminalo, faru tion, kio sekvas tie. + Aŭ, se vi havas atingon al alia terminalo, faru tion, kio sekvas tie. - 2. �e la �elinvito, tajpu �i tiun komandon: vim tutor - 'vim' estas la komando por lan�i la redaktilon Vim, 'tutor' estas la + 2. Ĉe la ŝelinvito, tajpu ĉi tiun komandon: vim tutor + 'vim' estas la komando por lanĉi la redaktilon Vim, 'tutor' estas la dosiernomo de la dosiero, kiun vi volas redakti. Uzu dosieron, kiu - �an�eblas. + ŝanĝeblas. - 3. Enmetu kaj forvi�u tekston, kiel vi lernis en la anta�aj lecionoj. + 3. Enmetu kaj forviŝu tekston, kiel vi lernis en la antaŭaj lecionoj. - 4. Konservu la dosieron kun �an�oj kaj eliru el Vim per: :wq + 4. Konservu la dosieron kun ŝanĝoj kaj eliru el Vim per: :wq - 5. Se vi eliris el la instruilo vimtutor en pa�o 1, restartigu la instruilon - vimtutor kaj movi�u suben al la sekvanta resumo. + 5. Se vi eliris el la instruilo vimtutor en paŝo 1, restartigu la instruilon + vimtutor kaj moviĝu suben al la sekvanta resumo. - 6. Post kiam vi legis la suprajn pa�ojn, kaj komprenis ilin: faru ilin. + 6. Post kiam vi legis la suprajn paŝojn, kaj komprenis ilin: faru ilin. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.1 RESUMO - 1. La kursoro movi�as a� per la sagoklavoj, a� per la klavoj hjkl. + 1. La kursoro moviĝas aŭ per la sagoklavoj, aŭ per la klavoj hjkl. h (liven) j (suben) k (supren) l (dekstren) - 2. Por lan�i Vim el la �elinvito, tajpu: vim DOSIERNOMO + 2. Por lanĉi Vim el la ŝelinvito, tajpu: vim DOSIERNOMO - 3. Por eliri el Vim, tajpu: :q! por rezigni la �an�ojn + 3. Por eliri el Vim, tajpu: :q! por rezigni la ŝanĝojn - 4. Por forvi�i la signojn �e la pozicio de la kursoro, tajpu: x + 4. Por forviŝi la signojn ĉe la pozicio de la kursoro, tajpu: x - 5. Por enmeti a� postaldoni tekston, tajpu: + 5. Por enmeti aŭ postaldoni tekston, tajpu: i tajpu enmetendan tekston - enmetas tekston anta� la kursoro + enmetas tekston antaŭ la kursoro A tajpu la postaldonendan tekston postaldonas post la kursoro -RIMARKO: Premo de iras al la normala re�imo, a� rezignas la - nedeziratan a� parte plenumita komando. +RIMARKO: Premo de iras al la normala reĝimo, aŭ rezignas la + nedeziratan aŭ parte plenumita komando. -Nun da�rigu al la leciono 2. +Nun daŭrigu al la leciono 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.1: KOMANDOJ DE FORVI�O + Leciono 1.2.1: KOMANDOJ DE FORVIŜO - ** Tajpu dw por forvi�i vorton. ** + ** Tajpu dw por forviŝi vorton. ** - 1. Premu por certigi, ke vi estas en normala re�imo. + 1. Premu por certigi, ke vi estas en normala reĝimo. 2. Movu la kursoron al la suba linio markita per --->. - 3. Movu la kursoron al la komenco de vorto, kiu forvi�endas. + 3. Movu la kursoron al la komenco de vorto, kiu forviŝendas. - 4. Tajpu dw por forvi�i la vorton. + 4. Tajpu dw por forviŝi la vorton. RIMARKO: La litero d aperos en la lasta linio sur la ekrano kiam vi - tajpas �in. Vim atendas �is kiam vi tajpas w . Se vi vidas + tajpas ĝin. Vim atendas ĝis kiam vi tajpas w . Se vi vidas alian signon ol d vi tajpis ion mise; premu kaj rekomencu. ----> Estas iuj vortoj kiuj Zamenhof ne devus esti akuzativo en �i tiu frazo. +---> Estas iuj vortoj kiuj Zamenhof ne devus esti akuzativo en ĉi tiu frazo. - 5. Ripetu pa�ojn 3 kaj 4 �is kiam la frazo estas �usta kaj movi�u al la + 5. Ripetu paŝojn 3 kaj 4 ĝis kiam la frazo estas ĝusta kaj moviĝu al la leciono 2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.2: PLIAJ KOMANDOJ DE FORVI�O + Leciono 1.2.2: PLIAJ KOMANDOJ DE FORVIŜO - ** Tajpu d$ por forvi�i la finon de la linio. ** + ** Tajpu d$ por forviŝi la finon de la linio. ** - 1. Premu por certigi, ke vi estas en normala re�imo. + 1. Premu por certigi, ke vi estas en normala reĝimo. 2. Movu la kursoron al la suba linio markita per --->. - 3. Movu la kursoron �e la fino de la �usta linio (POST la unua . ). + 3. Movu la kursoron ĉe la fino de la ĝusta linio (POST la unua . ). - 4. Tajpu d$ por forivi�i �is la fino de la linio. + 4. Tajpu d$ por foriviŝi ĝis la fino de la linio. ----> Iu tajpis la finon de �i tiu linio dufoje. fino de �i tiu linio dufoje. +---> Iu tajpis la finon de ĉi tiu linio dufoje. fino de ĉi tiu linio dufoje. - 5. Movi�u al la leciono 2.3 por kompreni kio okazas. + 5. Moviĝu al la leciono 2.3 por kompreni kio okazas. @@ -242,8 +242,8 @@ Nun da Leciono 1.2.3: PRI OPERATOROJ KAJ MOVOJ - Multaj komandoj, kiuj �an�as la tekston, estas faritaj de operatoro kaj - movo. La formato de komando de forvi�o per la operatoro de forvi�o d + Multaj komandoj, kiuj ŝanĝas la tekston, estas faritaj de operatoro kaj + movo. La formato de komando de forviŝo per la operatoro de forviŝo d estas kiel sekvas: d movo @@ -253,52 +253,52 @@ Nun da movo - estas tio, pri kio la operatoro operacios (listigita sube) Mallonga listo de movoj: - w - �is la komenco de la sekvanta vorto, krom �ia unua signo. - e - �is la fino de la nuna vorto, krom la lasta signo. - $ - �is la fino de la linio, krom la lasta signo. + w - ĝis la komenco de la sekvanta vorto, krom ĝia unua signo. + e - ĝis la fino de la nuna vorto, krom la lasta signo. + $ - ĝis la fino de la linio, krom la lasta signo. - Do tajpo de 'de' forvi�os ekde la kursoro �is la fino de la vorto. + Do tajpo de 'de' forviŝos ekde la kursoro ĝis la fino de la vorto. -RIMARKO: Premo de nur la movo en Normala re�imo sen operatoro movos +RIMARKO: Premo de nur la movo en Normala reĝimo sen operatoro movos la kursoron kiel specifite. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.2.4: UZI NOMBRON POR MOVO - ** Tajpo de nombro anta� movo ripetas �in la�foje. ** + ** Tajpo de nombro antaŭ movo ripetas ĝin laŭfoje. ** - 1. Movu la kursoron �e la komenco de la suba linio markita per --->. + 1. Movu la kursoron ĉe la komenco de la suba linio markita per --->. - 2. Tajpu 2w por movi la kursoron je du vortoj anta�en. + 2. Tajpu 2w por movi la kursoron je du vortoj antaŭen. - 3. Tajpu 3e por movi la kursoron �e la fino de la tria vorto anta�en. + 3. Tajpu 3e por movi la kursoron ĉe la fino de la tria vorto antaŭen. - 4. Tajpu 0 (nul) por movi�i �e la komenco de la linio. + 4. Tajpu 0 (nul) por moviĝi ĉe la komenco de la linio. - 5. Ripetu pa�ojn 2 �is 3 kun malsamaj nombroj. + 5. Ripetu paŝojn 2 ĝis 3 kun malsamaj nombroj. ----> Tio estas nur linio kun vortoj, kie vi povas movi�i. +---> Tio estas nur linio kun vortoj, kie vi povas moviĝi. - 6. Movi�u al la leciono 2.5. + 6. Moviĝu al la leciono 2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.5: UZI NOMBRON POR FORVI�I PLI + Leciono 1.2.5: UZI NOMBRON POR FORVIŜI PLI - ** Tajpo de nombro kun operatoro ripetas �in la�foje. ** + ** Tajpo de nombro kun operatoro ripetas ĝin laŭfoje. ** - En la kombina�o de la operatoro de forvi�o, kaj movo kiel menciita - �i-supre, eblas aldoni nombron anta� la movo por pli forvi�i: + En la kombinaĵo de la operatoro de forviŝo, kaj movo kiel menciita + ĉi-supre, eblas aldoni nombron antaŭ la movo por pli forviŝi: d nombro movo - 1. Movu la kursoron �e la unua MAJUSKLA vorto en la linio markita per --->. + 1. Movu la kursoron ĉe la unua MAJUSKLA vorto en la linio markita per --->. - 2. Tajpu d2w por forvi�i la du MAJUSKLAJN vortojn. + 2. Tajpu d2w por forviŝi la du MAJUSKLAJN vortojn. - 3. Ripetu pa�ojn 1 �is 2 per malsama nombro por forvi�i la sinsekvajn + 3. Ripetu paŝojn 1 ĝis 2 per malsama nombro por forviŝi la sinsekvajn MAJUSKLAJN vortojn per unu komando. ---> Tiu AB CDE linio FGHI JK LMN OP de vortoj estas Q RS TUV purigita. @@ -308,22 +308,22 @@ RIMARKO: Premo de nur la movo en Normala re Leciono 1.2.6: OPERACII SUR LINIOJ - ** Tajpu dd por forvi�i tutan linion. ** + ** Tajpu dd por forviŝi tutan linion. ** - Pro la ofteco de forvi�o de tuta linio, la verkisto de Vi decidis, ke - estus pli facile simple tajpi du d-ojn por forvi�i linion. + Pro la ofteco de forviŝo de tuta linio, la verkisto de Vi decidis, ke + estus pli facile simple tajpi du d-ojn por forviŝi linion. 1. Movu la kursoron sur la duan linion en la suba frazo. - 2. Tajpu dd por forvi�i la linion. - 3. Nun movi�u al la kvara linio. - 4. Tajpu 2dd por forvi�i du liniojn. + 2. Tajpu dd por forviŝi la linion. + 3. Nun moviĝu al la kvara linio. + 4. Tajpu 2dd por forviŝi du liniojn. ----> 1) Rozoj estas ru�aj, ----> 2) �limo estas amuza, +---> 1) Rozoj estas ruĝaj, +---> 2) Ŝlimo estas amuza, ---> 3) Violoj estas bluaj, ----> 4) Mi havas a�ton, ----> 5) Horlo�oj diras kioma horo estas, ----> 6) Sukero estas dol�a, +---> 4) Mi havas aŭton, +---> 5) Horloĝoj diras kioma horo estas, +---> 6) Sukero estas dolĉa, ---> 7) Kaj tiel vi estas. @@ -333,43 +333,43 @@ RIMARKO: Premo de nur la movo en Normala re ** Premu u por malfari la lastajn komandojn, U por ripari la tutan linion. ** - 1. Movu la kursoron �e la suba linio markita per ---> kaj metu �in sur + 1. Movu la kursoron ĉe la suba linio markita per ---> kaj metu ĝin sur la unuan eraron. - 2. Tajpu x por forvi�i la unuan nedeziratan signon. + 2. Tajpu x por forviŝi la unuan nedeziratan signon. 3. Nun tajpu u por malfari la lastan plenumitan komandon. - 4. �i-foje, riparu �iujn erarojn en la linio kaj �ia originala stato. - 5. Nun tajpu majusklan U por igi la linion al �ia anta�a stato. - 6. Nun tajpu u kelkfoje por malfari la U kaj anta�ajn komandojn. + 4. Ĉi-foje, riparu ĉiujn erarojn en la linio kaj ĝia originala stato. + 5. Nun tajpu majusklan U por igi la linion al ĝia antaŭa stato. + 6. Nun tajpu u kelkfoje por malfari la U kaj antaŭajn komandojn. 7. Nun tajpu CTRL-R (premante la CTRL klavon dum vi premas R) kelkfoje por refari la komandojn (malfari la malfarojn). ----> Koorektii la erarojn sur tiuu �i liniio kaj remettu illlin per malfaro. +---> Koorektii la erarojn sur tiuu ĉi liniio kaj remettu illlin per malfaro. - 8. Tiuj estas tre utilaj komandoj. Nun movi�u al la leciono 1.2 RESUMO. + 8. Tiuj estas tre utilaj komandoj. Nun moviĝu al la leciono 1.2 RESUMO. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.2 RESUMO - 1. Por forvi�i ekde la kursoro �is la sekvanta vorto, tajpu: dw - 2. Por forvi�i ekde la kursoro �is la fino de la linio, tajpu: d$ - 3. Por forvi�i tutan linion, tajpu: dd + 1. Por forviŝi ekde la kursoro ĝis la sekvanta vorto, tajpu: dw + 2. Por forviŝi ekde la kursoro ĝis la fino de la linio, tajpu: d$ + 3. Por forviŝi tutan linion, tajpu: dd - 4. Por ripeti movon, anta�metu nombron: 2w - 5. La formato de �an�a komando estas: + 4. Por ripeti movon, antaŭmetu nombron: 2w + 5. La formato de ŝanĝa komando estas: operatoro [nombro] movo kie: - operatoro - estas tio, kio farendas, kiel d por forvi�i + operatoro - estas tio, kio farendas, kiel d por forviŝi [nombro] - estas opcia nombro por ripeti la movon movo - movas sur la teksto por operacii, kiel ekzemple w (vorto), - $ (�is fino de linio), ktp. + $ (ĝis fino de linio), ktp. - 6. Por movi�i al la komenco de la linio, uzu nul: 0 + 6. Por moviĝi al la komenco de la linio, uzu nul: 0 - 7. Por malfari anta�ajn agojn, tajpu: u (minuskla u) - Por malfari �iujn �an�ojn sur la linio, tajpu: U (majuskla U) + 7. Por malfari antaŭajn agojn, tajpu: u (minuskla u) + Por malfari ĉiujn ŝanĝojn sur la linio, tajpu: U (majuskla U) Por refari la malfarojn, tajpu: CTRL-R @@ -377,111 +377,111 @@ RIMARKO: Premo de nur la movo en Normala re Leciono 3.1 LA KOMANDO DE METO - ** Tajpu p por meti tekston forvi�itan anta�e post la kursoro. ** + ** Tajpu p por meti tekston forviŝitan antaŭe post la kursoro. ** - 1. Movu la kursoron �e la unua suba linio markita per --->. + 1. Movu la kursoron ĉe la unua suba linio markita per --->. - 2. Tajpu dd por forvi�i la linion kaj konservi �in ene de re�istro de Vim. + 2. Tajpu dd por forviŝi la linion kaj konservi ĝin ene de reĝistro de Vim. - 3. Movu la kursoron �e la linio c), SUPER kie la forvi�ita linio devus esti. + 3. Movu la kursoron ĉe la linio c), SUPER kie la forviŝita linio devus esti. 4. Tajpu p por meti la linion sub la kursoron. - 5. Ripetu la pa�ojn 2 �is 4 por meti �iujn liniojn en la �usta ordo. + 5. Ripetu la paŝojn 2 ĝis 4 por meti ĉiujn liniojn en la ĝusta ordo. ----> d) �u anka� vi povas lerni? +---> d) Ĉu ankaŭ vi povas lerni? ---> b) Violoj estas bluaj, ---> c) Inteligenteco lerneblas, ----> a) Rozoj estas ru�aj, +---> a) Rozoj estas ruĝaj, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 3.2 LA KOMANDO DE ANSTATA�IGO + Leciono 3.2 LA KOMANDO DE ANSTATAŬIGO - ** Tajpu rx por anstata�igi la signon �e la kursoro per x . ** + ** Tajpu rx por anstataŭigi la signon ĉe la kursoro per x . ** - 1. Movu la kursoron �e la unua suba linio markita per --->. + 1. Movu la kursoron ĉe la unua suba linio markita per --->. - 2. Movu la kursoron �is la unua eraro. + 2. Movu la kursoron ĝis la unua eraro. 3. Tajpu r kaj la signon, kiu devus esti tie. - 4. Ripetu pa�ojn 2 kaj 3 �is kiam la unua linio egalas la duan. + 4. Ripetu paŝojn 2 kaj 3 ĝis kiam la unua linio egalas la duan. ----> Kiem tiu lanio estis tajpita, iu pramis la na�uftajn klovojn! ----> Kiam tiu linio estis tajpita, iu premis la ne�ustajn klavojn! +---> Kiem tiu lanio estis tajpita, iu pramis la naĝuftajn klovojn! +---> Kiam tiu linio estis tajpita, iu premis la neĝustajn klavojn! - 5. Nun movi�u al la leciono 3.3. + 5. Nun moviĝu al la leciono 3.3. RIMARKO: Memoru, ke vi devus lerni per uzo, kaj ne per memorado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 3.3 LA OPERATORO DE �AN�O + Leciono 3.3 LA OPERATORO DE ŜANĜO - ** Por �an�i �is la fino de la vorto, tajpu ce . ** + ** Por ŝanĝi ĝis la fino de la vorto, tajpu ce . ** - 1. Movu la kursoron �e la unua suba linio markita per --->. + 1. Movu la kursoron ĉe la unua suba linio markita per --->. 2. Metu la kursoron sur la d en lduzw - 3. Tajpu ce kaj la �ustan vorton (en tiu �i kazo, tajpu inio ). + 3. Tajpu ce kaj la ĝustan vorton (en tiu ĉi kazo, tajpu inio ). - 4. Premu kaj movi�u al la sekvanta signo, kiu bezonas �an�on. + 4. Premu kaj moviĝu al la sekvanta signo, kiu bezonas ŝanĝon. - 5. Ripetu la pa�ojn 3 kaj 4 �is kiam la unua frazo egalas la duan. + 5. Ripetu la paŝojn 3 kaj 4 ĝis kiam la unua frazo egalas la duan. ----> Tiu lduzw havas kelkajn vortojn, kiii bezas �an�on per la �an�ooto. ----> Tiu linio havas kelkajn vortojn, kiuj bezonas �an�on per la �an�operatoro. +---> Tiu lduzw havas kelkajn vortojn, kiii bezas ŝanĝon per la ŝanĝooto. +---> Tiu linio havas kelkajn vortojn, kiuj bezonas ŝanĝon per la ŝanĝoperatoro. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 3.4 PLIAJ �AN�OJ PER c + Leciono 3.4 PLIAJ ŜANĜOJ PER c - ** La operatoro de �an�o uzeblas kun la sama movo kiel forvi�o. ** + ** La operatoro de ŝanĝo uzeblas kun la sama movo kiel forviŝo. ** - 1. La operatoro de �an�o funkcias sammaniere kiel forvi�o. La formato estas: + 1. La operatoro de ŝanĝo funkcias sammaniere kiel forviŝo. La formato estas: c [nombro] movo 2. La movoj estas samaj, kiel ekzemple w (vorto) kaj $ (fino de linio). - 3. Movi�u �e la unua suba linio markita per --->. + 3. Moviĝu ĉe la unua suba linio markita per --->. 4. Movu la kursoron al la unua eraro. 5. Tajpu c$ kaj tajpu la reston de la linio kiel la dua kaj premu . ----> La fino de �i tiu linio bezonas helpon por igi �in same kiel la dua. ----> La fino de �i tiu linio bezonas korektojn per uzo de la komando c$ +---> La fino de ĉi tiu linio bezonas helpon por igi ĝin same kiel la dua. +---> La fino de ĉi tiu linio bezonas korektojn per uzo de la komando c$ -RIMARKO: Vi povas uzi la klavon Retropa�o por korekti erarojn dum vi tajpas. +RIMARKO: Vi povas uzi la klavon Retropaŝo por korekti erarojn dum vi tajpas. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.3 RESUMO - 1. Por remeti tekston, kiun vi �us forvi�is, tajpu p. Tio metas la - forvi�itan tekston POST la kursoro (se linio estis forvi�ita, �i + 1. Por remeti tekston, kiun vi ĵus forviŝis, tajpu p. Tio metas la + forviŝitan tekston POST la kursoro (se linio estis forviŝita, ĝi iros en la linion sub la kursoro). - 2. Por anstata�igi la signon sub la kursoro, tajpu r kaj tiam la signon + 2. Por anstataŭigi la signon sub la kursoro, tajpu r kaj tiam la signon kion vi deziras havi tie. - 3. La operatoro de �an�o ebligas al vi �an�i ekde la kursoro, �is kie - la movo iras. Ekz. tajpu ce por �an�i ekde la kursoro �is la fino - de la vorto, c$ por �an�i �is la fino de la linio. + 3. La operatoro de ŝanĝo ebligas al vi ŝanĝi ekde la kursoro, ĝis kie + la movo iras. Ekz. tajpu ce por ŝanĝi ekde la kursoro ĝis la fino + de la vorto, c$ por ŝanĝi ĝis la fino de la linio. - 4. La formato de �an�o estas: + 4. La formato de ŝanĝo estas: c [nombro] movo -Nun da�rigu al la sekvanta leciono. +Nun daŭrigu al la sekvanta leciono. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -489,99 +489,99 @@ Nun da ** Tajpu CTRL-G por montri vian pozicion en la dosiero kaj la dosierstaton. - Tajpu G por movi�i al linio en la dosiero. ** + Tajpu G por moviĝi al linio en la dosiero. ** - RIMARKO: Legu la tutan lecionon anta� ol plenumi iun pa�on ajn!! + RIMARKO: Legu la tutan lecionon antaŭ ol plenumi iun paŝon ajn!! 1. Premu la klavon Ctrl kaj premu g . Oni nomas tion CTRL-G. - Mesa�o aperos �e la suba parto de la pa�o kun la dosiernomo kaj la - pozicio en la dosiero. Memoru la numeron de la linio por pa�o 3. + Mesaĝo aperos ĉe la suba parto de la paĝo kun la dosiernomo kaj la + pozicio en la dosiero. Memoru la numeron de la linio por paŝo 3. - RIMARKO: Vi eble vidas la pozicion de la kursoro �e la suba dekstra + RIMARKO: Vi eble vidas la pozicion de la kursoro ĉe la suba dekstra angulo de la ekrano. Tio okazas kiam la agordo 'ruler' estas - �altita (vidu :help 'ruler') + ŝaltita (vidu :help 'ruler') - 2. Premu G por movi�i �e la subo de la dosiero. - Tajpu gg por movi�i �e la komenco de la dosiero. + 2. Premu G por moviĝi ĉe la subo de la dosiero. + Tajpu gg por moviĝi ĉe la komenco de la dosiero. 3. Tajpu la numeron de la linio kie vi estis kaj poste G . Tio removos vin al la linio, kie vi estis kiam vi unue premis CTRL-G. - 4. Se vi sentas vin komforta, plenumu pa�ojn 1 �is 3. + 4. Se vi sentas vin komforta, plenumu paŝojn 1 ĝis 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.4.2: LA KOMANDO DE SER�O + Leciono 1.4.2: LA KOMANDO DE SERĈO - ** Tajpu / kaj poste frazon por ser�i la frazon. ** + ** Tajpu / kaj poste frazon por serĉi la frazon. ** - 1. En normala re�imo, tajpu la / signon. Rimarku, ke �i kaj la kursoro - aperas �e la suba parto de la ekrano kiel por la : komando. + 1. En normala reĝimo, tajpu la / signon. Rimarku, ke ĝi kaj la kursoro + aperas ĉe la suba parto de la ekrano kiel por la : komando. 2. Nun tajpu 'errarro' . - Tio estas la vorto, kion vi volas ser�i. + Tio estas la vorto, kion vi volas serĉi. - 3. Por ser�i la saman frazon denove, simple tajpu n . - Por ser�i la saman frazon denove en la retrodirekto, tajpu N . + 3. Por serĉi la saman frazon denove, simple tajpu n . + Por serĉi la saman frazon denove en la retrodirekto, tajpu N . - 4. Por ser�i frazon en la retrodirekto, uzu ? anstata� / . + 4. Por serĉi frazon en la retrodirekto, uzu ? anstataŭ / . 5. Por reiri tien, el kie vi venis, premu CTRL-O (Premu Ctrl kaj o - literon o). Ripetu por pli retroiri. CTRL-I iras anta�en. + literon o). Ripetu por pli retroiri. CTRL-I iras antaŭen. ---> "errarro" ne estas maniero por literumi eraro; errarro estas eraro. -RIMARKO: Kiam la ser�o atingas la finon de la dosiero, �i da�ras �e la - komenco, krom se la agordo 'wrapscan' estas mal�altita. +RIMARKO: Kiam la serĉo atingas la finon de la dosiero, ĝi daŭras ĉe la + komenco, krom se la agordo 'wrapscan' estas malŝaltita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.4.3: SER�O DE KONGRUAJ KRAMPOJ + Leciono 1.4.3: SERĈO DE KONGRUAJ KRAMPOJ - ** Tajpu % por trovi kongruan ), ] a� } ** + ** Tajpu % por trovi kongruan ), ] aŭ } ** - 1. Poziciu la kursoron sur iun (, [ a� { en la linio markita per --->. + 1. Poziciu la kursoron sur iun (, [ aŭ { en la linio markita per --->. 2. Nun tajpu la % signon. - 3. La kursoro movi�as al la kongrua krampo. + 3. La kursoro moviĝas al la kongrua krampo. 4. Tajpu % por movi la kursoron al la alia kongrua krampo. 5. Movu la kursoron al la alia (, ), [, ], {, } kaj observu tion, kion % faras. ----> �i tiu ( estas testa linio kun (-oj, [-oj, ]-oj kaj {-oj, }-oj en �i. )) +---> Ĉi tiu ( estas testa linio kun (-oj, [-oj, ]-oj kaj {-oj, }-oj en ĝi. )) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.4.4: LA KOMANDO DE ANSTATA�IGO + Leciono 1.4.4: LA KOMANDO DE ANSTATAŭIGO - ** Tajpu :s/malnova/nova/g por anstata�igi 'nova' per 'malnova'. ** + ** Tajpu :s/malnova/nova/g por anstataŭigi 'nova' per 'malnova'. ** 1. Movu la kursoron al la suba linio markita per --->. - 2. Tajpu :s/laa/la . Rimarku, ke la komando �an�as nur la - unuan okaza�on de "laa" en la linio. + 2. Tajpu :s/laa/la . Rimarku, ke la komando ŝanĝas nur la + unuan okazaĵon de "laa" en la linio. 3. Nun tajpu :s/laa/la/g . Aldono de g opcio signifas mallokan - anstata�igon en la linio. �i �an�as �iujn okaza�ojn de "laa" en la + anstataŭigon en la linio. Ĝi ŝanĝas ĉiujn okazaĵojn de "laa" en la linio. ---> laa plej bona tempo por vidi florojn estas en laa printempo. - 4. Por �an�i �iujn okaza�ojn de iu �ena signo inter du linioj, + 4. Por ŝanĝi ĉiujn okazaĵojn de iu ĉena signo inter du linioj, tajpu :#,#s/malnova/nova/g kie #,# estas la numeroj de linioj de la - intervalo de la linioj kie la anstata�igo + intervalo de la linioj kie la anstataŭigo okazos. - Tajpu :%s/malnova/nova/g por �an�i �iujn okaza�ojn en la tuta + Tajpu :%s/malnova/nova/g por ŝanĝi ĉiujn okazaĵojn en la tuta dosiero. - Tajpu :s/malnova/nova/gc por trovi �iujn okaza�ojn en la tuta - dosiero, kun invitilo �u anstata�igi - a� ne. + Tajpu :s/malnova/nova/gc por trovi ĉiujn okazaĵojn en la tuta + dosiero, kun invitilo ĉu anstataŭigi + aŭ ne. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -592,20 +592,20 @@ RIMARKO: Kiam la ser numero G movas la kursoron al numero de tiu linio. gg movas la kursoron al la unua linio. - 2. Tajpo de / kaj frazon ser�as la frazon anta�en. - Tajpo de ? kaj frazon ser�as la frazon malanta�en. - Post ser�o, tajpu n por trovi la sekvantan okaza�on en la sama direkto a� - N por ser�i en la mala direkto. - CTRL-O movas vin al la anta�aj pozicioj, CTRL-I al la novaj pozicioj. + 2. Tajpo de / kaj frazon serĉas la frazon antaŭen. + Tajpo de ? kaj frazon serĉas la frazon malantaŭen. + Post serĉo, tajpu n por trovi la sekvantan okazaĵon en la sama direkto aŭ + N por serĉi en la mala direkto. + CTRL-O movas vin al la antaŭaj pozicioj, CTRL-I al la novaj pozicioj. - 3. Tajpo de % kiam la kursoro estas sur (,),[,],{ a� } movi�as al �ia + 3. Tajpo de % kiam la kursoro estas sur (,),[,],{ aŭ } moviĝas al ĝia kongruo. - 4. Por anstata�igi 'nova' en la unua 'malnova' en linio :s/malnova/nova - Por anstata�igi 'nova' en �iuj 'malnova'-oj en linio :s/malnova/nova/g - Por anstata�igi frazon inter du #-aj linioj :#,#s/malnova/nova/g - Por anstata�igi �iujn okaza�ojn en la dosiero :%s/malnova/nova/g - Por demandi konfirmon �iu-foje, aldonu 'c' :%s/malnova/nova/gc + 4. Por anstataŭigi 'nova' en la unua 'malnova' en linio :s/malnova/nova + Por anstataŭigi 'nova' en ĉiuj 'malnova'-oj en linio :s/malnova/nova/g + Por anstataŭigi frazon inter du #-aj linioj :#,#s/malnova/nova/g + Por anstataŭigi ĉiujn okazaĵojn en la dosiero :%s/malnova/nova/g + Por demandi konfirmon ĉiu-foje, aldonu 'c' :%s/malnova/nova/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -614,20 +614,20 @@ RIMARKO: Kiam la ser ** Tajpu :! sekvata de ekstera komando por plenumi la komandon. ** - 1. Tajpu la konatan komandon : por pozicii la kursoron �e la suba parto + 1. Tajpu la konatan komandon : por pozicii la kursoron ĉe la suba parto de la ekrano. Tio ebligas tajpadon de komando en komanda linio. 2. Nun tajpu la ! (krisigno) signon. Tio ebligas al vi plenumi iun - eksteran �elan komandon ajn. + eksteran ŝelan komandon ajn. 3. Ekzemple, tajpu ls post ! kaj tajpu . Tio listigos la - enhavon de la dosierujo, same kiel se vi estis en �ela invito. - A� uzu :!dir se ls ne funkcias. + enhavon de la dosierujo, same kiel se vi estis en ŝela invito. + Aŭ uzu :!dir se ls ne funkcias. -RIMARKO: Eblas plenumi iun eksteran komandon ajn tiamaniere, anka� kun +RIMARKO: Eblas plenumi iun eksteran komandon ajn tiamaniere, ankaŭ kun argumentoj. -RIMARKO: �iuj : komandoj devas fini�i per tajpo de +RIMARKO: Ĉiuj : komandoj devas finiĝi per tajpo de Ekde nun, ni ne plu mencios tion. @@ -635,25 +635,25 @@ RIMARKO: Leciono 1.5.2: PLI PRI KONSERVO DE DOSIERO - ** Por konservi la faritajn �an�ojn en la teksto, tajpu :w DOSIERNOMO. ** + ** Por konservi la faritajn ŝanĝojn en la teksto, tajpu :w DOSIERNOMO. ** - 1. Tajpu !dir a� !ls por akiri liston de via dosierujo. + 1. Tajpu !dir aŭ !ls por akiri liston de via dosierujo. Vi jam scias, ke vi devas tajpi post tio. - 2. Elektu dosieron, kiu ankora� ne ekzistas, kiel ekzemple TESTO. + 2. Elektu dosieron, kiu ankoraŭ ne ekzistas, kiel ekzemple TESTO. 3. Nun tajpu: :w TESTO (kie TESTO estas la elektita dosiernomo) 4. Tio konservas la tutan dosieron (instruilon de Vim) kun la nomo TESTO. - Por kontroli tion, tajpu :!dir a� :!ls denove por vidigi vian + Por kontroli tion, tajpu :!dir aŭ :!ls denove por vidigi vian dosierujon. -RIMARKO: Se vi volus eliri el Vim kaj restartigi �in denove per vim TESTO, +RIMARKO: Se vi volus eliri el Vim kaj restartigi ĝin denove per vim TESTO, la dosiero estus precize same kiel kopio de la instruilo kiam vi - konservis �in. + konservis ĝin. - 5. Nun forvi�u la dosieron tajpante (VINDOZO): :!del TESTO - a� (UNIKSO): :!rm TESTO + 5. Nun forviŝu la dosieron tajpante (VINDOZO): :!del TESTO + aŭ (UNIKSO): :!rm TESTO ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -665,20 +665,20 @@ RIMARKO: Se vi volus eliri el Vim kaj restartigi 1. Movu la kursoron al tiu linio. 2. Premu v kaj movu la kursoron al la kvina suba ero. Rimarku, ke la - teksto emfazi�as. + teksto emfaziĝas. - 3. Premu la : signon. �e la fino de la ekrano :'<,'> aperos. + 3. Premu la : signon. Ĉe la fino de la ekrano :'<,'> aperos. - 4. Tajpu w TESTO , kie TESTO estas dosiernomo, kiu ankora� ne ekzistas. - Kontrolu, ke vi vidas :'<,'>w TESTO anta� ol premi . + 4. Tajpu w TESTO , kie TESTO estas dosiernomo, kiu ankoraŭ ne ekzistas. + Kontrolu, ke vi vidas :'<,'>w TESTO antaŭ ol premi . 5. Vim konservos la apartigitajn liniojn al la dosiero TESTO. Uzu :dir - a� :!ls por vidigi �in. Ne forvi�u �in. Ni uzos �in en la sekvanta + aŭ :!ls por vidigi ĝin. Ne forviŝu ĝin. Ni uzos ĝin en la sekvanta leciono. RIMARKO: Premo de v komencas Viduman apartigon. Vi povas movi la kursoron - por pligrandigi a� malpligrandigi la apartigon. Tiam vi povas uzi - operatoron por plenumi ion kun la teksto. Ekzemple, d forvi�as + por pligrandigi aŭ malpligrandigi la apartigon. Tiam vi povas uzi + operatoron por plenumi ion kun la teksto. Ekzemple, d forviŝas la tekston. @@ -688,21 +688,21 @@ RIMARKO: Premo de v komencas Viduman apartigon. Vi povas movi la kursoron ** Por enmeti la enhavon de dosiero, tajpu :r DOSIERNOMON ** - 1. Movu la kursoron tuj super �i tiu linio. + 1. Movu la kursoron tuj super ĉi tiu linio. -RIMARKO: Post plenumo de pa�o 2, vi vidos tekston el la leciono 5.3. Tiam - movi�u SUBEN por vidi tiun lecionon denove. +RIMARKO: Post plenumo de paŝo 2, vi vidos tekston el la leciono 5.3. Tiam + moviĝu SUBEN por vidi tiun lecionon denove. 2. Nun akiru vian dosieron TESTO uzante la komandon :r TESTO kie TESTO estas la nomo de la dosiero, kiun vi uzis. La dosiero, kion vi akiras, estas metita sub la linio de la kursoro. - 3. Por kontroli, �u la dosiero akiri�is, retromovu la kursoron kaj rimarku, + 3. Por kontroli, ĉu la dosiero akiriĝis, retromovu la kursoron kaj rimarku, ke estas nun du kopioj de la leciono 5.3, la originala kaj la versio mem de la dosiero. RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, - :r !ls legas la eliron de la komando ls kaj metas �in sub la + :r !ls legas la eliron de la komando ls kaj metas ĝin sub la kursoron. @@ -715,7 +715,7 @@ RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, Iuj utilaj ekzemploj estas: (VINDOZO) (UNIKSO) :!dir :!ls - listigas dosierujon - :!del DOSIERNOMO :!rm DOSIERNOMO - forvi�as la dosieron DOSIERNOMO + :!del DOSIERNOMO :!rm DOSIERNOMO - forviŝas la dosieron DOSIERNOMO 2. :w DOSIERNOMO konservas la nunan dosieron de Vim al disko kun la nomo DOSIERNOMO. @@ -724,9 +724,9 @@ RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, dosiero DOSIERNOMO. 4. :r DOSIERNOMO akiras la dosieron DOSIERNOMO el la disko kaj metas - �in sub la pozicion de la kursoro. + ĝin sub la pozicion de la kursoro. - 5. :r !dir legas la eligon de la komando dir kaj metas �in sub la + 5. :r !dir legas la eligon de la komando dir kaj metas ĝin sub la pozicion de la kursoro. @@ -734,20 +734,20 @@ RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, Leciono 1.6.1: LA KOMANDO DE MALFERMO - ** Tajpu o por malfermi linion sub la kursoro kaj eniri Enmetan re�imon. ** + ** Tajpu o por malfermi linion sub la kursoro kaj eniri Enmetan reĝimon. ** 1. Movu la kursoron al la suba linio markita per --->. 2. Tajpu la minusklan literon o por malfermi linion SUB la kursoro kaj - eniri la Enmetan re�imon. + eniri la Enmetan reĝimon. - 3. Nun tajpu tekston kaj premu por eliri el la Enmeta re�imo. + 3. Nun tajpu tekston kaj premu por eliri el la Enmeta reĝimo. ----> Post tajpo de o la kursoro movi�as al la malfermata linio en - Enmeta re�imo. +---> Post tajpo de o la kursoro moviĝas al la malfermata linio en + Enmeta reĝimo. 4. Por malfermi linion SUPER la kursoro, nur tajpu majusklan O , - anstata� minusklan o. Provu tion per la suba linio. + anstataŭ minusklan o. Provu tion per la suba linio. ---> Malfermu linion SUPER tiu tajpante O dum la kursoro estas sur tiu linio. @@ -758,105 +758,105 @@ RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, ** Tajpu a por enmeti POST la kursoro. ** - 1. Movu la kursoron �e la komenco de la linio markita per --->. + 1. Movu la kursoron ĉe la komenco de la linio markita per --->. - 2. Premu e �is kiam la kursoro estas �e la fino de li. + 2. Premu e ĝis kiam la kursoro estas ĉe la fino de li. 3. Tajpu a (minuskle) por aldoni tekston POST la kursoro. - 4. Kompletigu la vorton same kiel la linio sub �i. Premu por - eliri el la Enmeta re�imo. + 4. Kompletigu la vorton same kiel la linio sub ĝi. Premu por + eliri el la Enmeta reĝimo. - 5. Uzu e por movi�i al la sekvanta nekompleta vorto kaj ripetu - pa�ojn 3 kaj 4. + 5. Uzu e por moviĝi al la sekvanta nekompleta vorto kaj ripetu + paŝojn 3 kaj 4. ----> �i tiu lin ebligos vin ekz vin postal tekston al linio. ----> �i tiu linio ebligos vin ekzerci vin postaldoni tekston al linio. +---> Ĉi tiu lin ebligos vin ekz vin postal tekston al linio. +---> Ĉi tiu linio ebligos vin ekzerci vin postaldoni tekston al linio. -RIMARKO: �iu a, i kaj A iras al la sama Enmeta re�imo, la nura malsamo +RIMARKO: Ĉiu a, i kaj A iras al la sama Enmeta reĝimo, la nura malsamo estas tie, kie la signoj estas enmetitaj. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.6.3: ALIA MANIERO POR ANSTATA�IGI + Leciono 1.6.3: ALIA MANIERO POR ANSTATAŬIGI - ** Tajpu majusklan R por anstata�igi pli ol unu signo. ** + ** Tajpu majusklan R por anstataŭigi pli ol unu signo. ** 1. Movu la kursoron al la unua suba linio markita per --->. Movu la kursoron al la komenco de la unua xxx . - 2. Nun premu R kaj tajpu la nombron sub �i en la dua linio, por ke �i - anstata�igu la xxx . + 2. Nun premu R kaj tajpu la nombron sub ĝi en la dua linio, por ke ĝi + anstataŭigu la xxx . - 3. Premu por foriri el la Anstata�iga re�imo. Rimarku, ke la cetera - parto de la linio restas ne�an�ata. + 3. Premu por foriri el la Anstataŭiga reĝimo. Rimarku, ke la cetera + parto de la linio restas neŝanĝata. - 4. Ripetu la pa�ojn por anstata�igi la restantajn xxx. + 4. Ripetu la paŝojn por anstataŭigi la restantajn xxx. ---> Aldono de 123 al xxx donas al vi xxx. ---> Aldono de 123 al 456 donas al vi 579. -RIMARKO: Anstata�iga re�imo estas same kiel Enmeta re�imo, sed �iu signo - tajpita forvi�as ekzistan signon. +RIMARKO: Anstataŭiga reĝimo estas same kiel Enmeta reĝimo, sed ĉiu signo + tajpita forviŝas ekzistan signon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.6.4: KOPII KAJ ALGLUI TEKSTON - ** Uzu la y operatoron por kopii tekston, kaj p por alglui �in ** + ** Uzu la y operatoron por kopii tekston, kaj p por alglui ĝin ** 1. Iru al la suba linio markita per ---> kaj poziciu la kursoron post "a)". - 2. Komencu la Viduman re�imon per v kaj movu la kursoron tuj anta� "unua". + 2. Komencu la Viduman reĝimon per v kaj movu la kursoron tuj antaŭ "unua". 3. Tajpu y por kopii la emfazitan tekston. - 4. Movu la kursoron �e la fino de la linio: j$ + 4. Movu la kursoron ĉe la fino de la linio: j$ 5. Tajpu p por alglui la tekston. Tiam tajpu: a dua . - 6. Uzu Viduman re�imon por apartigi " ero.", kopiu �in per y , movi�u - �e la fino de la sekvanta linio per j$ kaj algluu la tekston tie + 6. Uzu Viduman reĝimon por apartigi " ero.", kopiu ĝin per y , moviĝu + ĉe la fino de la sekvanta linio per j$ kaj algluu la tekston tie per p . ---> a) tio estas la unua ero. b) -RIMARKO: vi povas anka� uzi y kiel operatoro; yw kopias unu vorton. +RIMARKO: vi povas ankaŭ uzi y kiel operatoro; yw kopias unu vorton. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.6.5: AGORDI OPCION - ** Agordu opcion por ke ser�o a� anstata�igo ignoru usklecon ** + ** Agordu opcion por ke serĉo aŭ anstataŭigo ignoru usklecon ** - 1. Ser�u 'ignori' per tajpo de /ignori + 1. Serĉu 'ignori' per tajpo de /ignori Ripetu plurfoje premante n . - 2. �altu la opcion 'ic' (ignori usklecon) per: :set ic + 2. Ŝaltu la opcion 'ic' (ignori usklecon) per: :set ic - 3. Nun ser�u 'ignori' denove premante n + 3. Nun serĉu 'ignori' denove premante n Rimarku, ke Ignori kaj IGNORI estas nun troveblas. - 4. �altu la opciojn 'hlsearch' kaj 'incsearch': :set hls is + 4. Ŝaltu la opciojn 'hlsearch' kaj 'incsearch': :set hls is - 5. Nun retajpu la ser�an komandon kaj vidu kio okazas: /ignore + 5. Nun retajpu la serĉan komandon kaj vidu kio okazas: /ignore - 6. Por mal�alti ignoron de uskleco: :set noic + 6. Por malŝalti ignoron de uskleco: :set noic RIMARKO: Por forigi emfazon de kongruo, tajpu: :nohlsearch -RIMARKO: Se vi deziras ignori usklecon por nur unu ser�a komando, uzu \c +RIMARKO: Se vi deziras ignori usklecon por nur unu serĉa komando, uzu \c en la frazo: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leciono 1.6 RESUMO - 1. Tajpu o por malfermi linion SUB la kursoro kaj eki en Enmeta re�imo. + 1. Tajpu o por malfermi linion SUB la kursoro kaj eki en Enmeta reĝimo. 1. Tajpu O por malfermi linion SUPER la kursoro. 2. Tajpu a por enmeti tekston POST la kursoro. @@ -864,18 +864,18 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser 3. La e komando movas la kursoron al la fino de vorto. - 4. la y operatoro kopias tekston, p algluas �in. + 4. la y operatoro kopias tekston, p algluas ĝin. - 5. Tajpo de majuskla R eniras la Anstata�igan re�imon �is kiam + 5. Tajpo de majuskla R eniras la Anstataŭigan reĝimon ĝis kiam estas premita. - 6. Tajpo de ":set xxx" �altas la opcion "xxx". Iuj opcioj estas: - 'ic' 'ignorecase' ignori usklecon dum ser�o - 'is' 'incsearch' montru partan kongruon dum ser�o - 'hls' 'hlsearch' emfazas �iujn kongruajn frazojn - Vi povas uzi a� la longan, a� la mallongan nomon de opcio. + 6. Tajpo de ":set xxx" ŝaltas la opcion "xxx". Iuj opcioj estas: + 'ic' 'ignorecase' ignori usklecon dum serĉo + 'is' 'incsearch' montru partan kongruon dum serĉo + 'hls' 'hlsearch' emfazas ĉiujn kongruajn frazojn + Vi povas uzi aŭ la longan, aŭ la mallongan nomon de opcio. - 7. Anta�aldonu "no" por mal�alti la opcion: :set noic + 7. Antaŭaldonu "no" por malŝalti la opcion: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -884,10 +884,10 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser ** Uzu la helpan sistemon ** - Vim havas ampleksan helpan sistemon. Por komenci�i, provu unu el la tiuj + Vim havas ampleksan helpan sistemon. Por komenciĝi, provu unu el la tiuj tri: - - premu la klavon (se vi havas �in) - - premu la klavon (se vi havas �in) + - premu la klavon (se vi havas ĝin) + - premu la klavon (se vi havas ĝin) - tajpu :help Legu la tekston en la helpfenestro por trovi kiel helpo funkcias. @@ -909,8 +909,8 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser ** Ebligu kapablojn de Vim ** - Vim havas multe pli da kapabloj ol Vi, sed la plej multaj estas defa�lte - mal�altitaj. Por ekuzi la kapablojn, vi devas krei dosieron "vimrc". + Vim havas multe pli da kapabloj ol Vi, sed la plej multaj estas defaŭlte + malŝaltitaj. Por ekuzi la kapablojn, vi devas krei dosieron "vimrc". 1. Ekredaktu la dosieron "vimrc". Tio dependas de via sistemo: :e ~/.vimrc por Unikso @@ -922,8 +922,8 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser 3. Konservu la dosieron per: :w - La sekvantan fojon, kiam vi lan�as Vim, �i uzos sintaksan emfazon. - Vi povas aldoni �iujn viajn preferatajn agordojn al tiu dosiero "vimrc". + La sekvantan fojon, kiam vi lanĉas Vim, ĝi uzos sintaksan emfazon. + Vi povas aldoni ĉiujn viajn preferatajn agordojn al tiu dosiero "vimrc". Por pli da informoj, tajpu :help vimrc-intro @@ -933,9 +933,9 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser ** Kompletigo de komanda linio per CTRL-D kaj ** - 1. Certigu ke Vim estas en kongrua re�imo: :set nocp + 1. Certigu ke Vim estas en kongrua reĝimo: :set nocp - 2. Rigardu tiujn dosierojn, kiuj ekzistas en la dosierujo: :!ls a� :!dir + 2. Rigardu tiujn dosierojn, kiuj ekzistas en la dosierujo: :!ls aŭ :!dir 3. Tajpu la komencon de komando: :e @@ -945,7 +945,7 @@ RIMARKO: Se vi deziras ignori usklecon por nur unu ser 6. Nun aldonu spaceton kaj la komencon de ekzistanta nomo: :edit DOSI - 7. Premu d. Vim kompletigos la nomon (se �i estas unika) + 7. Premu d. Vim kompletigos la nomon (se ĝi estas unika) RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj . Estas aparte utila por :help . @@ -954,7 +954,7 @@ RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj Leciono 1.7 RESUMO - 1. Tajpu :help a� premu a� por malfermi helpan fenestron. + 1. Tajpu :help aŭ premu por malfermi helpan fenestron. 2. Tajpu :help kmd por trovi helpon pri kmd. @@ -964,15 +964,15 @@ RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj 5. Kreu komencan skripton vimrc por konservi viajn agordojn. - 6. Kiam vi tajpas : komandon, premu CTRL-D por vidi �iujn kompleteblojn. + 6. Kiam vi tajpas : komandon, premu CTRL-D por vidi ĉiujn kompleteblojn. Premu por uzi unu kompletigon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Tio konkludas la instruilon de Vim. �i celis doni mallongan superrigardon - de la redaktilo Vim, nur tion kio sufi�as por ebligi al vi facilan uzon de - la redaktilo. Estas nepre nekompleta, �ar Vim havas multajn multajn pliajn + Tio konkludas la instruilon de Vim. Ĝi celis doni mallongan superrigardon + de la redaktilo Vim, nur tion kio sufiĉas por ebligi al vi facilan uzon de + la redaktilo. Estas nepre nekompleta, ĉar Vim havas multajn multajn pliajn komandojn. Legu la manlibron: ":help user-manual". Tiu instruilo estis verkita de Michael C. Pierce kaj Robert K. Ware, @@ -980,12 +980,12 @@ RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj ideojn provizitajn de Charles Smith el la Stata Universitato de Koloradio (Colorado State University) - Retpo�to: bware@mines.colorado.edu. + Retpoŝto: bware@mines.colorado.edu. Modifita por Vim de Bram Moolenaar. - Esperantigita fare de Dominique Pell�, 2008-04-01 - Retpo�to: dominique.pelle@gmail.com - Lasta �an�o: 2020-07-19 + Esperantigita fare de Dominique Pellé, 2008-04-01 + Retpoŝto: dominique.pelle@gmail.com + Lasta ŝanĝo: 2020-07-19 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.eo.utf-8 b/runtime/tutor/tutor1.eo.utf-8 deleted file mode 100644 index 52daa8fc70..0000000000 --- a/runtime/tutor/tutor1.eo.utf-8 +++ /dev/null @@ -1,991 +0,0 @@ -============================================================================== -= B o n v e n o n al la I n s t r u i l o de V I M - Versio 1.7 = -============================================================================== - - Vim estas tre potenca redaktilo, kiu havas multajn komandojn, tro da ili - por ĉion klarigi en instruilo kiel ĉi tiu. Ĉi tiu instruilo estas - fasonita por priskribi sufiĉajn komandojn, por ke vi kapablu uzi Vim - kun sufiĉa facileco. - - La tempo bezonata por plenumi la kurson estas 30 minutoj, kaj dependas - de kiom da tempo estas uzata por eksperimenti. - - ATENTU: - La komandoj en la lecionoj ŝanĝos la tekston. Kopiu tiun ĉi dosieron - por ekzerci vin (se vi lanĉis "vimtutor", tiam estas jam kopio). - - Gravas memori, ke ĉi tiu instruilo estas organizata por instrui per - la uzo. Tio signifas, ke vi devas plenumi la komandojn por bone lerni - ilin. Se vi nur legas la tekston, vi forgesos la komandojn! - - Nun, certigu, ke la majuskla baskulo NE estas en reĝimo majuskla, - kaj premu la klavon j sufiĉe da fojoj por movi la kursoron, kaj por - ke la leciono 1.1 plenigu la ekranon. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.1.1: MOVI LA KURSORON - - - ** Por movi la kursoron, premu la h,j,k,l klavojn kiel montrite. ** - ^ - k Konsilo: La klavo h estas la plej liva kaj movas liven. - < h l > La klavo l estas la plej dekstra kaj movas dekstren. - j La klavo j aspektas kiel malsuprena sago. - v - 1. Movu la kursoron sur la ekrano ĝis kiam vi sentas vin komforta. - - 2. Premu la klavon (j) ĝis kiam ĝi ripetas. - Vi nun scias, kiel moviĝi al la sekvanta leciono - - 3. Uzante la malsuprenan klavon, moviĝu al la leciono 1.2. - -RIMARKO: Se vi dubas pri tio, kion vi premis, premu por reiri al - la normala reĝimo. Tiam repremu la deziratan komandon. - -RIMARKO: La klavoj de la kursoro devus ankaŭ funkcii. Sed uzante hjkl, - vi kapablos moviĝi pli rapide post kiam vi kutimiĝos. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.1.2: ELIRI EL VIM - - - !! RIMARKO: Antaŭ ol plenumi iujn subajn paŝojn ajn, legu la tutan lecionon!! - - 1. Premu la klavon (por certigi, ke vi estas en normala reĝimo). - - 2. Tajpu: :q! . - Tio eliras el la rekdaktilo, SEN konservi la ŝanĝojn, kiujn vi faris. - - 3. Kiam vi vidas la ŝelinviton, tajpu la komandon kiun vi uzis por eniri - en ĉi tiu instruilo. Tio estus: vimtutor - - 4. Se vi memoris tiujn paŝojn kaj sentas vin memfida, plenumu la paŝojn - 1 ĝis 3 por eliri kaj reeniri la redaktilon. - -RIMARKO: :q! eliras sen konservi la ŝanĝojn, kiujn vi faris. - Post kelkaj lecionoj, vi lernos kiel konservi la ŝanĝojn al dosiero. - - 5. Movu la kursoron suben ĝis la leciono 1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.1.3: REDAKTO DE TEKSTO - FORVIŜO - - - ** Premu x por forviŝi la signon sub la kursoro. ** - - 1. Movu la kursoron al la suba linio markita per --->. - - 2. Por korekti la erarojn, movu la kursoron ĝis kiam ĝi estas sur la - forviŝenda signo. - - 3. Premu la klavon x por forviŝi la nedeziratan signon. - - 4. Ripetu paŝojn 2 ĝis 4 ĝis kiam la frazo estas ĝusta. - - ----> La boovinno saaltiss ssur laa luuno. - - 5. Post kiam la linio estas ĝusta, iru al la leciono 1.4 - -RIMARKO: Trairante la instruilon, ne provu memori, lernu per la uzo. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.1.4: REDAKTO DE TEKSTO - ENMETO - - - ** Premu i por enmeti tekston. ** - - 1. Movu la kursoron al la unua suba linio markita per --->. - - 2. Por igi la unuan linion sama kiel la dua, movu la kursoron sur la unuan - signon antaŭ kie la teksto estas enmetenda. - - 3. Premu i kaj tajpu la bezonatajn aldonojn. - - 4. Premu kiam la eraroj estas korektitaj por reiri al la normala - reĝimo. Ripetu la paŝojn 2 ĝis 4 por korekti la frazon. - ----> Mank en ĉi linio. ----> Mankas teksto en ĉi tiu linio. - - 5. Kiam vi sentas vin komforta pri enmeto de teksto, moviĝu al la - leciono 1.5. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.1.5: REDAKTO DE TEKSTO - POSTALDONO - - - ** Premu A por postaldoni tekston. ** - - 1. Movu la kursoron al la unua suba linio markita per --->. - Ne gravas sur kiu signo estas la kursoro. - - 2. Premu majusklan A kaj tajpu la bezonatajn aldonojn. - - 3. Post kiam la teksto estas aldonita, premu por reiri al la normala - reĝimo. - - 4. Movu la kursoron al la dua linio markita per ---> kaj ripetu la - paŝojn 2 kaj 3 por korekti la frazon. - ----> Mankas teksto el ti - Mankas teksto el tiu linio. ----> Mankas ankaŭ teks - Mankas ankaŭ teksto ĉi tie. - - 5 Kiam vi sentas vin komforta pri postaldono de teksto, moviĝu al la - leciono 1.6 - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.1.6: REDAKTI DOSIERON - - ** Uzu :wq por konservi dosieron kaj eliri. ** - - !! RIMARKO: Antaŭ ol plenumi iun suban paŝon ajn, legu la tutan lecionon!! - - 1. Eliru el la instruilo kiel vi faris en la leciono 1.1.2: :q! - Aŭ, se vi havas atingon al alia terminalo, faru tion, kio sekvas tie. - - 2. Ĉe la ŝelinvito, tajpu ĉi tiun komandon: vim tutor - 'vim' estas la komando por lanĉi la redaktilon Vim, 'tutor' estas la - dosiernomo de la dosiero, kiun vi volas redakti. Uzu dosieron, kiu - ŝanĝeblas. - - 3. Enmetu kaj forviŝu tekston, kiel vi lernis en la antaŭaj lecionoj. - - 4. Konservu la dosieron kun ŝanĝoj kaj eliru el Vim per: :wq - - 5. Se vi eliris el la instruilo vimtutor en paŝo 1, restartigu la instruilon - vimtutor kaj moviĝu suben al la sekvanta resumo. - - 6. Post kiam vi legis la suprajn paŝojn, kaj komprenis ilin: faru ilin. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.1 RESUMO - - - 1. La kursoro moviĝas aŭ per la sagoklavoj, aŭ per la klavoj hjkl. - h (liven) j (suben) k (supren) l (dekstren) - - 2. Por lanĉi Vim el la ŝelinvito, tajpu: vim DOSIERNOMO - - 3. Por eliri el Vim, tajpu: :q! por rezigni la ŝanĝojn - - 4. Por forviŝi la signojn ĉe la pozicio de la kursoro, tajpu: x - - 5. Por enmeti aŭ postaldoni tekston, tajpu: - i tajpu enmetendan tekston - enmetas tekston antaŭ la kursoro - - A tajpu la postaldonendan tekston - postaldonas post la kursoro - -RIMARKO: Premo de iras al la normala reĝimo, aŭ rezignas la - nedeziratan aŭ parte plenumita komando. - -Nun daŭrigu al la leciono 2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.1: KOMANDOJ DE FORVIŜO - - - ** Tajpu dw por forviŝi vorton. ** - - 1. Premu por certigi, ke vi estas en normala reĝimo. - - 2. Movu la kursoron al la suba linio markita per --->. - - 3. Movu la kursoron al la komenco de vorto, kiu forviŝendas. - - 4. Tajpu dw por forviŝi la vorton. - - RIMARKO: La litero d aperos en la lasta linio sur la ekrano kiam vi - tajpas ĝin. Vim atendas ĝis kiam vi tajpas w . Se vi vidas - alian signon ol d vi tajpis ion mise; premu kaj - rekomencu. - ----> Estas iuj vortoj kiuj Zamenhof ne devus esti akuzativo en ĉi tiu frazo. - - 5. Ripetu paŝojn 3 kaj 4 ĝis kiam la frazo estas ĝusta kaj moviĝu al la - leciono 2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.2: PLIAJ KOMANDOJ DE FORVIŜO - - - ** Tajpu d$ por forviŝi la finon de la linio. ** - - 1. Premu por certigi, ke vi estas en normala reĝimo. - - 2. Movu la kursoron al la suba linio markita per --->. - - 3. Movu la kursoron ĉe la fino de la ĝusta linio (POST la unua . ). - - 4. Tajpu d$ por foriviŝi ĝis la fino de la linio. - ----> Iu tajpis la finon de ĉi tiu linio dufoje. fino de ĉi tiu linio dufoje. - - - 5. Moviĝu al la leciono 2.3 por kompreni kio okazas. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.3: PRI OPERATOROJ KAJ MOVOJ - - - Multaj komandoj, kiuj ŝanĝas la tekston, estas faritaj de operatoro kaj - movo. La formato de komando de forviŝo per la operatoro de forviŝo d - estas kiel sekvas: - - d movo - - Kie: - d - estas la operatoro de movo - movo - estas tio, pri kio la operatoro operacios (listigita sube) - - Mallonga listo de movoj: - w - ĝis la komenco de la sekvanta vorto, krom ĝia unua signo. - e - ĝis la fino de la nuna vorto, krom la lasta signo. - $ - ĝis la fino de la linio, krom la lasta signo. - - Do tajpo de 'de' forviŝos ekde la kursoro ĝis la fino de la vorto. - -RIMARKO: Premo de nur la movo en Normala reĝimo sen operatoro movos - la kursoron kiel specifite. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.4: UZI NOMBRON POR MOVO - - ** Tajpo de nombro antaŭ movo ripetas ĝin laŭfoje. ** - - 1. Movu la kursoron ĉe la komenco de la suba linio markita per --->. - - 2. Tajpu 2w por movi la kursoron je du vortoj antaŭen. - - 3. Tajpu 3e por movi la kursoron ĉe la fino de la tria vorto antaŭen. - - 4. Tajpu 0 (nul) por moviĝi ĉe la komenco de la linio. - - - 5. Ripetu paŝojn 2 ĝis 3 kun malsamaj nombroj. - ----> Tio estas nur linio kun vortoj, kie vi povas moviĝi. - - 6. Moviĝu al la leciono 2.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.5: UZI NOMBRON POR FORVIŜI PLI - - - ** Tajpo de nombro kun operatoro ripetas ĝin laŭfoje. ** - - En la kombinaĵo de la operatoro de forviŝo, kaj movo kiel menciita - ĉi-supre, eblas aldoni nombron antaŭ la movo por pli forviŝi: - d nombro movo - - 1. Movu la kursoron ĉe la unua MAJUSKLA vorto en la linio markita per --->. - - 2. Tajpu d2w por forviŝi la du MAJUSKLAJN vortojn. - - 3. Ripetu paŝojn 1 ĝis 2 per malsama nombro por forviŝi la sinsekvajn - MAJUSKLAJN vortojn per unu komando. - ----> Tiu AB CDE linio FGHI JK LMN OP de vortoj estas Q RS TUV purigita. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.6: OPERACII SUR LINIOJ - - - ** Tajpu dd por forviŝi tutan linion. ** - - Pro la ofteco de forviŝo de tuta linio, la verkisto de Vi decidis, ke - estus pli facile simple tajpi du d-ojn por forviŝi linion. - - 1. Movu la kursoron sur la duan linion en la suba frazo. - 2. Tajpu dd por forviŝi la linion. - 3. Nun moviĝu al la kvara linio. - 4. Tajpu 2dd por forviŝi du liniojn. - ----> 1) Rozoj estas ruĝaj, ----> 2) Ŝlimo estas amuza, ----> 3) Violoj estas bluaj, ----> 4) Mi havas aŭton, ----> 5) Horloĝoj diras kioma horo estas, ----> 6) Sukero estas dolĉa, ----> 7) Kaj tiel vi estas. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2.7: LA KOMANDO DE MALFARO - - - ** Premu u por malfari la lastajn komandojn, U por ripari la tutan linion. ** - - 1. Movu la kursoron ĉe la suba linio markita per ---> kaj metu ĝin sur - la unuan eraron. - 2. Tajpu x por forviŝi la unuan nedeziratan signon. - 3. Nun tajpu u por malfari la lastan plenumitan komandon. - 4. Ĉi-foje, riparu ĉiujn erarojn en la linio kaj ĝia originala stato. - 5. Nun tajpu majusklan U por igi la linion al ĝia antaŭa stato. - 6. Nun tajpu u kelkfoje por malfari la U kaj antaŭajn komandojn. - 7. Nun tajpu CTRL-R (premante la CTRL klavon dum vi premas R) kelkfoje - por refari la komandojn (malfari la malfarojn). - ----> Koorektii la erarojn sur tiuu ĉi liniio kaj remettu illlin per malfaro. - - 8. Tiuj estas tre utilaj komandoj. Nun moviĝu al la leciono 1.2 RESUMO. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.2 RESUMO - - - 1. Por forviŝi ekde la kursoro ĝis la sekvanta vorto, tajpu: dw - 2. Por forviŝi ekde la kursoro ĝis la fino de la linio, tajpu: d$ - 3. Por forviŝi tutan linion, tajpu: dd - - 4. Por ripeti movon, antaŭmetu nombron: 2w - 5. La formato de ŝanĝa komando estas: - operatoro [nombro] movo - - kie: - operatoro - estas tio, kio farendas, kiel d por forviŝi - [nombro] - estas opcia nombro por ripeti la movon - movo - movas sur la teksto por operacii, kiel ekzemple w (vorto), - $ (ĝis fino de linio), ktp. - - 6. Por moviĝi al la komenco de la linio, uzu nul: 0 - - 7. Por malfari antaŭajn agojn, tajpu: u (minuskla u) - Por malfari ĉiujn ŝanĝojn sur la linio, tajpu: U (majuskla U) - Por refari la malfarojn, tajpu: CTRL-R - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 3.1 LA KOMANDO DE METO - - - ** Tajpu p por meti tekston forviŝitan antaŭe post la kursoro. ** - - 1. Movu la kursoron ĉe la unua suba linio markita per --->. - - 2. Tajpu dd por forviŝi la linion kaj konservi ĝin ene de reĝistro de Vim. - - 3. Movu la kursoron ĉe la linio c), SUPER kie la forviŝita linio devus esti. - - 4. Tajpu p por meti la linion sub la kursoron. - - 5. Ripetu la paŝojn 2 ĝis 4 por meti ĉiujn liniojn en la ĝusta ordo. - ----> d) Ĉu ankaŭ vi povas lerni? ----> b) Violoj estas bluaj, ----> c) Inteligenteco lerneblas, ----> a) Rozoj estas ruĝaj, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 3.2 LA KOMANDO DE ANSTATAŬIGO - - - ** Tajpu rx por anstataŭigi la signon ĉe la kursoro per x . ** - - - 1. Movu la kursoron ĉe la unua suba linio markita per --->. - - 2. Movu la kursoron ĝis la unua eraro. - - 3. Tajpu r kaj la signon, kiu devus esti tie. - - 4. Ripetu paŝojn 2 kaj 3 ĝis kiam la unua linio egalas la duan. - ----> Kiem tiu lanio estis tajpita, iu pramis la naĝuftajn klovojn! ----> Kiam tiu linio estis tajpita, iu premis la neĝustajn klavojn! - - 5. Nun moviĝu al la leciono 3.3. - -RIMARKO: Memoru, ke vi devus lerni per uzo, kaj ne per memorado. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 3.3 LA OPERATORO DE ŜANĜO - - - ** Por ŝanĝi ĝis la fino de la vorto, tajpu ce . ** - - 1. Movu la kursoron ĉe la unua suba linio markita per --->. - - 2. Metu la kursoron sur la d en lduzw - - 3. Tajpu ce kaj la ĝustan vorton (en tiu ĉi kazo, tajpu inio ). - - 4. Premu kaj moviĝu al la sekvanta signo, kiu bezonas ŝanĝon. - - 5. Ripetu la paŝojn 3 kaj 4 ĝis kiam la unua frazo egalas la duan. - ----> Tiu lduzw havas kelkajn vortojn, kiii bezas ŝanĝon per la ŝanĝooto. ----> Tiu linio havas kelkajn vortojn, kiuj bezonas ŝanĝon per la ŝanĝoperatoro. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 3.4 PLIAJ ŜANĜOJ PER c - - - ** La operatoro de ŝanĝo uzeblas kun la sama movo kiel forviŝo. ** - - 1. La operatoro de ŝanĝo funkcias sammaniere kiel forviŝo. La formato estas: - - c [nombro] movo - - 2. La movoj estas samaj, kiel ekzemple w (vorto) kaj $ (fino de linio). - - 3. Moviĝu ĉe la unua suba linio markita per --->. - - 4. Movu la kursoron al la unua eraro. - - 5. Tajpu c$ kaj tajpu la reston de la linio kiel la dua kaj premu . - ----> La fino de ĉi tiu linio bezonas helpon por igi ĝin same kiel la dua. ----> La fino de ĉi tiu linio bezonas korektojn per uzo de la komando c$ - -RIMARKO: Vi povas uzi la klavon Retropaŝo por korekti erarojn dum vi tajpas. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.3 RESUMO - - - 1. Por remeti tekston, kiun vi ĵus forviŝis, tajpu p. Tio metas la - forviŝitan tekston POST la kursoro (se linio estis forviŝita, ĝi - iros en la linion sub la kursoro). - - 2. Por anstataŭigi la signon sub la kursoro, tajpu r kaj tiam la signon - kion vi deziras havi tie. - - 3. La operatoro de ŝanĝo ebligas al vi ŝanĝi ekde la kursoro, ĝis kie - la movo iras. Ekz. tajpu ce por ŝanĝi ekde la kursoro ĝis la fino - de la vorto, c$ por ŝanĝi ĝis la fino de la linio. - - 4. La formato de ŝanĝo estas: - - c [nombro] movo - -Nun daŭrigu al la sekvanta leciono. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.4.1: POZICIO DE KURSORO KAJ STATO DE DOSIERO - - - ** Tajpu CTRL-G por montri vian pozicion en la dosiero kaj la dosierstaton. - Tajpu G por moviĝi al linio en la dosiero. ** - - RIMARKO: Legu la tutan lecionon antaŭ ol plenumi iun paŝon ajn!! - - 1. Premu la klavon Ctrl kaj premu g . Oni nomas tion CTRL-G. - Mesaĝo aperos ĉe la suba parto de la paĝo kun la dosiernomo kaj la - pozicio en la dosiero. Memoru la numeron de la linio por paŝo 3. - - RIMARKO: Vi eble vidas la pozicion de la kursoro ĉe la suba dekstra - angulo de la ekrano. Tio okazas kiam la agordo 'ruler' estas - ŝaltita (vidu :help 'ruler') - - 2. Premu G por moviĝi ĉe la subo de la dosiero. - Tajpu gg por moviĝi ĉe la komenco de la dosiero. - - 3. Tajpu la numeron de la linio kie vi estis kaj poste G . Tio removos - vin al la linio, kie vi estis kiam vi unue premis CTRL-G. - - 4. Se vi sentas vin komforta, plenumu paŝojn 1 ĝis 3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.4.2: LA KOMANDO DE SERĈO - - - ** Tajpu / kaj poste frazon por serĉi la frazon. ** - - 1. En normala reĝimo, tajpu la / signon. Rimarku, ke ĝi kaj la kursoro - aperas ĉe la suba parto de la ekrano kiel por la : komando. - - 2. Nun tajpu 'errarro' . - Tio estas la vorto, kion vi volas serĉi. - - 3. Por serĉi la saman frazon denove, simple tajpu n . - Por serĉi la saman frazon denove en la retrodirekto, tajpu N . - - 4. Por serĉi frazon en la retrodirekto, uzu ? anstataŭ / . - - 5. Por reiri tien, el kie vi venis, premu CTRL-O (Premu Ctrl kaj o - literon o). Ripetu por pli retroiri. CTRL-I iras antaŭen. - ----> "errarro" ne estas maniero por literumi eraro; errarro estas eraro. - -RIMARKO: Kiam la serĉo atingas la finon de la dosiero, ĝi daŭras ĉe la - komenco, krom se la agordo 'wrapscan' estas malŝaltita. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.4.3: SERĈO DE KONGRUAJ KRAMPOJ - - - ** Tajpu % por trovi kongruan ), ] aŭ } ** - - 1. Poziciu la kursoron sur iun (, [ aŭ { en la linio markita per --->. - - 2. Nun tajpu la % signon. - - 3. La kursoro moviĝas al la kongrua krampo. - - 4. Tajpu % por movi la kursoron al la alia kongrua krampo. - - 5. Movu la kursoron al la alia (, ), [, ], {, } kaj observu tion, - kion % faras. - ----> Ĉi tiu ( estas testa linio kun (-oj, [-oj, ]-oj kaj {-oj, }-oj en ĝi. )) - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.4.4: LA KOMANDO DE ANSTATAŭIGO - - - ** Tajpu :s/malnova/nova/g por anstataŭigi 'nova' per 'malnova'. ** - - 1. Movu la kursoron al la suba linio markita per --->. - - 2. Tajpu :s/laa/la . Rimarku, ke la komando ŝanĝas nur la - unuan okazaĵon de "laa" en la linio. - - 3. Nun tajpu :s/laa/la/g . Aldono de g opcio signifas mallokan - anstataŭigon en la linio. Ĝi ŝanĝas ĉiujn okazaĵojn de "laa" en la - linio. - ----> laa plej bona tempo por vidi florojn estas en laa printempo. - - 4. Por ŝanĝi ĉiujn okazaĵojn de iu ĉena signo inter du linioj, - tajpu :#,#s/malnova/nova/g kie #,# estas la numeroj de linioj de la - intervalo de la linioj kie la anstataŭigo - okazos. - Tajpu :%s/malnova/nova/g por ŝanĝi ĉiujn okazaĵojn en la tuta - dosiero. - Tajpu :s/malnova/nova/gc por trovi ĉiujn okazaĵojn en la tuta - dosiero, kun invitilo ĉu anstataŭigi - aŭ ne. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.4 RESUMO - - 1. CTRL-G vidigas vian pozicion en la dosiero kaj la staton de la dosiero. - G movas la kursoron al la fino de la dosiero. - numero G movas la kursoron al numero de tiu linio. - gg movas la kursoron al la unua linio. - - 2. Tajpo de / kaj frazon serĉas la frazon antaŭen. - Tajpo de ? kaj frazon serĉas la frazon malantaŭen. - Post serĉo, tajpu n por trovi la sekvantan okazaĵon en la sama direkto aŭ - N por serĉi en la mala direkto. - CTRL-O movas vin al la antaŭaj pozicioj, CTRL-I al la novaj pozicioj. - - 3. Tajpo de % kiam la kursoro estas sur (,),[,],{ aŭ } moviĝas al ĝia - kongruo. - - 4. Por anstataŭigi 'nova' en la unua 'malnova' en linio :s/malnova/nova - Por anstataŭigi 'nova' en ĉiuj 'malnova'-oj en linio :s/malnova/nova/g - Por anstataŭigi frazon inter du #-aj linioj :#,#s/malnova/nova/g - Por anstataŭigi ĉiujn okazaĵojn en la dosiero :%s/malnova/nova/g - Por demandi konfirmon ĉiu-foje, aldonu 'c' :%s/malnova/nova/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.5.1: KIEL PLENUMI EKSTERAN KOMANDON - - - ** Tajpu :! sekvata de ekstera komando por plenumi la komandon. ** - - 1. Tajpu la konatan komandon : por pozicii la kursoron ĉe la suba parto - de la ekrano. Tio ebligas tajpadon de komando en komanda linio. - - 2. Nun tajpu la ! (krisigno) signon. Tio ebligas al vi plenumi iun - eksteran ŝelan komandon ajn. - - 3. Ekzemple, tajpu ls post ! kaj tajpu . Tio listigos la - enhavon de la dosierujo, same kiel se vi estis en ŝela invito. - Aŭ uzu :!dir se ls ne funkcias. - -RIMARKO: Eblas plenumi iun eksteran komandon ajn tiamaniere, ankaŭ kun - argumentoj. - -RIMARKO: Ĉiuj : komandoj devas finiĝi per tajpo de - Ekde nun, ni ne plu mencios tion. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.5.2: PLI PRI KONSERVO DE DOSIERO - - - ** Por konservi la faritajn ŝanĝojn en la teksto, tajpu :w DOSIERNOMO. ** - - 1. Tajpu !dir aŭ !ls por akiri liston de via dosierujo. - Vi jam scias, ke vi devas tajpi post tio. - - 2. Elektu dosieron, kiu ankoraŭ ne ekzistas, kiel ekzemple TESTO. - - 3. Nun tajpu: :w TESTO (kie TESTO estas la elektita dosiernomo) - - 4. Tio konservas la tutan dosieron (instruilon de Vim) kun la nomo TESTO. - Por kontroli tion, tajpu :!dir aŭ :!ls denove por vidigi vian - dosierujon. - -RIMARKO: Se vi volus eliri el Vim kaj restartigi ĝin denove per vim TESTO, - la dosiero estus precize same kiel kopio de la instruilo kiam vi - konservis ĝin. - - 5. Nun forviŝu la dosieron tajpante (VINDOZO): :!del TESTO - aŭ (UNIKSO): :!rm TESTO - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.5.3: APARTIGI KONSERVENDAN TESTON - - - ** Por konservi parton de la dosiero, tajpu v movo :w DOSIERNOMO ** - - 1. Movu la kursoron al tiu linio. - - 2. Premu v kaj movu la kursoron al la kvina suba ero. Rimarku, ke la - teksto emfaziĝas. - - 3. Premu la : signon. Ĉe la fino de la ekrano :'<,'> aperos. - - 4. Tajpu w TESTO , kie TESTO estas dosiernomo, kiu ankoraŭ ne ekzistas. - Kontrolu, ke vi vidas :'<,'>w TESTO antaŭ ol premi . - - 5. Vim konservos la apartigitajn liniojn al la dosiero TESTO. Uzu :dir - aŭ :!ls por vidigi ĝin. Ne forviŝu ĝin. Ni uzos ĝin en la sekvanta - leciono. - -RIMARKO: Premo de v komencas Viduman apartigon. Vi povas movi la kursoron - por pligrandigi aŭ malpligrandigi la apartigon. Tiam vi povas uzi - operatoron por plenumi ion kun la teksto. Ekzemple, d forviŝas - la tekston. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.5.4: AKIRI KAJ KUNFANDI DOSIEROJN - - - ** Por enmeti la enhavon de dosiero, tajpu :r DOSIERNOMON ** - - 1. Movu la kursoron tuj super ĉi tiu linio. - -RIMARKO: Post plenumo de paŝo 2, vi vidos tekston el la leciono 5.3. Tiam - moviĝu SUBEN por vidi tiun lecionon denove. - - 2. Nun akiru vian dosieron TESTO uzante la komandon :r TESTO kie TESTO - estas la nomo de la dosiero, kiun vi uzis. - La dosiero, kion vi akiras, estas metita sub la linio de la kursoro. - - 3. Por kontroli, ĉu la dosiero akiriĝis, retromovu la kursoron kaj rimarku, - ke estas nun du kopioj de la leciono 5.3, la originala kaj la versio mem - de la dosiero. - -RIMARKO: Vi nun povas legi la eliron de ekstera komando. Ekzemple, - :r !ls legas la eliron de la komando ls kaj metas ĝin sub la - kursoron. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.5 RESUMO - - - 1. :!komando plenumas eksteran komandon. - - Iuj utilaj ekzemploj estas: - (VINDOZO) (UNIKSO) - :!dir :!ls - listigas dosierujon - :!del DOSIERNOMO :!rm DOSIERNOMO - forviŝas la dosieron DOSIERNOMO - - 2. :w DOSIERNOMO konservas la nunan dosieron de Vim al disko kun la - nomo DOSIERNOMO. - - 3. v movo :w DOSIERNOMO konservas la Viduman apartigon de linioj en - dosiero DOSIERNOMO. - - 4. :r DOSIERNOMO akiras la dosieron DOSIERNOMO el la disko kaj metas - ĝin sub la pozicion de la kursoro. - - 5. :r !dir legas la eligon de la komando dir kaj metas ĝin sub la - pozicion de la kursoro. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.6.1: LA KOMANDO DE MALFERMO - - - ** Tajpu o por malfermi linion sub la kursoro kaj eniri Enmetan reĝimon. ** - - 1. Movu la kursoron al la suba linio markita per --->. - - 2. Tajpu la minusklan literon o por malfermi linion SUB la kursoro kaj - eniri la Enmetan reĝimon. - - 3. Nun tajpu tekston kaj premu por eliri el la Enmeta reĝimo. - ----> Post tajpo de o la kursoro moviĝas al la malfermata linio en - Enmeta reĝimo. - - 4. Por malfermi linion SUPER la kursoro, nur tajpu majusklan O , - anstataŭ minusklan o. Provu tion per la suba linio. - ----> Malfermu linion SUPER tiu tajpante O dum la kursoro estas sur tiu linio. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.6.2: LA KOMANDO DE POSTALDONO - - - ** Tajpu a por enmeti POST la kursoro. ** - - 1. Movu la kursoron ĉe la komenco de la linio markita per --->. - - 2. Premu e ĝis kiam la kursoro estas ĉe la fino de li. - - 3. Tajpu a (minuskle) por aldoni tekston POST la kursoro. - - 4. Kompletigu la vorton same kiel la linio sub ĝi. Premu por - eliri el la Enmeta reĝimo. - - 5. Uzu e por moviĝi al la sekvanta nekompleta vorto kaj ripetu - paŝojn 3 kaj 4. - ----> Ĉi tiu lin ebligos vin ekz vin postal tekston al linio. ----> Ĉi tiu linio ebligos vin ekzerci vin postaldoni tekston al linio. - -RIMARKO: Ĉiu a, i kaj A iras al la sama Enmeta reĝimo, la nura malsamo - estas tie, kie la signoj estas enmetitaj. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.6.3: ALIA MANIERO POR ANSTATAŬIGI - - - ** Tajpu majusklan R por anstataŭigi pli ol unu signo. ** - - 1. Movu la kursoron al la unua suba linio markita per --->. Movu la - kursoron al la komenco de la unua xxx . - - 2. Nun premu R kaj tajpu la nombron sub ĝi en la dua linio, por ke ĝi - anstataŭigu la xxx . - - 3. Premu por foriri el la Anstataŭiga reĝimo. Rimarku, ke la cetera - parto de la linio restas neŝanĝata. - - 4. Ripetu la paŝojn por anstataŭigi la restantajn xxx. - ----> Aldono de 123 al xxx donas al vi xxx. ----> Aldono de 123 al 456 donas al vi 579. - -RIMARKO: Anstataŭiga reĝimo estas same kiel Enmeta reĝimo, sed ĉiu signo - tajpita forviŝas ekzistan signon. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.6.4: KOPII KAJ ALGLUI TEKSTON - - - ** Uzu la y operatoron por kopii tekston, kaj p por alglui ĝin ** - - - 1. Iru al la suba linio markita per ---> kaj poziciu la kursoron post "a)". - - 2. Komencu la Viduman reĝimon per v kaj movu la kursoron tuj antaŭ "unua". - - 3. Tajpu y por kopii la emfazitan tekston. - - 4. Movu la kursoron ĉe la fino de la linio: j$ - - 5. Tajpu p por alglui la tekston. Tiam tajpu: a dua . - - 6. Uzu Viduman reĝimon por apartigi " ero.", kopiu ĝin per y , moviĝu - ĉe la fino de la sekvanta linio per j$ kaj algluu la tekston tie - per p . - ----> a) tio estas la unua ero. - b) - -RIMARKO: vi povas ankaŭ uzi y kiel operatoro; yw kopias unu vorton. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.6.5: AGORDI OPCION - - - ** Agordu opcion por ke serĉo aŭ anstataŭigo ignoru usklecon ** - - 1. Serĉu 'ignori' per tajpo de /ignori - Ripetu plurfoje premante n . - - 2. Ŝaltu la opcion 'ic' (ignori usklecon) per: :set ic - - 3. Nun serĉu 'ignori' denove premante n - Rimarku, ke Ignori kaj IGNORI estas nun troveblas. - - 4. Ŝaltu la opciojn 'hlsearch' kaj 'incsearch': :set hls is - - 5. Nun retajpu la serĉan komandon kaj vidu kio okazas: /ignore - - 6. Por malŝalti ignoron de uskleco: :set noic - -RIMARKO: Por forigi emfazon de kongruo, tajpu: :nohlsearch -RIMARKO: Se vi deziras ignori usklecon por nur unu serĉa komando, uzu \c - en la frazo: /ignore\c - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.6 RESUMO - - 1. Tajpu o por malfermi linion SUB la kursoro kaj eki en Enmeta reĝimo. - 1. Tajpu O por malfermi linion SUPER la kursoro. - - 2. Tajpu a por enmeti tekston POST la kursoro. - Tajpu A por enmeti tekston post la fino de la linio. - - 3. La e komando movas la kursoron al la fino de vorto. - - 4. la y operatoro kopias tekston, p algluas ĝin. - - 5. Tajpo de majuskla R eniras la Anstataŭigan reĝimon ĝis kiam - estas premita. - - 6. Tajpo de ":set xxx" ŝaltas la opcion "xxx". Iuj opcioj estas: - 'ic' 'ignorecase' ignori usklecon dum serĉo - 'is' 'incsearch' montru partan kongruon dum serĉo - 'hls' 'hlsearch' emfazas ĉiujn kongruajn frazojn - Vi povas uzi aŭ la longan, aŭ la mallongan nomon de opcio. - - 7. Antaŭaldonu "no" por malŝalti la opcion: :set noic - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.7.1: AKIRI HELPON - - - ** Uzu la helpan sistemon ** - - Vim havas ampleksan helpan sistemon. Por komenciĝi, provu unu el la tiuj - tri: - - premu la klavon (se vi havas ĝin) - - premu la klavon (se vi havas ĝin) - - tajpu :help - - Legu la tekston en la helpfenestro por trovi kiel helpo funkcias. - Tajpu CTRL-W CTRL-W por salti de unu fenestro al la alia. - Tajpu :q por fermi la helpan fenestron. - - Vi povas trovi helpon pri io ajn aldonante argumenton al la komando - ":help". Provu tiujn (ne forgesu premi ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.7.2: KREI STARTAN SKRIPTON - - - ** Ebligu kapablojn de Vim ** - - Vim havas multe pli da kapabloj ol Vi, sed la plej multaj estas defaŭlte - malŝaltitaj. Por ekuzi la kapablojn, vi devas krei dosieron "vimrc". - - 1. Ekredaktu la dosieron "vimrc". Tio dependas de via sistemo: - :e ~/.vimrc por Unikso - :e ~/_vimrc por Vindozo - - 2. Nun legu la enhavon de la ekzempla "vimrc" - :r $VIMRUNTIME/vimrc_example.vim - - 3. Konservu la dosieron per: - :w - - La sekvantan fojon, kiam vi lanĉas Vim, ĝi uzos sintaksan emfazon. - Vi povas aldoni ĉiujn viajn preferatajn agordojn al tiu dosiero "vimrc". - Por pli da informoj, tajpu :help vimrc-intro - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.7.3: KOMPLETIGO - - - ** Kompletigo de komanda linio per CTRL-D kaj ** - - 1. Certigu ke Vim estas en kongrua reĝimo: :set nocp - - 2. Rigardu tiujn dosierojn, kiuj ekzistas en la dosierujo: :!ls aŭ :!dir - - 3. Tajpu la komencon de komando: :e - - 4. Premu CTRL-D kaj Vim montros liston de komandoj, kiuj komencas per "e". - - 5. Premu d kaj Vim kompletigos la nomon de la komando al ":edit". - - 6. Nun aldonu spaceton kaj la komencon de ekzistanta nomo: :edit DOSI - - 7. Premu d. Vim kompletigos la nomon (se ĝi estas unika) - -RIMARKO: Kompletigo funkcias por multaj komandoj. Nur provu premi CTRL-D kaj - . Estas aparte utila por :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leciono 1.7 RESUMO - - - 1. Tajpu :help aŭ premu por malfermi helpan fenestron. - - 2. Tajpu :help kmd por trovi helpon pri kmd. - - 3. Tajpu CTRL-W CTRL-W por salti al alia fenestro. - - 4. Tajpu :q to fermi la helpan fenestron. - - 5. Kreu komencan skripton vimrc por konservi viajn agordojn. - - 6. Kiam vi tajpas : komandon, premu CTRL-D por vidi ĉiujn kompleteblojn. - Premu por uzi unu kompletigon. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Tio konkludas la instruilon de Vim. Ĝi celis doni mallongan superrigardon - de la redaktilo Vim, nur tion kio sufiĉas por ebligi al vi facilan uzon de - la redaktilo. Estas nepre nekompleta, ĉar Vim havas multajn multajn pliajn - komandojn. Legu la manlibron: ":help user-manual". - - Tiu instruilo estis verkita de Michael C. Pierce kaj Robert K. Ware, - el la Koloradia Lernejo de Minejoj (Colorado School of Mines) uzante - ideojn provizitajn de Charles Smith el la Stata Universitato de Koloradio - (Colorado State University) - - Retpoŝto: bware@mines.colorado.edu. - - Modifita por Vim de Bram Moolenaar. - - Esperantigita fare de Dominique Pellé, 2008-04-01 - Retpoŝto: dominique.pelle@gmail.com - Lasta ŝanĝo: 2020-07-19 - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.es b/runtime/tutor/tutor1.es index c92f494742..0d3ac4fa64 100644 --- a/runtime/tutor/tutor1.es +++ b/runtime/tutor/tutor1.es @@ -1,240 +1,240 @@ =============================================================================== -= B i e n v e n i d o a l t u t o r d e V I M - Versi�n 1.7 = += B i e n v e n i d o a l t u t o r d e V I M - Versión 1.7 = =============================================================================== Vim es un editor muy potente que dispone de muchos comandos, demasiados - para ser explicados en un tutor como �ste. Este tutor est� dise�ado + para ser explicados en un tutor como éste. Este tutor está diseñado para describir suficientes comandos para que usted sea capaz de - aprender f�cilmente a usar Vim como un editor de prop�sito general. + aprender fácilmente a usar Vim como un editor de propósito general. El tiempo necesario para completar el tutor es aproximadamente de 30 - minutos, dependiendo de cu�nto tiempo se dedique a la experimentaci�n. + minutos, dependiendo de cuánto tiempo se dedique a la experimentación. - Los comandos de estas lecciones modificar�n el texto. Haga una copia de - este fichero para practicar (con �vimtutor� esto ya es una copia). + Los comandos de estas lecciones modificarán el texto. Haga una copia de + este fichero para practicar (con «vimtutor» esto ya es una copia). - Es importante recordar que este tutor est� pensado para ense�ar con - la pr�ctica. Esto significa que es necesario ejecutar los comandos - para aprenderlos adecuadamente. Si �nicamente lee el texto, �se le - olvidar�n los comandos. + Es importante recordar que este tutor está pensado para enseñar con + la práctica. Esto significa que es necesario ejecutar los comandos + para aprenderlos adecuadamente. Si únicamente lee el texto, ¡se le + olvidarán los comandos. - Ahora, aseg�rese de que la tecla de bloqueo de may�sculas NO est� + Ahora, asegúrese de que la tecla de bloqueo de mayúsculas NO está activada y pulse la tecla j lo suficiente para mover el cursor - de forma que la Lecci�n 1.1.1 ocupe completamente la pantalla. + de forma que la Lección 1.1.1 ocupe completamente la pantalla. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.1.1: MOVER EL CURSOR + Lección 1.1.1: MOVER EL CURSOR ** Para mover el cursor, pulse las teclas h,j,k,l de la forma indicada. ** ^ - k Indicaci�n: La tecla h est� a la izquierda y lo mueve a la izquierda. - < h l > La tecla l est� a la derecha y lo mueve a la derecha. + k Indicación: La tecla h está a la izquierda y lo mueve a la izquierda. + < h l > La tecla l está a la derecha y lo mueve a la derecha. j La tecla j parece una flecha que apunta hacia abajo. v - 1. Mueva el cursor por la pantalla hasta que se sienta c�modo con ello. + 1. Mueva el cursor por la pantalla hasta que se sienta cómodo con ello. - 2. Mantenga pulsada la tecla (j) hasta que se repita �autom�gicamente�. - Ahora ya sabe como llegar a la lecci�n siguiente. + 2. Mantenga pulsada la tecla (j) hasta que se repita «automágicamente». + Ahora ya sabe como llegar a la lección siguiente. - 3. Utilizando la tecla abajo, vaya a la lecci�n 1.1.2. + 3. Utilizando la tecla abajo, vaya a la lección 1.1.2. -NOTA: Si alguna vez no est� seguro sobre algo que ha tecleado, pulse +NOTA: Si alguna vez no está seguro sobre algo que ha tecleado, pulse para situarse en modo Normal. Luego vuelva a teclear la orden que deseaba. -NOTA: Las teclas de movimiento del cursor tambi�n funcionan. Pero usando - hjkl podr� moverse mucho m�s r�pido una vez que se acostumbre a ello. - �De verdad! +NOTA: Las teclas de movimiento del cursor también funcionan. Pero usando + hjkl podrá moverse mucho más rápido una vez que se acostumbre a ello. + ¡De verdad! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.1.2: SALIR DE VIM + Lección 1.1.2: SALIR DE VIM - �� NOTA: Antes de ejecutar alguno de los siguientes pasos lea primero - la lecci�n entera!! + ¡¡ NOTA: Antes de ejecutar alguno de los siguientes pasos lea primero + la lección entera!! - 1. Pulse la tecla (para asegurarse de que est� en modo Normal). + 1. Pulse la tecla (para asegurarse de que está en modo Normal). 2. Escriba: :q! Esto provoca la salida del editor DESCARTANDO cualquier cambio que haya hecho. - 3. Regrese aqu� ejecutando el comando que le trajo a este tutor. - �ste puede haber sido: vimtutor + 3. Regrese aquí ejecutando el comando que le trajo a este tutor. + Éste puede haber sido: vimtutor 4. Si ha memorizado estos pasos y se siente con confianza, ejecute los pasos 1 a 3 para salir y volver a entrar al editor. NOTA: :q! descarta cualquier cambio que haya realizado. - En pr�ximas lecciones aprender� c�mo guardar los cambios en un archivo. + En próximas lecciones aprenderá cómo guardar los cambios en un archivo. - 5. Mueva el cursor hasta la Lecci�n 1.1.3. + 5. Mueva el cursor hasta la Lección 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.1.3: EDITAR TEXTO - BORRAR + Lección 1.1.3: EDITAR TEXTO - BORRAR - ** Pulse x para eliminar el car�cter bajo el cursor. ** + ** Pulse x para eliminar el carácter bajo el cursor. ** - 1. Mueva el cursor a la l�nea de abajo se�alada con --->. + 1. Mueva el cursor a la línea de abajo señalada con --->. - 2. Para corregir los errores, mueva el cursor hasta que est� sobre el - car�cter que va a ser borrado. + 2. Para corregir los errores, mueva el cursor hasta que esté sobre el + carácter que va a ser borrado. - 3. Pulse la tecla x para eliminar el car�cter no deseado. + 3. Pulse la tecla x para eliminar el carácter no deseado. 4. Repita los pasos 2 a 4 hasta que la frase sea la correcta. ----> La vvaca salt�� soobree laa luuuuna. +---> La vvaca saltóó soobree laa luuuuna. - 5. Ahora que la l�nea esta correcta, contin�e con la Lecci�n 1.1.4. + 5. Ahora que la línea esta correcta, continúe con la Lección 1.1.4. NOTA: A medida que vaya avanzando en este tutor no intente memorizar, aprenda practicando. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.1.4: EDITAR TEXTO - INSERTAR + Lección 1.1.4: EDITAR TEXTO - INSERTAR ** Pulse i para insertar texto. ** - 1. Mueva el cursor a la primera l�nea de abajo se�alada con --->. + 1. Mueva el cursor a la primera línea de abajo señalada con --->. - 2. Para hacer que la primera l�nea sea igual que la segunda, mueva el - cursor hasta que est� sobre el car�cter ANTES del cual el texto va a ser + 2. Para hacer que la primera línea sea igual que la segunda, mueva el + cursor hasta que esté sobre el carácter ANTES del cual el texto va a ser insertado. - 3. Pulse i y escriba los caracteres a a�adir. + 3. Pulse i y escriba los caracteres a añadir. 4. A medida que sea corregido cada error pulse para volver al modo Normal. Repita los pasos 2 a 4 para corregir la frase. ---> Flta texto en esta . ----> Falta algo de texto en esta l�nea. +---> Falta algo de texto en esta línea. - 5. Cuando se sienta c�modo insertando texto pase vaya a la lecci�n 1.1.5. + 5. Cuando se sienta cómodo insertando texto pase vaya a la lección 1.1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.1.5: EDITAR TEXTO - A�ADIR + Lección 1.1.5: EDITAR TEXTO - AÑADIR - ** Pulse A para a�adir texto. ** + ** Pulse A para añadir texto. ** - 1. Mueva el cursor a la primera l�nea inferior marcada con --->. - No importa sobre qu� car�cter est� el cursor en esta l�nea. + 1. Mueva el cursor a la primera línea inferior marcada con --->. + No importa sobre qué carácter está el cursor en esta línea. 2. Pulse A y escriba el texto necesario. - 3. Cuando el texto haya sido a�adido pulse para volver al modo Normal. + 3. Cuando el texto haya sido añadido pulse para volver al modo Normal. - 4. Mueva el cursor a la segunda l�nea marcada con ---> y repita los + 4. Mueva el cursor a la segunda línea marcada con ---> y repita los pasos 2 y 3 para corregir esta frase. ----> Falta alg�n texto en es - Falta alg�n texto en esta l�nea. ----> Tambi�n falta alg - Tambi�n falta alg�n texto aqu�. +---> Falta algún texto en es + Falta algún texto en esta línea. +---> También falta alg + También falta algún texto aquí. - 5. Cuando se sienta c�modo a�adiendo texto pase a la lecci�n 1.1.6. + 5. Cuando se sienta cómodo añadiendo texto pase a la lección 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.1.6: EDITAR UN ARCHIVO + Lección 1.1.6: EDITAR UN ARCHIVO ** Use :wq para guardar un archivo y salir ** - !! NOTA: Antes de ejecutar los siguientes pasos, lea la lecci�n entera!! + !! NOTA: Antes de ejecutar los siguientes pasos, lea la lección entera!! 1. Si tiene acceso a otra terminal, haga lo siguiente en ella. - Si no es as�, salga de este tutor como hizo en la lecci�n 1.1.2: :q! + Si no es así, salga de este tutor como hizo en la lección 1.1.2: :q! - 2. En el s�mbolo del sistema escriba este comando: vim archivo.txt + 2. En el símbolo del sistema escriba este comando: vim archivo.txt 'vim' es el comando para arrancar el editor Vim, 'archivo.txt' es el nombre del archivo que quiere editar Utilice el nombre de un archivo que pueda cambiar. - 3. Inserte y elimine texto como ya aprendi� en las lecciones anteriores. + 3. Inserte y elimine texto como ya aprendió en las lecciones anteriores. 4. Guarde el archivo con los cambios y salga de Vim con: :wq 5. Si ha salido de vimtutor en el paso 1 reinicie vimtutor y baje hasta el siguiente sumario. - 6. Despu�s de leer los pasos anteriores y haberlos entendido: h�galos. + 6. Después de leer los pasos anteriores y haberlos entendido: hágalos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCI�N 1.1 + RESUMEN DE LA LECCIÓN 1.1 1. El cursor se mueve utilizando las teclas de las flechas o las teclas hjkl. h (izquierda) j (abajo) k (arriba) l (derecha) - 2. Para acceder a Vim desde el s�mbolo del sistema escriba: + 2. Para acceder a Vim desde el símbolo del sistema escriba: vim NOMBREARCHIVO 3. Para salir de Vim escriba: :q! para eliminar todos los cambios. O escriba: :wq para guardar los cambios. - 4. Para borrar un car�cter bajo el cursor en modo Normal pulse: x + 4. Para borrar un carácter bajo el cursor en modo Normal pulse: x - 5. Para insertar o a�adir texto escriba: + 5. Para insertar o añadir texto escriba: i escriba el texto a insertar inserta el texto antes del cursor - A escriba el texto a a�adir a�ade texto al final de la l�nea + A escriba el texto a añadir añade texto al final de la línea NOTA: Pulsando se vuelve al modo Normal o cancela una orden no deseada o incompleta. -Ahora contin�e con la Lecci�n 1.2. +Ahora continúe con la Lección 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.2.1: COMANDOS PARA BORRAR + Lección 1.2.1: COMANDOS PARA BORRAR ** Escriba dw para borrar una palabra ** - 1. Pulse para asegurarse de que est� en el modo Normal. + 1. Pulse para asegurarse de que está en el modo Normal. - 2. Mueva el cursor a la l�nea inferior se�alada con --->. + 2. Mueva el cursor a la línea inferior señalada con --->. 3. Mueva el cursor al comienzo de una palabra que desee borrar. 4. Pulse dw para hacer que la palabra desaparezca. - NOTA: La letra d aparecer� en la �ltima l�nea inferior derecha - de la pantalla mientras la escribe. Vim est� esperando que escriba w . - Si ve otro car�cter que no sea d escribi� algo mal, pulse y + NOTA: La letra d aparecerá en la última línea inferior derecha + de la pantalla mientras la escribe. Vim está esperando que escriba w . + Si ve otro carácter que no sea d escribió algo mal, pulse y comience de nuevo. ----> Hay algunas palabras p�salo bien que no pertenecen papel a esta frase. +---> Hay algunas palabras pásalo bien que no pertenecen papel a esta frase. 5. Repita los pasos 3 y 4 hasta que la frase sea correcta y pase a la - lecci�n 1.2.2. + lección 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.2.2: M�S COMANDOS PARA BORRAR + Lección 1.2.2: MÁS COMANDOS PARA BORRAR - ** Escriba d$ para borrar hasta el final de la l�nea. ** + ** Escriba d$ para borrar hasta el final de la línea. ** - 1. Pulse para asegurarse de que est� en el modo Normal. + 1. Pulse para asegurarse de que está en el modo Normal. - 2. Mueva el cursor a la l�nea inferior se�alada con --->. + 2. Mueva el cursor a la línea inferior señalada con --->. - 3. Mueva el cursor al final de la l�nea correcta (DESPU�S del primer . ). + 3. Mueva el cursor al final de la línea correcta (DESPUÉS del primer . ). - 4. Escriba d$ para borrar hasta el final de la l�nea. + 4. Escriba d$ para borrar hasta el final de la línea. ----> Alguien ha escrito el final de esta l�nea dos veces. esta l�nea dos veces. +---> Alguien ha escrito el final de esta línea dos veces. esta línea dos veces. - 5. Pase a la lecci�n 1.2.3 para entender qu� est� pasando. + 5. Pase a la lección 1.2.3 para entender qué está pasando. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.2.3: SOBRE OPERADORES Y MOVIMIENTOS + Lección 1.2.3: SOBRE OPERADORES Y MOVIMIENTOS - Muchos comandos que cambian texto est�n compuestos por un operador y un + Muchos comandos que cambian texto están compuestos por un operador y un movimiento. El formato para comando eliminar con el operador de borrado d es el siguiente: @@ -247,57 +247,57 @@ Ahora contin Una lista resumida de movimientos: w - hasta el comienzo de la siguiente palabra, EXCLUYENDO su primer - car�cter. - e - hasta el final de la palabra actual, INCLUYENDO el �ltimo car�cter. - $ - hasta el final de la l�nea, INCLUYENDO el �ltimo car�cter. + carácter. + e - hasta el final de la palabra actual, INCLUYENDO el último carácter. + $ - hasta el final de la línea, INCLUYENDO el último carácter. - Por tanto, al escribir de borrar� desde la posici�n del cursor, hasta + Por tanto, al escribir de borrará desde la posición del cursor, hasta el final de la palabra. -NOTA: Pulsando �nicamente el movimiento estando en el modo Normal sin un - operador, mover� el cursor como se especifica en la lista anterior. +NOTA: Pulsando únicamente el movimiento estando en el modo Normal sin un + operador, moverá el cursor como se especifica en la lista anterior. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.2.4: UTILIZAR UN CONTADOR PARA UN MOVIMIENTO + Lección 1.2.4: UTILIZAR UN CONTADOR PARA UN MOVIMIENTO - ** Al escribir un n�mero antes de un movimiento, lo repite esas veces. ** + ** Al escribir un número antes de un movimiento, lo repite esas veces. ** - 1. Mueva el cursor al comienzo de la l�nea marcada con --->. + 1. Mueva el cursor al comienzo de la línea marcada con --->. 2. Escriba 2w para mover el cursor dos palabras hacia adelante. 3. Escriba 3e para mover el cursor al final de la tercera palabra hacia adelante. - 4. Escriba 0 (cero) para colocar el cursor al inicio de la l�nea. + 4. Escriba 0 (cero) para colocar el cursor al inicio de la línea. - 5. Repita el paso 2 y 3 con diferentes n�meros. + 5. Repita el paso 2 y 3 con diferentes números. ----> Esto es solo una l�nea con palabras donde poder moverse. +---> Esto es solo una línea con palabras donde poder moverse. - 6. Pase a la lecci�n 1.2.5. + 6. Pase a la lección 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.2.5: UTILIZAR UN CONTADOR PARA BORRAR MAS + Lección 1.2.5: UTILIZAR UN CONTADOR PARA BORRAR MAS - ** Al escribir un n�mero con un operador lo repite esas veces. ** + ** Al escribir un número con un operador lo repite esas veces. ** - En combinaci�n con el operador de borrado y el movimiento mencionado - anteriormente, a�ada un contador antes del movimiento para eliminar m�s: - d n�mero movimiento + En combinación con el operador de borrado y el movimiento mencionado + anteriormente, añada un contador antes del movimiento para eliminar más: + d número movimiento - 1. Mueva el cursor al inicio de la primera palabra en MAY�SCULAS en la - l�nea marcada con --->. + 1. Mueva el cursor al inicio de la primera palabra en MAYÚSCULAS en la + línea marcada con --->. - 2. Escriba d2w para eliminar las dos palabras en MAY�SCULAS. + 2. Escriba d2w para eliminar las dos palabras en MAYÚSCULAS. 3. Repita los pasos 1 y 2 con diferentes contadores para eliminar - las siguientes palabras en MAY�SCULAS con un comando. + las siguientes palabras en MAYÚSCULAS con un comando. ---> Esta ABC DE serie FGHI JK LMN OP de palabras ha sido Q RS TUV limpiada. @@ -306,345 +306,345 @@ NOTA: Pulsando ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.2.6: OPERACI�N EN L�NEAS + Lección 1.2.6: OPERACIÓN EN LÍNEAS - ** Escriba dd para eliminar una l�nea completa. ** + ** Escriba dd para eliminar una línea completa. ** - Debido a la frecuencia con que se elimina una l�nea completa, los - dise�adores de Vi, decidieron que ser�a m�s sencillo simplemente escribir - dos letras d para eliminar una l�nea. + Debido a la frecuencia con que se elimina una línea completa, los + diseñadores de Vi, decidieron que sería más sencillo simplemente escribir + dos letras d para eliminar una línea. - 1. Mueva el cursor a la segunda l�nea del p�rrafo inferior. - 2. Escriba dd para eliminar la l�nea. - 3. Ahora mu�vase a la cuarta l�nea. - 4. Escriba 2dd para eliminar dos l�neas a la vez. + 1. Mueva el cursor a la segunda línea del párrafo inferior. + 2. Escriba dd para eliminar la línea. + 3. Ahora muévase a la cuarta línea. + 4. Escriba 2dd para eliminar dos líneas a la vez. ---> 1) Las rosas son rojas, ---> 2) El barro es divertido, ---> 3) La violeta es azul, ---> 4) Tengo un coche, ---> 5) Los relojes dan la hora, ----> 6) El az�car es dulce ----> 7) Y tambi�n lo eres t�. +---> 6) El azúcar es dulce +---> 7) Y también lo eres tú. -La duplicaci�n para borrar l�neas tambi�n funcionan con los operadores +La duplicación para borrar líneas también funcionan con los operadores mencionados anteriormente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.2.7: EL MANDATO DESHACER + Lección 1.2.7: EL MANDATO DESHACER - ** Pulse u para deshacer los �ltimos comandos, - U para deshacer una l�nea entera. ** + ** Pulse u para deshacer los últimos comandos, + U para deshacer una línea entera. ** - 1. Mueva el cursor a la l�nea inferior se�alada con ---> y sit�elo bajo el + 1. Mueva el cursor a la línea inferior señalada con ---> y sitúelo bajo el primer error. - 2. Pulse x para borrar el primer car�cter no deseado. - 3. Pulse ahora u para deshacer el �ltimo comando ejecutado. - 4. Ahora corrija todos los errores de la l�nea usando el comando x. - 5. Pulse ahora U may�scula para devolver la l�nea a su estado original. + 2. Pulse x para borrar el primer carácter no deseado. + 3. Pulse ahora u para deshacer el último comando ejecutado. + 4. Ahora corrija todos los errores de la línea usando el comando x. + 5. Pulse ahora U mayúscula para devolver la línea a su estado original. 6. Pulse ahora u unas pocas veces para deshacer lo hecho por U y los comandos previos. 7. Ahora pulse CTRL-R (mantenga pulsada la tecla CTRL y pulse R) unas cuantas veces para volver a ejecutar los comandos (deshacer lo deshecho). ----> Corrrija los errores dee esttta l�nea y vuuelva a ponerlos coon deshacer. +---> Corrrija los errores dee esttta línea y vuuelva a ponerlos coon deshacer. - 8. Estos son unos comandos muy �tiles. Ahora vayamos al resumen de la - lecci�n 1.2. + 8. Estos son unos comandos muy útiles. Ahora vayamos al resumen de la + lección 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCI�N 1.2 + RESUMEN DE LA LECCIÓN 1.2 1. Para borrar desde el cursor hasta siguiente palabra pulse: dw 2. Para borrar desde el cursor hasta el final de la palabra pulse: de - 3. Para borrar desde el cursor hasta el final de una l�nea pulse: d$ - 4. Para borrar una l�nea entera pulse: dd + 3. Para borrar desde el cursor hasta el final de una línea pulse: d$ + 4. Para borrar una línea entera pulse: dd - 5. Para repetir un movimiento anteponga un n�mero: 2w + 5. Para repetir un movimiento anteponga un número: 2w 6. El formato para un comando de cambio es: - operador [n�mero] movimiento + operador [número] movimiento donde: comando - es lo que hay que hacer, por ejemplo, d para borrar - [n�mero] - es un n�mero opcional para repetir el movimiento + [número] - es un número opcional para repetir el movimiento movimiento - se mueve sobre el texto sobre el que operar, como - w (palabra), $ (hasta el final de la l�nea), etc. - 7. Para moverse al inicio de la l�nea utilice un cero: 0 + w (palabra), $ (hasta el final de la línea), etc. + 7. Para moverse al inicio de la línea utilice un cero: 0 - 8. Para deshacer acciones previas pulse: u (u min�scula) - Para deshacer todos los cambios de una l�nea pulse: U (U may�scula) + 8. Para deshacer acciones previas pulse: u (u minúscula) + Para deshacer todos los cambios de una línea pulse: U (U mayúscula) Para deshacer lo deshecho pulse: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.3.1: EL COMANDO �PUT� (poner) + Lección 1.3.1: EL COMANDO «PUT» (poner) -** Pulse p para poner (pegar) despu�s del cursor lo �ltimo que ha borrado. ** +** Pulse p para poner (pegar) después del cursor lo último que ha borrado. ** - 1. Mueva el cursor a la primera l�nea inferior marcada con --->. + 1. Mueva el cursor a la primera línea inferior marcada con --->. - 2. Escriba dd para borrar la l�nea y almacenarla en un registro de Vim. + 2. Escriba dd para borrar la línea y almacenarla en un registro de Vim. - 3. Mueva el cursor a la l�nea c) por ENCIMA de donde deber�a estar - la l�nea eliminada. + 3. Mueva el cursor a la línea c) por ENCIMA de donde debería estar + la línea eliminada. - 4. Pulse p para pegar la l�nea borrada por debajo del cursor. + 4. Pulse p para pegar la línea borrada por debajo del cursor. - 5. Repita los pasos 2 a 4 para poner todas las l�neas en el orden correcto. + 5. Repita los pasos 2 a 4 para poner todas las líneas en el orden correcto. ----> d) �Puedes aprenderla t�? +---> d) ¿Puedes aprenderla tú? ---> b) La violeta es azul, ---> c) La inteligencia se aprende, ---> a) Las rosas son rojas, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.3.2: EL COMANDO REEMPLAZAR + Lección 1.3.2: EL COMANDO REEMPLAZAR - ** Pulse rx para reemplazar el car�cter bajo el cursor con x . ** + ** Pulse rx para reemplazar el carácter bajo el cursor con x . ** - 1. Mueva el cursor a la primera l�nea inferior marcada con --->. + 1. Mueva el cursor a la primera línea inferior marcada con --->. 2. Mueva el cursor para situarlo sobre el primer error. - 3. Pulse r y despu�s el car�cter que deber�a ir ah�. + 3. Pulse r y después el carácter que debería ir ahí. 4. Repita los pasos 2 y 3 hasta que la primera sea igual a la segunda. ----> �Cuendo esta l�nea fue rscrita alguien pulso algunas teclas equibocadas! ----> �Cuando esta l�nea fue escrita alguien puls� algunas teclas equivocadas! +---> ¡Cuendo esta línea fue rscrita alguien pulso algunas teclas equibocadas! +---> ¡Cuando esta línea fue escrita alguien pulsó algunas teclas equivocadas! - 5. Ahora pase a la lecci�n 1.3.3. + 5. Ahora pase a la lección 1.3.3. -NOTA: Recuerde que deber�a aprender practicando. +NOTA: Recuerde que debería aprender practicando. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.3.3: EL COMANDO CAMBIAR + Lección 1.3.3: EL COMANDO CAMBIAR ** Para cambiar hasta el final de una palabra, escriba ce . ** - 1. Mueva el cursor a la primera l�nea inferior marcada con --->. + 1. Mueva el cursor a la primera línea inferior marcada con --->. - 2. Sit�e el cursor en la u de lubrs. + 2. Sitúe el cursor en la u de lubrs. - 3. Escriba ce y corrija la palabra (en este caso, escriba '�nea'). + 3. Escriba ce y corrija la palabra (en este caso, escriba 'ínea'). 4. Pulse y mueva el cursor al siguiente error que debe ser cambiado. 5. Repita los pasos 3 y 4 hasta que la primera frase sea igual a la segunda. ---> Esta lubrs tiene unas pocas pskavtad que corregir usem el comando change. ----> Esta l�nea tiene unas pocas palabras que corregir usando el comando change. +---> Esta línea tiene unas pocas palabras que corregir usando el comando change. Tenga en cuenta que ce elimina la palabra y entra en el modo Insertar. - cc hace lo mismo para toda la l�nea. + cc hace lo mismo para toda la línea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.3.4: M�S CAMBIOS USANDO c + Lección 1.3.4: MÁS CAMBIOS USANDO c ** El operador change se utiliza con los mismos movimientos que delete. ** 1. El operador change funciona de la misma forma que delete. El formato es: - c [n�mero] movimiento + c [número] movimiento - 2. Los movimientos son tambi�n los mismos, tales como w (palabra) o - $ (fin de la l�nea). + 2. Los movimientos son también los mismos, tales como w (palabra) o + $ (fin de la línea). - 3. Mueva el cursor a la primera l�nea inferior se�alada con --->. + 3. Mueva el cursor a la primera línea inferior señalada con --->. 4. Mueva el cursor al primer error. - 5. Pulse c$ y escriba el resto de la l�nea para que sea como la segunda + 5. Pulse c$ y escriba el resto de la línea para que sea como la segunda y pulse . ----> El final de esta l�nea necesita alguna ayuda para que sea como la segunda. ----> El final de esta l�nea necesita ser corregido usando el comando c$. +---> El final de esta línea necesita alguna ayuda para que sea como la segunda. +---> El final de esta línea necesita ser corregido usando el comando c$. NOTA: Puede utilizar el retorno de carro para corregir errores mientras escribe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCI�N 1.3 + RESUMEN DE LA LECCIÓN 1.3 1. Para volver a poner o pegar el texto que acaba de ser borrado, - escriba p . Esto pega el texto despu�s del cursor (si se borr� una - l�nea, al pegarla, esta se situar� en la l�nea debajo del cursor). + escriba p . Esto pega el texto después del cursor (si se borró una + línea, al pegarla, esta se situará en la línea debajo del cursor). - 2. Para reemplazar el car�cter bajo el cursor, pulse r y luego el - car�cter que quiere que est� en ese lugar. + 2. Para reemplazar el carácter bajo el cursor, pulse r y luego el + carácter que quiere que esté en ese lugar. - 3. El operador change le permite cambiar desde la posici�n del cursor + 3. El operador change le permite cambiar desde la posición del cursor hasta donde el movimiento indicado le lleve. Por ejemplo, pulse ce para cambiar desde el cursor hasta el final de la palabra, o c$ - para cambiar hasta el final de la l�nea. + para cambiar hasta el final de la línea. 4. El formato para change es: - c [n�mero] movimiento + c [número] movimiento - Pase ahora a la lecci�n siguiente. + Pase ahora a la lección siguiente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.4.1: UBICACI�N DEL CURSOR Y ESTADO DEL ARCHIVO + Lección 1.4.1: UBICACIÓN DEL CURSOR Y ESTADO DEL ARCHIVO - ** Pulse CTRL-G para mostrar su situaci�n en el fichero y su estado. - Pulse G para moverse a una determinada l�nea del fichero. ** + ** Pulse CTRL-G para mostrar su situación en el fichero y su estado. + Pulse G para moverse a una determinada línea del fichero. ** -NOTA: ��Lea esta lecci�n entera antes de ejecutar cualquiera de los pasos!! +NOTA: ¡¡Lea esta lección entera antes de ejecutar cualquiera de los pasos!! 1. Mantenga pulsada la tecla Ctrl y pulse g . Le llamamos a esto CTRL-G. - Aparecer� un mensaje en la parte inferior de la p�gina con el nombre - del archivo y la posici�n en este. Recuerde el n�mero de l�nea + Aparecerá un mensaje en la parte inferior de la página con el nombre + del archivo y la posición en este. Recuerde el número de línea para el paso 3. -NOTA: Quiz�s pueda ver la posici�n del cursor en la esquina inferior derecha - de la pantalla. Esto ocurre cuando la opci�n 'ruler' (regla) est� +NOTA: Quizás pueda ver la posición del cursor en la esquina inferior derecha + de la pantalla. Esto ocurre cuando la opción 'ruler' (regla) está habilitada (consulte :help 'ruler' ) 2. Pulse G para mover el cursor hasta la parte inferior del archivo. Pulse gg para mover el cursor al inicio del archivo. - 3. Escriba el n�mero de la l�nea en la que estaba y despu�s G . Esto - le volver� a la l�nea en la que estaba cuando puls� CTRL-G. + 3. Escriba el número de la línea en la que estaba y después G . Esto + le volverá a la línea en la que estaba cuando pulsó CTRL-G. 4. Si se siente seguro en poder hacer esto ejecute los pasos 1 a 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.4.2: EL COMANDO �SEARCH� (buscar) + Lección 1.4.2: EL COMANDO «SEARCH» (buscar) ** Escriba / seguido de una frase para buscar la frase. ** - 1. En modo Normal pulse el car�cter / . F�jese que tanto el car�cter / - como el cursor aparecen en la �ltima l�nea de la pantalla, lo mismo + 1. En modo Normal pulse el carácter / . Fíjese que tanto el carácter / + como el cursor aparecen en la última línea de la pantalla, lo mismo que el comando : . 2. Escriba ahora errroor . Esta es la palabra que quiere buscar. - 3. Para repetir la b�squeda de la misma frase otra vez, simplemente pulse n . - Para buscar la misma frase en la direcci�n opuesta, pulse N . + 3. Para repetir la búsqueda de la misma frase otra vez, simplemente pulse n . + Para buscar la misma frase en la dirección opuesta, pulse N . - 4. Si quiere buscar una frase en la direcci�n opuesta (hacia arriba), + 4. Si quiere buscar una frase en la dirección opuesta (hacia arriba), utilice el comando ? en lugar de / . - 5. Para regresar al lugar de donde proced�a pulse CTRL-O (Mantenga pulsado - Ctrl mientras pulsa la letra o). Repita el proceso para regresar m�s atr�s. + 5. Para regresar al lugar de donde procedía pulse CTRL-O (Mantenga pulsado + Ctrl mientras pulsa la letra o). Repita el proceso para regresar más atrás. CTRL-I va hacia adelante. ---> "errroor" no es la forma correcta de escribir error, errroor es un error. -NOTA: Cuando la b�squeda llega al final del archivo, continuar� desde el - comienzo, a menos que la opci�n 'wrapscan' haya sido desactivada. +NOTA: Cuando la búsqueda llega al final del archivo, continuará desde el + comienzo, a menos que la opción 'wrapscan' haya sido desactivada. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.4.3: B�SQUEDA PARA COMPROBAR PAR�NTESIS + Lección 1.4.3: BÚSQUEDA PARA COMPROBAR PARÉNTESIS - ** Pulse % para encontrar el par�ntesis correspondiente a ),] o } . ** + ** Pulse % para encontrar el paréntesis correspondiente a ),] o } . ** - 1. Sit�e el cursor en cualquiera de los caracteres (, [ o { en la l�nea - inferior se�alada con --->. + 1. Sitúe el cursor en cualquiera de los caracteres (, [ o { en la línea + inferior señalada con --->. - 2. Pulse ahora el car�cter % . + 2. Pulse ahora el carácter % . - 3. El cursor se mover� a la pareja de cierre del par�ntesis, corchete + 3. El cursor se moverá a la pareja de cierre del paréntesis, corchete o llave correspondiente. - 4. Pulse % para mover el cursor a la otra pareja del car�cter. + 4. Pulse % para mover el cursor a la otra pareja del carácter. 5. Mueva el cursor a otro (,),[,],{ o } y vea lo que hace % . ----> Esto ( es una l�nea de prueba con (, [, ], {, y } en ella. )) +---> Esto ( es una línea de prueba con (, [, ], {, y } en ella. )) -NOTA: �Esto es muy �til en la detecci�n de errores en un programa con - par�ntesis, corchetes o llaves sin pareja. +NOTA: ¡Esto es muy útil en la detección de errores en un programa con + paréntesis, corchetes o llaves sin pareja. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.4.4: EL COMANDO SUSTITUIR + Lección 1.4.4: EL COMANDO SUSTITUIR ** Escriba :s/viejo/nuevo/g para sustituir 'viejo' por 'nuevo'. ** - 1. Mueva el cursor a la l�nea inferior se�alada con --->. + 1. Mueva el cursor a la línea inferior señalada con --->. 2. Escriba :s/laas/las/ . Tenga en cuenta que este mandato cambia - s�lo la primera aparici�n en la l�nea de la expresi�n a cambiar. + sólo la primera aparición en la línea de la expresión a cambiar. - 3. Ahora escriba :s/laas/la/g . Al a�adir la opci�n g esto significa - que har� la sustituci�n global en la l�nea, cambiando todas las - ocurrencias del t�rmino "laas" en la l�nea. + 3. Ahora escriba :s/laas/la/g . Al añadir la opción g esto significa + que hará la sustitución global en la línea, cambiando todas las + ocurrencias del término "laas" en la línea. ----> Laas mejores �pocas para ver laas flores son laas primaveras. +---> Laas mejores épocas para ver laas flores son laas primaveras. - 4. Para cambiar cada ocurrencia de la cadena de caracteres entre dos l�neas, - Escriba :#,#s/viejo/nuevo/g donde #,# son los n�meros de l�nea del rango - de l�neas donde se realizar� la sustituci�n. + 4. Para cambiar cada ocurrencia de la cadena de caracteres entre dos líneas, + Escriba :#,#s/viejo/nuevo/g donde #,# son los números de línea del rango + de líneas donde se realizará la sustitución. Escriba :%s/old/new/g para cambiar cada ocurrencia en todo el archivo. Escriba :%s/old/new/gc para encontrar cada ocurrencia en todo el - archivo, pidiendo confirmaci�n para - realizar la sustituci�n o no. + archivo, pidiendo confirmación para + realizar la sustitución o no. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCI�N 1.4 + RESUMEN DE LA LECCIÓN 1.4 - 1. CTRL-G muestra la posici�n del cursor en el fichero y su estado. + 1. CTRL-G muestra la posición del cursor en el fichero y su estado. G mueve el cursor al final del archivo. - n�mero G mueve el cursor a ese n�mero de l�nea. - gg mueve el cursor a la primera l�nea del archivo. + número G mueve el cursor a ese número de línea. + gg mueve el cursor a la primera línea del archivo. 2. Escribiendo / seguido de una frase busca la frase hacia ADELANTE. - Escribiendo ? seguido de una frase busca la frase hacia ATR�S. - Despu�s de una b�squeda pulse n para encontrar la aparici�n - siguiente en la misma direcci�n o N para buscar en direcci�n opuesta. + Escribiendo ? seguido de una frase busca la frase hacia ATRÁS. + Después de una búsqueda pulse n para encontrar la aparición + siguiente en la misma dirección o N para buscar en dirección opuesta. 3. Pulsando % cuando el cursor esta sobre (,), [,], { o } localiza la pareja correspondiente. - 4. Para cambiar viejo en el primer nuevo en una l�nea escriba :s/viejo/nuevo - Para cambiar todos los viejo por nuevo en una l�nea escriba :s/viejo/nuevo/g - Para cambiar frases entre dos n�meros de l�neas escriba :#,#s/viejo/nuevo/g + 4. Para cambiar viejo en el primer nuevo en una línea escriba :s/viejo/nuevo + Para cambiar todos los viejo por nuevo en una línea escriba :s/viejo/nuevo/g + Para cambiar frases entre dos números de líneas escriba :#,#s/viejo/nuevo/g Para cambiar viejo por nuevo en todo el fichero escriba :%s/viejo/nuevo/g - Para pedir confirmaci�n en cada caso a�ada 'c' :%s/viejo/nuevo/gc + Para pedir confirmación en cada caso añada 'c' :%s/viejo/nuevo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.5.1: C�MO EJECUTAR UN MANDATO EXTERNO + Lección 1.5.1: CÓMO EJECUTAR UN MANDATO EXTERNO ** Escriba :! seguido de un comando externo para ejecutar ese comando. ** 1. Escriba el conocido comando : para situar el cursor al final de la - pantalla. Esto le permitir� introducir un comando. + pantalla. Esto le permitirá introducir un comando. - 2. Ahora escriba el car�cter ! (signo de admiraci�n). Esto le permitir� + 2. Ahora escriba el carácter ! (signo de admiración). Esto le permitirá ejecutar cualquier mandato del sistema. - 3. Como ejemplo escriba ls despu�s del ! y luego pulse . Esto - le mostrar� una lista de su directorio, igual que si estuviera en el - s�mbolo del sistema. Si ls no funciona utilice :!dir . + 3. Como ejemplo escriba ls después del ! y luego pulse . Esto + le mostrará una lista de su directorio, igual que si estuviera en el + símbolo del sistema. Si ls no funciona utilice :!dir . NOTA: De esta manera es posible ejecutar cualquier comando externo, - tambi�n incluyendo argumentos. + también incluyendo argumentos. NOTA: Todos los comando : deben finalizarse pulsando . - De ahora en adelante no siempre se mencionar�. + De ahora en adelante no siempre se mencionará. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.5.2: M�S SOBRE GUARDAR FICHEROS + Lección 1.5.2: MÁS SOBRE GUARDAR FICHEROS ** Para guardar los cambios hechos en un fichero, @@ -652,81 +652,81 @@ NOTA: Todos los comando : deben finalizarse pulsando . 1. Escriba :!dir o :!ls para ver una lista de los archivos de su directorio. - Ya sabe que debe pulsar despu�s de ello. + Ya sabe que debe pulsar después de ello. - 2. Elija un nombre de fichero que todav�a no exista, como TEST. + 2. Elija un nombre de fichero que todavía no exista, como TEST. 3. Ahora escriba :w TEST (donde TEST es el nombre de fichero elegido). - 4. Esta acci�n guarda todo el fichero (Vim Tutor) bajo el nombre TEST. + 4. Esta acción guarda todo el fichero (Vim Tutor) bajo el nombre TEST. Para comprobarlo escriba :!dir o :!ls de nuevo y vea su directorio. NOTA: Si saliera de Vim y volviera a entrar de nuevo con vim TEST , el - archivo ser�a una copia exacta del tutorial cuando lo guard�. + archivo sería una copia exacta del tutorial cuando lo guardó. 5. Ahora elimine el archivo escribiendo (Windows): :!del TEST o (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.5.3: SELECCIONAR TEXTO PARA GUARDAR + Lección 1.5.3: SELECCIONAR TEXTO PARA GUARDAR ** Para guardar parte del archivo, escriba v movimiento :w ARCHIVO ** - 1. Mueva el cursor a esta l�nea. + 1. Mueva el cursor a esta línea. 2. Pulse v y mueva el cursor hasta el quinto elemento inferior. Vea que el texto es resaltado. - 3. Pulse el car�cter : en la parte inferior de la pantalla aparecer� + 3. Pulse el carácter : en la parte inferior de la pantalla aparecerá :'<,'> - 4. Pulse w TEST , donde TEST es un nombre de archivo que a�n no existe. + 4. Pulse w TEST , donde TEST es un nombre de archivo que aún no existe. Verifique que ve :'<,'>w TEST antes de pulsar . - 5. Vim escribir� las l�neas seleccionadas en el archivo TEST. Utilice - :!dir o :!ls para verlo. �No lo elimine todav�a! Lo utilizaremos - en la siguiente lecci�n. + 5. Vim escribirá las líneas seleccionadas en el archivo TEST. Utilice + :!dir o :!ls para verlo. ¡No lo elimine todavía! Lo utilizaremos + en la siguiente lección. -NOTA: Al pulsar v inicia la selecci�n visual. Puede mover el cursor para - hacer la selecci�n m�s grande o peque�a. Despu�s puede utilizar un - operador para hacer algo con el texto. Por ejemplo, d eliminar� +NOTA: Al pulsar v inicia la selección visual. Puede mover el cursor para + hacer la selección más grande o pequeña. Después puede utilizar un + operador para hacer algo con el texto. Por ejemplo, d eliminará el texto seleccionado. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.5.4: RECUPERANDO Y MEZCLANDO FICHEROS + Lección 1.5.4: RECUPERANDO Y MEZCLANDO FICHEROS ** Para insertar el contenido de un fichero escriba :r NOMBRE_DEL_FICHERO ** - 1. Sit�e el cursor justo por encima de esta l�nea. + 1. Sitúe el cursor justo por encima de esta línea. -NOTA: Despu�s de ejecutar el paso 2 ver� texto de la lecci�n 1.5.3. Despu�s - DESCIENDA hasta ver de nuevo esta lecci�n. +NOTA: Después de ejecutar el paso 2 verá texto de la lección 1.5.3. Después + DESCIENDA hasta ver de nuevo esta lección. 2. Ahora recupere el archivo TEST utilizando el comando :r TEST donde TEST es el nombre que ha utilizado. - El archivo que ha recuperado se colocar� debajo de la l�nea donde + El archivo que ha recuperado se colocará debajo de la línea donde se encuentra el cursor. 3. Para verificar que se ha recuperado el archivo, suba el cursor y - compruebe que ahora hay dos copias de la lecci�n 1.5.3, la original y - la versi�n del archivo. + compruebe que ahora hay dos copias de la lección 1.5.3, la original y + la versión del archivo. -NOTA: Tambi�n puede leer la salida de un comando externo. Por ejemplo, - :r !ls lee la salida del comando ls y lo pega debajo de la l�nea +NOTA: También puede leer la salida de un comando externo. Por ejemplo, + :r !ls lee la salida del comando ls y lo pega debajo de la línea donde se encuentra el cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCI�N 1.5 + RESUMEN DE LA LECCIÓN 1.5 1. :!comando ejecuta un comando externo. - Algunos ejemplos �tiles son: + Algunos ejemplos útiles son: (Windows) (Unix) :!dir :!ls - muestra el contenido de un directorio. :!del ARCHIVO :!rm ARCHIVO - borra el fichero ARCHIVO. @@ -734,202 +734,202 @@ NOTA: Tambi 2. :w ARCHIVO escribe el archivo actual de Vim en el disco con el nombre de ARCHIVO. - 3. v movimiento :w ARCHIVO guarda las l�neas seleccionadas visualmente + 3. v movimiento :w ARCHIVO guarda las líneas seleccionadas visualmente en el archivo ARCHIVO. 4. :r ARCHIVO recupera del disco el archivo ARCHIVO y lo pega debajo - de la posici�n del cursor. + de la posición del cursor. 5. :r !dir lee la salida del comando dir y lo pega debajo de la - posici�n del cursor. + posición del cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.6.1: EL COMANDO OPEN + Lección 1.6.1: EL COMANDO OPEN - ** Pulse o para abrir una l�nea debajo del cursor + ** Pulse o para abrir una línea debajo del cursor y situarle en modo Insertar ** - 1. Mueva el cursor a la l�nea inferior se�alada con --->. + 1. Mueva el cursor a la línea inferior señalada con --->. - 2. Pulse la letra min�scula o para abrir una l�nea por DEBAJO del cursor + 2. Pulse la letra minúscula o para abrir una línea por DEBAJO del cursor y situarle en modo Insertar. - 3. Ahora escriba alg�n texto y despu�s pulse para salir del modo + 3. Ahora escriba algún texto y después pulse para salir del modo insertar. ----> Despu�s de pulsar o el cursor se sit�a en la l�nea abierta en modo Insertar. +---> Después de pulsar o el cursor se sitúa en la línea abierta en modo Insertar. - 4. Para abrir una l�nea por ENCIMA del cursor, simplemente pulse una O - may�scula, en lugar de una o min�scula. Pruebe esto en la l�nea siguiente. + 4. Para abrir una línea por ENCIMA del cursor, simplemente pulse una O + mayúscula, en lugar de una o minúscula. Pruebe esto en la línea siguiente. ----> Abra una l�nea sobre esta pulsando O cuando el cursor est� en esta l�nea. +---> Abra una línea sobre esta pulsando O cuando el cursor está en esta línea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.6.2: EL COMANDO APPEND (a�adir) + Lección 1.6.2: EL COMANDO APPEND (añadir) - ** Pulse a para insertar texto DESPU�S del cursor. ** + ** Pulse a para insertar texto DESPUÉS del cursor. ** - 1. Mueva el cursor al inicio de la primera l�nea inferior se�alada con --->. + 1. Mueva el cursor al inicio de la primera línea inferior señalada con --->. - 2. Escriba e hasta que el cursor est� al final de l�n . + 2. Escriba e hasta que el cursor esté al final de lín . - 3. Escriba una a (min�scula) para a�adir texto DESPU�S del cursor. + 3. Escriba una a (minúscula) para añadir texto DESPUÉS del cursor. - 4. Complete la palabra como en la l�nea inferior. Pulse para salir + 4. Complete la palabra como en la línea inferior. Pulse para salir del modo insertar. 5. Utilice e para moverse hasta la siguiente palabra incompleta y repita los pasos 3 y 4. ----> Esta l�n le permit prati c�mo a�ad texto a una l�nea. ----> Esta l�nea le permitir� practicar c�mo a�adir texto a una l�nea. +---> Esta lín le permit prati cómo añad texto a una línea. +---> Esta línea le permitirá practicar cómo añadir texto a una línea. -NOTA: a, i y A todos entran en el modo Insertar, la �nica diferencia es - d�nde ubican los caracteres insertados. +NOTA: a, i y A todos entran en el modo Insertar, la única diferencia es + dónde ubican los caracteres insertados. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.6.3: OTRA VERSI�N DE REPLACE (remplazar) + Lección 1.6.3: OTRA VERSIÓN DE REPLACE (remplazar) - ** Pulse una R may�scula para sustituir m�s de un car�cter. ** + ** Pulse una R mayúscula para sustituir más de un carácter. ** - 1. Mueva el cursor a la primera l�nea inferior se�alada con --->. Mueva + 1. Mueva el cursor a la primera línea inferior señalada con --->. Mueva el cursor al inicio de la primera xxx . - 2. Ahora pulse R y escriba el n�mero que aparece en la l�nea inferior, - esto reemplazar� el texto xxx . + 2. Ahora pulse R y escriba el número que aparece en la línea inferior, + esto reemplazará el texto xxx . 3. Pulse para abandonar el modo Reemplazar. Observe que el resto de - la l�nea permanece sin modificaciones. + la línea permanece sin modificaciones. 4. Repita los pasos para reemplazar el texto xxx que queda. ---> Sumar 123 a xxx da un resultado de xxx. ---> Sumar 123 a 456 da un resultado de 579. -NOTA: El modo Reemplazar es como el modo Insertar, pero cada car�cter escrito - elimina un car�cter ya existente. +NOTA: El modo Reemplazar es como el modo Insertar, pero cada carácter escrito + elimina un carácter ya existente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.6.4: COPIAR Y PEGAR TEXTO + Lección 1.6.4: COPIAR Y PEGAR TEXTO ** Utilice el operador y para copiar texto y p para pegarlo. ** - 1. Mueva el cursor a la l�nea inferior marcada con ---> y posicione el - cursor despu�s de "a)". + 1. Mueva el cursor a la línea inferior marcada con ---> y posicione el + cursor después de "a)". 2. Inicie el modo Visual con v y mueva el cursor justo antes de "primer". 3. Pulse y para copiar ("yank") el texto resaltado. - 4. Mueva el cursor al final de la siguiente l�nea mediante: j$ + 4. Mueva el cursor al final de la siguiente línea mediante: j$ - 5. Pulse p para poner (pegar) el texto. Despu�s escriba: el segundo . + 5. Pulse p para poner (pegar) el texto. Después escriba: el segundo . - 6. Utilice el modo visual para seleccionar " elemento.", y c�pielo con y - mueva el cursor al final de la siguiente l�nea con j$ y pegue el texto - reci�n copiado con p . + 6. Utilice el modo visual para seleccionar " elemento.", y cópielo con y + mueva el cursor al final de la siguiente línea con j$ y pegue el texto + recién copiado con p . ---> a) este es el primer elemento. b) -NOTA: Tambi�n puede utilizar y como un operador: yw copia una palabra, - yy copia la l�nea completa donde est� el cursor, despu�s p pegar� - esa l�nea. +NOTA: También puede utilizar y como un operador: yw copia una palabra, + yy copia la línea completa donde está el cursor, después p pegará + esa línea. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.6.5: ACTIVAR (SET) UNA OPCI�N + Lección 1.6.5: ACTIVAR (SET) UNA OPCIÓN - ** Active una opci�n para buscar o sustituir ignorando si est� - en may�sculas o min�sculas el texto. ** + ** Active una opción para buscar o sustituir ignorando si está + en mayúsculas o minúsculas el texto. ** 1. Busque la cadena de texto 'ignorar' escribiendo: /ignorar - Repita la b�squeda varias veces pulsando n . + Repita la búsqueda varias veces pulsando n . - 2. Active la opci�n 'ic' (Ignore case o ignorar may�sculas y min�sculas) + 2. Active la opción 'ic' (Ignore case o ignorar mayúsculas y minúsculas) mediante: :set ic 3. Ahora busque de nuevo 'ignorar' pulsando n - Observe que ahora tambi�n se encuentran Ignorar e IGNORAR. + Observe que ahora también se encuentran Ignorar e IGNORAR. 4. Active las opciones 'hlsearch' y 'incsearch' escribiendo: :set hls is - 5. Ahora escriba de nuevo el comando de b�squeda y vea qu� ocurre: /ignore + 5. Ahora escriba de nuevo el comando de búsqueda y vea qué ocurre: /ignore - 6. Para inhabilitar el ignorar la distinci�n de may�sculas y min�sculas + 6. Para inhabilitar el ignorar la distinción de mayúsculas y minúsculas escriba: :set noic NOTA: Para eliminar el resaltado de las coincidencias escriba: :nohlsearch -NOTA: Si quiere ignorar las may�sculas y min�sculas, solo para un comando - de b�squeda, utilice \c en la frase: /ignorar\c +NOTA: Si quiere ignorar las mayúsculas y minúsculas, solo para un comando + de búsqueda, utilice \c en la frase: /ignorar\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCI�N 1.6 + RESUMEN DE LA LECCIÓN 1.6 - 1. Escriba o para abrir una l�nea por DEBAJO de la posici�n del cursor y + 1. Escriba o para abrir una línea por DEBAJO de la posición del cursor y entrar en modo Insertar. - Escriba O para abrir una l�nea por ENCIMA de la posici�n del cursor y + Escriba O para abrir una línea por ENCIMA de la posición del cursor y entrar en modo Insertar - 2. Escriba a para insertar texto DESPU�S del cursor. - Escriba A para insertar texto al final de la l�nea. + 2. Escriba a para insertar texto DESPUÉS del cursor. + Escriba A para insertar texto al final de la línea. 3. El comando e mueve el cursor al final de una palabra. 4. El operador y copia (yank) texto, p lo pega (pone). - 5. Al escribir una R may�scula entra en el modo Reemplazar hasta que + 5. Al escribir una R mayúscula entra en el modo Reemplazar hasta que se pulsa . - 6. Al escribir ":set xxx" activa la opci�n "xxx". Algunas opciones son: - 'ic' 'ignorecase' ignorar may�sculas/min�sculas al buscar - 'is' 'incsearch' mostrar las coincidencias parciales para la b�squeda + 6. Al escribir ":set xxx" activa la opción "xxx". Algunas opciones son: + 'ic' 'ignorecase' ignorar mayúsculas/minúsculas al buscar + 'is' 'incsearch' mostrar las coincidencias parciales para la búsqueda de una frase 'hls' 'hlsearch' resalta todas las coincidencias de la frases Puedes utilizar tanto los nombre largos o cortos de las opciones. - 7. A�ada "no" para inhabilitar una opci�n: :set noic + 7. Añada "no" para inhabilitar una opción: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 7: OBTENER AYUDA + Lección 7: OBTENER AYUDA - ** Utilice el sistema de ayuda en l�nea ** + ** Utilice el sistema de ayuda en línea ** - Vim dispone de un sistema de ayuda en l�nea. Para comenzar, pruebe una + Vim dispone de un sistema de ayuda en línea. Para comenzar, pruebe una de estas tres formas: - pulse la tecla (si dispone de ella) - pulse la tecla (si dispone de ella) - escriba :help - Lea el texto en la ventana de ayuda para descubrir c�mo funciona la ayuda. + Lea el texto en la ventana de ayuda para descubrir cómo funciona la ayuda. Escriba CTRL-W CTRL-W para saltar de una ventana a otra. Escriba :q para cerrar la ventana de ayuda. - Puede encontrar ayuda en casi cualquier tema a�adiendo un argumento al - comando �:help�. Pruebe �stos (no olvide pulsar ): + Puede encontrar ayuda en casi cualquier tema añadiendo un argumento al + comando «:help». Pruebe éstos (no olvide pulsar ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.7.2: CREAR UN SCRIPT DE INICIO + Lección 1.7.2: CREAR UN SCRIPT DE INICIO ** Habilitar funcionalidades en Vim ** - Vim tiene muchas m�s funcionalidades que Vi, pero algunas est�n + Vim tiene muchas más funcionalidades que Vi, pero algunas están inhabilitadas de manera predeterminada. - Para empezar a utilizar m�s funcionalidades deber�a crear un archivo + Para empezar a utilizar más funcionalidades debería crear un archivo llamado "vimrc". 1. Comience a editar el archivo "vimrc". Esto depende de su sistema: @@ -942,35 +942,35 @@ NOTA: Si quiere ignorar las may 3. Guarde el archivo mediante: :w - La pr�xima vez que inicie Vim, este usar� el resaltado de sintaxis. - Puede a�adir todos sus ajustes preferidos a este archivo "vimrc". - Para m�s informaci�n escriba :help vimrc-intro + La próxima vez que inicie Vim, este usará el resaltado de sintaxis. + Puede añadir todos sus ajustes preferidos a este archivo "vimrc". + Para más información escriba :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lecci�n 1.7.3: COMPLETADO + Lección 1.7.3: COMPLETADO - ** Completado de la l�nea de comandos con CTRL-D o ** + ** Completado de la línea de comandos con CTRL-D o ** - 1. Aseg�rese de que Vim no est� en el modo compatible: :set nocp + 1. Asegúrese de que Vim no está en el modo compatible: :set nocp - 2. Vea qu� archivos existen en el directorio con: :!ls o :!dir + 2. Vea qué archivos existen en el directorio con: :!ls o :!dir 3. Escriba el inicio de un comando: :e - 4. Pulse CTRL-D y Vim mostrar� una lista de comandos que empiezan con "e". + 4. Pulse CTRL-D y Vim mostrará una lista de comandos que empiezan con "e". - 5. A�ada d y Vim completar� el nombre del comando a ":edit". + 5. Añada d y Vim completará el nombre del comando a ":edit". - 6. Ahora a�ada un espacio y el inicio del nombre de un archivo: :edit FIL + 6. Ahora añada un espacio y el inicio del nombre de un archivo: :edit FIL - 7. Pulse . Vim completar� el nombre (si solo hay uno). + 7. Pulse . Vim completará el nombre (si solo hay uno). NOTA: El completado funciona con muchos comandos. Solo pulse CTRL-D o - . Es especialmente �til para :help . + . Es especialmente útil para :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCI�N 1.7 + RESUMEN DE LA LECCIÓN 1.7 1. Escriba :help o pulse o para abrir la ventana de ayuda. @@ -994,17 +994,17 @@ NOTA: El completado funciona con muchos comandos. Solo pulse CTRL-D o ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Aqu� concluye el tutor de Vim. Est� pensado para dar una visi�n breve del + Aquí concluye el tutor de Vim. Está pensado para dar una visión breve del editor Vim, lo suficiente para permitirle usar el editor de forma bastante - sencilla. Est� muy lejos de estar completo pues Vim tiene much�simos m�s + sencilla. Está muy lejos de estar completo pues Vim tiene muchísimos más comandos. Lea el siguiente manual de usuario: ":help user-manual". Para lecturas y estudios posteriores se recomienda el libro: Vim - Vi Improved - de Steve Oualline Editado por: New Riders - El primer libro dedicado completamente a Vim. Especialmente �til para - reci�n principiantes. - Tiene muchos ejemplos e im�genes. + El primer libro dedicado completamente a Vim. Especialmente útil para + recién principiantes. + Tiene muchos ejemplos e imágenes. Vea https://iccf-holland.org/click5.html Este tutorial ha sido escrito por Michael C. Pierce y Robert K. Ware, @@ -1016,11 +1016,11 @@ NOTA: El completado funciona con muchos comandos. Solo pulse CTRL-D o ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Traducido del ingl�s por: + Traducido del inglés por: * Eduardo F. Amatria - Correo electr�nico: eferna1@platea.pntic.mec.es + Correo electrónico: eferna1@platea.pntic.mec.es * Victorhck - Correo electr�nico: victorhck@opensuse.org + Correo electrónico: victorhck@opensuse.org ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.es.utf-8 b/runtime/tutor/tutor1.es.utf-8 deleted file mode 100644 index 0d3ac4fa64..0000000000 --- a/runtime/tutor/tutor1.es.utf-8 +++ /dev/null @@ -1,1026 +0,0 @@ -=============================================================================== -= B i e n v e n i d o a l t u t o r d e V I M - Versión 1.7 = -=============================================================================== - - Vim es un editor muy potente que dispone de muchos comandos, demasiados - para ser explicados en un tutor como éste. Este tutor está diseñado - para describir suficientes comandos para que usted sea capaz de - aprender fácilmente a usar Vim como un editor de propósito general. - - El tiempo necesario para completar el tutor es aproximadamente de 30 - minutos, dependiendo de cuánto tiempo se dedique a la experimentación. - - Los comandos de estas lecciones modificarán el texto. Haga una copia de - este fichero para practicar (con «vimtutor» esto ya es una copia). - - Es importante recordar que este tutor está pensado para enseñar con - la práctica. Esto significa que es necesario ejecutar los comandos - para aprenderlos adecuadamente. Si únicamente lee el texto, ¡se le - olvidarán los comandos. - - Ahora, asegúrese de que la tecla de bloqueo de mayúsculas NO está - activada y pulse la tecla j lo suficiente para mover el cursor - de forma que la Lección 1.1.1 ocupe completamente la pantalla. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.1.1: MOVER EL CURSOR - - ** Para mover el cursor, pulse las teclas h,j,k,l de la forma indicada. ** - ^ - k Indicación: La tecla h está a la izquierda y lo mueve a la izquierda. - < h l > La tecla l está a la derecha y lo mueve a la derecha. - j La tecla j parece una flecha que apunta hacia abajo. - v - - 1. Mueva el cursor por la pantalla hasta que se sienta cómodo con ello. - - 2. Mantenga pulsada la tecla (j) hasta que se repita «automágicamente». - Ahora ya sabe como llegar a la lección siguiente. - - 3. Utilizando la tecla abajo, vaya a la lección 1.1.2. - -NOTA: Si alguna vez no está seguro sobre algo que ha tecleado, pulse - para situarse en modo Normal. Luego vuelva a teclear la orden que deseaba. - -NOTA: Las teclas de movimiento del cursor también funcionan. Pero usando - hjkl podrá moverse mucho más rápido una vez que se acostumbre a ello. - ¡De verdad! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.1.2: SALIR DE VIM - - ¡¡ NOTA: Antes de ejecutar alguno de los siguientes pasos lea primero - la lección entera!! - - 1. Pulse la tecla (para asegurarse de que está en modo Normal). - - 2. Escriba: :q! - Esto provoca la salida del editor DESCARTANDO cualquier cambio que haya hecho. - - 3. Regrese aquí ejecutando el comando que le trajo a este tutor. - Éste puede haber sido: vimtutor - - 4. Si ha memorizado estos pasos y se siente con confianza, ejecute los - pasos 1 a 3 para salir y volver a entrar al editor. - -NOTA: :q! descarta cualquier cambio que haya realizado. - En próximas lecciones aprenderá cómo guardar los cambios en un archivo. - - 5. Mueva el cursor hasta la Lección 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.1.3: EDITAR TEXTO - BORRAR - - ** Pulse x para eliminar el carácter bajo el cursor. ** - - 1. Mueva el cursor a la línea de abajo señalada con --->. - - 2. Para corregir los errores, mueva el cursor hasta que esté sobre el - carácter que va a ser borrado. - - 3. Pulse la tecla x para eliminar el carácter no deseado. - - 4. Repita los pasos 2 a 4 hasta que la frase sea la correcta. - ----> La vvaca saltóó soobree laa luuuuna. - - 5. Ahora que la línea esta correcta, continúe con la Lección 1.1.4. - -NOTA: A medida que vaya avanzando en este tutor no intente memorizar, - aprenda practicando. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.1.4: EDITAR TEXTO - INSERTAR - - ** Pulse i para insertar texto. ** - - 1. Mueva el cursor a la primera línea de abajo señalada con --->. - - 2. Para hacer que la primera línea sea igual que la segunda, mueva el - cursor hasta que esté sobre el carácter ANTES del cual el texto va a ser - insertado. - - 3. Pulse i y escriba los caracteres a añadir. - - 4. A medida que sea corregido cada error pulse para volver al modo - Normal. Repita los pasos 2 a 4 para corregir la frase. - ----> Flta texto en esta . ----> Falta algo de texto en esta línea. - - 5. Cuando se sienta cómodo insertando texto pase vaya a la lección 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.1.5: EDITAR TEXTO - AÑADIR - - - ** Pulse A para añadir texto. ** - - 1. Mueva el cursor a la primera línea inferior marcada con --->. - No importa sobre qué carácter está el cursor en esta línea. - - 2. Pulse A y escriba el texto necesario. - - 3. Cuando el texto haya sido añadido pulse para volver al modo Normal. - - 4. Mueva el cursor a la segunda línea marcada con ---> y repita los - pasos 2 y 3 para corregir esta frase. - ----> Falta algún texto en es - Falta algún texto en esta línea. ----> También falta alg - También falta algún texto aquí. - - 5. Cuando se sienta cómodo añadiendo texto pase a la lección 1.1.6. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.1.6: EDITAR UN ARCHIVO - - ** Use :wq para guardar un archivo y salir ** - - !! NOTA: Antes de ejecutar los siguientes pasos, lea la lección entera!! - - 1. Si tiene acceso a otra terminal, haga lo siguiente en ella. - Si no es así, salga de este tutor como hizo en la lección 1.1.2: :q! - - 2. En el símbolo del sistema escriba este comando: vim archivo.txt - 'vim' es el comando para arrancar el editor Vim, 'archivo.txt' - es el nombre del archivo que quiere editar - Utilice el nombre de un archivo que pueda cambiar. - - 3. Inserte y elimine texto como ya aprendió en las lecciones anteriores. - - 4. Guarde el archivo con los cambios y salga de Vim con: :wq - - 5. Si ha salido de vimtutor en el paso 1 reinicie vimtutor y baje hasta - el siguiente sumario. - - 6. Después de leer los pasos anteriores y haberlos entendido: hágalos. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 1.1 - - - 1. El cursor se mueve utilizando las teclas de las flechas o las teclas hjkl. - h (izquierda) j (abajo) k (arriba) l (derecha) - - 2. Para acceder a Vim desde el símbolo del sistema escriba: - vim NOMBREARCHIVO - - 3. Para salir de Vim escriba: :q! para eliminar todos - los cambios. - O escriba: :wq para guardar los cambios. - - 4. Para borrar un carácter bajo el cursor en modo Normal pulse: x - - 5. Para insertar o añadir texto escriba: - i escriba el texto a insertar inserta el texto antes del cursor - A escriba el texto a añadir añade texto al final de la línea - -NOTA: Pulsando se vuelve al modo Normal o cancela una orden no deseada - o incompleta. - -Ahora continúe con la Lección 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.2.1: COMANDOS PARA BORRAR - - - ** Escriba dw para borrar una palabra ** - - - 1. Pulse para asegurarse de que está en el modo Normal. - - 2. Mueva el cursor a la línea inferior señalada con --->. - - 3. Mueva el cursor al comienzo de una palabra que desee borrar. - - 4. Pulse dw para hacer que la palabra desaparezca. - - NOTA: La letra d aparecerá en la última línea inferior derecha - de la pantalla mientras la escribe. Vim está esperando que escriba w . - Si ve otro carácter que no sea d escribió algo mal, pulse y - comience de nuevo. - ----> Hay algunas palabras pásalo bien que no pertenecen papel a esta frase. - - 5. Repita los pasos 3 y 4 hasta que la frase sea correcta y pase a la - lección 1.2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.2.2: MÁS COMANDOS PARA BORRAR - - - ** Escriba d$ para borrar hasta el final de la línea. ** - - 1. Pulse para asegurarse de que está en el modo Normal. - - 2. Mueva el cursor a la línea inferior señalada con --->. - - 3. Mueva el cursor al final de la línea correcta (DESPUÉS del primer . ). - - 4. Escriba d$ para borrar hasta el final de la línea. - ----> Alguien ha escrito el final de esta línea dos veces. esta línea dos veces. - - 5. Pase a la lección 1.2.3 para entender qué está pasando. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.2.3: SOBRE OPERADORES Y MOVIMIENTOS - - - Muchos comandos que cambian texto están compuestos por un operador y un - movimiento. - El formato para comando eliminar con el operador de borrado d es el - siguiente: - - d movimiento - - Donde: - d - es el operador para borrar. - movimiento - es sobre lo que el comando va a operar (lista inferior). - - Una lista resumida de movimientos: - w - hasta el comienzo de la siguiente palabra, EXCLUYENDO su primer - carácter. - e - hasta el final de la palabra actual, INCLUYENDO el último carácter. - $ - hasta el final de la línea, INCLUYENDO el último carácter. - - Por tanto, al escribir de borrará desde la posición del cursor, hasta - el final de la palabra. - -NOTA: Pulsando únicamente el movimiento estando en el modo Normal sin un - operador, moverá el cursor como se especifica en la lista anterior. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.2.4: UTILIZAR UN CONTADOR PARA UN MOVIMIENTO - - - ** Al escribir un número antes de un movimiento, lo repite esas veces. ** - - 1. Mueva el cursor al comienzo de la línea marcada con --->. - - 2. Escriba 2w para mover el cursor dos palabras hacia adelante. - - 3. Escriba 3e para mover el cursor al final de la tercera palabra hacia - adelante. - - 4. Escriba 0 (cero) para colocar el cursor al inicio de la línea. - - 5. Repita el paso 2 y 3 con diferentes números. - ----> Esto es solo una línea con palabras donde poder moverse. - - 6. Pase a la lección 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.2.5: UTILIZAR UN CONTADOR PARA BORRAR MAS - - - ** Al escribir un número con un operador lo repite esas veces. ** - - En combinación con el operador de borrado y el movimiento mencionado - anteriormente, añada un contador antes del movimiento para eliminar más: - d número movimiento - - 1. Mueva el cursor al inicio de la primera palabra en MAYÚSCULAS en la - línea marcada con --->. - - 2. Escriba d2w para eliminar las dos palabras en MAYÚSCULAS. - - 3. Repita los pasos 1 y 2 con diferentes contadores para eliminar - las siguientes palabras en MAYÚSCULAS con un comando. - ----> Esta ABC DE serie FGHI JK LMN OP de palabras ha sido Q RS TUV limpiada. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.2.6: OPERACIÓN EN LÍNEAS - - - ** Escriba dd para eliminar una línea completa. ** - - Debido a la frecuencia con que se elimina una línea completa, los - diseñadores de Vi, decidieron que sería más sencillo simplemente escribir - dos letras d para eliminar una línea. - - 1. Mueva el cursor a la segunda línea del párrafo inferior. - 2. Escriba dd para eliminar la línea. - 3. Ahora muévase a la cuarta línea. - 4. Escriba 2dd para eliminar dos líneas a la vez. - ----> 1) Las rosas son rojas, ----> 2) El barro es divertido, ----> 3) La violeta es azul, ----> 4) Tengo un coche, ----> 5) Los relojes dan la hora, ----> 6) El azúcar es dulce ----> 7) Y también lo eres tú. - -La duplicación para borrar líneas también funcionan con los operadores -mencionados anteriormente. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.2.7: EL MANDATO DESHACER - - - ** Pulse u para deshacer los últimos comandos, - U para deshacer una línea entera. ** - - 1. Mueva el cursor a la línea inferior señalada con ---> y sitúelo bajo el - primer error. - 2. Pulse x para borrar el primer carácter no deseado. - 3. Pulse ahora u para deshacer el último comando ejecutado. - 4. Ahora corrija todos los errores de la línea usando el comando x. - 5. Pulse ahora U mayúscula para devolver la línea a su estado original. - 6. Pulse ahora u unas pocas veces para deshacer lo hecho por U y los - comandos previos. - 7. Ahora pulse CTRL-R (mantenga pulsada la tecla CTRL y pulse R) unas - cuantas veces para volver a ejecutar los comandos (deshacer lo deshecho). - ----> Corrrija los errores dee esttta línea y vuuelva a ponerlos coon deshacer. - - 8. Estos son unos comandos muy útiles. Ahora vayamos al resumen de la - lección 1.2. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 1.2 - - 1. Para borrar desde el cursor hasta siguiente palabra pulse: dw - 2. Para borrar desde el cursor hasta el final de la palabra pulse: de - 3. Para borrar desde el cursor hasta el final de una línea pulse: d$ - 4. Para borrar una línea entera pulse: dd - - 5. Para repetir un movimiento anteponga un número: 2w - 6. El formato para un comando de cambio es: - operador [número] movimiento - donde: - comando - es lo que hay que hacer, por ejemplo, d para borrar - [número] - es un número opcional para repetir el movimiento - movimiento - se mueve sobre el texto sobre el que operar, como - w (palabra), $ (hasta el final de la línea), etc. - 7. Para moverse al inicio de la línea utilice un cero: 0 - - 8. Para deshacer acciones previas pulse: u (u minúscula) - Para deshacer todos los cambios de una línea pulse: U (U mayúscula) - Para deshacer lo deshecho pulse: CTRL-R - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.3.1: EL COMANDO «PUT» (poner) - -** Pulse p para poner (pegar) después del cursor lo último que ha borrado. ** - - 1. Mueva el cursor a la primera línea inferior marcada con --->. - - 2. Escriba dd para borrar la línea y almacenarla en un registro de Vim. - - 3. Mueva el cursor a la línea c) por ENCIMA de donde debería estar - la línea eliminada. - - 4. Pulse p para pegar la línea borrada por debajo del cursor. - - 5. Repita los pasos 2 a 4 para poner todas las líneas en el orden correcto. - ----> d) ¿Puedes aprenderla tú? ----> b) La violeta es azul, ----> c) La inteligencia se aprende, ----> a) Las rosas son rojas, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.3.2: EL COMANDO REEMPLAZAR - - - ** Pulse rx para reemplazar el carácter bajo el cursor con x . ** - - 1. Mueva el cursor a la primera línea inferior marcada con --->. - - 2. Mueva el cursor para situarlo sobre el primer error. - - 3. Pulse r y después el carácter que debería ir ahí. - - 4. Repita los pasos 2 y 3 hasta que la primera sea igual a la segunda. - ----> ¡Cuendo esta línea fue rscrita alguien pulso algunas teclas equibocadas! ----> ¡Cuando esta línea fue escrita alguien pulsó algunas teclas equivocadas! - - 5. Ahora pase a la lección 1.3.3. - -NOTA: Recuerde que debería aprender practicando. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.3.3: EL COMANDO CAMBIAR - - - ** Para cambiar hasta el final de una palabra, escriba ce . ** - - 1. Mueva el cursor a la primera línea inferior marcada con --->. - - 2. Sitúe el cursor en la u de lubrs. - - 3. Escriba ce y corrija la palabra (en este caso, escriba 'ínea'). - - 4. Pulse y mueva el cursor al siguiente error que debe ser cambiado. - - 5. Repita los pasos 3 y 4 hasta que la primera frase sea igual a la segunda. - ----> Esta lubrs tiene unas pocas pskavtad que corregir usem el comando change. ----> Esta línea tiene unas pocas palabras que corregir usando el comando change. - -Tenga en cuenta que ce elimina la palabra y entra en el modo Insertar. - cc hace lo mismo para toda la línea. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.3.4: MÁS CAMBIOS USANDO c - - ** El operador change se utiliza con los mismos movimientos que delete. ** - - 1. El operador change funciona de la misma forma que delete. El formato es: - - c [número] movimiento - - 2. Los movimientos son también los mismos, tales como w (palabra) o - $ (fin de la línea). - - 3. Mueva el cursor a la primera línea inferior señalada con --->. - - 4. Mueva el cursor al primer error. - - 5. Pulse c$ y escriba el resto de la línea para que sea como la segunda - y pulse . - ----> El final de esta línea necesita alguna ayuda para que sea como la segunda. ----> El final de esta línea necesita ser corregido usando el comando c$. - -NOTA: Puede utilizar el retorno de carro para corregir errores mientras escribe. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 1.3 - - - 1. Para volver a poner o pegar el texto que acaba de ser borrado, - escriba p . Esto pega el texto después del cursor (si se borró una - línea, al pegarla, esta se situará en la línea debajo del cursor). - - 2. Para reemplazar el carácter bajo el cursor, pulse r y luego el - carácter que quiere que esté en ese lugar. - - 3. El operador change le permite cambiar desde la posición del cursor - hasta donde el movimiento indicado le lleve. Por ejemplo, pulse ce - para cambiar desde el cursor hasta el final de la palabra, o c$ - para cambiar hasta el final de la línea. - - 4. El formato para change es: - - c [número] movimiento - - Pase ahora a la lección siguiente. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.4.1: UBICACIÓN DEL CURSOR Y ESTADO DEL ARCHIVO - - ** Pulse CTRL-G para mostrar su situación en el fichero y su estado. - Pulse G para moverse a una determinada línea del fichero. ** - -NOTA: ¡¡Lea esta lección entera antes de ejecutar cualquiera de los pasos!! - - 1. Mantenga pulsada la tecla Ctrl y pulse g . Le llamamos a esto CTRL-G. - Aparecerá un mensaje en la parte inferior de la página con el nombre - del archivo y la posición en este. Recuerde el número de línea - para el paso 3. - -NOTA: Quizás pueda ver la posición del cursor en la esquina inferior derecha - de la pantalla. Esto ocurre cuando la opción 'ruler' (regla) está - habilitada (consulte :help 'ruler' ) - - 2. Pulse G para mover el cursor hasta la parte inferior del archivo. - Pulse gg para mover el cursor al inicio del archivo. - - 3. Escriba el número de la línea en la que estaba y después G . Esto - le volverá a la línea en la que estaba cuando pulsó CTRL-G. - - 4. Si se siente seguro en poder hacer esto ejecute los pasos 1 a 3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.4.2: EL COMANDO «SEARCH» (buscar) - - ** Escriba / seguido de una frase para buscar la frase. ** - - 1. En modo Normal pulse el carácter / . Fíjese que tanto el carácter / - como el cursor aparecen en la última línea de la pantalla, lo mismo - que el comando : . - - 2. Escriba ahora errroor . Esta es la palabra que quiere buscar. - - 3. Para repetir la búsqueda de la misma frase otra vez, simplemente pulse n . - Para buscar la misma frase en la dirección opuesta, pulse N . - - 4. Si quiere buscar una frase en la dirección opuesta (hacia arriba), - utilice el comando ? en lugar de / . - - 5. Para regresar al lugar de donde procedía pulse CTRL-O (Mantenga pulsado - Ctrl mientras pulsa la letra o). Repita el proceso para regresar más atrás. - CTRL-I va hacia adelante. - ----> "errroor" no es la forma correcta de escribir error, errroor es un error. - -NOTA: Cuando la búsqueda llega al final del archivo, continuará desde el - comienzo, a menos que la opción 'wrapscan' haya sido desactivada. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.4.3: BÚSQUEDA PARA COMPROBAR PARÉNTESIS - - ** Pulse % para encontrar el paréntesis correspondiente a ),] o } . ** - - 1. Sitúe el cursor en cualquiera de los caracteres (, [ o { en la línea - inferior señalada con --->. - - 2. Pulse ahora el carácter % . - - 3. El cursor se moverá a la pareja de cierre del paréntesis, corchete - o llave correspondiente. - - 4. Pulse % para mover el cursor a la otra pareja del carácter. - - 5. Mueva el cursor a otro (,),[,],{ o } y vea lo que hace % . - ----> Esto ( es una línea de prueba con (, [, ], {, y } en ella. )) - -NOTA: ¡Esto es muy útil en la detección de errores en un programa con - paréntesis, corchetes o llaves sin pareja. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.4.4: EL COMANDO SUSTITUIR - - - ** Escriba :s/viejo/nuevo/g para sustituir 'viejo' por 'nuevo'. ** - - 1. Mueva el cursor a la línea inferior señalada con --->. - - 2. Escriba :s/laas/las/ . Tenga en cuenta que este mandato cambia - sólo la primera aparición en la línea de la expresión a cambiar. - - 3. Ahora escriba :s/laas/la/g . Al añadir la opción g esto significa - que hará la sustitución global en la línea, cambiando todas las - ocurrencias del término "laas" en la línea. - ----> Laas mejores épocas para ver laas flores son laas primaveras. - - 4. Para cambiar cada ocurrencia de la cadena de caracteres entre dos líneas, - Escriba :#,#s/viejo/nuevo/g donde #,# son los números de línea del rango - de líneas donde se realizará la sustitución. - Escriba :%s/old/new/g para cambiar cada ocurrencia en todo el - archivo. - Escriba :%s/old/new/gc para encontrar cada ocurrencia en todo el - archivo, pidiendo confirmación para - realizar la sustitución o no. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 1.4 - - - 1. CTRL-G muestra la posición del cursor en el fichero y su estado. - G mueve el cursor al final del archivo. - número G mueve el cursor a ese número de línea. - gg mueve el cursor a la primera línea del archivo. - - 2. Escribiendo / seguido de una frase busca la frase hacia ADELANTE. - Escribiendo ? seguido de una frase busca la frase hacia ATRÁS. - Después de una búsqueda pulse n para encontrar la aparición - siguiente en la misma dirección o N para buscar en dirección opuesta. - - 3. Pulsando % cuando el cursor esta sobre (,), [,], { o } localiza - la pareja correspondiente. - - 4. Para cambiar viejo en el primer nuevo en una línea escriba :s/viejo/nuevo - Para cambiar todos los viejo por nuevo en una línea escriba :s/viejo/nuevo/g - Para cambiar frases entre dos números de líneas escriba :#,#s/viejo/nuevo/g - Para cambiar viejo por nuevo en todo el fichero escriba :%s/viejo/nuevo/g - Para pedir confirmación en cada caso añada 'c' :%s/viejo/nuevo/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.5.1: CÓMO EJECUTAR UN MANDATO EXTERNO - - - ** Escriba :! seguido de un comando externo para ejecutar ese comando. ** - - 1. Escriba el conocido comando : para situar el cursor al final de la - pantalla. Esto le permitirá introducir un comando. - - 2. Ahora escriba el carácter ! (signo de admiración). Esto le permitirá - ejecutar cualquier mandato del sistema. - - 3. Como ejemplo escriba ls después del ! y luego pulse . Esto - le mostrará una lista de su directorio, igual que si estuviera en el - símbolo del sistema. Si ls no funciona utilice :!dir . - -NOTA: De esta manera es posible ejecutar cualquier comando externo, - también incluyendo argumentos. - -NOTA: Todos los comando : deben finalizarse pulsando . - De ahora en adelante no siempre se mencionará. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.5.2: MÁS SOBRE GUARDAR FICHEROS - - - ** Para guardar los cambios hechos en un fichero, - escriba :w NOMBRE_DE_FICHERO ** - - 1. Escriba :!dir o :!ls para ver una lista de los archivos - de su directorio. - Ya sabe que debe pulsar después de ello. - - 2. Elija un nombre de fichero que todavía no exista, como TEST. - - 3. Ahora escriba :w TEST (donde TEST es el nombre de fichero elegido). - - 4. Esta acción guarda todo el fichero (Vim Tutor) bajo el nombre TEST. - Para comprobarlo escriba :!dir o :!ls de nuevo y vea su directorio. - -NOTA: Si saliera de Vim y volviera a entrar de nuevo con vim TEST , el - archivo sería una copia exacta del tutorial cuando lo guardó. - - 5. Ahora elimine el archivo escribiendo (Windows): :!del TEST - o (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.5.3: SELECCIONAR TEXTO PARA GUARDAR - - - ** Para guardar parte del archivo, escriba v movimiento :w ARCHIVO ** - - 1. Mueva el cursor a esta línea. - - 2. Pulse v y mueva el cursor hasta el quinto elemento inferior. Vea que - el texto es resaltado. - - 3. Pulse el carácter : en la parte inferior de la pantalla aparecerá - :'<,'> - - 4. Pulse w TEST , donde TEST es un nombre de archivo que aún no existe. - Verifique que ve :'<,'>w TEST antes de pulsar . - - 5. Vim escribirá las líneas seleccionadas en el archivo TEST. Utilice - :!dir o :!ls para verlo. ¡No lo elimine todavía! Lo utilizaremos - en la siguiente lección. - -NOTA: Al pulsar v inicia la selección visual. Puede mover el cursor para - hacer la selección más grande o pequeña. Después puede utilizar un - operador para hacer algo con el texto. Por ejemplo, d eliminará - el texto seleccionado. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.5.4: RECUPERANDO Y MEZCLANDO FICHEROS - - - ** Para insertar el contenido de un fichero escriba :r NOMBRE_DEL_FICHERO ** - - 1. Sitúe el cursor justo por encima de esta línea. - -NOTA: Después de ejecutar el paso 2 verá texto de la lección 1.5.3. Después - DESCIENDA hasta ver de nuevo esta lección. - - 2. Ahora recupere el archivo TEST utilizando el comando :r TEST donde - TEST es el nombre que ha utilizado. - El archivo que ha recuperado se colocará debajo de la línea donde - se encuentra el cursor. - - 3. Para verificar que se ha recuperado el archivo, suba el cursor y - compruebe que ahora hay dos copias de la lección 1.5.3, la original y - la versión del archivo. - -NOTA: También puede leer la salida de un comando externo. Por ejemplo, - :r !ls lee la salida del comando ls y lo pega debajo de la línea - donde se encuentra el cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 1.5 - - - 1. :!comando ejecuta un comando externo. - - Algunos ejemplos útiles son: - (Windows) (Unix) - :!dir :!ls - muestra el contenido de un directorio. - :!del ARCHIVO :!rm ARCHIVO - borra el fichero ARCHIVO. - - 2. :w ARCHIVO escribe el archivo actual de Vim en el disco con el - nombre de ARCHIVO. - - 3. v movimiento :w ARCHIVO guarda las líneas seleccionadas visualmente - en el archivo ARCHIVO. - - 4. :r ARCHIVO recupera del disco el archivo ARCHIVO y lo pega debajo - de la posición del cursor. - - 5. :r !dir lee la salida del comando dir y lo pega debajo de la - posición del cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.6.1: EL COMANDO OPEN - - - ** Pulse o para abrir una línea debajo del cursor - y situarle en modo Insertar ** - - 1. Mueva el cursor a la línea inferior señalada con --->. - - 2. Pulse la letra minúscula o para abrir una línea por DEBAJO del cursor - y situarle en modo Insertar. - - 3. Ahora escriba algún texto y después pulse para salir del modo - insertar. - ----> Después de pulsar o el cursor se sitúa en la línea abierta en modo Insertar. - - 4. Para abrir una línea por ENCIMA del cursor, simplemente pulse una O - mayúscula, en lugar de una o minúscula. Pruebe esto en la línea siguiente. - ----> Abra una línea sobre esta pulsando O cuando el cursor está en esta línea. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.6.2: EL COMANDO APPEND (añadir) - - - ** Pulse a para insertar texto DESPUÉS del cursor. ** - - 1. Mueva el cursor al inicio de la primera línea inferior señalada con --->. - - 2. Escriba e hasta que el cursor esté al final de lín . - - 3. Escriba una a (minúscula) para añadir texto DESPUÉS del cursor. - - 4. Complete la palabra como en la línea inferior. Pulse para salir - del modo insertar. - - 5. Utilice e para moverse hasta la siguiente palabra incompleta y - repita los pasos 3 y 4. - ----> Esta lín le permit prati cómo añad texto a una línea. ----> Esta línea le permitirá practicar cómo añadir texto a una línea. - -NOTA: a, i y A todos entran en el modo Insertar, la única diferencia es - dónde ubican los caracteres insertados. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.6.3: OTRA VERSIÓN DE REPLACE (remplazar) - - - ** Pulse una R mayúscula para sustituir más de un carácter. ** - - 1. Mueva el cursor a la primera línea inferior señalada con --->. Mueva - el cursor al inicio de la primera xxx . - - 2. Ahora pulse R y escriba el número que aparece en la línea inferior, - esto reemplazará el texto xxx . - - 3. Pulse para abandonar el modo Reemplazar. Observe que el resto de - la línea permanece sin modificaciones. - - 4. Repita los pasos para reemplazar el texto xxx que queda. - ----> Sumar 123 a xxx da un resultado de xxx. ----> Sumar 123 a 456 da un resultado de 579. - -NOTA: El modo Reemplazar es como el modo Insertar, pero cada carácter escrito - elimina un carácter ya existente. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.6.4: COPIAR Y PEGAR TEXTO - - - - ** Utilice el operador y para copiar texto y p para pegarlo. ** - - 1. Mueva el cursor a la línea inferior marcada con ---> y posicione el - cursor después de "a)". - - 2. Inicie el modo Visual con v y mueva el cursor justo antes de "primer". - - 3. Pulse y para copiar ("yank") el texto resaltado. - - 4. Mueva el cursor al final de la siguiente línea mediante: j$ - - 5. Pulse p para poner (pegar) el texto. Después escriba: el segundo . - - 6. Utilice el modo visual para seleccionar " elemento.", y cópielo con y - mueva el cursor al final de la siguiente línea con j$ y pegue el texto - recién copiado con p . - ----> a) este es el primer elemento. - b) - -NOTA: También puede utilizar y como un operador: yw copia una palabra, - yy copia la línea completa donde está el cursor, después p pegará - esa línea. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.6.5: ACTIVAR (SET) UNA OPCIÓN - - - ** Active una opción para buscar o sustituir ignorando si está - en mayúsculas o minúsculas el texto. ** - - 1. Busque la cadena de texto 'ignorar' escribiendo: /ignorar - Repita la búsqueda varias veces pulsando n . - - 2. Active la opción 'ic' (Ignore case o ignorar mayúsculas y minúsculas) - mediante: :set ic - - 3. Ahora busque de nuevo 'ignorar' pulsando n - Observe que ahora también se encuentran Ignorar e IGNORAR. - - 4. Active las opciones 'hlsearch' y 'incsearch' escribiendo: :set hls is - - 5. Ahora escriba de nuevo el comando de búsqueda y vea qué ocurre: /ignore - - 6. Para inhabilitar el ignorar la distinción de mayúsculas y minúsculas - escriba: :set noic - -NOTA: Para eliminar el resaltado de las coincidencias escriba: :nohlsearch -NOTA: Si quiere ignorar las mayúsculas y minúsculas, solo para un comando - de búsqueda, utilice \c en la frase: /ignorar\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 1.6 - - - 1. Escriba o para abrir una línea por DEBAJO de la posición del cursor y - entrar en modo Insertar. - Escriba O para abrir una línea por ENCIMA de la posición del cursor y - entrar en modo Insertar - - 2. Escriba a para insertar texto DESPUÉS del cursor. - Escriba A para insertar texto al final de la línea. - - 3. El comando e mueve el cursor al final de una palabra. - - 4. El operador y copia (yank) texto, p lo pega (pone). - - 5. Al escribir una R mayúscula entra en el modo Reemplazar hasta que - se pulsa . - - 6. Al escribir ":set xxx" activa la opción "xxx". Algunas opciones son: - 'ic' 'ignorecase' ignorar mayúsculas/minúsculas al buscar - 'is' 'incsearch' mostrar las coincidencias parciales para la búsqueda - de una frase - 'hls' 'hlsearch' resalta todas las coincidencias de la frases - Puedes utilizar tanto los nombre largos o cortos de las opciones. - - 7. Añada "no" para inhabilitar una opción: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 7: OBTENER AYUDA - - - ** Utilice el sistema de ayuda en línea ** - - Vim dispone de un sistema de ayuda en línea. Para comenzar, pruebe una - de estas tres formas: - - pulse la tecla (si dispone de ella) - - pulse la tecla (si dispone de ella) - - escriba :help - - Lea el texto en la ventana de ayuda para descubrir cómo funciona la ayuda. - Escriba CTRL-W CTRL-W para saltar de una ventana a otra. - Escriba :q para cerrar la ventana de ayuda. - - Puede encontrar ayuda en casi cualquier tema añadiendo un argumento al - comando «:help». Pruebe éstos (no olvide pulsar ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.7.2: CREAR UN SCRIPT DE INICIO - - - ** Habilitar funcionalidades en Vim ** - - Vim tiene muchas más funcionalidades que Vi, pero algunas están - inhabilitadas de manera predeterminada. - Para empezar a utilizar más funcionalidades debería crear un archivo - llamado "vimrc". - - 1. Comience a editar el archivo "vimrc". Esto depende de su sistema: - :e ~/.vimrc para Unix - :e ~/_vimrc para Windows - - 2. Ahora lea el contenido del archivo "vimrc" de ejemplo: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Guarde el archivo mediante: - :w - - La próxima vez que inicie Vim, este usará el resaltado de sintaxis. - Puede añadir todos sus ajustes preferidos a este archivo "vimrc". - Para más información escriba :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lección 1.7.3: COMPLETADO - - - ** Completado de la línea de comandos con CTRL-D o ** - - 1. Asegúrese de que Vim no está en el modo compatible: :set nocp - - 2. Vea qué archivos existen en el directorio con: :!ls o :!dir - - 3. Escriba el inicio de un comando: :e - - 4. Pulse CTRL-D y Vim mostrará una lista de comandos que empiezan con "e". - - 5. Añada d y Vim completará el nombre del comando a ":edit". - - 6. Ahora añada un espacio y el inicio del nombre de un archivo: :edit FIL - - 7. Pulse . Vim completará el nombre (si solo hay uno). - -NOTA: El completado funciona con muchos comandos. Solo pulse CTRL-D o - . Es especialmente útil para :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMEN DE LA LECCIÓN 1.7 - - - 1. Escriba :help o pulse o para abrir la ventana de ayuda. - - 2. Escriba :help cmd para encontrar ayuda sobre cmd . - - 3. Escriba CTRL-W CTRL-W para saltar a otra ventana. - - 4. Escriba :q para cerrar la ventana de ayuda. - - 5. Cree un fichero vimrc de inicio para guardar sus ajustes preferidos. - - 6. Cuando escriba un comando : pulse CTRL-D para ver posibles opciones. - Pulse para utilizar una de las opciones de completado. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Aquí concluye el tutor de Vim. Está pensado para dar una visión breve del - editor Vim, lo suficiente para permitirle usar el editor de forma bastante - sencilla. Está muy lejos de estar completo pues Vim tiene muchísimos más - comandos. Lea el siguiente manual de usuario: ":help user-manual". - - Para lecturas y estudios posteriores se recomienda el libro: - Vim - Vi Improved - de Steve Oualline - Editado por: New Riders - El primer libro dedicado completamente a Vim. Especialmente útil para - recién principiantes. - Tiene muchos ejemplos e imágenes. - Vea https://iccf-holland.org/click5.html - - Este tutorial ha sido escrito por Michael C. Pierce y Robert K. Ware, - Colorado School of Mines utilizando ideas suministradas por Charles Smith, - Colorado State University. - E-mail: bware@mines.colorado.edu. - - Modificado para Vim por Bram Moolenaar. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Traducido del inglés por: - - * Eduardo F. Amatria - Correo electrónico: eferna1@platea.pntic.mec.es - * Victorhck - Correo electrónico: victorhck@opensuse.org - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.fr b/runtime/tutor/tutor1.fr index 079f2da3b4..217d63fba0 100644 --- a/runtime/tutor/tutor1.fr +++ b/runtime/tutor/tutor1.fr @@ -2,334 +2,334 @@ = B i e n v e n u e dans l e T u t o r i e l de V I M - Version 1.7 = =============================================================================== - Vim est un �diteur tr�s puissant qui a trop de commandes pour pouvoir - toutes les expliquer dans un cours comme celui-ci, qui est con�u pour en - d�crire suffisamment afin de vous permettre d'utiliser simplement Vim. + Vim est un éditeur très puissant qui a trop de commandes pour pouvoir + toutes les expliquer dans un cours comme celui-ci, qui est conçu pour en + décrire suffisamment afin de vous permettre d'utiliser simplement Vim. - Le temps requis pour suivre ce cours est d'environ 25 � 30 minutes, selon - le temps que vous passerez � exp�rimenter. + Le temps requis pour suivre ce cours est d'environ 25 à 30 minutes, selon + le temps que vous passerez à expérimenter. ATTENTION : - Les commandes utilis�es dans les le�ons modifieront le texte. Faites une - copie de ce fichier afin de vous entra�ner dessus (si vous avez lanc� - "vimtutor" ceci est d�j� une copie). + Les commandes utilisées dans les leçons modifieront le texte. Faites une + copie de ce fichier afin de vous entraîner dessus (si vous avez lancé + "vimtutor" ceci est déjà une copie). - Il est important de garder en t�te que ce cours est con�u pour apprendre - par la pratique. Cela signifie que vous devez ex�cuter les commandes + Il est important de garder en tête que ce cours est conçu pour apprendre + par la pratique. Cela signifie que vous devez exécuter les commandes pour les apprendre correctement. Si vous vous contentez de lire le texte, vous oublierez les commandes ! - Maintenant, v�rifiez que votre clavier n'est PAS verrouill� en + Maintenant, vérifiez que votre clavier n'est PAS verrouillé en majuscules, et appuyez la touche j le nombre de fois suffisant pour - que la Le�on 1.1.1 remplisse compl�tement l'�cran. + que la Leçon 1.1.1 remplisse complètement l'écran. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.1.1 : D�PLACEMENT DU CURSEUR + Leçon 1.1.1 : DÉPLACEMENT DU CURSEUR - ** Pour d�placer le curseur, appuyez les touches h,j,k,l comme indiqu�. ** + ** Pour déplacer le curseur, appuyez les touches h,j,k,l comme indiqué. ** ^ - k Astuce : La touche h est � gauche et d�place � gauche. - < h l > La touche l est � droite et d�place � droite. - j La touche j ressemble � une fl�che vers le bas. + k Astuce : La touche h est à gauche et déplace à gauche. + < h l > La touche l est à droite et déplace à droite. + j La touche j ressemble à une flèche vers le bas. v - 1. D�placez le curseur sur l'�cran jusqu'� vous sentir � l'aise. + 1. Déplacez le curseur sur l'écran jusqu'à vous sentir à l'aise. - 2. Maintenez la touche Bas (j) enfonc�e jusqu'� ce qu'elle se r�p�te. - Maintenant vous �tes capable de vous d�placer jusqu'� la le�on suivante. + 2. Maintenez la touche Bas (j) enfoncée jusqu'à ce qu'elle se répète. + Maintenant vous êtes capable de vous déplacer jusqu'à la leçon suivante. - 3. En utilisant la touche Bas, allez � la Le�on 1.1.2. + 3. En utilisant la touche Bas, allez à la Leçon 1.1.2. -NOTE : Si jamais vous doutez de ce que vous venez de taper, appuyez <�chap> +NOTE : Si jamais vous doutez de ce que vous venez de taper, appuyez <Échap> pour revenir en mode Normal. Puis retapez la commande que vous vouliez. -NOTE : Les touches fl�ch�es devraient �galement fonctionner. Mais en utilisant - hjkl vous pourrez vous d�placer beaucoup plus rapidement, une fois que +NOTE : Les touches fléchées devraient également fonctionner. Mais en utilisant + hjkl vous pourrez vous déplacer beaucoup plus rapidement, une fois que vous aurez pris l'habitude. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.1.2 : SORTIR DE VIM + Leçon 1.1.2 : SORTIR DE VIM - !! NOTE : Avant d'effectuer les �tapes ci-dessous, lisez toute cette le�on !! + !! NOTE : Avant d'effectuer les étapes ci-dessous, lisez toute cette leçon !! - 1. Appuyez la touche <�chap> (pour �tre s�r d'�tre en mode Normal). + 1. Appuyez la touche <Échap> (pour être sûr d'être en mode Normal). - 2. Tapez : :q! - Ceci quitte l'�diteur SANS enregistrer les changements que vous avez + 2. Tapez : :q! + Ceci quitte l'éditeur SANS enregistrer les changements que vous avez faits. - 3. Revenez ici en tapant la commande qui vous a men� � ce tutoriel. - Cela pourrait �tre : vimtutor + 3. Revenez ici en tapant la commande qui vous a mené à ce tutoriel. + Cela pourrait être : vimtutor - 4. Si vous avez m�moris� ces �tapes et �tes confiant, effectuez les �tapes - 1 � 3 pour sortir puis rentrer dans l'�diteur. + 4. Si vous avez mémorisé ces étapes et êtes confiant, effectuez les étapes + 1 à 3 pour sortir puis rentrer dans l'éditeur. -NOTE : :q! annule tous les changements que vous avez faits. Dans - quelques le�ons, vous apprendrez � enregistrer les changements. +NOTE : :q! annule tous les changements que vous avez faits. Dans + quelques leçons, vous apprendrez à enregistrer les changements. - 5. D�placez le curseur � la Le�on 1.1.3. + 5. Déplacez le curseur à la Leçon 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.1.3 : �DITION DE TEXTE - EFFACEMENT + Leçon 1.1.3 : ÉDITION DE TEXTE - EFFACEMENT - ** Appuyez x pour effacer le caract�re sous le curseur. ** + ** Appuyez x pour effacer le caractère sous le curseur. ** - 1. D�placez le curseur sur la ligne marqu�e ---> ci-dessous. + 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - 2. Pour corriger les erreurs, d�placez le curseur jusqu'� ce qu'il soit - sur un caract�re � effacer. + 2. Pour corriger les erreurs, déplacez le curseur jusqu'à ce qu'il soit + sur un caractère à effacer. - 3. Appuyez la touche x pour effacer le caract�re redondant. + 3. Appuyez la touche x pour effacer le caractère redondant. - 4. R�p�tez les �tapes 2 � 4 jusqu'� ce que la phrase soit correcte. + 4. Répétez les étapes 2 à 4 jusqu'à ce que la phrase soit correcte. ----> La vvache a saut�� au-ddessus dde la luune. +---> La vvache a sautéé au-ddessus dde la luune. - 5. Maintenant que la ligne est correcte, passez � la Le�on 1.1.4. + 5. Maintenant que la ligne est correcte, passez à la Leçon 1.1.4. -NOTE : En avan�ant dans ce cours, n'essayez pas de m�moriser, apprenez par +NOTE : En avançant dans ce cours, n'essayez pas de mémoriser, apprenez par la pratique. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.1.4 : �DITION DE TEXTE - INSERTION + Leçon 1.1.4 : ÉDITION DE TEXTE - INSERTION - ** Appuyez i pour ins�rer du texte. ** + ** Appuyez i pour insérer du texte. ** - 1. D�placez le curseur sur la premi�re ligne marqu�e ---> ci-dessous. + 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous. - 2. Pour rendre la premi�re ligne identique � la seconde, mettez le curseur - sur le premier caract�re APR�S l'endroit o� ins�rer le texte. + 2. Pour rendre la première ligne identique à la seconde, mettez le curseur + sur le premier caractère APRÈS l'endroit où insérer le texte. - 3. Appuyez i et tapez les caract�res qui manquent. + 3. Appuyez i et tapez les caractères qui manquent. - 4. Une fois qu'une erreur est corrig�e, appuyez <�chap> pour revenir en mode - Normal. R�p�tez les �tapes 2 � 4 pour corriger la phrase. + 4. Une fois qu'une erreur est corrigée, appuyez <Échap> pour revenir en mode + Normal. Répétez les étapes 2 à 4 pour corriger la phrase. ----> Il mnqe caract�res cette . ----> Il manque des caract�res dans cette ligne. +---> Il mnqe caractères cette . +---> Il manque des caractères dans cette ligne. - 5. Une fois que vous �tes � l'aise avec l'insertion de texte, allez � la - Le�on 1.1.5. + 5. Une fois que vous êtes à l'aise avec l'insertion de texte, allez à la + Leçon 1.1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.1.5 : �DITION DE TEXTE - AJOUTER + Leçon 1.1.5 : ÉDITION DE TEXTE - AJOUTER ** Appuyez A pour ajouter du texte. ** - 1. D�placez le curseur sur la premi�re ligne ci-dessous marqu�e --->. - Peu importe sur quel caract�re se trouve le curseur sur cette ligne. + 1. Déplacez le curseur sur la première ligne ci-dessous marquée --->. + Peu importe sur quel caractère se trouve le curseur sur cette ligne. - 2. Appuyez A et tapez les ajouts n�cessaires. + 2. Appuyez A et tapez les ajouts nécessaires. - 3. Quand le texte a �t� ajout�, appuyez <�chap> pour revenir en mode + 3. Quand le texte a été ajouté, appuyez <Échap> pour revenir en mode Normal. - 4. D�placez le curseur sur la seconde ligne marqu�e ---> et r�p�tez les - �tapes 2 et 3 pour corriger la phrase. + 4. Déplacez le curseur sur la seconde ligne marquée ---> et répétez les + étapes 2 et 3 pour corriger la phrase. ----> Il manque du texte � partir de cet - Il manque du texte � partir de cette ligne. +---> Il manque du texte à partir de cet + Il manque du texte à partir de cette ligne. ---> Il manque aussi du te Il manque aussi du texte ici. - 5. Quand vous vous sentez suffisamment � l'aise pour ajouter du texte, - allez � la Le�on 1.1.6. + 5. Quand vous vous sentez suffisamment à l'aise pour ajouter du texte, + allez à la Leçon 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.1.6 : �DITER UN FICHIER + Leçon 1.1.6 : ÉDITER UN FICHIER ** Utilisez :wq pour enregistrer un fichier et sortir. ** -!! NOTE : Lisez toute la le�on avant d'ex�cuter les instructions ci-dessous !! +!! NOTE : Lisez toute la leçon avant d'exécuter les instructions ci-dessous !! - 1. Sortez de ce tutoriel comme vous l'avez fait dans la Le�on 1.1.2 : :q! - Ou, si vous avez acc�s � un autre terminal, ex�cutez-y les actions + 1. Sortez de ce tutoriel comme vous l'avez fait dans la Leçon 1.1.2 : :q! + Ou, si vous avez accès à un autre terminal, exécutez-y les actions qui suivent. - 2. � l'invite du shell, tapez cette commande : vim tutor - 'vim' est la commande pour d�marrer l'�diteur Vim, 'tutor' est le - nom du fichier que vous souhaitez �diter. Utilisez un fichier qui peut - �tre modifi�. + 2. À l'invite du shell, tapez cette commande : vim tutor + 'vim' est la commande pour démarrer l'éditeur Vim, 'tutor' est le + nom du fichier que vous souhaitez éditer. Utilisez un fichier qui peut + être modifié. - 3. Ins�rez et effacez du texte comme vous l'avez appris dans les le�ons - pr�c�dentes. + 3. Insérez et effacez du texte comme vous l'avez appris dans les leçons + précédentes. 4. Enregistrez le fichier avec les changements et sortez de Vim avec : - :wq + :wq - 5. Si vous avez quitt� vimtutor � l'�tape 1, recommencez vimtutor et - d�placez-vous en bas vers le r�sum� suivant. + 5. Si vous avez quitté vimtutor à l'étape 1, recommencez vimtutor et + déplacez-vous en bas vers le résumé suivant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - R�SUM� DE LA LE�ON 1.1 + RÉSUMÉ DE LA LEÇON 1.1 - 1. Le curseur se d�place avec les touches fl�ch�es ou les touches hjkl. + 1. Le curseur se déplace avec les touches fléchées ou les touches hjkl. h (gauche) j (bas) k (haut) l (droite) - 2. Pour d�marrer Vim � l'invite du shell tapez : vim FICHIER + 2. Pour démarrer Vim à l'invite du shell tapez : vim FICHIER - 3. Pour quitter Vim tapez : <�chap> :q! pour perdre tous les + 3. Pour quitter Vim tapez : <Échap> :q! pour perdre tous les changements. - OU tapez : <�chap> :wq pour enregistrer les + OU tapez : <Échap> :wq pour enregistrer les changements. - 4. Pour effacer un caract�re sous le curseur tapez : x + 4. Pour effacer un caractère sous le curseur tapez : x - 5. Pour ins�rer ou ajouter du texte tapez : - i tapez le texte � ins�rer avant le curseur <�chap> - A tapez le texte � ajouter en fin de ligne <�chap> + 5. Pour insérer ou ajouter du texte tapez : + i tapez le texte à insérer avant le curseur <Échap> + A tapez le texte à ajouter en fin de ligne <Échap> -NOTE : Appuyer <�chap> vous place en mode Normal ou annule une commande - partiellement tap�e dont vous ne voulez plus. +NOTE : Appuyer <Échap> vous place en mode Normal ou annule une commande + partiellement tapée dont vous ne voulez plus. -Passez maintenant � la le�on 2. +Passez maintenant à la leçon 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.2.1 : COMMANDES D'EFFACEMENT + Leçon 1.2.1 : COMMANDES D'EFFACEMENT ** Tapez dw pour effacer un mot. ** - 1. Appuyez <�chap> pour �tre s�r d'�tre en mode Normal. + 1. Appuyez <Échap> pour être sûr d'être en mode Normal. - 2. D�placez le curseur sur la ligne marqu�e ---> ci-dessous. + 2. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - 3. Placez le curseur sur le d�but d'un mot qui a besoin d'�tre effac�. + 3. Placez le curseur sur le début d'un mot qui a besoin d'être effacé. - 4. Tapez dw pour faire dispara�tre ce mot. + 4. Tapez dw pour faire disparaître ce mot. -NOTE : La lettre d appara�tra sur la derni�re ligne de l'�cran lors de +NOTE : La lettre d apparaîtra sur la dernière ligne de l'écran lors de votre frappe. Vim attend que vous tapiez w . Si vous voyez un autre - caract�re que d vous avez tap� autre chose ; appuyez <�chap> et + caractère que d vous avez tapé autre chose ; appuyez <Échap> et recommencez. ----> Il y a quelques dr�le mots qui n'ont rien � faire papier sur cette ligne. +---> Il y a quelques drôle mots qui n'ont rien à faire papier sur cette ligne. - 5. R�p�tez les �tapes 3 et 4 jusqu'� ce que la phrase soit correcte et allez - � la Le�on 1.2.2. + 5. Répétez les étapes 3 et 4 jusqu'à ce que la phrase soit correcte et allez + à la Leçon 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.2.2 : PLUS DE COMMANDES D'EFFACEMENTS + Leçon 1.2.2 : PLUS DE COMMANDES D'EFFACEMENTS - ** Tapez d$ pour effacer jusqu'� la fin de la ligne. ** + ** Tapez d$ pour effacer jusqu'à la fin de la ligne. ** - 1. Appuyez <�chap> pour �tre s�r d'�tre en mode Normal. + 1. Appuyez <Échap> pour être sûr d'être en mode Normal. - 2. D�placez le curseur sur la ligne marqu�e ---> ci-dessous. + 2. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - 3. D�placez le curseur jusqu'� la fin de la ligne correcte (APR�S le + 3. Déplacez le curseur jusqu'à la fin de la ligne correcte (APRÈS le premier . ). - 4. Tapez d$ pour effacer jusqu'� la fin de la ligne. + 4. Tapez d$ pour effacer jusqu'à la fin de la ligne. ----> Quelqu'un a tap� la fin de cette ligne deux fois. cette ligne deux fois. +---> Quelqu'un a tapé la fin de cette ligne deux fois. cette ligne deux fois. - 5. Allez � la Le�on 1.2.3 pour comprendre ce qui se passe. + 5. Allez à la Leçon 1.2.3 pour comprendre ce qui se passe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.2.3 : � PROPOS DES OP�RATEURS ET DES MOUVEMENTS + Leçon 1.2.3 : À PROPOS DES OPÉRATEURS ET DES MOUVEMENTS - Plusieurs commandes qui changent le texte sont constitu�es d'un op�rateur - et d'un mouvement. Le format pour une commande d'effacement avec l'op�rateur + Plusieurs commandes qui changent le texte sont constituées d'un opérateur + et d'un mouvement. Le format pour une commande d'effacement avec l'opérateur d d'effacement est le suivant : d mouvement - O� : - d - est l'op�rateur d'effacement - mouvement - est le mouvement sur lequel agit l'op�rateur (list�s + Où : + d - est l'opérateur d'effacement + mouvement - est le mouvement sur lequel agit l'opérateur (listés ci-dessous) Une courte liste de mouvements : - w - jusqu'au d�but du prochain mot, en EXCLUANT son premier caract�re. - e - jusqu'� la fin du mot courant, en EXCLUANT son dernier caract�re. - $ - jusqu'� la fin de la ligne, en INCLUANT son dernier caract�re. + w - jusqu'au début du prochain mot, en EXCLUANT son premier caractère. + e - jusqu'à la fin du mot courant, en EXCLUANT son dernier caractère. + $ - jusqu'à la fin de la ligne, en INCLUANT son dernier caractère. - Ainsi, taper de va effacer depuis le curseur jusqu'� la fin du mot. + Ainsi, taper de va effacer depuis le curseur jusqu'à la fin du mot. -NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, d�place le - curseur comme indiqu�. +NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, déplace le + curseur comme indiqué. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.2.4 : UTILISER UN QUANTIFICATEUR AVEC UN MOUVEMENT + Leçon 1.2.4 : UTILISER UN QUANTIFICATEUR AVEC UN MOUVEMENT - ** Taper un nombre avant un mouvement le r�p�te autant de fois. ** + ** Taper un nombre avant un mouvement le répète autant de fois. ** - 1. D�placez le curseur au d�but de la ligne marqu�e ---> ci-dessous. + 1. Déplacez le curseur au début de la ligne marquée ---> ci-dessous. - 2. Tapez 2w pour d�placer le curseur de 2 mots vers l'avant. + 2. Tapez 2w pour déplacer le curseur de 2 mots vers l'avant. - 3. Tapez 3e pour d�placer le curseur � la fin du troisi�me mot vers + 3. Tapez 3e pour déplacer le curseur à la fin du troisième mot vers l'avant. - 4. Tapez 0 (z�ro) pour d�placer au d�but de la ligne. + 4. Tapez 0 (zéro) pour déplacer au début de la ligne. - 5. R�p�tez les �tapes 2 et 3 avec des quantificateurs diff�rents. + 5. Répétez les étapes 2 et 3 avec des quantificateurs différents. ----> Ceci est juste une ligne avec des mots o� vous pouvez vous d�placer. +---> Ceci est juste une ligne avec des mots où vous pouvez vous déplacer. - 6. D�placez-vous � la Le�on 1.2.5. + 6. Déplacez-vous à la Leçon 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.2.5 : UTILISER UN QUANTIFICATEUR POUR EFFACER PLUS + Leçon 1.2.5 : UTILISER UN QUANTIFICATEUR POUR EFFACER PLUS - ** Taper un nombre avec un op�rateur le r�p�te autant de fois. ** + ** Taper un nombre avec un opérateur le répète autant de fois. ** - Outre la combinaison de l'op�rateur d'effacement avec un d�placement - mentionn� ci-dessus, vous pouvez ins�rer un nombre (quantificateur) + Outre la combinaison de l'opérateur d'effacement avec un déplacement + mentionné ci-dessus, vous pouvez insérer un nombre (quantificateur) pour effacer encore plus : - d nombre d�placement + d nombre déplacement - 1. D�placez le curseur vers le premier mot en MAJUSCULES dans la ligne - marqu�e --->. + 1. Déplacez le curseur vers le premier mot en MAJUSCULES dans la ligne + marquée --->. 2. Tapez d2w pour effacer les deux mots en MAJUSCULES. - 3. R�p�tez les �tapes 1 et 2 avec des quantificateurs diff�rents pour - effacer les mots suivants en MAJUSCULES � l'aide d'une commande. + 3. Répétez les étapes 1 et 2 avec des quantificateurs différents pour + effacer les mots suivants en MAJUSCULES à l'aide d'une commande. ----> Cette ABC DE ligne FGHI JK LMN OP de mots est Q RS TUV nettoy�e. +---> Cette ABC DE ligne FGHI JK LMN OP de mots est Q RS TUV nettoyée. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.2.6 : OP�REZ SUR DES LIGNES + Leçon 1.2.6 : OPÉREZ SUR DES LIGNES - ** Tapez dd pour effacer une ligne compl�te. ** + ** Tapez dd pour effacer une ligne complète. ** - Vu le nombre de fois o� l'on efface des lignes compl�tes, les concepteurs - de Vi ont d�cid� qu'il serait plus facile de taper simplement deux d + Vu le nombre de fois où l'on efface des lignes complètes, les concepteurs + de Vi ont décidé qu'il serait plus facile de taper simplement deux d pour effacer une ligne. 1. Placez le curseur sur la seconde ligne de la phrase ci-dessous. 2. Tapez dd pour effacer la ligne. - 3. Maintenant allez � la quatri�me ligne. + 3. Maintenant allez à la quatrième ligne. 4. Tapez 2dd pour effacer deux lignes. ---> 1) Les roses sont rouges, ----> 2) La boue c'est dr�le, +---> 2) La boue c'est drôle, ---> 3) Les violettes sont bleues, ---> 4) J'ai une voiture, ---> 5) Les horloges donnent l'heure, @@ -338,75 +338,75 @@ NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, d ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.2.7 : L'ANNULATION + Leçon 1.2.7 : L'ANNULATION - ** Tapez u pour annuler les derni�res commandes. ** - ** Tapez U pour r�cup�rer toute une ligne. ** + ** Tapez u pour annuler les dernières commandes. ** + ** Tapez U pour récupérer toute une ligne. ** - 1. D�placez le curseur sur la ligne marqu�e ---> ci-dessous et placez-le sur - la premi�re erreur. - 2. Tapez x pour effacer le premier caract�re redondant. - 3. Puis tapez u pour annuler la derni�re commande ex�cut�e. + 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous et placez-le sur + la première erreur. + 2. Tapez x pour effacer le premier caractère redondant. + 3. Puis tapez u pour annuler la dernière commande exécutée. 4. Cette fois, corrigez toutes les erreurs de la ligne avec la commande x . - 5. Puis tapez un U majuscule pour remettre la ligne dans son �tat initial. + 5. Puis tapez un U majuscule pour remettre la ligne dans son état initial. 6. Puis tapez u deux-trois fois pour annuler le U et les commandes - pr�c�dentes. - 7. Maintenant tapez CTRL-R (maintenez la touche CTRL enfonc�e pendant que + précédentes. + 7. Maintenant tapez CTRL-R (maintenez la touche CTRL enfoncée pendant que vous appuyez R) deux-trois fois pour refaire les commandes (annuler les annulations). ---> Coorrigez les erreurs suur ccette ligne et reemettez-les avvec 'annuler'. - 8. Ce sont des commandes tr�s utiles. Maintenant, allez au r�sum� de la - Le�on 1.2. + 8. Ce sont des commandes très utiles. Maintenant, allez au résumé de la + Leçon 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - R�SUM� DE LA LE�ON 1.2 + RÉSUMÉ DE LA LEÇON 1.2 1. Pour effacer du curseur jusqu'au mot suivant tapez : dw - 2. Pour effacer du curseur jusqu'� la fin d'une ligne tapez : d$ + 2. Pour effacer du curseur jusqu'à la fin d'une ligne tapez : d$ 3. Pour effacer toute une ligne tapez : dd - 4. Pour r�p�ter un d�placement ajoutez un quantificateur : 2w + 4. Pour répéter un déplacement ajoutez un quantificateur : 2w 5. Le format d'une commande de changement est : - op�rateur [nombre] d�placement + opérateur [nombre] déplacement - O� : - op�rateur - est ce qu'il faut faire, comme d pour effacer. - [nombre] - un quantificateur optionnel pour r�p�ter le d�placement. - d�placement - d�place le long du texte � op�rer, tel que w (mot), - $ (jusqu'� la fin de ligne), etc. + Où : + opérateur - est ce qu'il faut faire, comme d pour effacer. + [nombre] - un quantificateur optionnel pour répéter le déplacement. + déplacement - déplace le long du texte à opérer, tel que w (mot), + $ (jusqu'à la fin de ligne), etc. - 6. Pour se d�placer au d�but de ligne, utilisez un z�ro : 0 + 6. Pour se déplacer au début de ligne, utilisez un zéro : 0 - 5. Pour annuler des actions pr�c�dentes, tapez : u (u minuscule) + 5. Pour annuler des actions précédentes, tapez : u (u minuscule) Pour annuler tous les changements sur une ligne tapez : U (U majuscule) Pour annuler l'annulation tapez : CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.3.1 : LE COLLAGE + Leçon 1.3.1 : LE COLLAGE - ** Tapez p pour placer apr�s le curseur ce qui vient d'�tre effac�. ** + ** Tapez p pour placer après le curseur ce qui vient d'être effacé. ** - 1. Placez le curseur sur la premi�re ligne ci-dessous marqu�e --->. + 1. Placez le curseur sur la première ligne ci-dessous marquée --->. 2. Tapez dd pour effacer la ligne et la placer dans un registre de Vim. - 3. D�placez le curseur sur la ligne c) au-dessus o� vous voulez remettre la - ligne effac�e. + 3. Déplacez le curseur sur la ligne c) au-dessus où vous voulez remettre la + ligne effacée. 4. En mode Normal, tapez p pour remettre la ligne en dessous du curseur. - 5. R�p�tez les �tapes 2 � 4 pour mettre toutes les lignes dans le bon ordre. + 5. Répétez les étapes 2 à 4 pour mettre toutes les lignes dans le bon ordre. ---> d) Et vous, qu'apprenez-vous ? ---> b) Les violettes sont bleues, @@ -415,189 +415,189 @@ NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, d ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.3.2 : LA COMMANDE DE REMPLACEMENT + Leçon 1.3.2 : LA COMMANDE DE REMPLACEMENT - ** Tapez rx pour remplacer un caract�re sous le curseur par x . ** + ** Tapez rx pour remplacer un caractère sous le curseur par x . ** - 1. D�placez le curseur sur la premi�re ligne marqu�e ---> ci-dessous. + 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous. - 2. Placez le curseur de mani�re � ce qu'il surplombe la premi�re erreur. + 2. Placez le curseur de manière à ce qu'il surplombe la première erreur. - 3. Tapez r suivi du caract�re qui doit corriger l'erreur. + 3. Tapez r suivi du caractère qui doit corriger l'erreur. - 4. R�p�tez les �tapes 2 et 3 jusqu'� ce que la premi�re ligne soit �gale - � la seconde. + 4. Répétez les étapes 2 et 3 jusqu'à ce que la première ligne soit égale + à la seconde. ----> Quand cette ligne a �t� sauvie, quelqu'un a lait des faunes de frappe ! ----> Quand cette ligne a �t� saisie, quelqu'un a fait des fautes de frappe ! +---> Quand cette ligne a été sauvie, quelqu'un a lait des faunes de frappe ! +---> Quand cette ligne a été saisie, quelqu'un a fait des fautes de frappe ! - 5. Maintenant, allez � la Le�on 1.3.3. + 5. Maintenant, allez à la Leçon 1.3.3. NOTE : N'oubliez pas que vous devriez apprendre par la pratique, pas par - m�morisation. + mémorisation. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.3.3 : L'OP�RATEUR DE CHANGEMENT + Leçon 1.3.3 : L'OPÉRATEUR DE CHANGEMENT - ** Pour changer jusqu'� la fin d'un mot, tapez ce .** + ** Pour changer jusqu'à la fin d'un mot, tapez ce .** - 1. D�placez le curseur sur la premi�re ligne marqu�e ---> ci-dessous. + 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous. 2. Placez le curseur sur le u de luhko. 3. Tapez ce et corrigez le mot (dans notre cas, tapez 'igne'.) - 4. Appuyez <�chap> et placez-vous sur le prochain caract�re qui doit - �tre chang�. + 4. Appuyez <Échap> et placez-vous sur le prochain caractère qui doit + être changé. - 5. R�p�tez les �tapes 3 et 4 jusqu'� ce que la premi�re phrase soit - identique � la seconde. + 5. Répétez les étapes 3 et 4 jusqu'à ce que la première phrase soit + identique à la seconde. ----> Cette luhko contient quelques myqa qui ont ricne d'�tre chantufip. ----> Cette ligne contient quelques mots qui ont besoin d'�tre chang�s. +---> Cette luhko contient quelques myqa qui ont ricne d'être chantufip. +---> Cette ligne contient quelques mots qui ont besoin d'être changés. Notez que ce efface le mot et vous place ensuite en mode Insertion. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.3.4 : PLUS DE CHANGEMENTS AVEC c + Leçon 1.3.4 : PLUS DE CHANGEMENTS AVEC c - ** L'op�rateur de changement fonctionne avec les m�mes d�placements + ** L'opérateur de changement fonctionne avec les mêmes déplacements que l'effacement. ** - 1. L'op�rateur de changement fonctionne de la m�me mani�re que + 1. L'opérateur de changement fonctionne de la même manière que l'effacement. Le format est : - c [nombre] d�placement + c [nombre] déplacement - 2. Les d�placements sont identiques : w (mot) et $ (fin de ligne). + 2. Les déplacements sont identiques : w (mot) et $ (fin de ligne). - 3. D�placez-vous sur la premi�re ligne marqu�e ---> ci-dessous. + 3. Déplacez-vous sur la première ligne marquée ---> ci-dessous. - 4. Placez le curseur sur la premi�re erreur. + 4. Placez le curseur sur la première erreur. 5. Tapez c$ et tapez le reste de la ligne afin qu'elle soit identique - � la seconde ligne, puis tapez <�chap>. + à la seconde ligne, puis tapez <Échap>. ----> La fin de cette ligne doit �tre rendue identique � la seconde. ----> La fin de cette ligne doit �tre corrig�e avec la commande c$ . +---> La fin de cette ligne doit être rendue identique à la seconde. +---> La fin de cette ligne doit être corrigée avec la commande c$ . -NOTE : Vous pouvez utiliser la touche Retour Arri�re pour corriger les +NOTE : Vous pouvez utiliser la touche Retour Arrière pour corriger les erreurs lorsque vous tapez. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - R�SUM� DE LA LE�ON 1.3 + RÉSUMÉ DE LA LEÇON 1.3 - 1. Pour remettre le texte qui a d�j� �t� effac�, tapez p . Cela Place le - texte effac� APR�S le curseur (si une ligne compl�te a �t� effac�e, elle - sera plac�e sous la ligne du curseur). + 1. Pour remettre le texte qui a déjà été effacé, tapez p . Cela Place le + texte effacé APRÈS le curseur (si une ligne complète a été effacée, elle + sera placée sous la ligne du curseur). - 2. Pour remplacer le caract�re sous le curseur, tapez r suivi du caract�re + 2. Pour remplacer le caractère sous le curseur, tapez r suivi du caractère qui remplacera l'original. - 3. L'op�rateur de changement vous permet de changer depuis la position du - curseur jusqu'o� le d�placement vous am�ne. Par exemple, tapez ce - pour changer du curseur jusqu'� la fin du mot, c$ pour changer jusqu'� + 3. L'opérateur de changement vous permet de changer depuis la position du + curseur jusqu'où le déplacement vous amène. Par exemple, tapez ce + pour changer du curseur jusqu'à la fin du mot, c$ pour changer jusqu'à la fin d'une ligne. 4. Le format pour le changement est : - c [nombre] d�placement + c [nombre] déplacement -Passez maintenant � la le�on suivante. +Passez maintenant à la leçon suivante. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.4.1 : POSITION DU CURSEUR ET �TAT DU FICHIER + Leçon 1.4.1 : POSITION DU CURSEUR ET ÉTAT DU FICHIER - ** Tapez CTRL-G pour afficher votre position dans le fichier et son �tat. - Tapez G pour vous rendre � une ligne donn�e du fichier. ** + ** Tapez CTRL-G pour afficher votre position dans le fichier et son état. + Tapez G pour vous rendre à une ligne donnée du fichier. ** -NOTE : Lisez toute cette le�on avant d'effectuer l'une des �tapes !! +NOTE : Lisez toute cette leçon avant d'effectuer l'une des étapes !! - 1. Maintenez enfonc�e la touche CTRL et appuyez sur g . On appelle cela - CTRL-G. Une ligne d'�tat va appara�tre en bas de l'�cran avec le nom - du fichier et le num�ro de la ligne o� vous �tes. Notez ce num�ro, il - servira lors de l'�tape 3. + 1. Maintenez enfoncée la touche CTRL et appuyez sur g . On appelle cela + CTRL-G. Une ligne d'état va apparaître en bas de l'écran avec le nom + du fichier et le numéro de la ligne où vous êtes. Notez ce numéro, il + servira lors de l'étape 3. -NOTE : Vous pouvez peut-�tre voir le curseur en bas � droite de l'�cran. - Ceci arrive quand l'option 'ruler' est activ�e (voir :help 'ruler') +NOTE : Vous pouvez peut-être voir le curseur en bas à droite de l'écran. + Ceci arrive quand l'option 'ruler' est activée (voir :help 'ruler') - 2. Tapez G pour vous d�placer � la fin du fichier. - Tapez gg pour vous d�placer au d�but du fichier. + 2. Tapez G pour vous déplacer à la fin du fichier. + Tapez gg pour vous déplacer au début du fichier. - 3. Tapez le num�ro de la ligne o� vous �tiez suivi de G . Cela vous - ram�nera � la ligne o� vous �tiez au d�part quand vous aviez appuy� + 3. Tapez le numéro de la ligne où vous étiez suivi de G . Cela vous + ramènera à la ligne où vous étiez au départ quand vous aviez appuyé CTRL-G. - 4. Si vous vous sentez pr�t � faire ceci, effectuez les �tapes 1 � 3. + 4. Si vous vous sentez prêt à faire ceci, effectuez les étapes 1 à 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.4.2 : LA RECHERCHE + Leçon 1.4.2 : LA RECHERCHE ** Tapez / suivi d'un texte pour rechercher ce texte. ** - 1. Tapez le caract�re / en mode Normal. Notez que celui-ci et le curseur - apparaissent en bas de l'�cran, comme lorsque l'on utilise : . + 1. Tapez le caractère / en mode Normal. Notez que celui-ci et le curseur + apparaissent en bas de l'écran, comme lorsque l'on utilise : . - 2. Puis tapez 'errreuur' . C'est le mot que vous voulez rechercher. + 2. Puis tapez 'errreuur' . C'est le mot que vous voulez rechercher. - 3. Pour rechercher � nouveau le m�me texte, tapez simplement n . - Pour rechercher le m�me texte dans la direction oppos�e, tapez N . + 3. Pour rechercher à nouveau le même texte, tapez simplement n . + Pour rechercher le même texte dans la direction opposée, tapez N . - 4. Pour rechercher une phrase dans la direction oppos�e, utilisez ? + 4. Pour rechercher une phrase dans la direction opposée, utilisez ? au lieu de / . ----> erreur ne s'�crit pas "errreuur" ; errreuur est une erreur. +---> erreur ne s'écrit pas "errreuur" ; errreuur est une erreur. -NOTE : Quand la recherche atteint la fin du fichier, elle reprend au d�but - sauf si l'option 'wrapscan' est d�sactiv�e. +NOTE : Quand la recherche atteint la fin du fichier, elle reprend au début + sauf si l'option 'wrapscan' est désactivée. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.4.3 : RECHERCHE DES PARENTH�SES CORRESPONDANTES + Leçon 1.4.3 : RECHERCHE DES PARENTHÈSES CORRESPONDANTES ** Tapez % pour trouver des ), ] ou } correspondants. ** - 1. Placez le curseur sur l'un des (, [ ou { de la ligne marqu�e ---> + 1. Placez le curseur sur l'un des (, [ ou { de la ligne marquée ---> ci-dessous. - 2. Puis tapez le caract�re % . + 2. Puis tapez le caractère % . - 3. Le curseur se d�placera sur la parenth�se ou crochet correspondant. + 3. Le curseur se déplacera sur la parenthèse ou crochet correspondant. - 4. Tapez % pour replacer le curseur sur la parenth�se ou crochet + 4. Tapez % pour replacer le curseur sur la parenthèse ou crochet correspondant. - 5. D�placez le curseur sur un autre (,),[,],{ ou } et regardez ce que + 5. Déplacez le curseur sur un autre (,),[,],{ ou } et regardez ce que fait % . ---> Voici ( une ligne de test contenant des (, des [ ] et des { } )). -NOTE : Cette fonctionnalit� est tr�s utile lors du d�bogage d'un programme qui - contient des parenth�ses d�s�quilibr�es ! +NOTE : Cette fonctionnalité est très utile lors du débogage d'un programme qui + contient des parenthèses déséquilibrées ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.4.4 : LA COMMANDE DE SUBSTITUTION + Leçon 1.4.4 : LA COMMANDE DE SUBSTITUTION ** Tapez :s/ancien/nouveau/g pour remplacer 'ancien' par 'nouveau'. ** - 1. D�placez le curseur sur la ligne marqu�e ---> ci-dessous. + 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - 2. Tapez :s/lee/le . Notez que cette commande change seulement la - premi�re occurrence de "lee" dans la ligne. + 2. Tapez :s/lee/le . Notez que cette commande change seulement la + première occurrence de "lee" dans la ligne. 3. Puis tapez :s/lee/le/g . L'ajout du drapeau g ordonne de faire une substitution globale sur la ligne, et change toutes les occurrences de @@ -606,8 +606,8 @@ NOTE : Cette fonctionnalit ---> lee meilleur moment pour regarder lees fleurs est pendant lee printemps. 4. Pour changer toutes les occurrences d'un texte, entre deux lignes, - tapez :#,#s/ancien/nouveau/g o� #,# sont les num�ros de lignes de la - plage o� la substitution doit �tre faite. + tapez :#,#s/ancien/nouveau/g où #,# sont les numéros de lignes de la + plage où la substitution doit être faite. Tapez :%s/ancien/nouveau/g pour changer toutes les occurrences dans tout le fichier. Tapez :%s/ancien/nouveau/gc pour trouver toutes les occurrences dans @@ -617,122 +617,122 @@ NOTE : Cette fonctionnalit ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - R�SUM� DE LA LE�ON 1.4 + RÉSUMÉ DE LA LEÇON 1.4 - 1. CTRL-G affiche la position dans le fichier et l'�tat de celui-ci. - G d�place � la fin du fichier. - nombre G d�place au num�ro de ligne. - gg d�place � la premi�re ligne. + 1. CTRL-G affiche la position dans le fichier et l'état de celui-ci. + G déplace à la fin du fichier. + nombre G déplace au numéro de ligne. + gg déplace à la première ligne. 2. Taper / suivi d'un texte recherche ce texte vers l'AVANT. - Taper ? suivi d'un texte recherche ce texte vers l'ARRI�RE. - Apr�s une recherche tapez n pour trouver l'occurrence suivante dans la - m�me direction ou Maj-N pour rechercher dans la direction oppos�e. + Taper ? suivi d'un texte recherche ce texte vers l'ARRIÈRE. + Après une recherche tapez n pour trouver l'occurrence suivante dans la + même direction ou Maj-N pour rechercher dans la direction opposée. - 3. Taper % lorsque le curseur est sur (, ), [, ], { ou } d�place - celui-ci sur le caract�re correspondant. + 3. Taper % lorsque le curseur est sur (, ), [, ], { ou } déplace + celui-ci sur le caractère correspondant. 4. Pour remplacer le premier aa par bb sur une ligne tapez :s/aa/bb Pour remplacer tous les aa par bb sur une ligne tapez :s/aa/bb/g - Pour remplacer du texte entre deux num�ros de ligne tapez :#,#s/aa/bb/g + Pour remplacer du texte entre deux numéros de ligne tapez :#,#s/aa/bb/g Pour remplacer toutes les occurrences dans le fichier tapez :%s/aa/bb/g - Pour demander une confirmation � chaque fois ajoutez 'c' :%s/aa/bb/gc + Pour demander une confirmation à chaque fois ajoutez 'c' :%s/aa/bb/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.5.1 : COMMENT EX�CUTER UNE COMMANDE EXTERNE + Leçon 1.5.1 : COMMENT EXÉCUTER UNE COMMANDE EXTERNE - ** Tapez :! suivi d'une commande externe pour ex�cuter cette commande. ** + ** Tapez :! suivi d'une commande externe pour exécuter cette commande. ** - 1. Tapez le : familier pour mettre le curseur en bas de l'�cran. Cela vous + 1. Tapez le : familier pour mettre le curseur en bas de l'écran. Cela vous permet de saisir une commande. - 2. Puis tapez un ! (point d'exclamation). Cela vous permet d'ex�cuter - n'importe quelle commande valide pour votre interpr�teur (shell). + 2. Puis tapez un ! (point d'exclamation). Cela vous permet d'exécuter + n'importe quelle commande valide pour votre interpréteur (shell). - 3. Par exemple, tapez ls apr�s le ! et appuyez . Ceci affichera - la liste des fichiers du r�pertoire courant, comme si vous aviez tap� la - commande � l'invite du shell. Utilisez :!dir si :!ls ne marche pas. + 3. Par exemple, tapez ls après le ! et appuyez . Ceci affichera + la liste des fichiers du répertoire courant, comme si vous aviez tapé la + commande à l'invite du shell. Utilisez :!dir si :!ls ne marche pas. -NOTE : Il est possible d'ex�cuter n'importe quelle commande externe de cette - mani�re, avec ou sans argument. +NOTE : Il est possible d'exécuter n'importe quelle commande externe de cette + manière, avec ou sans argument. -NOTE : Toutes les commandes : doivent finir par la frappe de . - � partir de maintenant, nous ne le mentionnerons plus. +NOTE : Toutes les commandes : doivent finir par la frappe de . + À partir de maintenant, nous ne le mentionnerons plus. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.5.2 : PLUS DE D�TAILS SUR L'ENREGISTREMENT DE FICHIERS + Leçon 1.5.2 : PLUS DE DÉTAILS SUR L'ENREGISTREMENT DE FICHIERS ** Pour enregistrer les changements faits au texte, tapez :w FICHIER . ** 1. Tapez :!dir ou :!ls pour avoir la liste des fichiers dans le - r�pertoire courant. Vous savez d�j� qu'il faut appuyer apr�s + répertoire courant. Vous savez déjà qu'il faut appuyer après cela. 2. Choisissez un nom de fichier qui n'existe pas encore, par exemple TEST. - 3. Puis tapez :w TEST (o� TEST est le nom que vous avez choisi). + 3. Puis tapez :w TEST (où TEST est le nom que vous avez choisi). 4. Cela enregistre tout le fichier (Tutoriel Vim) sous le nom TEST. - Pour le v�rifier, tapez :!dir ou :!ls de nouveau pour revisualiser - votre r�pertoire. + Pour le vérifier, tapez :!dir ou :!ls de nouveau pour revisualiser + votre répertoire. -NOTE : Si vous quittez Vim et le red�marrez de nouveau avec le fichier TEST, - celui-ci sera une copie exacte de ce cours au moment o� vous l'avez - enregistr�. +NOTE : Si vous quittez Vim et le redémarrez de nouveau avec le fichier TEST, + celui-ci sera une copie exacte de ce cours au moment où vous l'avez + enregistré. 5. Maintenant, effacez le fichier en tapant (Windows) : :!del TEST ou (Unix) : :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.5.3 : S�LECTION DU TEXTE � ENREGISTRER + Leçon 1.5.3 : SÉLECTION DU TEXTE À ENREGISTRER ** Pour enregistrer une portion du fichier, - tapez : v d�placement :w FICHIER ** + tapez : v déplacement :w FICHIER ** - 1. D�placez le curseur sur cette ligne. + 1. Déplacez le curseur sur cette ligne. - 2. Appuyez v et d�placez le curseur vers la cinqui�me ligne plus bas. + 2. Appuyez v et déplacez le curseur vers la cinquième ligne plus bas. Remarquez que le texte est en surbrillance. - 3. Appuyez : . En bas de l'�cran :'<,'> va appara�tre. + 3. Appuyez : . En bas de l'écran :'<,'> va apparaître. - 4. Tapez w TEST , o� TEST est un nom de fichier qui n'existe pas. - V�rifiez que vous voyez :'<,'>w TEST avant d'appuyer sur . + 4. Tapez w TEST , où TEST est un nom de fichier qui n'existe pas. + Vérifiez que vous voyez :'<,'>w TEST avant d'appuyer sur . - 5. Vim va enregistrer les lignes s�lectionn�es dans le fichier TEST. + 5. Vim va enregistrer les lignes sélectionnées dans le fichier TEST. Utilisez :!dir ou :!ls pour le voir. Ne l'effacez pas encore ! - Nous allons l'utiliser dans la le�on suivante. + Nous allons l'utiliser dans la leçon suivante. -NOTE : L'appui de v d�marre la s�lection Visuelle. Vous pouvez d�placer le - curseur pour agrandir ou r�tr�cir la s�lection. Puis vous pouvez - utiliser un op�rateur pour faire quelque chose sur le texte. Par +NOTE : L'appui de v démarre la sélection Visuelle. Vous pouvez déplacer le + curseur pour agrandir ou rétrécir la sélection. Puis vous pouvez + utiliser un opérateur pour faire quelque chose sur le texte. Par exemple, d efface le texte. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.5.4 : R�CUP�RATION ET FUSION DE FICHIERS + Leçon 1.5.4 : RÉCUPÉRATION ET FUSION DE FICHIERS - ** Pour ins�rer le contenu d'un fichier, tapez :r FICHIER ** + ** Pour insérer le contenu d'un fichier, tapez :r FICHIER ** 1. Placez le curseur juste au-dessus de cette ligne. -NOTE : Apr�s avoir ex�cut� l'�tape 2 vous verrez du texte de la Le�on 1.5.3. - Puis d�placez-vous vers le bas pour voir cette le�on � nouveau. +NOTE : Après avoir exécuté l'étape 2 vous verrez du texte de la Leçon 1.5.3. + Puis déplacez-vous vers le bas pour voir cette leçon à nouveau. - 2. Maintenant r�cup�rez votre fichier TEST en utilisant la commande :r TEST - o� TEST est le nom de votre fichier. - Le fichier que vous r�cup�rez est plac� au-dessous de la ligne du curseur. + 2. Maintenant récupérez votre fichier TEST en utilisant la commande :r TEST + où TEST est le nom de votre fichier. + Le fichier que vous récupérez est placé au-dessous de la ligne du curseur. - 3. Pour v�rifier que le fichier a bien �t� ins�r�, remontez et v�rifiez - qu'il y a maintenant deux copies de la Le�on 1.5.3, l'originale et celle + 3. Pour vérifier que le fichier a bien été inséré, remontez et vérifiez + qu'il y a maintenant deux copies de la Leçon 1.5.3, l'originale et celle contenue dans le fichier. NOTE : Vous pouvez aussi lire la sortie d'une commande externe. Par exemple, @@ -741,169 +741,169 @@ NOTE : Vous pouvez aussi lire la sortie d'une commande externe. Par exemple, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - R�SUM� DE LA LE�ON 1.5 + RÉSUMÉ DE LA LEÇON 1.5 - 1. :!commande ex�cute une commande externe. + 1. :!commande exécute une commande externe. Quelques exemples pratiques : (Windows) (Unix) - :!dir :!ls affiche le contenu du r�pertoire courant. + :!dir :!ls affiche le contenu du répertoire courant. :!del FICHIER :!rm FICHIER efface FICHIER. 2. :w FICHIER enregistre le fichier Vim courant sur le disque avec pour nom FICHIER. - 3. v d�placement :w FICHIER sauvegarde les lignes de la s�lection Visuelle + 3. v déplacement :w FICHIER sauvegarde les lignes de la sélection Visuelle dans le fichier FICHIER. - 4. :r FICHIER r�cup�re le contenu du fichier FICHIER et l'ins�re sous la + 4. :r FICHIER récupère le contenu du fichier FICHIER et l'insère sous la position du curseur. - 5. :r !dir lit la sortie de la commande dir et l'ins�re sous la position + 5. :r !dir lit la sortie de la commande dir et l'insère sous la position du curseur. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.6.1 : LA COMMANDE D'OUVERTURE + Leçon 1.6.1 : LA COMMANDE D'OUVERTURE ** Tapez o pour ouvrir une ligne sous le curseur et y aller en Insertion. ** - 1. D�placez le curseur sur la ligne marqu�e ---> ci-dessous. + 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous. 2. Tapez la lettre o minuscule pour ouvrir une ligne SOUS le curseur et vous y placer en mode Insertion. - 3. Puis tapez du texte et appuyez <�chap> pour sortir du mode Insertion. + 3. Puis tapez du texte et appuyez <Échap> pour sortir du mode Insertion. ---> En tapant o le curseur se met sur la ligne ouverte, en mode Insertion. 4. Pour ouvrir une ligne au-DESSUS du curseur, tapez simplement un O - majuscule, plut�t qu'un o minuscule. Faites un essai sur la ligne + majuscule, plutôt qu'un o minuscule. Faites un essai sur la ligne ci-dessous. ---> Ouvrez une ligne ci-dessus en tapant O lorsque le curseur est ici. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.6.2 : LA COMMANDE D'AJOUT + Leçon 1.6.2 : LA COMMANDE D'AJOUT - ** Tapez a pour ins�rer du texte APR�S le curseur. ** + ** Tapez a pour insérer du texte APRÈS le curseur. ** - 1. Placez le curseur au d�but de la ligne marqu�e ---> ci-dessous. + 1. Placez le curseur au début de la ligne marquée ---> ci-dessous. - 2. Appuyez e jusqu'� ce que le curseur soit sur la fin de li . + 2. Appuyez e jusqu'à ce que le curseur soit sur la fin de li . - 3. Appuyez a (minuscule) pour ajouter du texte APR�S le curseur. + 3. Appuyez a (minuscule) pour ajouter du texte APRÈS le curseur. - 4. Compl�tez le mot comme dans la ligne dessous. Appuyez <�chap> pour + 4. Complétez le mot comme dans la ligne dessous. Appuyez <Échap> pour sortir du mode Insertion. - 5. Utilisez e pour vous d�placer vers le mot incomplet suivant et - r�p�tez les �tapes 3 et 4. + 5. Utilisez e pour vous déplacer vers le mot incomplet suivant et + répétez les étapes 3 et 4. ---> Cette li vous perm de pratiq l'ajout de t dans une ligne. ---> Cette ligne vous permet de pratiquer l'ajout de texte dans une ligne. -NOTE : a, i, A vont tous dans le m�me mode Insertion, la seule diff�rence - est l'endroit o� les caract�res sont ins�r�s. +NOTE : a, i, A vont tous dans le même mode Insertion, la seule différence + est l'endroit où les caractères sont insérés. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.6.3 : UNE AUTRE MANI�RE DE REMPLACER + Leçon 1.6.3 : UNE AUTRE MANIÈRE DE REMPLACER - ** Tapez un R majuscule pour remplacer plus d'un caract�re. ** + ** Tapez un R majuscule pour remplacer plus d'un caractère. ** - 1. D�placez le curseur sur la premi�re ligne marqu�e ---> ci-dessous. - D�placez le curseur sur le d�but du premier xxx . + 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous. + Déplacez le curseur sur le début du premier xxx . - 2. Appuyez maintenant R et tapez le nombre dessous dans la deuxi�me ligne, - de mani�re � remplacer le xxx . + 2. Appuyez maintenant R et tapez le nombre dessous dans la deuxième ligne, + de manière à remplacer le xxx . - 3. Appuyez <�chap> pour quitter le mode Remplacement. Notez que le reste de - la ligne demeure inchang�. + 3. Appuyez <Échap> pour quitter le mode Remplacement. Notez que le reste de + la ligne demeure inchangé. - 4. R�p�tez les �tapes pour remplacer les xxx restants. + 4. Répétez les étapes pour remplacer les xxx restants. ----> L'ajout de 123 � xxx donne xxx. ----> L'ajout de 123 � 456 donne 579. +---> L'ajout de 123 à xxx donne xxx. +---> L'ajout de 123 à 456 donne 579. NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les - caract�res tap�s effacent un caract�re existant. + caractères tapés effacent un caractère existant. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.6.4 : COPIER ET COLLER DU TEXTE + Leçon 1.6.4 : COPIER ET COLLER DU TEXTE - ** Utilisez l'op�rateur y pour copier du texte et p pour le coller ** + ** Utilisez l'opérateur y pour copier du texte et p pour le coller ** - 1. Allez � la ligne marqu�e ---> ci-dessous et placez le curseur apr�s "a)". + 1. Allez à la ligne marquée ---> ci-dessous et placez le curseur après "a)". - 2. D�marrez le mode Visuel avec v et d�placez le curseur juste devant + 2. Démarrez le mode Visuel avec v et déplacez le curseur juste devant "premier". 3. Tapez y pour copier le texte en surbrillance. - 4. D�placez le curseur � la fin de la ligne suivante : j$ + 4. Déplacez le curseur à la fin de la ligne suivante : j$ - 5. Tapez p pour coller le texte. Puis tapez : un second <�chap> . + 5. Tapez p pour coller le texte. Puis tapez : un second <Échap> . - 6. Utilisez le mode Visuel pour s�lectionner "�l�ment", copiez-le avec y , - d�placez-vous � la fin de la ligne suivante avec j$ et collez le texte - � cet endroit avec p . + 6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y , + déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte + à cet endroit avec p . ----> a) ceci est le premier �l�ment. +---> a) ceci est le premier élément. b) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.6.5 : R�GLAGE DES OPTIONS + Leçon 1.6.5 : RÉGLAGE DES OPTIONS - ** R�glons une option afin que la recherche et la substitution ignorent la - casse des caract�res. ** + ** Réglons une option afin que la recherche et la substitution ignorent la + casse des caractères. ** - 1. Recherchez 'ignore' en tapant : /ignore - R�p�tez ceci plusieurs fois en utilisant la touche n . + 1. Recherchez 'ignore' en tapant : /ignore + Répétez ceci plusieurs fois en utilisant la touche n . 2. Activez l'option 'ic' (ignorer casse) en tapant :set ic . 3. Puis cherchez 'ignore' de nouveau en utilisant n . - Remarquez que Ignore et IGNORE sont maintenant aussi trouv�s. + Remarquez que Ignore et IGNORE sont maintenant aussi trouvés. 4. Activez les options 'hlsearch' et 'incsearch' avec :set hls is . - 5. Puis recommencez une recherche, et faites bien attention � ce qui se - produit : /ignore + 5. Puis recommencez une recherche, et faites bien attention à ce qui se + produit : /ignore - 6. Pour d�sactiver 'ignorer casse', entrez : :set noic + 6. Pour désactiver 'ignorer casse', entrez : :set noic -NOTE : Pour enlever la surbrillance des r�sultats, entrez : :nohlsearch +NOTE : Pour enlever la surbrillance des résultats, entrez : :nohlsearch NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez - \c dans la phrase : /ignore\c + \c dans la phrase : /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - R�SUM� DE LA LE�ON 1.6 + RÉSUMÉ DE LA LEÇON 1.6 - 1. Taper o ouvre une ligne SOUS le curseur et d�marre le mode Insertion. + 1. Taper o ouvre une ligne SOUS le curseur et démarre le mode Insertion. Taper O ouvre une ligne au-DESSUS du curseur. - 2. Taper a pour ins�rer du texte APR�S le curseur. - Taper A pour ins�rer du texte apr�s la fin de ligne. + 2. Taper a pour insérer du texte APRÈS le curseur. + Taper A pour insérer du texte après la fin de ligne. - 3. Taper e d�place � la fin du mot. + 3. Taper e déplace à la fin du mot. 4. Taper y copie du texte, p le colle. - 5. Taper R majuscule active le mode Remplacement jusqu'� ce qu' <�chap> - soit appuy�. + 5. Taper R majuscule active le mode Remplacement jusqu'à ce qu' <Échap> + soit appuyé. 6. Taper ":set xxx" active l'option "xxx". Quelques options sont : 'ic' 'ignorecase' pour ignorer la casse lors des recherches. @@ -912,25 +912,25 @@ NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.7.1 : OBTENIR DE L'AIDE + Leçon 1.7.1 : OBTENIR DE L'AIDE - ** Utiliser le syst�me d'aide en ligne. ** + ** Utiliser le système d'aide en ligne. ** - Vim a un syst�me complet d'aide en ligne. Pour y acc�der, essayez l'une de - ces trois m�thodes : + Vim a un système complet d'aide en ligne. Pour y accéder, essayez l'une de + ces trois méthodes : - appuyez la touche (si vous en avez une) - appuyez la touche (si vous en avez une) - - tapez :help + - tapez :help - Lisez le texte dans la fen�tre d'aide pour savoir comment fonctionne l'aide. - Tapez CTRL-W CTRL-W pour sauter d'une fen�tre � l'autre. - Tapez :q pour fermer la fen�tre d'aide. + Lisez le texte dans la fenêtre d'aide pour savoir comment fonctionne l'aide. + Tapez CTRL-W CTRL-W pour sauter d'une fenêtre à l'autre. + Tapez :q pour fermer la fenêtre d'aide. - Vous pouvez acc�der � l'aide sur � peu pr�s n'importe quel sujet en donnant - des arguments � la commande :help . Essayez par exemple (n'oubliez pas - d'appuyer sur ) : + Vous pouvez accéder à l'aide sur à peu près n'importe quel sujet en donnant + des arguments à la commande :help . Essayez par exemple (n'oubliez pas + d'appuyer sur ) : :help w :help c_CTRL-D @@ -940,15 +940,15 @@ NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.7.2 : CR�ER UN SCRIPT DE D�MARRAGE + Leçon 1.7.2 : CRÉER UN SCRIPT DE DÉMARRAGE - ** Activer les fonctionnalit�s de Vim. ** + ** Activer les fonctionnalités de Vim. ** - Vim a beaucoup plus de fonctionnalit�s que Vi, mais la plupart de celles-ci - sont d�sactiv�es par d�faut. Pour commencer � les utiliser, vous devez - cr�er un fichier "vimrc". + Vim a beaucoup plus de fonctionnalités que Vi, mais la plupart de celles-ci + sont désactivées par défaut. Pour commencer à les utiliser, vous devez + créer un fichier "vimrc". - 1. Commencez � �diter le fichier "vimrc". Ceci d�pend de votre syst�me : + 1. Commencez à éditer le fichier "vimrc". Ceci dépend de votre système : :edit ~/.vimrc pour Unix :edit ~/_vimrc pour Windows @@ -958,80 +958,83 @@ NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez 3. Enregistrez le fichier avec : :w - La prochaine fois que vous d�marrerez Vim, la coloration syntaxique sera - activ�e. Vous pouvez ajouter tous vos r�glages pr�f�r�s dans ce fichier + La prochaine fois que vous démarrerez Vim, la coloration syntaxique sera + activée. Vous pouvez ajouter tous vos réglages préférés dans ce fichier "vimrc". Pour plus d'informations, tapez :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Le�on 1.7.3 : COMPL�TEMENT + Leçon 1.7.3 : COMPLÈTEMENT - ** Compl�tement de ligne de commande avec CTRL-D et ** + ** Complètement de ligne de commande avec CTRL-D et ** 1. Mettez Vim soit en mode non compatible : set nocp - 2. Regardez quels fichiers existent dans le r�pertoire : !ls ou !dir + 2. Regardez quels fichiers existent dans le répertoire : !ls ou !dir - 3. Tapez le d�but d'une commande : :e + 3. Tapez le début d'une commande : :e 4. Appuyez CTRL-D et Vim affichera une liste de commandes qui commencent par "e". - 5. Appuyez d et Vim compl�tera le nom de la commande : ":edit" + 5. Appuyez d et Vim complétera le nom de la commande : ":edit" - 6. Ajoutez maintenant un espace et le d�but d'un fichier existant : + 6. Ajoutez maintenant un espace et le début d'un fichier existant : :edit FIC - 7 Appuyez . Vim va compl�ter le nom (s'il est unique). + 7 Appuyez . Vim va compléter le nom (s'il est unique). -NOTE : Le compl�tement fonctionne pour de nombreuses commandes. Essayez +NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez d'appuyer CTRL-D et . C'est utile en particulier pour :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - R�SUM� DE LA LE�ON 1.7 + RÉSUMÉ DE LA LEÇON 1.7 - 1. Tapez :help ou appuyez ou pour ouvrir la fen�tre d'aide. + 1. Tapez :help ou appuyez ou pour ouvrir la fenêtre d'aide. 2. Tapez :help cmd pour trouver l'aide sur cmd . - 3. Tapez CTRL-W CTRL-W pour sauter � une autre fen�tre. + 3. Tapez CTRL-W CTRL-W pour sauter à une autre fenêtre. - 4. Tapez :q pour fermer la fen�tre d'aide. + 4. Tapez :q pour fermer la fenêtre d'aide. - 5. Cr�ez un script de d�marrage vimrc pour conserver vos r�glages pr�f�r�s. + 5. Créez un script de démarrage vimrc pour conserver vos réglages préférés. 6. Quand vous tapez une commande : appuyez CTRL-D pour voir les - compl�tements possibles. Appuyez pour utiliser un compl�tement. + complètements possibles. Appuyez pour utiliser un complètement. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ceci conclut le Tutoriel Vim. Le but �tait de vous donner un bref aper�u de - l'�diteur Vim, juste assez pour vous permettre d'utiliser l'�diteur - relativement facilement. Il est loin d'�tre complet, vu que Vim a beaucoup - plus de commandes. Un Manuel de l'utilisateur est disponible en anglais : + Voilà, c'est la fin du chapitre 1 de ce tutoriel. Vous pouvez maintenant + passer au chapitre 2. + + Le but était de vous donner un bref aperçu de l'éditeur Vim, juste assez pour + vous permettre d'utiliser l'éditeur relativement facilement. + Il est loin d'être complet, vu que Vim a beaucoup plus de commandes. + Un Manuel de l'utilisateur est disponible en anglais : :help user-manual - Pour continuer � d�couvrir et � apprendre Vim, il existe un livre traduit en - fran�ais. Il parle plus de Vi que de Vim, mais pourra vous �tre utile. - L'�diteur Vi - Collection Pr�cis et concis - par Arnold Robbins - �diteur : O'Reilly France + Pour continuer à découvrir et à apprendre Vim, il existe un livre traduit en + français. Il parle plus de Vi que de Vim, mais pourra vous être utile. + L'éditeur Vi - Collection Précis et concis - par Arnold Robbins + Éditeur : O'Reilly France ISBN : 2-84177-102-4 - Deux livres en anglais sont �galement mentionn�s dans la version originale - de ce tutoriel, dont un qui traite sp�cifiquement de Vim. Merci de vous y - r�f�rer si vous �tes int�ress�s. + Deux livres en anglais sont également mentionnés dans la version originale + de ce tutoriel, dont un qui traite spécifiquement de Vim. Merci de vous y + référer si vous êtes intéressés. - Ce tutoriel a �t� �crit par Michael C. Pierce et Robert K. Ware de l'�cole - des Mines du Colorado et reprend des id�es fournies par Charles Smith, - Universit� d'�tat du Colorado. E-mail : bware@mines.colorado.edu. + Ce tutoriel a été écrit par Michael C. Pierce et Robert K. Ware de l'École + des Mines du Colorado et reprend des idées fournies par Charles Smith, + Université d'État du Colorado. E-mail : bware@mines.colorado.edu. - Modifi� pour Vim par Bram Moolenaar. - Traduit en fran�ais par Adrien Beau, en avril 2001. - Derni�res mises � jour par Dominique Pell�. + Modifié pour Vim par Bram Moolenaar. + Traduit en français par Adrien Beau, en avril 2001. + Dernières mises à jour par Dominique Pellé. E-mail : dominique.pelle@gmail.com Last Change : 2018 Dec 2 diff --git a/runtime/tutor/tutor1.fr.utf-8 b/runtime/tutor/tutor1.fr.utf-8 deleted file mode 100644 index f479cd2815..0000000000 --- a/runtime/tutor/tutor1.fr.utf-8 +++ /dev/null @@ -1,1038 +0,0 @@ -=============================================================================== -= B i e n v e n u e dans l e T u t o r i e l de V I M - Version 1.7 = -=============================================================================== - - Vim est un éditeur très puissant qui a trop de commandes pour pouvoir - toutes les expliquer dans un cours comme celui-ci, qui est conçu pour en - décrire suffisamment afin de vous permettre d'utiliser simplement Vim. - - Le temps requis pour suivre ce cours est d'environ 25 à 30 minutes, selon - le temps que vous passerez à expérimenter. - - ATTENTION : - Les commandes utilisées dans les leçons modifieront le texte. Faites une - copie de ce fichier afin de vous entraîner dessus (si vous avez lancé - "vimtutor" ceci est déjà une copie). - - Il est important de garder en tête que ce cours est conçu pour apprendre - par la pratique. Cela signifie que vous devez exécuter les commandes - pour les apprendre correctement. Si vous vous contentez de lire le texte, - vous oublierez les commandes ! - - Maintenant, vérifiez que votre clavier n'est PAS verrouillé en - majuscules, et appuyez la touche j le nombre de fois suffisant pour - que la Leçon 1.1.1 remplisse complètement l'écran. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.1.1 : DÉPLACEMENT DU CURSEUR - - - ** Pour déplacer le curseur, appuyez les touches h,j,k,l comme indiqué. ** - ^ - k Astuce : La touche h est à gauche et déplace à gauche. - < h l > La touche l est à droite et déplace à droite. - j La touche j ressemble à une flèche vers le bas. - v - 1. Déplacez le curseur sur l'écran jusqu'à vous sentir à l'aise. - - 2. Maintenez la touche Bas (j) enfoncée jusqu'à ce qu'elle se répète. - Maintenant vous êtes capable de vous déplacer jusqu'à la leçon suivante. - - 3. En utilisant la touche Bas, allez à la Leçon 1.1.2. - -NOTE : Si jamais vous doutez de ce que vous venez de taper, appuyez <Échap> - pour revenir en mode Normal. Puis retapez la commande que vous vouliez. - -NOTE : Les touches fléchées devraient également fonctionner. Mais en utilisant - hjkl vous pourrez vous déplacer beaucoup plus rapidement, une fois que - vous aurez pris l'habitude. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.1.2 : SORTIR DE VIM - - - !! NOTE : Avant d'effectuer les étapes ci-dessous, lisez toute cette leçon !! - - 1. Appuyez la touche <Échap> (pour être sûr d'être en mode Normal). - - 2. Tapez : :q! - Ceci quitte l'éditeur SANS enregistrer les changements que vous avez - faits. - - 3. Revenez ici en tapant la commande qui vous a mené à ce tutoriel. - Cela pourrait être : vimtutor - - 4. Si vous avez mémorisé ces étapes et êtes confiant, effectuez les étapes - 1 à 3 pour sortir puis rentrer dans l'éditeur. - -NOTE : :q! annule tous les changements que vous avez faits. Dans - quelques leçons, vous apprendrez à enregistrer les changements. - - 5. Déplacez le curseur à la Leçon 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.1.3 : ÉDITION DE TEXTE - EFFACEMENT - - - ** Appuyez x pour effacer le caractère sous le curseur. ** - - 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - - 2. Pour corriger les erreurs, déplacez le curseur jusqu'à ce qu'il soit - sur un caractère à effacer. - - 3. Appuyez la touche x pour effacer le caractère redondant. - - 4. Répétez les étapes 2 à 4 jusqu'à ce que la phrase soit correcte. - ----> La vvache a sautéé au-ddessus dde la luune. - - 5. Maintenant que la ligne est correcte, passez à la Leçon 1.1.4. - -NOTE : En avançant dans ce cours, n'essayez pas de mémoriser, apprenez par - la pratique. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.1.4 : ÉDITION DE TEXTE - INSERTION - - - ** Appuyez i pour insérer du texte. ** - - 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous. - - 2. Pour rendre la première ligne identique à la seconde, mettez le curseur - sur le premier caractère APRÈS l'endroit où insérer le texte. - - 3. Appuyez i et tapez les caractères qui manquent. - - 4. Une fois qu'une erreur est corrigée, appuyez <Échap> pour revenir en mode - Normal. Répétez les étapes 2 à 4 pour corriger la phrase. - ----> Il mnqe caractères cette . ----> Il manque des caractères dans cette ligne. - - 5. Une fois que vous êtes à l'aise avec l'insertion de texte, allez à la - Leçon 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.1.5 : ÉDITION DE TEXTE - AJOUTER - - - ** Appuyez A pour ajouter du texte. ** - - 1. Déplacez le curseur sur la première ligne ci-dessous marquée --->. - Peu importe sur quel caractère se trouve le curseur sur cette ligne. - - 2. Appuyez A et tapez les ajouts nécessaires. - - 3. Quand le texte a été ajouté, appuyez <Échap> pour revenir en mode - Normal. - - 4. Déplacez le curseur sur la seconde ligne marquée ---> et répétez les - étapes 2 et 3 pour corriger la phrase. - ----> Il manque du texte à partir de cet - Il manque du texte à partir de cette ligne. ----> Il manque aussi du te - Il manque aussi du texte ici. - - 5. Quand vous vous sentez suffisamment à l'aise pour ajouter du texte, - allez à la Leçon 1.1.6. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.1.6 : ÉDITER UN FICHIER - - - ** Utilisez :wq pour enregistrer un fichier et sortir. ** - -!! NOTE : Lisez toute la leçon avant d'exécuter les instructions ci-dessous !! - - 1. Sortez de ce tutoriel comme vous l'avez fait dans la Leçon 1.1.2 : :q! - Ou, si vous avez accès à un autre terminal, exécutez-y les actions - qui suivent. - - 2. À l'invite du shell, tapez cette commande : vim tutor - 'vim' est la commande pour démarrer l'éditeur Vim, 'tutor' est le - nom du fichier que vous souhaitez éditer. Utilisez un fichier qui peut - être modifié. - - 3. Insérez et effacez du texte comme vous l'avez appris dans les leçons - précédentes. - - 4. Enregistrez le fichier avec les changements et sortez de Vim avec : - :wq - - 5. Si vous avez quitté vimtutor à l'étape 1, recommencez vimtutor et - déplacez-vous en bas vers le résumé suivant. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RÉSUMÉ DE LA LEÇON 1.1 - - - 1. Le curseur se déplace avec les touches fléchées ou les touches hjkl. - h (gauche) j (bas) k (haut) l (droite) - - 2. Pour démarrer Vim à l'invite du shell tapez : vim FICHIER - - 3. Pour quitter Vim tapez : <Échap> :q! pour perdre tous les - changements. - OU tapez : <Échap> :wq pour enregistrer les - changements. - - 4. Pour effacer un caractère sous le curseur tapez : x - - 5. Pour insérer ou ajouter du texte tapez : - i tapez le texte à insérer avant le curseur <Échap> - A tapez le texte à ajouter en fin de ligne <Échap> - -NOTE : Appuyer <Échap> vous place en mode Normal ou annule une commande - partiellement tapée dont vous ne voulez plus. - -Passez maintenant à la leçon 2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.2.1 : COMMANDES D'EFFACEMENT - - - ** Tapez dw pour effacer un mot. ** - - 1. Appuyez <Échap> pour être sûr d'être en mode Normal. - - 2. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - - 3. Placez le curseur sur le début d'un mot qui a besoin d'être effacé. - - 4. Tapez dw pour faire disparaître ce mot. - -NOTE : La lettre d apparaîtra sur la dernière ligne de l'écran lors de - votre frappe. Vim attend que vous tapiez w . Si vous voyez un autre - caractère que d vous avez tapé autre chose ; appuyez <Échap> et - recommencez. - ----> Il y a quelques drôle mots qui n'ont rien à faire papier sur cette ligne. - - 5. Répétez les étapes 3 et 4 jusqu'à ce que la phrase soit correcte et allez - à la Leçon 1.2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.2.2 : PLUS DE COMMANDES D'EFFACEMENTS - - - ** Tapez d$ pour effacer jusqu'à la fin de la ligne. ** - - 1. Appuyez <Échap> pour être sûr d'être en mode Normal. - - 2. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - - 3. Déplacez le curseur jusqu'à la fin de la ligne correcte (APRÈS le - premier . ). - - 4. Tapez d$ pour effacer jusqu'à la fin de la ligne. - ----> Quelqu'un a tapé la fin de cette ligne deux fois. cette ligne deux fois. - - 5. Allez à la Leçon 1.2.3 pour comprendre ce qui se passe. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.2.3 : À PROPOS DES OPÉRATEURS ET DES MOUVEMENTS - - - Plusieurs commandes qui changent le texte sont constituées d'un opérateur - et d'un mouvement. Le format pour une commande d'effacement avec l'opérateur - d d'effacement est le suivant : - - d mouvement - - Où : - d - est l'opérateur d'effacement - mouvement - est le mouvement sur lequel agit l'opérateur (listés - ci-dessous) - - Une courte liste de mouvements : - w - jusqu'au début du prochain mot, en EXCLUANT son premier caractère. - e - jusqu'à la fin du mot courant, en EXCLUANT son dernier caractère. - $ - jusqu'à la fin de la ligne, en INCLUANT son dernier caractère. - - Ainsi, taper de va effacer depuis le curseur jusqu'à la fin du mot. - -NOTE : Le seul appui d'un mouvement en mode Normal, sans commande, déplace le - curseur comme indiqué. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.2.4 : UTILISER UN QUANTIFICATEUR AVEC UN MOUVEMENT - - - ** Taper un nombre avant un mouvement le répète autant de fois. ** - - 1. Déplacez le curseur au début de la ligne marquée ---> ci-dessous. - - 2. Tapez 2w pour déplacer le curseur de 2 mots vers l'avant. - - 3. Tapez 3e pour déplacer le curseur à la fin du troisième mot vers - l'avant. - - 4. Tapez 0 (zéro) pour déplacer au début de la ligne. - - 5. Répétez les étapes 2 et 3 avec des quantificateurs différents. - ----> Ceci est juste une ligne avec des mots où vous pouvez vous déplacer. - - 6. Déplacez-vous à la Leçon 1.2.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.2.5 : UTILISER UN QUANTIFICATEUR POUR EFFACER PLUS - - - ** Taper un nombre avec un opérateur le répète autant de fois. ** - - Outre la combinaison de l'opérateur d'effacement avec un déplacement - mentionné ci-dessus, vous pouvez insérer un nombre (quantificateur) - pour effacer encore plus : - d nombre déplacement - - 1. Déplacez le curseur vers le premier mot en MAJUSCULES dans la ligne - marquée --->. - - 2. Tapez d2w pour effacer les deux mots en MAJUSCULES. - - 3. Répétez les étapes 1 et 2 avec des quantificateurs différents pour - effacer les mots suivants en MAJUSCULES à l'aide d'une commande. - ----> Cette ABC DE ligne FGHI JK LMN OP de mots est Q RS TUV nettoyée. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.2.6 : OPÉREZ SUR DES LIGNES - - - ** Tapez dd pour effacer une ligne complète. ** - - Vu le nombre de fois où l'on efface des lignes complètes, les concepteurs - de Vi ont décidé qu'il serait plus facile de taper simplement deux d - pour effacer une ligne. - - 1. Placez le curseur sur la seconde ligne de la phrase ci-dessous. - 2. Tapez dd pour effacer la ligne. - 3. Maintenant allez à la quatrième ligne. - 4. Tapez 2dd pour effacer deux lignes. - ----> 1) Les roses sont rouges, ----> 2) La boue c'est drôle, ----> 3) Les violettes sont bleues, ----> 4) J'ai une voiture, ----> 5) Les horloges donnent l'heure, ----> 6) Le sucre est doux ----> 7) Tout comme vous. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.2.7 : L'ANNULATION - - - ** Tapez u pour annuler les dernières commandes. ** - ** Tapez U pour récupérer toute une ligne. ** - - 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous et placez-le sur - la première erreur. - 2. Tapez x pour effacer le premier caractère redondant. - 3. Puis tapez u pour annuler la dernière commande exécutée. - 4. Cette fois, corrigez toutes les erreurs de la ligne avec la commande x . - 5. Puis tapez un U majuscule pour remettre la ligne dans son état initial. - 6. Puis tapez u deux-trois fois pour annuler le U et les commandes - précédentes. - 7. Maintenant tapez CTRL-R (maintenez la touche CTRL enfoncée pendant que - vous appuyez R) deux-trois fois pour refaire les commandes (annuler - les annulations). - ----> Coorrigez les erreurs suur ccette ligne et reemettez-les avvec 'annuler'. - - 8. Ce sont des commandes très utiles. Maintenant, allez au résumé de la - Leçon 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RÉSUMÉ DE LA LEÇON 1.2 - - - 1. Pour effacer du curseur jusqu'au mot suivant tapez : dw - - 2. Pour effacer du curseur jusqu'à la fin d'une ligne tapez : d$ - - 3. Pour effacer toute une ligne tapez : dd - - 4. Pour répéter un déplacement ajoutez un quantificateur : 2w - - 5. Le format d'une commande de changement est : - - opérateur [nombre] déplacement - - Où : - opérateur - est ce qu'il faut faire, comme d pour effacer. - [nombre] - un quantificateur optionnel pour répéter le déplacement. - déplacement - déplace le long du texte à opérer, tel que w (mot), - $ (jusqu'à la fin de ligne), etc. - - 6. Pour se déplacer au début de ligne, utilisez un zéro : 0 - - 5. Pour annuler des actions précédentes, tapez : u (u minuscule) - Pour annuler tous les changements sur une ligne tapez : U (U majuscule) - Pour annuler l'annulation tapez : CTRL-R - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.3.1 : LE COLLAGE - - - ** Tapez p pour placer après le curseur ce qui vient d'être effacé. ** - - 1. Placez le curseur sur la première ligne ci-dessous marquée --->. - - 2. Tapez dd pour effacer la ligne et la placer dans un registre de Vim. - - 3. Déplacez le curseur sur la ligne c) au-dessus où vous voulez remettre la - ligne effacée. - - 4. En mode Normal, tapez p pour remettre la ligne en dessous du curseur. - - 5. Répétez les étapes 2 à 4 pour mettre toutes les lignes dans le bon ordre. - ----> d) Et vous, qu'apprenez-vous ? ----> b) Les violettes sont bleues, ----> c) L'intelligence s'apprend, ----> a) Les roses sont rouges, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.3.2 : LA COMMANDE DE REMPLACEMENT - - - ** Tapez rx pour remplacer un caractère sous le curseur par x . ** - - 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous. - - 2. Placez le curseur de manière à ce qu'il surplombe la première erreur. - - 3. Tapez r suivi du caractère qui doit corriger l'erreur. - - 4. Répétez les étapes 2 et 3 jusqu'à ce que la première ligne soit égale - à la seconde. - ----> Quand cette ligne a été sauvie, quelqu'un a lait des faunes de frappe ! ----> Quand cette ligne a été saisie, quelqu'un a fait des fautes de frappe ! - - 5. Maintenant, allez à la Leçon 1.3.3. - -NOTE : N'oubliez pas que vous devriez apprendre par la pratique, pas par - mémorisation. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.3.3 : L'OPÉRATEUR DE CHANGEMENT - - - ** Pour changer jusqu'à la fin d'un mot, tapez ce .** - - 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous. - - 2. Placez le curseur sur le u de luhko. - - 3. Tapez ce et corrigez le mot (dans notre cas, tapez 'igne'.) - - 4. Appuyez <Échap> et placez-vous sur le prochain caractère qui doit - être changé. - - 5. Répétez les étapes 3 et 4 jusqu'à ce que la première phrase soit - identique à la seconde. - ----> Cette luhko contient quelques myqa qui ont ricne d'être chantufip. ----> Cette ligne contient quelques mots qui ont besoin d'être changés. - -Notez que ce efface le mot et vous place ensuite en mode Insertion. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.3.4 : PLUS DE CHANGEMENTS AVEC c - - - ** L'opérateur de changement fonctionne avec les mêmes déplacements - que l'effacement. ** - - 1. L'opérateur de changement fonctionne de la même manière que - l'effacement. Le format est : - - c [nombre] déplacement - - 2. Les déplacements sont identiques : w (mot) et $ (fin de ligne). - - 3. Déplacez-vous sur la première ligne marquée ---> ci-dessous. - - 4. Placez le curseur sur la première erreur. - - 5. Tapez c$ et tapez le reste de la ligne afin qu'elle soit identique - à la seconde ligne, puis tapez <Échap>. - ----> La fin de cette ligne doit être rendue identique à la seconde. ----> La fin de cette ligne doit être corrigée avec la commande c$ . - -NOTE : Vous pouvez utiliser la touche Retour Arrière pour corriger les - erreurs lorsque vous tapez. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RÉSUMÉ DE LA LEÇON 1.3 - - - 1. Pour remettre le texte qui a déjà été effacé, tapez p . Cela Place le - texte effacé APRÈS le curseur (si une ligne complète a été effacée, elle - sera placée sous la ligne du curseur). - - 2. Pour remplacer le caractère sous le curseur, tapez r suivi du caractère - qui remplacera l'original. - - 3. L'opérateur de changement vous permet de changer depuis la position du - curseur jusqu'où le déplacement vous amène. Par exemple, tapez ce - pour changer du curseur jusqu'à la fin du mot, c$ pour changer jusqu'à - la fin d'une ligne. - - 4. Le format pour le changement est : - - c [nombre] déplacement - -Passez maintenant à la leçon suivante. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.4.1 : POSITION DU CURSEUR ET ÉTAT DU FICHIER - - - ** Tapez CTRL-G pour afficher votre position dans le fichier et son état. - Tapez G pour vous rendre à une ligne donnée du fichier. ** - -NOTE : Lisez toute cette leçon avant d'effectuer l'une des étapes !! - - 1. Maintenez enfoncée la touche CTRL et appuyez sur g . On appelle cela - CTRL-G. Une ligne d'état va apparaître en bas de l'écran avec le nom - du fichier et le numéro de la ligne où vous êtes. Notez ce numéro, il - servira lors de l'étape 3. - -NOTE : Vous pouvez peut-être voir le curseur en bas à droite de l'écran. - Ceci arrive quand l'option 'ruler' est activée (voir :help 'ruler') - - 2. Tapez G pour vous déplacer à la fin du fichier. - Tapez gg pour vous déplacer au début du fichier. - - 3. Tapez le numéro de la ligne où vous étiez suivi de G . Cela vous - ramènera à la ligne où vous étiez au départ quand vous aviez appuyé - CTRL-G. - - 4. Si vous vous sentez prêt à faire ceci, effectuez les étapes 1 à 3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.4.2 : LA RECHERCHE - - - ** Tapez / suivi d'un texte pour rechercher ce texte. ** - - 1. Tapez le caractère / en mode Normal. Notez que celui-ci et le curseur - apparaissent en bas de l'écran, comme lorsque l'on utilise : . - - 2. Puis tapez 'errreuur' . C'est le mot que vous voulez rechercher. - - 3. Pour rechercher à nouveau le même texte, tapez simplement n . - Pour rechercher le même texte dans la direction opposée, tapez N . - - 4. Pour rechercher une phrase dans la direction opposée, utilisez ? - au lieu de / . - ----> erreur ne s'écrit pas "errreuur" ; errreuur est une erreur. - -NOTE : Quand la recherche atteint la fin du fichier, elle reprend au début - sauf si l'option 'wrapscan' est désactivée. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.4.3 : RECHERCHE DES PARENTHÈSES CORRESPONDANTES - - - ** Tapez % pour trouver des ), ] ou } correspondants. ** - - 1. Placez le curseur sur l'un des (, [ ou { de la ligne marquée ---> - ci-dessous. - - 2. Puis tapez le caractère % . - - 3. Le curseur se déplacera sur la parenthèse ou crochet correspondant. - - 4. Tapez % pour replacer le curseur sur la parenthèse ou crochet - correspondant. - - 5. Déplacez le curseur sur un autre (,),[,],{ ou } et regardez ce que - fait % . - ----> Voici ( une ligne de test contenant des (, des [ ] et des { } )). - -NOTE : Cette fonctionnalité est très utile lors du débogage d'un programme qui - contient des parenthèses déséquilibrées ! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.4.4 : LA COMMANDE DE SUBSTITUTION - - - ** Tapez :s/ancien/nouveau/g pour remplacer 'ancien' par 'nouveau'. ** - - 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - - 2. Tapez :s/lee/le . Notez que cette commande change seulement la - première occurrence de "lee" dans la ligne. - - 3. Puis tapez :s/lee/le/g . L'ajout du drapeau g ordonne de faire une - substitution globale sur la ligne, et change toutes les occurrences de - "lee" sur la ligne. - ----> lee meilleur moment pour regarder lees fleurs est pendant lee printemps. - - 4. Pour changer toutes les occurrences d'un texte, entre deux lignes, - tapez :#,#s/ancien/nouveau/g où #,# sont les numéros de lignes de la - plage où la substitution doit être faite. - Tapez :%s/ancien/nouveau/g pour changer toutes les occurrences dans - tout le fichier. - Tapez :%s/ancien/nouveau/gc pour trouver toutes les occurrences dans - tout le fichier avec une invite pour - confirmer ou infirmer chaque substitution. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RÉSUMÉ DE LA LEÇON 1.4 - - - 1. CTRL-G affiche la position dans le fichier et l'état de celui-ci. - G déplace à la fin du fichier. - nombre G déplace au numéro de ligne. - gg déplace à la première ligne. - - 2. Taper / suivi d'un texte recherche ce texte vers l'AVANT. - Taper ? suivi d'un texte recherche ce texte vers l'ARRIÈRE. - Après une recherche tapez n pour trouver l'occurrence suivante dans la - même direction ou Maj-N pour rechercher dans la direction opposée. - - 3. Taper % lorsque le curseur est sur (, ), [, ], { ou } déplace - celui-ci sur le caractère correspondant. - - 4. Pour remplacer le premier aa par bb sur une ligne tapez :s/aa/bb - Pour remplacer tous les aa par bb sur une ligne tapez :s/aa/bb/g - Pour remplacer du texte entre deux numéros de ligne tapez :#,#s/aa/bb/g - Pour remplacer toutes les occurrences dans le fichier tapez :%s/aa/bb/g - Pour demander une confirmation à chaque fois ajoutez 'c' :%s/aa/bb/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.5.1 : COMMENT EXÉCUTER UNE COMMANDE EXTERNE - - - ** Tapez :! suivi d'une commande externe pour exécuter cette commande. ** - - 1. Tapez le : familier pour mettre le curseur en bas de l'écran. Cela vous - permet de saisir une commande. - - 2. Puis tapez un ! (point d'exclamation). Cela vous permet d'exécuter - n'importe quelle commande valide pour votre interpréteur (shell). - - 3. Par exemple, tapez ls après le ! et appuyez . Ceci affichera - la liste des fichiers du répertoire courant, comme si vous aviez tapé la - commande à l'invite du shell. Utilisez :!dir si :!ls ne marche pas. - -NOTE : Il est possible d'exécuter n'importe quelle commande externe de cette - manière, avec ou sans argument. - -NOTE : Toutes les commandes : doivent finir par la frappe de . - À partir de maintenant, nous ne le mentionnerons plus. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.5.2 : PLUS DE DÉTAILS SUR L'ENREGISTREMENT DE FICHIERS - - - ** Pour enregistrer les changements faits au texte, tapez :w FICHIER . ** - - 1. Tapez :!dir ou :!ls pour avoir la liste des fichiers dans le - répertoire courant. Vous savez déjà qu'il faut appuyer après - cela. - - 2. Choisissez un nom de fichier qui n'existe pas encore, par exemple TEST. - - 3. Puis tapez :w TEST (où TEST est le nom que vous avez choisi). - - 4. Cela enregistre tout le fichier (Tutoriel Vim) sous le nom TEST. - Pour le vérifier, tapez :!dir ou :!ls de nouveau pour revisualiser - votre répertoire. - -NOTE : Si vous quittez Vim et le redémarrez de nouveau avec le fichier TEST, - celui-ci sera une copie exacte de ce cours au moment où vous l'avez - enregistré. - - 5. Maintenant, effacez le fichier en tapant (Windows) : :!del TEST - ou (Unix) : :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.5.3 : SÉLECTION DU TEXTE À ENREGISTRER - - - ** Pour enregistrer une portion du fichier, - tapez : v déplacement :w FICHIER ** - - 1. Déplacez le curseur sur cette ligne. - - 2. Appuyez v et déplacez le curseur vers la cinquième ligne plus bas. - Remarquez que le texte est en surbrillance. - - 3. Appuyez : . En bas de l'écran :'<,'> va apparaître. - - 4. Tapez w TEST , où TEST est un nom de fichier qui n'existe pas. - Vérifiez que vous voyez :'<,'>w TEST avant d'appuyer sur . - - 5. Vim va enregistrer les lignes sélectionnées dans le fichier TEST. - Utilisez :!dir ou :!ls pour le voir. Ne l'effacez pas encore ! - Nous allons l'utiliser dans la leçon suivante. - -NOTE : L'appui de v démarre la sélection Visuelle. Vous pouvez déplacer le - curseur pour agrandir ou rétrécir la sélection. Puis vous pouvez - utiliser un opérateur pour faire quelque chose sur le texte. Par - exemple, d efface le texte. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.5.4 : RÉCUPÉRATION ET FUSION DE FICHIERS - - - ** Pour insérer le contenu d'un fichier, tapez :r FICHIER ** - - 1. Placez le curseur juste au-dessus de cette ligne. - -NOTE : Après avoir exécuté l'étape 2 vous verrez du texte de la Leçon 1.5.3. - Puis déplacez-vous vers le bas pour voir cette leçon à nouveau. - - 2. Maintenant récupérez votre fichier TEST en utilisant la commande :r TEST - où TEST est le nom de votre fichier. - Le fichier que vous récupérez est placé au-dessous de la ligne du curseur. - - 3. Pour vérifier que le fichier a bien été inséré, remontez et vérifiez - qu'il y a maintenant deux copies de la Leçon 1.5.3, l'originale et celle - contenue dans le fichier. - -NOTE : Vous pouvez aussi lire la sortie d'une commande externe. Par exemple, - :r !ls lit la sortie de la commande ls et la place sous la ligne du - curseur. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RÉSUMÉ DE LA LEÇON 1.5 - - - 1. :!commande exécute une commande externe. - - Quelques exemples pratiques : - (Windows) (Unix) - :!dir :!ls affiche le contenu du répertoire courant. - :!del FICHIER :!rm FICHIER efface FICHIER. - - 2. :w FICHIER enregistre le fichier Vim courant sur le disque avec pour - nom FICHIER. - - 3. v déplacement :w FICHIER sauvegarde les lignes de la sélection Visuelle - dans le fichier FICHIER. - - 4. :r FICHIER récupère le contenu du fichier FICHIER et l'insère sous la - position du curseur. - - 5. :r !dir lit la sortie de la commande dir et l'insère sous la position - du curseur. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.6.1 : LA COMMANDE D'OUVERTURE - - -** Tapez o pour ouvrir une ligne sous le curseur et y aller en Insertion. ** - - 1. Déplacez le curseur sur la ligne marquée ---> ci-dessous. - - 2. Tapez la lettre o minuscule pour ouvrir une ligne SOUS le curseur et - vous y placer en mode Insertion. - - 3. Puis tapez du texte et appuyez <Échap> pour sortir du mode Insertion. - ----> En tapant o le curseur se met sur la ligne ouverte, en mode Insertion. - - 4. Pour ouvrir une ligne au-DESSUS du curseur, tapez simplement un O - majuscule, plutôt qu'un o minuscule. Faites un essai sur la ligne - ci-dessous. - ----> Ouvrez une ligne ci-dessus en tapant O lorsque le curseur est ici. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.6.2 : LA COMMANDE D'AJOUT - - - ** Tapez a pour insérer du texte APRÈS le curseur. ** - - 1. Placez le curseur au début de la ligne marquée ---> ci-dessous. - - 2. Appuyez e jusqu'à ce que le curseur soit sur la fin de li . - - 3. Appuyez a (minuscule) pour ajouter du texte APRÈS le curseur. - - 4. Complétez le mot comme dans la ligne dessous. Appuyez <Échap> pour - sortir du mode Insertion. - - 5. Utilisez e pour vous déplacer vers le mot incomplet suivant et - répétez les étapes 3 et 4. - ----> Cette li vous perm de pratiq l'ajout de t dans une ligne. ----> Cette ligne vous permet de pratiquer l'ajout de texte dans une ligne. - -NOTE : a, i, A vont tous dans le même mode Insertion, la seule différence - est l'endroit où les caractères sont insérés. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.6.3 : UNE AUTRE MANIÈRE DE REMPLACER - - - ** Tapez un R majuscule pour remplacer plus d'un caractère. ** - - 1. Déplacez le curseur sur la première ligne marquée ---> ci-dessous. - Déplacez le curseur sur le début du premier xxx . - - 2. Appuyez maintenant R et tapez le nombre dessous dans la deuxième ligne, - de manière à remplacer le xxx . - - 3. Appuyez <Échap> pour quitter le mode Remplacement. Notez que le reste de - la ligne demeure inchangé. - - 4. Répétez les étapes pour remplacer les xxx restants. - - ----> L'ajout de 123 à xxx donne xxx. ----> L'ajout de 123 à 456 donne 579. - -NOTE : Le mode Remplacement est comme le mode Insertion, mais tous les - caractères tapés effacent un caractère existant. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.6.4 : COPIER ET COLLER DU TEXTE - - - ** Utilisez l'opérateur y pour copier du texte et p pour le coller ** - - 1. Allez à la ligne marquée ---> ci-dessous et placez le curseur après "a)". - - 2. Démarrez le mode Visuel avec v et déplacez le curseur juste devant - "premier". - - 3. Tapez y pour copier le texte en surbrillance. - - 4. Déplacez le curseur à la fin de la ligne suivante : j$ - - 5. Tapez p pour coller le texte. Puis tapez : un second <Échap> . - - 6. Utilisez le mode Visuel pour sélectionner "élément", copiez-le avec y , - déplacez-vous à la fin de la ligne suivante avec j$ et collez le texte - à cet endroit avec p . - ----> a) ceci est le premier élément. - b) - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.6.5 : RÉGLAGE DES OPTIONS - - - ** Réglons une option afin que la recherche et la substitution ignorent la - casse des caractères. ** - - 1. Recherchez 'ignore' en tapant : /ignore - Répétez ceci plusieurs fois en utilisant la touche n . - - 2. Activez l'option 'ic' (ignorer casse) en tapant :set ic . - - 3. Puis cherchez 'ignore' de nouveau en utilisant n . - Remarquez que Ignore et IGNORE sont maintenant aussi trouvés. - - 4. Activez les options 'hlsearch' et 'incsearch' avec :set hls is . - - 5. Puis recommencez une recherche, et faites bien attention à ce qui se - produit : /ignore - - 6. Pour désactiver 'ignorer casse', entrez : :set noic - -NOTE : Pour enlever la surbrillance des résultats, entrez : :nohlsearch - -NOTE : Si vous voulez ignorer la casse uniquement pour une recherche, utilisez - \c dans la phrase : /ignore\c - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RÉSUMÉ DE LA LEÇON 1.6 - - - 1. Taper o ouvre une ligne SOUS le curseur et démarre le mode Insertion. - Taper O ouvre une ligne au-DESSUS du curseur. - - 2. Taper a pour insérer du texte APRÈS le curseur. - Taper A pour insérer du texte après la fin de ligne. - - 3. Taper e déplace à la fin du mot. - - 4. Taper y copie du texte, p le colle. - - 5. Taper R majuscule active le mode Remplacement jusqu'à ce qu' <Échap> - soit appuyé. - - 6. Taper ":set xxx" active l'option "xxx". Quelques options sont : - 'ic' 'ignorecase' pour ignorer la casse lors des recherches. - 'is' 'incsearch' pour montrer les appariements partiels. - 'hls' 'hlsearch' pour mettre en surbrillance les appariements. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leçon 1.7.1 : OBTENIR DE L'AIDE - - - ** Utiliser le système d'aide en ligne. ** - - Vim a un système complet d'aide en ligne. Pour y accéder, essayez l'une de - ces trois méthodes : - - appuyez la touche (si vous en avez une) - - appuyez la touche (si vous en avez une) - - tapez :help - - - Lisez le texte dans la fenêtre d'aide pour savoir comment fonctionne l'aide. - Tapez CTRL-W CTRL-W pour sauter d'une fenêtre à l'autre. - Tapez :q pour fermer la fenêtre d'aide. - - Vous pouvez accéder à l'aide sur à peu près n'importe quel sujet en donnant - des arguments à la commande :help . Essayez par exemple (n'oubliez pas - d'appuyer sur ) : - - :help w - :help c_CTRL-D - :help c_ ** - - 1. Mettez Vim soit en mode non compatible : set nocp - - 2. Regardez quels fichiers existent dans le répertoire : !ls ou !dir - - 3. Tapez le début d'une commande : :e - - 4. Appuyez CTRL-D et Vim affichera une liste de commandes qui commencent - par "e". - - 5. Appuyez d et Vim complétera le nom de la commande : ":edit" - - 6. Ajoutez maintenant un espace et le début d'un fichier existant : - :edit FIC - - 7 Appuyez . Vim va compléter le nom (s'il est unique). - -NOTE : Le complètement fonctionne pour de nombreuses commandes. Essayez - d'appuyer CTRL-D et . C'est utile en particulier pour :help . - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RÉSUMÉ DE LA LEÇON 1.7 - - - 1. Tapez :help ou appuyez ou pour ouvrir la fenêtre d'aide. - - 2. Tapez :help cmd pour trouver l'aide sur cmd . - - 3. Tapez CTRL-W CTRL-W pour sauter à une autre fenêtre. - - 4. Tapez :q pour fermer la fenêtre d'aide. - - 5. Créez un script de démarrage vimrc pour conserver vos réglages préférés. - - 6. Quand vous tapez une commande : appuyez CTRL-D pour voir les - complètements possibles. Appuyez pour utiliser un complètement. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Ceci conclut le Tutoriel Vim. Le but était de vous donner un bref aperçu de - l'éditeur Vim, juste assez pour vous permettre d'utiliser l'éditeur - relativement facilement. Il est loin d'être complet, vu que Vim a beaucoup - plus de commandes. Un Manuel de l'utilisateur est disponible en anglais : - :help user-manual - - Pour continuer à découvrir et à apprendre Vim, il existe un livre traduit en - français. Il parle plus de Vi que de Vim, mais pourra vous être utile. - L'éditeur Vi - Collection Précis et concis - par Arnold Robbins - Éditeur : O'Reilly France - ISBN : 2-84177-102-4 - - Deux livres en anglais sont également mentionnés dans la version originale - de ce tutoriel, dont un qui traite spécifiquement de Vim. Merci de vous y - référer si vous êtes intéressés. - - Ce tutoriel a été écrit par Michael C. Pierce et Robert K. Ware de l'École - des Mines du Colorado et reprend des idées fournies par Charles Smith, - Université d'État du Colorado. E-mail : bware@mines.colorado.edu. - - Modifié pour Vim par Bram Moolenaar. - Traduit en français par Adrien Beau, en avril 2001. - Dernières mises à jour par Dominique Pellé. - - E-mail : dominique.pelle@gmail.com - Last Change : 2018 Dec 2 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.gl b/runtime/tutor/tutor1.gl new file mode 100644 index 0000000000..1828289e51 --- /dev/null +++ b/runtime/tutor/tutor1.gl @@ -0,0 +1,1049 @@ + +=============================================================================== += B e n v i d o a o t u t o r d o V I M - Versión 1.7 = +=============================================================================== + + + Vim é un editor moi potente que dispón de moitos comandos, demasiados + para ser explicados nun tutor coma este. Este tutor está deseñado + para describir comandos dabondo para que vostede sexa capaz de + aprender fácilmente a usa-lo Vim como un editor de propósito xeral. + + O tempo necesario para completa-lo tutor é aproximadamente de 30 + minutos, dependendo de canto tempo se adique á experimentación. + + Os comandos destas leccións modificarán o texto. Faga unha copia deste + ficheiro para practicar (con «vimtutor», isto xa é unha copia). + + É importante lembrar que este tutor está pensado para ensinar coa + práctica. Isto significa que cómpre executa-los comandos para + aprendelos axeitadamente. Se únicamente le o texto, esqueceránselle + os comandos! + + Agora, asegúrese de que a tecla de bloqueo de maiúsculas NON está + activada e prema a tecla j para move-lo cursor, de xeito que o texto + da Lección 1.1.1 abranga completamente a pantalla. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.1.1: MOVE-LO CURSOR + + + ** Para move-lo cursor, prema as teclas h,j,k,l do xeito indicado. ** + ^ + k Indicación: A tecla h está á esquerda, e móveo á esquerda. + < h l > A tecla l está á dereita, e móveo á dereita. + j A tecla j semella unha frecha e apunta + v cara a embaixo. + + 1. Mova o cursor pola pantalla ata que sinta comodidade facendo a acción. + + 2. Manteña premida a tecla j ata que se repita automáticamente. + Agora xa sabe como chegar á lección seguinte. + + 3. Utilizando a tecla abaixo, vaia á lección 1.1.2. + +NOTA: Se alguna vez non está seguro sobre algo que tecleara, prema + para situarse no modo Normal. Logo, volva a teclear a orde que desexaba. + +NOTA: As teclas de movemento do cursor tamén funcionan. Pero usando hjkl + poderá moverse moito máis rápido unha vez que se acostume. + De verdade! + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.1.2: SAÍR DO VIM + + +NOTA: Antes de executar algún dos seguintes pasos, lea primeiro a lección + enteira!! + + 1. Prema a tecla (para asegurarse de que está no modo Normal). + + 2. Escriba: :q! + Isto provoca a saída do editor REXEITANDO calquer cambio que fora feito. + + 3. Regrese eiquí executando o comando que o trouxo a este tutor. + Este puido ser: vimtutor + + 4. Se memorizou estes pasos, e se sinte con confianza, execute os + pasos do 1 ao 3 para saír e volver a entrar ao editor. + +NOTA: :q! descarta cualquer cambio que realizara. + En próximas leccións, aprenderá como garda-los cambios nun arquivo. + + 5. Mova o cursor ata a Lección 1.1.3. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.1.3: EDITAR TEXTO - BORRAR + + + ** Prema x para elimina-lo carácter baixo o cursor. ** + + 1. Mova o cursor á liña de embaixo sinalada con --->. + + 2. Para corrixi-los erros, mova o cursor ata que estea sobre o + carácter que vai ser borrado. + + 3. Prema a tecla x para elimina-lo carácter non desexado. + + 4. Repita os pasos 2 a 4 ata que a frase sexa a correcta. + +---> A vvaca saltooooou soobree aa lúúúúúúúa. + + 5. Agora que a liña está correcta, continúe coa Lección 1.1.4. + +NOTA: A medida que vaia avanzando neste tutor, non tente memorizar, + aprenda practicando. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.1.4: EDITAR TEXTO - INSERIR + + + ** Prema i para inserir texto. ** + + 1. Mova o cursor á primeira liña de embaixo sinalada con --->. + + 2. Para facer que a primeira liña sexa igual ca segunda, mova o cursor + ata que estea sobre o carácter ANTES do texto que vai ser inserido. + + 3. Prema i e escriba os carácteres a engadir. + + 4. A medida que sexa corrixido cada erro, prema para volver ao modo + Normal. Repita os pasos 2 a 4 para corrixi-la frase. + +---> Flta texto nesta . +---> Falta algo de texto nesta liña. + + 5. Cuando se sinta con comodidade inserindo texto, pase á lección 1.1.5. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.1.5: EDITAR TEXTO - ENGADIR + + + ** Prema A para engadir texto. ** + + 1. Mova o cursor á primeira liña inferior marcada con --->. + Non importa sobre qué carácter estea o cursor nesta liña. + + 2. Prema A e escriba o texto necesario. + + 3. Cuando o texto estea engadido, prema para volver ao modo Normal. + + 4. Mova o cursor á segunda liña marcada con ---> e repita os pasos 2 e 3 + para corrixir esta frase. + +---> Falta algún texto nes + Falta algún texto nesta liña. +---> Tamén falta alg + Tamén falta algún texto eiquí. + + 5. Cuando se sinta con comodidade engadindo texto, pase á lección 1.1.6. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.1.6: EDITAR UN ARQUIVO + + + ** Use :wq para gardar un arquivo e saír ** + +NOTA: Antes de executar os seguintes pasos, lea a lección enteira!! + + 1. Se ten acceso a outra terminal, faga os seguintes puntos nela. + Se non é así, saia deste tutor como fixo na lección 1.1.2: :q! + + 2. No símbolo do sistema escriba este comando: vim arquivo.txt + 'vim' é o comando para arrincar o editor Vim, + 'arquivo.txt' é o nome do arquivo que quere editar. + Utilice o nome dun arquivo que poida cambiar. + + 3. Insira e elimine texto como xa aprendeu nas leccións anteriores. + + 4. Garde o arquivo cos cambios e saia do Vim con: :wq + + 5. Se xa saiu do vimtutor no paso 1, reinicie vimtutor e baixe ata + o seguinte resumo. + + 6. Despois de le-los pasos anteriores e telos entendido: fágaos. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMO DA LECCIÓN 1.1 + + + 1. O cursor móvese utilizando as teclas das frechas ou as teclas hjkl. + h (esquerda) j (abaixo) k (arriba) l (dereita) + + 2. Para acceder ao Vim dende o símbolo do sistema escriba: + vim nome_arquivo + + 3. Para saír do Vim escriba: :q! para eliminar tódolos + cambios. + Ou escriba: :wq para garda-los cambios. + + 4. Para borrar un carácter baixo o cursor en modo Normal prema: x . + + 5. Para inserir ou engadir texto escriba: + i escriba o texto a inserir insire o texto antes do cursor + A escriba o texto a engadir engade o texto ao final da liña + +NOTA: Premendo tórnase ao modo Normal ou cancélase unha orde non + desexada ou incompleta. + + Agora continúe coa Lección 1.2. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.2.1: COMANDOS PARA BORRAR + + + ** Escriba dw para borrar unha palabra ** + + 1. Prema para asegurarse de que está no modo Normal. + + 2. Mova o cursor á liña inferior sinalada con --->. + + 3. Mova o cursor ao comezo dunha palabra que desexe borrar. + + 4. Prema dw para facer que a palabra desapareza. + +NOTA: A letra d aparecerá na última liña inferior dereita da pantalla + namentres a escribe. O Vim está esperando que escriba w . + Se ve outro carácter que non sexa d , é que escribiu algo mal. Prema + e comece de novo. + +---> Hai algunhas palabras pásao ben que non pertencen papel a esta frase. + + 5. Repita os pasos 3 e 4 ata que a frase sexa correcta e pase á + lección 1.2.2. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.2.2: MÁIS COMANDOS PARA BORRAR + + + ** Escriba d$ para borrar ata o final da liña. ** + + 1. Prema para asegurarse de que está no modo Normal. + + 2. Mova o cursor á liña inferior sinalada con --->. + + 3. Mova o cursor ao final da liña correcta (DESPOIS do primeiro . ). + + 4. Escriba d$ para borrar ata o final da liña. + +---> Alguén escribiu o final desta liña dúas veces. esta liña dúas veces. + + Pase á lección 1.2.3 para entender qué está pasando. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.2.3: SOBRE OPERADORES E MOVEMENTOS + + + Moitos comandos que cambian texto están compostos por un operador e máis + un movemento. + O formato para o comando 'eliminar' co operador de borrado d é o + seguinte: + + d movemento + + Onde: + d - é o operador para borrar. + movemento - é o texto sobre o que o comando vai operar (lista inferior). + + Eiquí, unha lista resumida de movementos: + w - ata o comezo da seguinte palabra, EXCLUÍNDO o seu primero carácter. + e - ata o final da palabra actual, INCLUÍNDO o último carácter. + $ - ata o final da liña, INCLUÍNDO o último carácter. + + Polo tanto, ao escribir de borraráse dende a posición do cursor ata o + final da palabra. + +NOTA: Premendo únicamente o movemento, estando no modo Normal sen un + operador, moveráse o cursor como se especifica na lista anterior. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.2.4: UTILIZAR UN CONTADOR PARA UN MOVEMENTO + + + ** Ao escribir un número denantes dun movemento, repítise o movemento + o número de veces. ** + + 1. Mova o cursor ao comezo da liña marcada con --->. + + 2. Escriba 2w para mover o cursor dúas palabras cara a adiante. + + 3. Escriba 3e para mover o cursor ao final da terceira palabra cara a + adiante. + + 4. Escriba 0 (cero) para coloca-lo cursor ao inicio da liña. + + 5. Repita os pasos 2 e 3 con diferentes números. + +---> Isto é só unha liña con palabras onde poder moverse. + + Pase á lección 1.2.5. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.2.5: UTILIZAR UN CONTADOR PARA BORRAR MÁIS + + + ** Ao escribir un número cun operador, repítese ese número de veces. ** + + En combinación co operador de borrado e o movemento mencionado + anteriormente, engada un contador antes do movemento para eliminar máis: + d número movemento + + 1. Mova o cursor ao inicio da primeira palabra en MAIÚSCULAS na liña + marcada con --->. + + 2. Escriba d2w para elimina-las dúas palabras en MAIÚSCULAS. + + 3. Repita os pasos 1 e 2 con diferentes contadores para elimina-las + seguintes palabras en MAIÚSCULAS cun comando. + +---> Esta ABC DE cadea FGHI JK LMN OP de palabras foi Q RS TUV limpada. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.2.6: OPERACIÓN EN LIÑAS + + + ** Escriba dd para eliminar unha liña completa. ** + + Debido á frecuencia coa que se elimina unha liña completa, os deseñadores + do Vim decidiron que sería máis sinxelo simplemente escribir dúas letras + d para eliminar unha liña. + + 1. Mova o cursor á segunda liña do párrafo inferior. + + 2. Escriba dd para elimina-la liña. + + 3. Agora, móvase á cuarta liña. + + 4. Escriba 2dd para eliminar dúas liñas á vez. + +---> 1) As rosas son vermellas, +---> 2) o barro é divertido, +---> 3) a violeta é azul, +---> 4) teño un coche, +---> 5) os reloxos dan a hora, +---> 6) o azucere é dóce +---> 7) e ti tamén o es. + + A duplicación para borrar liñas tamén funcionan cos operadores + mencionados anteriormente. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.2.7: O COMANDO DESFACER + + + ** Prema u para desfacer os últimos comandos, + U para desfacer unha liña enteira. ** + + 1. Mova o cursor á liña inferior sinalada con ---> e sitúeo baixo o + primeiro erro. + + 2. Prema x para borra-lo primeiro carácter non desexado. + + 3. Prema agora u para desface-lo último comando executado. + + 4. Agora, corrixa tódolos erros da liña usando o comando x. + + 5. Prema agora U maiúsculo para devolver a liña ao seu estado orixinal. + + 6. Prema agora u unhas poucas veces máis para desface-lo feito por U e + mailos comandos previos. + + 7. Agora, prema CTRL-R (manteña pulsada a tecla CTRL e prema R) unhas + cantas veces para volver a executar os comandos (desface-lo desfeito). + +---> Corrrixa os erros dee esttta liña e vooolva ponelos coon desfacer. + + Estes son uns comandos moi útiles. Agora, vaiamos ao resumo da lección 1.2. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMO DA LECCIÓN 1.2 + + + 1. Para borrar dende o cursor ata a seguinte palabra prema: dw + 2. Para borrar dende o cursor ata o final da palabra prema: de + 3. Para borrar dende o cursor ata o final dunha liña prema: d$ + 4. Para borrar unha liña enteira prema: dd + 5. Para repetir un movemento, antepoña un número: 2w + 6. O formato para un comando de cambio é: + operador [número] movemento + onde: + comando - é o que hai que facer, por exemplo, d para borrar + [número] - é un número opcional para repetir o movemento + movemento - móvese sobre o texto no que operar, como w (palabra), + $ (ata o final da liña), etc. + + 7. Para moverse ao inicio da liña utilice un cero: 0 + 8. Para desfacer acciones previas prema: u (u minúsculo) + Para desfacer tódolos cambios dunha liña prema: U (U mAIÚSCULO) + Para desface-lo desfeito prema: CTRL-R + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.3.1: O COMANDO «PUT» (PÓR) + + + ** Prema p para pór (pegar) despois do cursor o último que borrou. ** + + 1. Mova o cursor á primeira liña inferior marcada con --->. + + 2. Escriba dd para borra-la liña e almacenala nun rexistro do Vim. + + 3. Mova o cursor á liña c) por RIBA de onde debería esta-la liña + eliminada. + + 4. Prema p para pega-la liña borrada por BAIXO do cursor. + + 5. Repita os pasos 2 a 4 para por tódalas liñas na orde correcta. + +---> d) Podes aprendela ti? +---> b) A violeta é azul, +---> c) a intelixencia apréndese, +---> a) as rosas son vermellas. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.3.2: O COMANDO «REPLACE» (TROCAR) + + + ** Prema rx para troca-lo carácter baixo o cursor con x . ** + + 1. Mova o cursor á primeira liña inferior marcada con --->. + + 2. Mova o cursor para situalo sobre o primeiro erro. + + 3. Prema r e despois o carácter que debería ir aí. + + 4. Repita os pasos 2 e 3 ata que a primeira liña sexa igual á segunda. + +---> Cande esti lita fui escrita alguér premeu alginhas teclas equibocadas! +---> Cando esta liña foi escrita alguén premeu algunhas teclas equivocadas! + + 5. Agora pase á lección 1.3.3. + +NOTA: Lembre que debería aprender practicando. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.3.3: O COMANDO CAMBIAR + + + ** Para cambiar ata o final dunha palabra, escriba ce . ** + + 1. Mova o cursor á primeria liña inferior marcada con --->. + + 2. Sitúe o cursor no u de lubrs. + + 3. Escriba ce e corrixa a palabra (neste caso, escriba 'iña'). + + 4. Prema e mova o cursor ao seguinte erro a cambiar. + + 5. Repita os pasos 3 e 4 ata que a primeira frase sexa igual á segunda. + +---> Esta lubrs ten unhas poucas pskavtad que corrixir co comando change. +---> Esta liña ten unhas poucas palabras que corrixir co comando cambiar. + + Teña en conta que ce elimina a palabra e entra no modo Inserir. + cc fai o mesmo para toda a liña. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.3.4: MÁIS CAMBIOS USANDO c + + + ** O operador cambio utilízase cos mesmos movementos que borrar. ** + + 1. O operador cambio funciona do mesmo xeito que borrar. O formato é: + + c [número] movemento + + 2. Os movementos son tamén os mesmos, como w (palabra) ou + $ (fin da liña). + + 3. Mova o cursor á primeira liña inferior sinalada con --->. + + 4. Mova o cursor ao primeiro erro. + + 5. Prema c$ e escriba o resto da liña para que sexa como a segunda, + e prema . + +---> O final desta liña necesita algunha axuda para que sexa como a segunda. +---> O final desta liña necesita ser corrixido usando o comando c$. + +NOTA: Pode utiliza-lo retorno de carro para corrixir erros mentres escribe. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMO DA LECCIÓN 1.3 + + + 1. Para volver a pór ou pega-lo texto que acaba de borrarse, + escriba p . Isto pega o texto despois do cursor (se borrou unha + liña, ao pegala, esta situaráse na liña baixo do cursor). + + 2. Para troca-lo carácter baixo do cursor, prema r e logo o + carácter que quere que estea no seu lugar. + + 3. O operador cambio permítelle cambiar dende a posición do cursor + ata onde leve o movemento indicado. Por exemplo, prema ce + para cambiar dende o cursor ata o final da palabra, ou c$ + para cambiar ata o final da liña. + + 4. O formato para cambio é: + + c [número] movemento + + Pase agora á lección seguinte. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.4.1: UBICACIÓN DO CURSOR E ESTADO DO ARQUIVO + + + ** Prema CTRL-G para mostra-la súa situación no ficheiro e mailo estado. + Prema G para moverse a unha determinada liña do fichero. ** + +NOTA: Lea esta lección enteira antes de executar calquera dos pasos!! + + 1. Manteña premida a tecla Ctrl e prema g . Chamamos a isto CTRL-G. + Aparecerá unha mensaxe na parte inferior da páxina co nome do arquivo + e a posición do cursor no arquivo. + Lembre o número de liña para o paso 3. + +NOTA: Seica poida ve-la posición do cursor no recanto inferior da dereita + da pantalla. Isto acontece cando a opción 'ruler' (regra) está + habilitada (consulte :help 'ruler' ) + + 2. Prema G para move-lo cursor ata a parte inferior do arquivo. + Prema gg para move-lo cursor ao inicio do arquivo. + + 3. Escriba o número da liña na que estaba e despois G . Isto + tornaráo á liña na que estaba cuando pulsou CTRL-G. + + 4. Se se atopa con seguridade para poder facer isto, + execute os pasos 1 a 3. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.4.2: O COMANDO «SEARCH» (BUSCAR) + + + ** Escriba / seguido dun texto para busca-lo texto. ** + + 1. En modo Normal, prema o carácter / . Fíxese que tanto o carácter / + como o cursor aparecen na derradeira liña da pantalla, o mesmo que + o comando : . + + 2. Escriba agora errroor . Esta é a palabra que quere buscar. + + 3. Para repeti-la busca do mesmo texto outra vez, simplemente prema n . + Para busca-lo mesmo texto na dirección oposta, prema N . + + 4. Se quere buscar un texto na dirección oposta (cara a enriba), + utilice o comando ? en troques de / . + + 5. Para regresar ao lugar de onde procedía, prema CTRL-O (manteña pulsado + Ctrl mentres pulsa a tecla o). Repita o proceso para voltar máis atrás. + CTRL-I vai cara a adiante. + +---> "errroor" non é o xeito correcto de escribir erro; errroor é un erro. + +NOTA: Cando a busca chega ao final do arquivo, continuará dende o comezo, + agás que a opción 'wrapscan' estea desactivada. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.4.3: BUSCA PARA COMPROBAR PARÉNTESES + + + ** Prema % para atopa-la paréntese correspondente a ),] ou } . ** + + 1. Sitúe o cursor en cualquera dos carácteres (, [ o { na liña inferior + sinalada con --->. + + 2. Prema agora o carácter % . + + 3. O cursor moveráse á parella de peche da paréntese, corchete + ou chave correspondente. + + 4. Prema % para move-lo cursor ata a outra parella do carácter. + + 5. Mova o cursor a outra (,),[,],{ o } e vexa o que fai % . + +---> Isto ( é unha liña de proba con (, [, ], {, e } nela. )) + +NOTA: Isto é moi útil na detección de erros nun programa con parénteses, + corchetes ou chaves sen parella. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.4.4: O COMANDO SUBSTITUÍR + + + ** Escriba :s/vello/novo/g para substituír 'vello' por 'novo'. ** + + 1. Mova o cursor á liña inferior sinalada con --->. + + 2. Escriba :s/aas/as/ . Teña en conta que este comando cambia + só o primeiro achado -na liña- da expresión que quere cambiar. + + 3. Agora escriba :s/aas/a/g . Ao engadir a opción g , o Vim fará + a substitución global na liña, cambiando tódo-los achados + do termo "aas" na liña. + +---> Coido que aas mellores épocas para aas frores son aas primaveras. + + 4. Para cambiar cada achado da cadea de carácteres entre dúas liñas: + Escriba :#,#s/vello/novo/g onde #,# son os números de liña do rango + de liñas onde se realizará a substitución. + Escriba :%s/vello/novo/g para cambiar cada achado en todo o arquivo. + Escriba :%s/vello/novo/gc para atopar cada achado en todo o arquivo, + pedindo confirmación para face-la + substitución ou non. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMO DA LECCIÓN 1.4 + + + 1. CTRL-G mostra a posición do cursor no ficheiro e mailo seu estado. + G move o cursor ao final do arquivo. + número G move o cursor a ese número de liña. + gg move o cursor á primeira liña do arquivo. + + 2. Escribindo / seguido dun texto busca o texto cara a ADIANTE. + Escribindo ? seguido dun texto busca o texto cara a ATRÁS. + Despois dunha busca, prema n para atopar o achado. + + 3. Premendo % cando o cursor está sobre (,), [,], { o } localiza + a parella correspondente. + + 4. Para cambiar vello por novo no primeiro achado dunha liña escriba + :s/vello/novo + Para cambiar tódo-los vello por novo nunha liña escriba + :s/vello/novo/g + Para cambiar texto entre dous números de liña escriba + :#,#s/vello/novo/g + Para cambiar vello por novo en todo o fichero escriba + :%s/vello/novo/g + Para pedir confirmación en cada caso engada 'c' + :%s/vello/novo/gc + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.5.1: CÓMO EXECUTAR UN COMANDO EXTERNO + + + ** Escriba :! seguido dun comando externo para executar ese comando. ** + + 1. Escriba o conocido comando : para situar o cursor ao final da + pantalla. Isto permitirálle introducir un comando. + + 2. Agora escriba o carácter ! (signo de admiración). Isto permitirálle + executar calquer mandato do sistema. + + 3. Como exemplo escriba ls despois do ! e logo prema . Isto + mostrarálle unha lista do seu directorio, igual que se estiviese no + símbolo do sistema. Se ls non funciona, utilice :!dir . + +NOTA: Deste xeito é posible executar cualquer comando externo, + tamén incluíndo argumentos. + +NOTA: Tódolos comandos : deben finalizarse premendo . + De agora en diante, non sempre se mencionará. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.5.2: MÁIS SOBRE GARDAR FICHEIROS + + + ** Para garda-los cambios feitos nun ficheiro, + escriba :w NOME_DE_FICHEIRO ** + + 1. Escriba :!dir ou :!ls para ver unha lista dos arquivos + do seu directorio. + Xa sabe que debe pulsar despois. + + 2. Elixa un nome de ficheiro que todavía non exista, como TEST. + + 3. Agora escriba :w TEST (onde TEST é o nome de ficheiro elixido). + + 4. Esta acción garda todo o ficheiro (Vim Tutor) baixo o nome TEST. + Para comprobalo, escriba :!dir ou :!ls de novo e vexa + o seu directorio. + +NOTA: Se saíra do Vim e volvera a entrar de novo con vim TEST , o + arquivo sería unha copia exacta do tutorial cuando o guardou. + + 5. Agora, elimine o arquivo escribindo (Windows): :!del TEST + ou (Unix): :!rm TEST + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.5.3: SELECCIONAR TEXTO PARA GARDAR + + + ** Para gardar parte do arquivo, escriba v movemento :w arquivo ** + + 1. Mova o cursor a esta liña. + + 2. Prema v e mova o cursor ata o quinto elemento inferior. Vexa que + o texto é salientado. + + 3. Prema o carácter : Na parte inferior da pantalla aparecerá + :'<,'> + + 4. Prema w TEST , onde TEST é un nome de arquivo que aínda non existe. + Verifique que ve :'<,'>w TEST antes de premer . + + 5. Vim escribirá as liñas seleccionadas no arquivo TEST. Utilice + :!dir o :!ls para velo. Non o elimine todavía! Utilizarémolo + na seguinte lección. + +NOTA: Ao pulsar v iniciá a selección visual. Pode move-lo cursor para + face-la selección máis grande ou pequena. Despois, pode utilizar un + operador para facer algo co texto. Por exemplo, d eliminará + o texto seleccionado. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.5.4: RECUPERANDO E MESTURANDO FICHEIROS + + + ** Para inseri-lo contido dun ficheiro escriba :r NOME_DO_FICHEIRO ** + + 1. Sitúe o cursor xusto por riba desta liña. + +NOTA: Despois de executar o paso 2 verá o texto da lección 1.5.3. Despois + DESCENDA ata ver de novo esta lección. + + 2. Agora recupere o arquivo TEST utilizando o comando :r TEST , onde + TEST é o nome que ven de utilizar. + O arquivo que recuperou colocaráse embaixo da liña onde se atope + o cursor. + + 3. Para verificar que se recuperou o arquivo, suba o cursor e + comprobe que agora hai dúas copias da lección 1.5.3, a orixinal e + maila versión do arquivo. + +NOTA: Tamén pode le-la saída dun comando externo. Por exemplo, + :r !ls le a saída do comando ls e pégao baixo da liña + onde se atopa o cursor. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMO DA LECCIÓN 1.5 + + + 1. :!comando executa un comando externo. + Alguns exemplos útiles son: + (Windows) (Unix) + :!dir :!ls - mostra o contido dun directorio. + :!del arquivo :!rm arquivo - borra o ficheiro arquivo. + + 2. :w arquivo escribe o arquivo actual no disco co nome de arquivo. + + 3. v movemento :w arquivo guarda as liñas seleccionadas visualmente + no arquivo arquivo. + + 4. :r arquivo recupera do disco o arquivo arquivo e pégao embaixo + da posición do cursor. + + 5. :r !dir le a saída do comando dir e pégao embaixo da + posición do cursor. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.6.1: O COMANDO «OPEN» (ABRIR) + + + ** Prema o para abrir unha liña embaixo do cursor + e situarse no modo inserir ** + + 1. Mova o cursor á liña inferior sinalada con --->. + + 2. Prema a letra minúscula o para abrir unha liña por EMBAIXO do cursor + e situarse en modo Inserir. + + 3. Agora, escriba algún texto, e despois prema para saír do modo + Inserir. + +---> Despois de pulsar o , o cursor sitúase na liña aberta en modo Inserir. + + 4. Para abrir unha liña por RIBA do cursor, simplemente prema un O + MAIÚSCULO, en troques dun o minúsculo. Probe isto na liña seguinte. + +---> Abra unha liña sobre esta, pulsando O cuando o cursor estea nesta liña. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.6.2: O COMANDO «APPEND» (ENGADIR) + + + ** Prema a para inserir texto despois do cursor. ** + + 1. Mova o cursor ao inicio da primeira liña inferior sinalada con --->. + + 2. Escriba e ata que o cursor estea ao final de li . + + 3. Escriba un a (minúsculo) para engadir texto despois do cursor. + + 4. Complete a palabra coma na liña inferior. Prema para saír + do modo Inserir. + + 5. Utilice e para moverse ata a seguinte palabra incompleta e + repita os pasos 3 e 4. + +---> Esta li permit practi cómo enga texto a unha +---> Esta liña permitirálle practicar cómo engadir texto a unha liña. + +NOTA: a, i e A entran no modo Inserir; a única diferencia é + onde se colocan os carácteres inseridos. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.6.3: OUTRA VERSIÓN DE «REPLACE» (SUBSTITUÍR) + + + ** Prema un R MAIÚSCULO para substituír máis dun carácter. ** + + 1. Mova o cursor á primeira liña inferior sinalada con --->. + Mova o cursor ao inicio da primeira xxx . + + 2. Agora prema R e escriba o número que aparece na liña inferior. + Isto substituirá o texto xxx . + + 3. Prema para abandoa-lo modo Substituír. + Observe que o resto da liña fica sen modificacions. + + 4. Repita os pasos para substituí-lo texto xxx que queda. + +---> Sumar 123 a xxx da un resultado de xxx. +---> Sumar 123 a 456 da un resultado de 579. + +NOTA: O modo Substituír é como o modo Inserir, pero cada carácter escrito + elimina un carácter xa existente. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.6.4: COPIAR E PEGAR TEXTO + + + ** Utilice o operador e para copiar texto e p para pegalo. ** + + 1. Mova o cursor á liña inferior marcada con ---> e posicione o + cursor despois de "a)". + + 2. Inicie o modo Visual con v + e mova o cursor xusto antes de "primeiro". + + 3. Prema e para copiar («yank») o texto salientado. + + 4. Mova o cursor ao final da seguinte liña mediante: j$ + + 5. Prema p para pór (pegar) o texto. Despois escriba: o segundo . + + 6. Utilice o modo visual para seleccionar " elemento.", e cópieo con y. + Mova o cursor ao final da seguinte liña con j$ e pegue o texto + xusto acabado de copiar con p . + +---> a) este é o primeiro elemento. + b) + +NOTA: Tamén pode utilizar e como un operador: yw copia unha palabra, + yy copia a liña completa onde está o cursor; despois p pegará + esa liña. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.6.5: ACTIVAR («SET») UNHA OPCIÓN + + + ** Active unha opción para buscar ou substituír ignorando + se o texto está en MAIÚSCULAS ou minúsculas ** + + 1. Busque a cadea de texto 'ignorar' escribindo: /ignorar + Repita a busca varias veces pulsando n . + + 2. Active a opción 'ic' ("Ignore case" ou ignorar maiúsculas e minúsculas) + mediante: :set ic + + 3. Agora, busque de novo 'ignorar' pulsando n . + Observe que agora tamén se acha Ignorar e IGNORAR. + + 4. Active as opcions 'hlsearch' e 'incsearch' escribindo: :set hls is + + 5. Agora escriba de novo o comando de busca + e vexa qué acontece: /ignore + + 6. Para inhabilitar ou ignorar a distinción entre MAIÚSCULAS e minúsculas + escriba: :set noic + +NOTA: Para elimina-lo salientado das coincidencias escriba: :nohlsearch +NOTA: Se quere ignora-las MAIÚSCULAS e minúsculas, só para un comando + de busca, utilice \c na frase: /ignorar\c + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMO DA LECCIÓN 1.6 + + + 1. Escriba o para abrir unha liña por BAIXO da posición do cursor e + entrar en modo Inserir. + Escriba O para abrir unha liña por RIBA da posición do cursor e + entrar en modo Inserir + + 2. Escriba a para inserir texto despois do cursor. + Escriba A para inserir texto ao final da liña. + + 3. O comando e move o cursor ao final dunha palabra. + + 4. O operador e copia («yank») texto; p pégao (pon). + + 5. Ao escribir un R MAIÚSCULO, entra no modo Substituír ata que + se preme . + + 6. Ao escribir :set xxx , actívase a opción 'xxx'. + Algunas opcións son: + 'ic' 'ignorecase' ignorar maiúsculas/minúsculas ao buscar + 'is' 'incsearch' amosa-las coincidencias parciais para + a busca dunha frase + 'hls' 'hlsearch' salienta tódalas coincidencias da frases + + Pode utilizar tanto os nomes longos coma os curtos das opcions. + + 7. Engada "no" para inhabilitar unha opción: :set noic + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 7: OBTER AXUDA + + + ** Utilice o sistema de axuda en liña ** + + O Vim dispón dun sistema de axuda en liña. Para comezar, probe unha + destas tres formas: + - prema a tecla (se dispón dela) + - prema a tecla (se dispón dela) + - escriba :help + + Lea o texto na xanela de axuda para descubrir cómo funciona a axuda. + Escriba CTRL-W CTRL-W para chimpar dunha xanela a outra. + Escriba :q para pechar a xanela de axuda. + + Pode atopar axuda en case calquer tema engadindo un argumento ao + comando :help . Probe estes (non esqueza premer ): + + :help w + :help c_CTRL-D + :help insert-index + :help user-manua + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.7.2: CREAR UN SCRIPT DE INICIO + + + ** Habilitar funcionalidades no Vim ** + + O Vim ten moitas máis funcionalidades que o Vi, pero algunhas están + inhabilitadas de xeito predeterminado. + Para empezar a utilizar máis funcionalidades debería crear un arquivo + chamado "vimrc". + + 1. Comece a edita-lo arquivo "vimrc". Isto depende do seu sistema: + :e ~/.vimrc para Unix + :e ~/_vimrc para Windows + + 2. Agora lea o contenido do arquivo "vimrc" de exemplo: + :r $VIMRUNTIME/vimrc_example.vim + + 3. Garde o arquivo mediante: + :w + + A próxima vez que inicie o Vim, este usará o salientado de sintaxe. + Pode engadir tódolos seus axustes preferidos a este arquivo "vimrc". + Para máis información escriba :help vimrc-intro + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + LECCIÓN 1.7.3: COMPLETADO + + + ** Completado da liña de comandos con CTRL-D ou . ** + + 1. Asegúrese de que o Vim non está no modo compatible: :set nocp + + 2. Vexa qué arquivos existen no directorio con: :!ls ou :!dir + + 3. Escriba o inicio dun comando: :e + + 4. Prema CTRL-D e o Vim mostrará a lista de comandos que empezan con "e". + + 5. Engada d e o Vim completará o nome do comando a ":edit". + + 6. Agora engada un espacio e o inicio do nome dun arquivo: :edit FIL + + 7. Prema . Vim completará o nome (se só hai un). + +NOTA: O completado funciona con moitos comandos. Só prema CTRL-D ou + . É especialmente útil para :help . + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + RESUMO DA LECCIÓN 1.7 + + + 1. Escriba :help ou prema ou para abri-la xanela de axuda. + + 2. Escriba :help cmd para atopar axuda sobre cmd . + + 3. Escriba CTRL-W CTRL-W para chimpar a outra xanela. + + 4. Escriba :q para pecha-la xanela de axuda. + + 5. Cree un ficheiro vimrc de inicio para garda-los sus axustes preferidos. + + 6. Cuando escriba un comando : prema CTRL-D para ver posibles opcións. + Prema para utilizar unha das opcións de completado. + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Aquí conclúe o tutor do Vim. Está pensado para dar unha visión breve do + editor Vim, suficiente para permitirlle usa-lo editor de forma bastante + sinxela. Está moi lonxe de estar completo pois o Vim ten moitísimos máis + comandos. Lea o seguinte manual de usuario: ":help user-manual". + + Para lecturas e estudos posteriores, recoméndase o libro: + Vim - Vi Improved - de Steve Oualline + Editado por: New Riders + o primeiro libro adicado completamente ao Vim. Especialmente útil para + principiantes. Ten moitos exemplos e imaxes. + Vexa https://iccf-holland.org/click5.html + + Este tutorial foi escrito por Michael C. Pierce e Robert K. Ware, + Colorado School of Mines utilizando ideas subministradas por Charles Smith, + Colorado State University. + E-mail: bware@mines.colorado.edu. + + Modificado para Vim por Bram Moolenaar. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Traducido do inglés ao galego por Fernando Vilariño. + Correo electrónico: fernando@cvc.uab.es. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.hr b/runtime/tutor/tutor1.hr index 89bbdc239e..cf3323a94e 100644 --- a/runtime/tutor/tutor1.hr +++ b/runtime/tutor/tutor1.hr @@ -1,24 +1,24 @@ =============================================================================== -= D o b r o d o � l i u VIM p r i r u � n i k - Verzija 1.7 = += D o b r o d o š l i u VIM p r i r u č n i k - Verzija 1.7 = =============================================================================== - Vim je vrlo mo�an editor koji ima mnogo naredbi, previ�e da bi ih - se svih ovdje spomenulo. Namjena priru�nika je objasniti dovoljno - naredbi kako bi po�etnici znatno lak�e koristili ovaj svestran editor. + Vim je vrlo moćan editor koji ima mnogo naredbi, previše da bi ih + se svih ovdje spomenulo. Namjena priručnika je objasniti dovoljno + naredbi kako bi početnici znatno lakše koristili ovaj svestran editor. - Pribli�no vrijeme potrebno za uspje�an zavr�etak priru�nika je oko - 30 minuta a ovisi o tome koliko �e te vremena odvojiti za vje�banje. + Približno vrijeme potrebno za uspješan završetak priručnika je oko + 30 minuta a ovisi o tome koliko će te vremena odvojiti za vježbanje. UPOZORENJE: - Naredbe u ovom priru�niku �e promijeniti ovaj tekst. - Napravite kopiju ove datoteke kako bi ste na istoj vje�bali - (ako ste pokrenuli "vimtutor" ovo je ve� kopija). + Naredbe u ovom priručniku će promijeniti ovaj tekst. + Napravite kopiju ove datoteke kako bi ste na istoj vježbali + (ako ste pokrenuli "vimtutor" ovo je već kopija). - Vrlo je va�no primijetiti da je ovaj priru�nik namijenjen za vje�banje. - Preciznije, morate izvr�iti naredbe u Vim-u kako bi ste iste nau�ili - pravilno koristiti. Ako samo �itate tekst, zaboraviti �e te naredbe! + Vrlo je važno primijetiti da je ovaj priručnik namijenjen za vježbanje. + Preciznije, morate izvršiti naredbe u Vim-u kako bi ste iste naučili + pravilno koristiti. Ako samo čitate tekst, zaboraviti će te naredbe! - Ako je CapsLock uklju�en ISKLJU�ITE ga. Pritiskajte tipku j kako + Ako je CapsLock uključen ISKLJUČITE ga. Pritiskajte tipku j kako bi pomakli kursor sve dok Lekcija 1.1.1 ne ispuni ekran. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -27,29 +27,29 @@ ** Za pomicanje kursora, pritisnite h,j,k,l tipke kako je prikazano ** ^ - k Savjet: h tipka je lijevo i pomi�e kursor lijevo. - < h l > l tipka je desno i pomi�e kursor desno. + k Savjet: h tipka je lijevo i pomiče kursor lijevo. + < h l > l tipka je desno i pomiče kursor desno. j j izgleda kao strelica usmjerena dolje. v - 1. Pomi�ite kursor po ekranu dok se ne naviknete na kori�tenje. + 1. Pomičite kursor po ekranu dok se ne naviknete na korištenje. - 2. Dr�ite tipku (j) pritisnutom. - Sada znate kako do�i do sljede�e lekcije. + 2. Držite tipku (j) pritisnutom. + Sada znate kako doći do sljedeće lekcije. - 3. Koriste�i tipku j prije�ite na sljede�u lekciju 1.1.2. + 3. Koristeći tipku j prijeđite na sljedeću lekciju 1.1.2. -NAPOMENA: Ako niste sigurni �to ste zapravo pritisnuli uvijek koristite - tipku kako bi pre�li u Normal mod i onda poku�ajte ponovno. +NAPOMENA: Ako niste sigurni što ste zapravo pritisnuli uvijek koristite + tipku kako bi prešli u Normal mod i onda pokušajte ponovno. -NAPOMENA: Kursorske tipke rade isto. Kori�tenje hjkl tipaka je znatno - br�e, nakon �to se jednom naviknete na njihovo kori�tenje. Stvarno! +NAPOMENA: Kursorske tipke rade isto. Korištenje hjkl tipaka je znatno + brže, nakon što se jednom naviknete na njihovo korištenje. Stvarno! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.1.2: IZLAZ IZ VIM-a - !! UPOZORENJE: Prije izvo�enja bilo kojeg koraka, - pro�itajte cijelu lekciju!! + !! UPOZORENJE: Prije izvođenja bilo kojeg koraka, + pročitajte cijelu lekciju!! 1. Pritisnite tipku (Vim je sada u Normal modu). @@ -57,13 +57,13 @@ NAPOMENA: Kursorske tipke rade isto. Kori Izlaz iz editora, GUBE se sve napravljene promjene. 3. Kada se pojavi ljuska, utipkajte naredbu koja je pokrenula - ovaj priru�nik: vimtutor + ovaj priručnik: vimtutor - 4. Ako ste upamtili ove korake, izvr�ite ih redom od 1 do 3 + 4. Ako ste upamtili ove korake, izvršite ih redom od 1 do 3 kako bi ponovno pokrenuli editor. -NAPOMENA: :q! poni�tava sve promjene koje ste napravili. - U sljede�im lekcijama nau�it �e te kako promjene sa�uvati. +NAPOMENA: :q! poništava sve promjene koje ste napravili. + U sljedećim lekcijama naučit će te kako promjene sačuvati. 5. Pomaknite kursor na Lekciju 1.1.3. @@ -73,21 +73,21 @@ NAPOMENA: :q! poni ** Pritisnite x za brisanje znaka pod kursorom. ** - 1. Pomaknite kursor na liniju ozna�enu s --->. + 1. Pomaknite kursor na liniju označenu s --->. - 2. Kako bi ste ispravili pogre�ke, pomi�ite kursor dok se + 2. Kako bi ste ispravili pogreške, pomičite kursor dok se ne bude nalazio na slovu kojeg trebate izbrisati. - 3. Pritisnite tipku x kako bi uklonili ne�eljeno slovo. + 3. Pritisnite tipku x kako bi uklonili neželjeno slovo. - 4. Ponovite korake od 2 do 4 dok ne ispravite sve pogre�ke. + 4. Ponovite korake od 2 do 4 dok ne ispravite sve pogreške. ----> KKKravaa jee pressko�ila mmjeseccc. +---> KKKravaa jee presskočila mmjeseccc. - 5. Nakon �to ispravite liniju, prije�ite na lekciju 1.1.4. + 5. Nakon što ispravite liniju, prijeđite na lekciju 1.1.4. -NAPOMENA: Koriste�i ovaj priru�nik ne poku�avajte pamtiti - ve� u�ite primjenom. +NAPOMENA: Koristeći ovaj priručnik ne pokušavajte pamtiti + već učite primjenom. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -96,20 +96,20 @@ NAPOMENA: Koriste ** Pritisnite i za ubacivanje teksta ispred kursora. ** - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. + 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. 2. Kako bi napravili prvu liniju istovjetnoj drugoj, pomaknite - kursor na prvi znak POSLIJE kojeg �e te utipkati potreban tekst. + kursor na prvi znak POSLIJE kojeg će te utipkati potreban tekst. 3. Pritisnite i te utipkajte potrebne nadopune. - 4. Nakon �to ispravite pogre�ku pritisnite kako bi vratili Vim - u Normal mod. Ponovite korake od 2 do 4 kako bi ispravili sve pogre�ke. + 4. Nakon što ispravite pogrešku pritisnite kako bi vratili Vim + u Normal mod. Ponovite korake od 2 do 4 kako bi ispravili sve pogreške. ---> Nedje no teka od v lin. ----> Nedostaje ne�to teksta od ove linije. +---> Nedostaje nešto teksta od ove linije. - 5. Prije�ite na sljede�u lekciju. + 5. Prijeđite na sljedeću lekciju. @@ -119,57 +119,57 @@ NAPOMENA: Koriste ** Pritisnite A za dodavanje teksta. ** - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - Nije va�no na kojem se slovu nalazi kursor na toj liniji. + 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. + Nije važno na kojem se slovu nalazi kursor na toj liniji. 2. Pritisnite A i napravite potrebne promjene. - 3. Nakon �to ste dodali tekst, pritisnite + 3. Nakon što ste dodali tekst, pritisnite za povratak u Normal mod. - 4. Pomaknite kursor na drugu liniju ozna�enu s ---> + 4. Pomaknite kursor na drugu liniju označenu s ---> i ponovite korake 2 i 3 dok ne popravite tekst. ----> Ima ne�to teksta koji nedostaje n - Ima ne�to teksta koji nedostaje na ovoj liniji. ----> Ima ne�to teksta koji ne - Ima ne�to teksta koji nedostaje ba� ovdje. +---> Ima nešto teksta koji nedostaje n + Ima nešto teksta koji nedostaje na ovoj liniji. +---> Ima nešto teksta koji ne + Ima nešto teksta koji nedostaje baš ovdje. - 5. Prije�ite na lekciju 1.1.6. + 5. Prijeđite na lekciju 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.1.6: PROMJENA DATOTEKE - ** Koristite :wq za spremanje teksta i napu�tanje Vim-a. ** + ** Koristite :wq za spremanje teksta i napuštanje Vim-a. ** - !! UPOZORENJE: Prije izvr�avanja bilo kojeg koraka, pro�itajte lekciju!! + !! UPOZORENJE: Prije izvršavanja bilo kojeg koraka, pročitajte lekciju!! - 1. Iza�ite iz programa kao sto ste napravili u lekciji 1.1.2: :q! + 1. Izađite iz programa kao sto ste napravili u lekciji 1.1.2: :q! - 2. Iz ljuske utipkajte sljede�u naredbu: vim tutor + 2. Iz ljuske utipkajte sljedeću naredbu: vim tutor 'vim' je naredba pokretanja Vim editora, 'tutor' je ime datoteke koju - �elite ure�ivati. Koristite datoteku koju imate ovlasti mijenjati. + želite uređivati. Koristite datoteku koju imate ovlasti mijenjati. - 3. Ubacite i izbri�ite tekst kao �to ste to napravili u lekcijama prije. + 3. Ubacite i izbrišite tekst kao što ste to napravili u lekcijama prije. - 4. Sa�uvajte promjenjeni tekst i iza�ite iz Vim-a: :wq + 4. Sačuvajte promjenjeni tekst i izađite iz Vim-a: :wq - 5. Ponovno pokrenite vimtutor i nastavite �itati sa�etak koji sljedi. + 5. Ponovno pokrenite vimtutor i nastavite čitati sažetak koji sljedi. - 6. Nakon sto pro�itate gornje korake i u potpunosti ih razumijete: - izvr�ite ih. + 6. Nakon sto pročitate gornje korake i u potpunosti ih razumijete: + izvršite ih. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1 SA�ETAK + Lekcija 1.1 SAŽETAK - 1. Kursor se pomi�e strelicama ili pomo�u hjkl tipaka. + 1. Kursor se pomiče strelicama ili pomoću hjkl tipaka. h (lijevo) j (dolje) k (gore) l (desno) 2. Pokretanje Vim-a iz ljuske: vim IME_DATOTEKE 3. Izlaz: :q! sve promjene su izgubljene. - ILI: :wq promjene su sa�uvane. + ILI: :wq promjene su sačuvane. 4. Brisanje znaka na kojem se nalazi kursor: x @@ -178,35 +178,35 @@ NAPOMENA: Koriste A utipkajte tekst dodavanje na kraju linije NAPOMENA: Tipkanjem tipke prebacuje Vim u Normal mod i - prekida ne�eljenu ili djelomi�no zavr�enu naredbu. + prekida neželjenu ili djelomično završenu naredbu. -Nastavite �itati Lekciju 2. +Nastavite čitati Lekciju 2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.2.1: NAREDBE BRISANJA - ** Tipkajte dw za brisanje rije�i. ** + ** Tipkajte dw za brisanje riječi. ** 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. - 2. Pomaknite kursor na liniju ozna�enu s --->. + 2. Pomaknite kursor na liniju označenu s --->. - 3. Pomaknite kursor na po�etak rije�i koju treba izbrisati. + 3. Pomaknite kursor na početak riječi koju treba izbrisati. - 4. Otipkajte dw kako bi uklonili rije�. + 4. Otipkajte dw kako bi uklonili riječ. -NAPOMENA: Vim �e prikazati slovo d na zadnjoj liniji kad ga otipkate. - Vim �eka da otipkate w . Ako je prikazano neko drugo slovo, - krivo ste otipkali; pritisnite i poku�ajte ponovno. +NAPOMENA: Vim će prikazati slovo d na zadnjoj liniji kad ga otipkate. + Vim čeka da otipkate w . Ako je prikazano neko drugo slovo, + krivo ste otipkali; pritisnite i pokušajte ponovno. ----> Neke rije�i smije�no ne pripadaju na papir ovoj re�enici. +---> Neke riječi smiješno ne pripadaju na papir ovoj rečenici. - 5. Ponovite korake 3 i 4 dok ne ispravite re�enicu; - prije�ite na Lekciju 1.2.2. + 5. Ponovite korake 3 i 4 dok ne ispravite rečenicu; + prijeđite na Lekciju 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.2: JO� BRISANJA + Lekcija 1.2.2: JOŠ BRISANJA ** Otipkajte d$ za brisanje znakova do kraja linije. ** @@ -214,9 +214,9 @@ NAPOMENA: Vim 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. - 2. Pomaknite kursor na liniju ozna�enu s --->. + 2. Pomaknite kursor na liniju označenu s --->. - 3. Pomaknite kursor do kraja ispravne re�enice + 3. Pomaknite kursor do kraja ispravne rečenice (POSLJE prve . ). 4. Otipkajte d$ @@ -224,7 +224,7 @@ NAPOMENA: Vim ---> Netko je utipkao kraj ove linije dvaput. kraj ove linije dvaput. - 5. Prije�ite na Lekciju 1.2.3 za bolje obja�njenje. + 5. Prijeđite na Lekciju 1.2.3 za bolje objašnjenje. @@ -233,67 +233,67 @@ NAPOMENA: Vim Mnogo naredbi koje mijenjaju tekst se sastoje od operatora i pokreta. - Oblik naredbe brisanja sa d operatorom je sljede�i: + Oblik naredbe brisanja sa d operatorom je sljedeći: d pokret - Pri �emu je: + Pri čemu je: d - operator brisanja. - pokret - ono na �emu �e se operacija izvr�avati (navedeno u nastavku). + pokret - ono na čemu će se operacija izvršavati (navedeno u nastavku). Kratka lista pokreta: - w - sve do po�etka sljede�e rije�i, NE UKLJU�UJU�I prvo slovo. - e - sve do kraja trenuta�ne rije�i, UKLJU�UJU�I zadnje slovo. - $ - sve do kraje linije, UKLJU�UJU�I zadnje slovo. + w - sve do početka sljedeće riječi, NE UKLJUČUJUĆI prvo slovo. + e - sve do kraja trenutačne riječi, UKLJUČUJUĆI zadnje slovo. + $ - sve do kraje linije, UKLJUČUJUĆI zadnje slovo. - Tipkanjem de �e se brisati od kursora do kraja rije�i. + Tipkanjem de će se brisati od kursora do kraja riječi. -NAPOMENA: Pritiskaju�i samo pokrete dok ste u Normal modu bez operatora �e - pomicati kursor kao �to je navedeno. +NAPOMENA: Pritiskajući samo pokrete dok ste u Normal modu bez operatora će + pomicati kursor kao što je navedeno. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.4: KORI�TENJE BROJANJA ZA POKRETE + Lekcija 1.2.4: KORIŠTENJE BROJANJA ZA POKRETE - ** Tipkanjem nekog broja prije pokreta, pokret se izvr�ava toliko puta. ** + ** Tipkanjem nekog broja prije pokreta, pokret se izvršava toliko puta. ** - 1. Pomaknite kursor na liniju ozna�enu s --->. + 1. Pomaknite kursor na liniju označenu s --->. - 2. Otipkajte 2w da pomaknete kursor dvije rije�i naprijed. + 2. Otipkajte 2w da pomaknete kursor dvije riječi naprijed. - 3. Otipkajte 3e da pomaknete kursor na kraj tre�e rije�i naprijed. + 3. Otipkajte 3e da pomaknete kursor na kraj treće riječi naprijed. - 4. Otipkajte 0 (nulu) da pomaknete kursor na po�etak linije. + 4. Otipkajte 0 (nulu) da pomaknete kursor na početak linije. 5. Ponovite korake 2 i 3 s nekim drugim brojevima. ----> Re�enica sa rije�ima po kojoj mo�ete pomicati kursor. +---> Rečenica sa riječima po kojoj možete pomicati kursor. - 6. Prije�ite na Lekciju 1.2.5. + 6. Prijeđite na Lekciju 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.5: KORI�TENJE BROJANJA ZA VE�E BRISANJE + Lekcija 1.2.5: KORIŠTENJE BROJANJA ZA VEĆE BRISANJE ** Tipkanje broja N s operatorom ponavlja ga N-puta. ** U kombinaciji operatora brisanja i pokreta spomenutih iznad - ubacujete broj prije pokreta kako bi izbrisali vi�e znakova: + ubacujete broj prije pokreta kako bi izbrisali više znakova: d broj pokret - 1. Pomaknite kursor na prvo slovo u rije�i sa VELIKIM SLOVIMA - ozna�enu s --->. + 1. Pomaknite kursor na prvo slovo u riječi sa VELIKIM SLOVIMA + označenu s --->. - 2. Otipkajte 2dw da izbri�ete dvije rije�i sa VELIKIM SLOVIMA + 2. Otipkajte 2dw da izbrišete dvije riječi sa VELIKIM SLOVIMA - 3. Ponovite korake 1 i 2 sa razli�itim brojevima da izbri�ete - uzastopne rije�i sa VELIKIM SLOVIMA sa samo jednom naredbom. + 3. Ponovite korake 1 i 2 sa različitim brojevima da izbrišete + uzastopne riječi sa VELIKIM SLOVIMA sa samo jednom naredbom. ----> ova ABC�� D�E linija FGHI JK LMN OP rije�i je RS� TUVZ� popravljena. +---> ova ABCČĆ DĐE linija FGHI JK LMN OP riječi je RSŠ TUVZŽ popravljena. @@ -303,51 +303,51 @@ NAPOMENA: Pritiskaju ** Otipkajte dd za brisanje cijele linije. ** - Zbog u�estalosti brisanja cijelih linija, dizajneri Vi-a su odlu�ili da - je lak�e brisati linije tipkanjem d dvaput. + Zbog učestalosti brisanja cijelih linija, dizajneri Vi-a su odlučili da + je lakše brisati linije tipkanjem d dvaput. 1. Pomaknite kursor na drugu liniju u donjoj kitici. 2. Otipkajte dd kako bi izbrisali liniju. - 3. Pomaknite kursor na �etvrtu liniju. + 3. Pomaknite kursor na četvrtu liniju. 4. Otipkajte 2dd kako bi izbrisali dvije linije. ----> 1) Ru�e su crvene, ----> 2) Pla�a je super, +---> 1) Ruže su crvene, +---> 2) Plaža je super, ---> 3) Ljubice su plave, ---> 4) Imam auto, ---> 5) Satovi ukazuju vrijeme, ----> 6) �e�er je sladak +---> 6) Šećer je sladak ---> 7) Kao i ti. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.7: NAREDBA PONI�TENJA + Lekcija 1.2.7: NAREDBA PONIŠTENJA - ** Pritisnite u za poni�tenje zadnje naredbe, U za cijelu liniju. ** + ** Pritisnite u za poništenje zadnje naredbe, U za cijelu liniju. ** - 1. Pomaknite kursor na liniju ozna�enu s ---> i postavite kursor na prvu - pogre�ku. - 2. Otipkajte x kako bi izbrisali prvi ne�eljeni znak. - 3. Otipkajte u kako bi poni�tili zadnju izvr�enu naredbu. - 4. Ovaj put ispravite sve pogre�ke na liniji koriste�i x naredbu. - 5. Sada utipkajte veliko U kako bi poni�tili sve promjene - na liniji, vra�aju�i je u prija�nje stanje. - 6. Sada utipkajte u nekoliko puta kako bi poni�tili U - i prija�nje naredbe. - 7. Sada utipkajte CTRL-R (dr�e�i CTRL tipku pritisnutom dok + 1. Pomaknite kursor na liniju označenu s ---> i postavite kursor na prvu + pogrešku. + 2. Otipkajte x kako bi izbrisali prvi neželjeni znak. + 3. Otipkajte u kako bi poništili zadnju izvršenu naredbu. + 4. Ovaj put ispravite sve pogreške na liniji koristeći x naredbu. + 5. Sada utipkajte veliko U kako bi poništili sve promjene + na liniji, vraćajući je u prijašnje stanje. + 6. Sada utipkajte u nekoliko puta kako bi poništili U + i prijašnje naredbe. + 7. Sada utipkajte CTRL-R (držeći CTRL tipku pritisnutom dok ne pritisnete R) nekoliko puta kako bi vratili promjene - (poni�tili poni�tenja). + (poništili poništenja). ----> Poopravite pogre�ke nna ovvoj liniji ii pooni�titeee ih. +---> Poopravite pogreške nna ovvoj liniji ii pooništiteee ih. - 8. Vrlo korisne naredbe. Prije�ite na sa�etak Lekcije 1.2. + 8. Vrlo korisne naredbe. Prijeđite na sažetak Lekcije 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2 SA�ETAK + Lekcija 1.2 SAŽETAK - 1. Brisanje od kursora do sljede�e rije�i: dw + 1. Brisanje od kursora do sljedeće riječi: dw 2. Brisanje od kursora do kraja linije: d$ 3. Brisanje cijele linije: dd @@ -355,16 +355,16 @@ NAPOMENA: Pritiskaju 5. Oblik naredbe mijenjanja: operator [broj] pokret gdje je: - operator - �to napraviti, npr. d za brisanje + operator - što napraviti, npr. d za brisanje [broj] - neobavezan broj ponavljanja pokreta pokret - kretanje po tekstu po kojem se operira, - kao �to je: w (rije�), $ (kraj linije), itd. + kao što je: w (riječ), $ (kraj linije), itd. - 6. Postavljanje kursora na po�etak linije: 0 + 6. Postavljanje kursora na početak linije: 0 - 7. Za poni�tenje prethodnih promjena, pritisnite: u (malo u) - Za poni�tenje svih promjena na liniji, pritisnite: U (veliko U) - Za vra�anja promjena, utipkajte: CTRL-R + 7. Za poništenje prethodnih promjena, pritisnite: u (malo u) + Za poništenje svih promjena na liniji, pritisnite: U (veliko U) + Za vraćanja promjena, utipkajte: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.3.1: NAREDBA POSTAVI @@ -372,7 +372,7 @@ NAPOMENA: Pritiskaju ** p za unos prethodno izbrisanog teksta iza kursora. ** - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. + 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. 2. Otipkajte dd kako bi izbrisali liniju i spremili je u Vim registar. @@ -383,10 +383,10 @@ NAPOMENA: Pritiskaju 5. Ponovite korake 2 do 4 kako bi postavili sve linije u pravilnom rasporedu. ----> d) Mo�e� li i ti nau�iti? +---> d) Možeš li i ti naučiti? ---> b) Ljubice su plave, ----> c) Inteligencija je nau�ena, ----> a) Ru�e su crvene, +---> c) Inteligencija je naučena, +---> a) Ruže su crvene, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -395,9 +395,9 @@ NAPOMENA: Pritiskaju ** Otipkajte rx za zamjenu slova ispod kursora sa slovom x . ** - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. + 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - 2. Pomaknite kursor tako da se nalazi na prvoj pogre�ci. + 2. Pomaknite kursor tako da se nalazi na prvoj pogrešci. 3. Otipkajte r i nakon toga ispravan znak na tom mjestu. @@ -407,59 +407,59 @@ NAPOMENA: Pritiskaju ---> Kede ju ovu limija tupjana, natko je protuskao kruve tupke! ---> Kada je ova linija tipkana, netko je pritiskao krive tipke! - 5. Prije�ite na Lekciju 1.3.2. + 5. Prijeđite na Lekciju 1.3.2. -NAPOMENA: Prisjetite da trebate u�iti vje�banjem, ne pam�enjem. +NAPOMENA: Prisjetite da trebate učiti vježbanjem, ne pamćenjem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.3.3: OPERATOR MIJENJANJA - ** Za mijenjanje do kraja rije�i, istipkajte ce . ** + ** Za mijenjanje do kraja riječi, istipkajte ce . ** - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. + 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. 2. Postavite kursor na a u lackmb. - 3. Otipkajte ce i ispravite rije� (u ovom slu�aju otipkajte inija ). + 3. Otipkajte ce i ispravite riječ (u ovom slučaju otipkajte inija ). - 4. Pritisnite i pomaknite kursor na sljede�i znak + 4. Pritisnite i pomaknite kursor na sljedeći znak kojeg je potrebno ispraviti. - 5. Ponovite korake 3 i 4 sve dok prva re�enica ne postane istovjetna + 5. Ponovite korake 3 i 4 sve dok prva rečenica ne postane istovjetna drugoj. ---> Ova lackmb ima nekoliko rjlcah koje trfcb mijdmlfsz. ----> Ova linija ima nekoliko rije�i koje treba mijenjati. +---> Ova linija ima nekoliko riječi koje treba mijenjati. -Primijetite da ce bri�e rije� i postavlja Vim u Insert mod. +Primijetite da ce briše riječ i postavlja Vim u Insert mod. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.4: JO� MIJENJANJA KORI�TENJEM c + Lekcija 1.3.4: JOŠ MIJENJANJA KORIŠTENJEM c ** Naredba mijenjanja se koristi sa istim pokretima kao i brisanje. ** - 1. Operator mijenjanja se koristi na isti na�in kao i operator brisanja: + 1. Operator mijenjanja se koristi na isti način kao i operator brisanja: c [broj] pokret - 2. Pokreti su isti, npr: w (rije�) i $ (kraj linije). + 2. Pokreti su isti, npr: w (riječ) i $ (kraj linije). - 3. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. + 3. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - 4. Pomaknite kursor na prvu pogre�ku. + 4. Pomaknite kursor na prvu pogrešku. 5. Otipkajte c$ i utipkajte ostatak linije tako da bude istovjetna drugoj te pritisnite . ----> Kraj ove linije treba pomo� tako da izgleda kao linija ispod. ----> Kraj ove linije treba ispraviti kori�tenjem c$ naredbe. +---> Kraj ove linije treba pomoć tako da izgleda kao linija ispod. +---> Kraj ove linije treba ispraviti korištenjem c$ naredbe. -NAPOMENA: Mo�ete koristiti Backspace za ispravljanje gre�aka. +NAPOMENA: Možete koristiti Backspace za ispravljanje grešaka. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3 SA�ETAK + Lekcija 1.3 SAŽETAK 1. Za postavljanje teksta koji je upravo izbrisan, pritisnite p . Ovo @@ -467,17 +467,17 @@ NAPOMENA: Mo postavlja na liniju ispod kursora). 2. Za promjenu znaka na kojem se nalazi kursor, pritisnite r i nakon toga - �eljeni znak. + željeni znak. 3. Operator mijenjanja dozvoljava promjenu teksta od kursora do pozicije do koje dovede pokret. tj. Otipkajte ce za mijenjanje od kursora do kraja - rije�i, c$ za mijenjanje od kursora do kraja linije. + riječi, c$ za mijenjanje od kursora do kraja linije. 4. Oblik naredbe mijenjanja: c [broj] pokret -Prije�ite na sljede�u lekciju. +Prijeđite na sljedeću lekciju. @@ -487,67 +487,67 @@ Prije ** CTRL-G za prikaz pozicije kursora u datoteci i status datoteke. Pritisnite G za pomicanje kursora na neku liniju u datoteci. ** -NAPOMENA: Pro�itajte cijelu lekciju prije izvr�enja bilo kojeg koraka!! +NAPOMENA: Pročitajte cijelu lekciju prije izvršenja bilo kojeg koraka!! - 1. Dr�ite Ctrl tipku pritisnutom i pritisnite g . Ukratko: CTRL-G. - Vim �e ispisati poruku na dnu ekrana sa imenom datoteke i pozicijom + 1. Držite Ctrl tipku pritisnutom i pritisnite g . Ukratko: CTRL-G. + Vim će ispisati poruku na dnu ekrana sa imenom datoteke i pozicijom kursora u datoteci. Zapamtite broj linije za 3. korak. -NAPOMENA: Mo�ete vidjeti poziciju kursora u donjem desnom kutu ako - je postavka 'ruler' aktivirana (obja�njeno u 6. lekciji). +NAPOMENA: Možete vidjeti poziciju kursora u donjem desnom kutu ako + je postavka 'ruler' aktivirana (objašnjeno u 6. lekciji). 2. Pritisnite G za pomicanje kursora na kraj datoteke. - Otipkajte gg za pomicanje kursora na po�etak datoteke. + Otipkajte gg za pomicanje kursora na početak datoteke. 3. Otipkajte broj linije na kojoj ste bili maloprije i zatim G . Kursor - �e se vratiti na liniju na kojoj se nalazio kada ste otipkali CTRL-G. + će se vratiti na liniju na kojoj se nalazio kada ste otipkali CTRL-G. - 4. Ako ste spremni, izvr�ite korake od 1 do 3. + 4. Ako ste spremni, izvršite korake od 1 do 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.2: NAREDBE TRA�ENJA + Lekcija 1.4.2: NAREDBE TRAŽENJA - ** Otipkajte / i nakon toga izraz kojeg �elite tra�iti. ** + ** Otipkajte / i nakon toga izraz kojeg želite tražiti. ** 1. U Normal modu otipkajte / znak. Primijetite da se znak pojavio zajedno sa kursorom na dnu ekrana kao kod : naredbe. - 2. Sada otipkajte 'grrrre�ka' . To je rije� koju zapravo tra�ite. + 2. Sada otipkajte 'grrrreška' . To je riječ koju zapravo tražite. - 3. Za ponovno tra�enje istog izraza, otipkajte n . - Za tra�enje istog izraza ali u suprotnom smjeru, otipkajte N . + 3. Za ponovno traženje istog izraza, otipkajte n . + Za traženje istog izraza ali u suprotnom smjeru, otipkajte N . - 4. Za tra�enje izraza unatrag, koristite ? umjesto / . + 4. Za traženje izraza unatrag, koristite ? umjesto / . - 5. Za povratak na prethodnu poziciju koristite CTRL-O (dr�ite Ctrl + 5. Za povratak na prethodnu poziciju koristite CTRL-O (držite Ctrl pritisnutim dok ne pritisnete tipku o). Ponavljajte sve dok se ne - vratite na po�etak. CTRL-I sli�no kao CTRL-O ali u suprotnom smjeru. + vratite na početak. CTRL-I slično kao CTRL-O ali u suprotnom smjeru. ----> "pogrrrre�ka" je pogre�no; umjesto pogrrrre�ka treba stajati pogre�ka. +---> "pogrrrreška" je pogrešno; umjesto pogrrrreška treba stajati pogreška. -NAPOMENA: Ako se tra�enjem do�e do kraja datoteke nastavit �e se od njenog - po�etka osim ako je postavka 'wrapscan' deaktivirana. +NAPOMENA: Ako se traženjem dođe do kraja datoteke nastavit će se od njenog + početka osim ako je postavka 'wrapscan' deaktivirana. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.3: TRA�ENJE PRIPADAJU�E ZAGRADE + Lekcija 1.4.3: TRAŽENJE PRIPADAJUĆE ZAGRADE - ** Otipkajte % za pronalazak pripadaju�e ), ] ili } . ** + ** Otipkajte % za pronalazak pripadajuće ), ] ili } . ** 1. Postavite kursor na bilo koju od ( , [ ili { - otvorenih zagrada u liniji ozna�enoj s --->. + otvorenih zagrada u liniji označenoj s --->. 2. Otipkajte znak % . - 3. Kursor �e se pomaknuti na pripadaju�u zatvorenu zagradu. + 3. Kursor će se pomaknuti na pripadajuću zatvorenu zagradu. - 4. Otipkajte % kako bi pomakli kursor na drugu pripadaju�u zagradu. + 4. Otipkajte % kako bi pomakli kursor na drugu pripadajuću zagradu. 5. Pomaknite kursor na neku od (,),[,],{ ili } i ponovite % naredbu. ----> Linija ( testiranja obi�nih ( [ uglatih ] i { viti�astih } zagrada.)) +---> Linija ( testiranja običnih ( [ uglatih ] i { vitičastih } zagrada.)) -NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadaju�im zagradama! +NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadajućim zagradama! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -556,25 +556,25 @@ NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadaju ** Otipkajte :s/staro/novo/g da zamijenite 'staro' za 'novo'. ** - 1. Pomaknite kursor na liniju ozna�enu s --->. + 1. Pomaknite kursor na liniju označenu s --->. - 2. Otipkajte :s/cvr��/cvr� . Primjetite da ova naredba zamjenjuje - samo prvi "cvr��" u liniji. + 2. Otipkajte :s/cvrćč/cvrč . Primjetite da ova naredba zamjenjuje + samo prvi "cvrćč" u liniji. - 3. Otipkajte :s/cvr��/cvr�/g . Dodavanje g stavke zna�i da �e se naredba - izvr�iti na cijeloj liniji, zamjenjivanjem svih "cvr��" u liniji. + 3. Otipkajte :s/cvrćč/cvrč/g . Dodavanje g stavke znači da će se naredba + izvršiti na cijeloj liniji, zamjenjivanjem svih "cvrćč" u liniji. ----> i cvr��i cvr��i cvr��ak na �voru crne smr�e. +---> i cvrćči cvrćči cvrćčak na čvoru crne smrče. 4. Za zamjenu svih izraza u rasponu dviju linija, otipkajte :#,#s/staro/novo/g #,# su brojevi linije datoteke na kojima - te izme�u njih �e se izvr�iti zamjena. + te između njih će se izvršiti zamjena. Otipkajte :%s/staro/novo/g za zamjenu svih izraza u cijeloj datoteci. Otipkajte :%s/staro/novo/gc za pronalazak svakog izraza u datoteci i potvrdu zamjene. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4 SA�ETAK + Lekcija 1.4 SAŽETAK 1. CTRL-G prikazuje poziciju kursora u datoteci i status datoteke. @@ -582,13 +582,13 @@ NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadaju broj G postavlja kursor na broj liniju. gg postavlja kursor na prvu liniju. - 2. Tipkanje / sa izrazom tra�i UNAPRIJED taj izraz. - Tipkanje ? sa izrazom tra�i UNATRAG taj izraz. - Nakon naredbe tra�enja koristite n za pronalazak izraza u istom + 2. Tipkanje / sa izrazom traži UNAPRIJED taj izraz. + Tipkanje ? sa izrazom traži UNATRAG taj izraz. + Nakon naredbe traženja koristite n za pronalazak izraza u istom smjeru, i N za pronalazak istog izraza ali u suprotnom smjeru. - CTRL-O vra�a kursor na prethodnu poziciju, CTRL-I na sljede�u poziciju. + CTRL-O vraća kursor na prethodnu poziciju, CTRL-I na sljedeću poziciju. - 3. Tipkanje % dok je kursor na zagradi pomi�e ga na pripadaju�u zagradu. + 3. Tipkanje % dok je kursor na zagradi pomiče ga na pripadajuću zagradu. 4. Za zamjenu prvog izraza staro za izraz novo :s/staro/novo Za zamjenu svih izraza staro na cijeloj liniji :s/staro/novo/g @@ -597,41 +597,41 @@ NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadaju Za potvrdu svake zamjene dodajte 'c' :%s/staro/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.1: IZVR�AVANJE VANJSKIH NAREDBI + Lekcija 1.5.1: IZVRŠAVANJE VANJSKIH NAREDBI - ** Otipkajte :! sa vanjskom naredbom koju �elite izvr�iti. ** + ** Otipkajte :! sa vanjskom naredbom koju želite izvršiti. ** 1. Otipkajte poznatu naredbu : kako bi kursor premjestili na dno - ekrana. Time omogu�avate unos naredbe u naredbenoj liniji. + ekrana. Time omogućavate unos naredbe u naredbenoj liniji. - 2. Otipkajte znak ! (uskli�nik). Tako omogu�avate - izvr�avanje naredbe vanjske ljuske. + 2. Otipkajte znak ! (uskličnik). Tako omogućavate + izvršavanje naredbe vanjske ljuske. 3. Kao primjer otipkajte ls nakon ! te pritisnite . - Ovo �e prikazati sadr�aj direktorija, kao da ste u ljusci. + Ovo će prikazati sadržaj direktorija, kao da ste u ljusci. Koristite :!dir ako :!ls ne radi. -NAPOMENA: Mogu�e je izvr�avati bilo koju vanjsku naredbu na ovaj na�in, +NAPOMENA: Moguće je izvršavati bilo koju vanjsku naredbu na ovaj način, zajedno sa njenim argumentima. -NAPOMENA: Sve : naredbe se izvr�avaju nakon �to pritisnete - U daljnjem tekstu to ne�e uvijek biti napomenuto. +NAPOMENA: Sve : naredbe se izvršavaju nakon što pritisnete + U daljnjem tekstu to neće uvijek biti napomenuto. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.2: VI�E O SPREMANJU DATOTEKA + Lekcija 1.5.2: VIŠE O SPREMANJU DATOTEKA ** Za spremanje promjena, otipkajte :w IME_DATOTEKE. ** 1. Otipkajte :!dir ili :!ls za pregled direktorija. - Ve� znate da morate pritisnuti na kraju tipkanja. + Već znate da morate pritisnuti na kraju tipkanja. - 2. Izaberite ime datoteke koja jo� ne postoji, npr. TEST. + 2. Izaberite ime datoteke koja još ne postoji, npr. TEST. 3. Otipkajte: :w TEST (gdje je TEST ime koje ste prethodno odabrali.) - 4. Time �e te spremiti cijelu datoteku (Vim Tutor) pod imenom TEST. + 4. Time će te spremiti cijelu datoteku (Vim Tutor) pod imenom TEST. Za provjeru, otipkajte ponovno :!dir ili :!ls za pregled direktorija. @@ -639,11 +639,11 @@ NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST , datoteka bi bila potpuna kopija ove datoteke u trenutku kada ste je spremili. - 5. Izbri�ite datoteku tako da otipkate (MS-DOS): :!del TEST + 5. Izbrišite datoteku tako da otipkate (MS-DOS): :!del TEST ili (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.3: SPREMANJE OZNA�ENOG TEKSTA + Lekcija 1.5.3: SPREMANJE OZNAČENOG TEKSTA ** Kako bi spremili dio datoteke, otipkajte v pokret :w IME_DATOTEKE ** @@ -651,63 +651,63 @@ NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST , 1. Pomaknite kursor na ovu liniju. 2. Pritisnite v i pomaknite kursor pet linija ispod ove. - Primijetite promjenu, ozna�eni tekst se razlikuje od obi�nog. + Primijetite promjenu, označeni tekst se razlikuje od običnog. - 3. Pritisnite : znak. Na dnu ekrana pojavit �e se :'<,'> . + 3. Pritisnite : znak. Na dnu ekrana pojavit će se :'<,'> . - 4. Otipkajte w TEST , pritom je TEST ime datoteke koja jo� ne postoji. - Provjerite da zaista pi�e :'<,'>w TEST - prije nego �to pritisnite . + 4. Otipkajte w TEST , pritom je TEST ime datoteke koja još ne postoji. + Provjerite da zaista piše :'<,'>w TEST + prije nego što pritisnite . - 5. Vim �e spremiti ozna�eni tekst u TEST. Provjerite sa :!dir ili :!ls . - Nemojte je jo� brisati! Koristiti �e te je u sljede�oj lekciji. + 5. Vim će spremiti označeni tekst u TEST. Provjerite sa :!dir ili :!ls . + Nemojte je još brisati! Koristiti će te je u sljedećoj lekciji. -NAPOMENA: Tipka v zapo�inje Vizualno ozna�avanje. Mo�ete pomicati kursor - unaokolo kako bi mijenjali veli�inu ozna�enog teksta. Mo�ete - koristiti i operatore. Npr, d �e izbrisati ozna�eni tekst. +NAPOMENA: Tipka v započinje Vizualno označavanje. Možete pomicati kursor + unaokolo kako bi mijenjali veličinu označenog teksta. Možete + koristiti i operatore. Npr, d će izbrisati označeni tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.4: U�ITAVANJE DATOTEKA + Lekcija 1.5.4: UČITAVANJE DATOTEKA - ** Za ubacivanje sadr�aja datoteke, otipkajte :r IME_DATOTEKE ** + ** Za ubacivanje sadržaja datoteke, otipkajte :r IME_DATOTEKE ** 1. Postavite kursor iznad ove linije. -NAPOMENA: Nakon �to izvr�ite 2. korak vidjeti �e te tekst iz Lekcije 1.5.3. +NAPOMENA: Nakon što izvršite 2. korak vidjeti će te tekst iz Lekcije 1.5.3. Stoga pomaknite kursor DOLJE kako bi ponovno vidjeli ovu lekciju. - 2. U�itajte va�u TEST datoteku koriste�i naredbu :r TEST + 2. Učitajte vašu TEST datoteku koristeći naredbu :r TEST gdje je TEST ime datoteke koju ste koristili u prethodnoj lekciji. - Sadr�aj u�itane datoteke je uba�en liniju ispod kursora. + Sadržaj učitane datoteke je ubačen liniju ispod kursora. - 3. Kako bi provjerili da je datoteka u�itana, vratite kursor unatrag i + 3. Kako bi provjerili da je datoteka učitana, vratite kursor unatrag i primijetite dvije kopije Lekcije 1.5.3, originalnu i onu iz datoteke. -NAPOMENA: Mo�ete tako�er u�itati ispis vanjske naredbe. Npr, :r !ls - �e u�itati ispis ls naredbe i postaviti ispis liniju ispod +NAPOMENA: Možete također učitati ispis vanjske naredbe. Npr, :r !ls + će učitati ispis ls naredbe i postaviti ispis liniju ispod kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5 SA�ETAK + Lekcija 1.5 SAŽETAK - 1. :!naredba izvr�ava vanjsku naredbu. + 1. :!naredba izvršava vanjsku naredbu. Korisni primjeri: (MS-DOS) (Unix) :!dir :!ls - pregled direktorija. - :!del DATOTEKA :!rm DATOTEKA - bri�e datoteku DATOTEKA. + :!del DATOTEKA :!rm DATOTEKA - briše datoteku DATOTEKA. - 2. :w DATOTEKA zapisuje trenuta�nu datoteku na disk sa imenom DATOTEKA. + 2. :w DATOTEKA zapisuje trenutačnu datoteku na disk sa imenom DATOTEKA. - 3. v pokret :w IME_DATOTEKE sprema vizualno ozna�ene linije u + 3. v pokret :w IME_DATOTEKE sprema vizualno označene linije u datoteku IME_DATOTEKE. - 4. :r IME_DATOTEKE u�itava datoteku IME_DATOTEKE sa diska i stavlja - njen sadr�aj liniju ispod kursora. + 4. :r IME_DATOTEKE učitava datoteku IME_DATOTEKE sa diska i stavlja + njen sadržaj liniju ispod kursora. - 5. :r !dir u�itava ispis naredbe dir i postavlja sadr�aj ispisa liniju + 5. :r !dir učitava ispis naredbe dir i postavlja sadržaj ispisa liniju ispod kursora. @@ -716,20 +716,20 @@ NAPOMENA: Mo ** Pritisnite o kako bi otvorili liniju ispod kursora - i pre�li u Insert mod. ** + i prešli u Insert mod. ** - 1. Pomaknite kursor na sljede�u liniju ozna�enu s --->. + 1. Pomaknite kursor na sljedeću liniju označenu s --->. 2. Otipkajte malo o kako bi otvorili novu liniju ISPOD kursora - i pre�li u Insert mod. + i prešli u Insert mod. - 3. Otipkajte ne�to teksta i nakon toga pritisnite + 3. Otipkajte nešto teksta i nakon toga pritisnite kako bi napustili Insert mod. ----> Nakon �to pritisnete o kursor �e pre�i u novu liniju u Insert mod. +---> Nakon što pritisnete o kursor će preći u novu liniju u Insert mod. 4. Za otvaranje linije IZNAD kursora, otipkajte umjesto malog o veliko O , - Poku�ajte na donjoj liniji ozna�enoj s --->. + Pokušajte na donjoj liniji označenoj s --->. ---> Otvorite liniju iznad ove - otipkajte O dok je kursor na ovoj liniji. @@ -740,31 +740,31 @@ NAPOMENA: Mo ** Otipkajte a za dodavanje teksta IZA kursora. ** - 1. Pomaknite kursor na po�etak sljede�e linije ozna�ene s --->. + 1. Pomaknite kursor na početak sljedeće linije označene s --->. 2. Tipkajte e dok se kursor ne nalazi na kraju li . 3. Otipkajte a (malo) kako bi dodali tekst IZA kursora. - 4. Dopunite rije� kao �to je na liniji ispod. + 4. Dopunite riječ kao što je na liniji ispod. Pritisnite za izlaz iz Insert moda. - 5. Sa e prije�ite na sljede�u nepotpunu rije� i ponovite korake 3 i 4. + 5. Sa e prijeđite na sljedeću nepotpunu riječ i ponovite korake 3 i 4. ----> Ova li omogu�ava vje dodav teksta nekoj liniji. ----> Ova linija omogu�ava vje�banje dodavanja teksta nekoj liniji. +---> Ova li omogućava vje dodav teksta nekoj liniji. +---> Ova linija omogućava vježbanje dodavanja teksta nekoj liniji. NAPOMENA: Sa i, a, i A prelazite u isti Insert mod, jedina - razlika je u poziciji od koje �e se tekst ubacivati. + razlika je u poziciji od koje će se tekst ubacivati. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.3: DRUGI NA�IN MIJENJANJA + Lekcija 1.6.3: DRUGI NAČIN MIJENJANJA - ** Otipkajte veliko R kako bi zamijelili vi�e od jednog znaka. ** + ** Otipkajte veliko R kako bi zamijelili više od jednog znaka. ** - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - Pomaknite kursor na po�etak prvog xxx . + 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. + Pomaknite kursor na početak prvog xxx . 2. Pritisnite R i otipkajte broj koji je liniju ispod, tako da zamijeni xxx . @@ -778,7 +778,7 @@ NAPOMENA: Sa i, a, i A prelazite u isti Insert mod, jedina ---> Zbrajanje: 123 plus 456 je 579. NAPOMENA: Replace mod je kao Insert mod, ali sa bitnom razlikom, - svaki otipkani znak bri�e ve� postoje�i. + svaki otipkani znak briše već postojeći. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.6.4: KOPIRANJE I LIJEPLJENJE TEKSTA @@ -790,44 +790,44 @@ NAPOMENA: Replace mod je kao Insert mod, ali sa bitnom razlikom, 2. Pokrenite Visual mod sa v i pomaknite kursor sve do ispred "prva". - 3. Pritisnite y kako bi kopirali ozna�eni tekst. + 3. Pritisnite y kako bi kopirali označeni tekst. - 4. Pomaknite kursor do kraja sljede�e linije: j$ + 4. Pomaknite kursor do kraja sljedeće linije: j$ 5. Pritisnite p kako bi zalijepili tekst. Onda utipkajte: druga . - 6. Koristite Visual mod kako bi ozna�ili " linija.", kopirajte: y , kursor - postavite na kraj sljede�e linije: j$ i ondje zalijepite tekst: p . + 6. Koristite Visual mod kako bi označili " linija.", kopirajte: y , kursor + postavite na kraj sljedeće linije: j$ i ondje zalijepite tekst: p . ---> a) ovo je prva linija. b) -NAPOMENA: mo�ete koristiti y kao operator; yw kopira jednu rije�. +NAPOMENA: možete koristiti y kao operator; yw kopira jednu riječ. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcija 1.6.5: MIJENJANJE POSTAVKI - ** Postavka: naredbe tra�enja i zamijene ne razlikuju VELIKA i mala slova ** + ** Postavka: naredbe traženja i zamijene ne razlikuju VELIKA i mala slova ** - 1. Potra�ite 'razlika' tipkanjem: /razlika + 1. Potražite 'razlika' tipkanjem: /razlika Nekoliko puta ponovite pritiskanjem n . 2. Aktivirajte 'ic' (Ignore case) postavku: :set ic - 3. Ponovno potra�ite 'razlika' tipkanjem n - Primijetite da su sada i RAZLIKA i Razlika prona�eni. + 3. Ponovno potražite 'razlika' tipkanjem n + Primijetite da su sada i RAZLIKA i Razlika pronađeni. 4. Aktivirajte 'hlsearch' i 'incsearch' postavke: :set hls is - 5. Otipkajte naredbu tra�enja i primijetite razlike: /razlika + 5. Otipkajte naredbu traženja i primijetite razlike: /razlika 6. Za deaktiviranje ic postavke koristite: :set noic -NAPOMENA: Za neozna�avanje prona�enih izraza otipkajte: :nohlsearch +NAPOMENA: Za neoznačavanje pronađenih izraza otipkajte: :nohlsearch NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi koristite \c u izrazu: /razlika\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6 SA�ETAK + Lekcija 1.6 SAŽETAK 1. Pritisnite o za otvaranje linije ISPOD kursora i prelazak u Insert mod. Pritisnite O za otvaranje linije IZNAD kursora. @@ -835,38 +835,38 @@ NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi 2. Pritisnite a za unos teksta IZA kursora. Pritisnite A za unos teksta na kraju linije. - 3. Naredba e pomi�e kursor na kraj rije�i. + 3. Naredba e pomiče kursor na kraj riječi. 4. Operator y kopira tekst, p ga lijepi. 5. Tipkanjem velikog R Vim prelazi u Replace mod dok ne pritisnete . 6. Tipkanjem ":set xxx" aktivira postavku "xxx". Neke postavke su: - 'ic' 'ignorecase' ne razlikuje velika/mala slova pri tra�enju - 'is' 'incsearch' tra�i nedovr�ene izraze - 'hls' 'hlsearch' ozna�i sve prona�ene izraze - Mo�ete koristite dugo ili kratko ime postavke. + 'ic' 'ignorecase' ne razlikuje velika/mala slova pri traženju + 'is' 'incsearch' traži nedovršene izraze + 'hls' 'hlsearch' označi sve pronađene izraze + Možete koristite dugo ili kratko ime postavke. 7. Prethodite "no" imenu postavke za deaktiviranje iste: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.1: DOBIVANJE POMO�I + Lekcija 1.7.1: DOBIVANJE POMOĆI - ** Koristite on-line sustav pomo�i ** + ** Koristite on-line sustav pomoći ** - Vim ima detaljan on-line sustav pomo�i. - Za po�etak, poku�ajte jedno od sljede�eg: - - pritisnite tipku (ako je va�a tipkovnica ima) - - pritisnite tipku (ako je va�a tipkovnica ima) + Vim ima detaljan on-line sustav pomoći. + Za početak, pokušajte jedno od sljedećeg: + - pritisnite tipku (ako je vaša tipkovnica ima) + - pritisnite tipku (ako je vaša tipkovnica ima) - utipkajte :help - Pro�itajte tekst u prozoru pomo�i kako bi ste se znali slu�iti istom. + Pročitajte tekst u prozoru pomoći kako bi ste se znali služiti istom. Tipkanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. - Otipkajte :q kako bi zatvorili prozor pomo�i. + Otipkajte :q kako bi zatvorili prozor pomoći. - Prona�i �e te pomo� o bilo kojoj temi, tako da dodate upit samoj - ":help" naredbi. Poku�ajte (ne zaboravite pritisnuti ): + Pronaći će te pomoć o bilo kojoj temi, tako da dodate upit samoj + ":help" naredbi. Pokušajte (ne zaboravite pritisnuti ): :help w :help c_CTRL-D @@ -876,65 +876,65 @@ NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi Lekcija 1.7.2: PRAVLJENJE SKRIPTE - ** Aktivirajte Vim mogu�nosti ** + ** Aktivirajte Vim mogućnosti ** - Vim ima mnogo vi�e alata od Vi-ja, ali ve�ina njih nije aktivirana. - Kako bi mogli koristiti vi�e mogu�nosti napravite "vimrc" datoteku. + Vim ima mnogo više alata od Vi-ja, ali većina njih nije aktivirana. + Kako bi mogli koristiti više mogućnosti napravite "vimrc" datoteku. - 1. Uredite "vimrc" datoteku. Ovo ovisi o va�em sistemu: + 1. Uredite "vimrc" datoteku. Ovo ovisi o vašem sistemu: :e ~/.vimrc za Unix :e ~/_vimrc za MS-Windows - 2. Sada u�itajte primjer sadr�aja "vimrc" datoteke: + 2. Sada učitajte primjer sadržaja "vimrc" datoteke: :r $VIMRUNTIME/vimrc_example.vim - 3. Sa�uvajte datoteku sa: + 3. Sačuvajte datoteku sa: :w - Sljede�eg puta kada pokrenete Vim, bojanje sintakse teksta biti �e - aktivirano. Sve va�e postavke mo�ete dodati u "vimrc" datoteku. - Za vi�e informacija otipkajte :help vimrc-intro + Sljedećeg puta kada pokrenete Vim, bojanje sintakse teksta biti će + aktivirano. Sve vaše postavke možete dodati u "vimrc" datoteku. + Za više informacija otipkajte :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.3: AUTOMATSKO DOVR�AVANJE + Lekcija 1.7.3: AUTOMATSKO DOVRŠAVANJE - ** Dovr�avanje iz naredbene linije pomo�u CTRL-D i ** + ** Dovršavanje iz naredbene linije pomoću CTRL-D i ** 1. Provjerite da Vim nije u Vi modu: :set nocp 2. Pogledajte koje datoteke postoje u direktoriju: :!ls or :!dir - 3. Otipkajte po�etak naredbe: :e + 3. Otipkajte početak naredbe: :e - 4. Tipkajte CTRL-D i prikazati �e se lista naredbi koje zapo�inju sa "e". + 4. Tipkajte CTRL-D i prikazati će se lista naredbi koje započinju sa "e". - 5. Pritisnite i Vim �e dopuniti unos u naredbu ":edit". + 5. Pritisnite i Vim će dopuniti unos u naredbu ":edit". - 6. Dodajte razmak i po�etak datoteke: :edit FIL + 6. Dodajte razmak i početak datoteke: :edit FIL - 7. Pritisnite . Vim �e nadopuniti ime datoteke (ako je jedinstveno). + 7. Pritisnite . Vim će nadopuniti ime datoteke (ako je jedinstveno). -NAPOMENA: Mogu�e je dopuniti mnoge naredbe. Koristite CTRL-D i . - Naro�ito je korisno za :help naredbe. +NAPOMENA: Moguće je dopuniti mnoge naredbe. Koristite CTRL-D i . + Naročito je korisno za :help naredbe. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7 SA�ETAK + Lekcija 1.7 SAŽETAK - 1. Otipkajte :help ili pritisnite ili za pomo�. + 1. Otipkajte :help ili pritisnite ili za pomoć. - 2. Otipkajte :help naredba kako bi dobili pomo� za naredba . + 2. Otipkajte :help naredba kako bi dobili pomoć za naredba . 3. Otipkajte CTRL-W CTRL-W za prelazak u drugi prozor - 4. Otipkajte :q kako bi zatvorili prozor pomo�i + 4. Otipkajte :q kako bi zatvorili prozor pomoći 5. Napravite vimrc skriptu za podizanje kako bi u nju spremali - va�e omiljene postavke. + vaše omiljene postavke. - 6. Kada tipkate naredbu koja zapo�inje sa : - pritisnite CTRL-D kako bi vidjeli mogu�e valjane vrijednosti. + 6. Kada tipkate naredbu koja započinje sa : + pritisnite CTRL-D kako bi vidjeli moguće valjane vrijednosti. Pritisnite kako bi odabrali jednu od njih. @@ -942,26 +942,26 @@ NAPOMENA: Mogu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Kraj. Cilj priru�nika je da poka�e kratak pregled Vim editora, tek toliko - da omogu�i njegovo kori�tenje. Priru�nik nije potpun jer Vim ima mnogo vi�e - naredbi. Za vi�e informacija: ":help user-manual". + Kraj. Cilj priručnika je da pokaže kratak pregled Vim editora, tek toliko + da omogući njegovo korištenje. Priručnik nije potpun jer Vim ima mnogo više + naredbi. Za više informacija: ":help user-manual". - Za �itanje i kori�tenje, preporu�amo: + Za čitanje i korištenje, preporučamo: Vim - Vi Improved - by Steve Oualline - Izdava�: New Riders - Prva knjiga potpuno posve�ena Vim-u. Vrlo korisna za po�etnike. + Izdavač: New Riders + Prva knjiga potpuno posvećena Vim-u. Vrlo korisna za početnike. Sa mnogo primjera i slika. Posjetite https://iccf-holland.org/click5.html - Sljede�a knjiga je ne�to starija i vi�e o Vi-u nego o Vim-u, preporu�amo: + Sljedeća knjiga je nešto starija i više o Vi-u nego o Vim-u, preporučamo: Learning the Vi Editor - by Linda Lamb - Izdava�: O'Reilly & Associates Inc. - Solidna knjiga, mo�ete saznati skoro sve �to mo�ete napraviti - u Vi-u. �esto izdanje ima ne�to informacija i o Vim-u. + Izdavač: O'Reilly & Associates Inc. + Solidna knjiga, možete saznati skoro sve što možete napraviti + u Vi-u. Šesto izdanje ima nešto informacija i o Vim-u. - Ovaj priru�nik su napisali: Michael C. Pierce i Robert K. Ware, - Colorado School of Mines koriste�i ideje Charles Smith, - Colorado State University. E-po�ta: bware@mines.colorado.edu. + Ovaj priručnik su napisali: Michael C. Pierce i Robert K. Ware, + Colorado School of Mines koristeći ideje Charles Smith, + Colorado State University. E-pošta: bware@mines.colorado.edu. Naknadne promjene napravio je Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.hr.cp1250 b/runtime/tutor/tutor1.hr.cp1250 deleted file mode 100644 index 3070ffd71c..0000000000 --- a/runtime/tutor/tutor1.hr.cp1250 +++ /dev/null @@ -1,972 +0,0 @@ -=============================================================================== -= D o b r o d o � l i u VIM p r i r u � n i k - Verzija 1.7 = -=============================================================================== - - Vim je vrlo mo�an editor koji ima mnogo naredbi, previ�e da bi ih - se svih ovdje spomenulo. Namjena priru�nika je objasniti dovoljno - naredbi kako bi po�etnici znatno lak�e koristili ovaj svestran editor. - - Pribli�no vrijeme potrebno za uspje�an zavr�etak priru�nika je oko - 30 minuta a ovisi o tome koliko �e te vremena odvojiti za vje�banje. - - UPOZORENJE: - Naredbe u ovom priru�niku �e promijeniti ovaj tekst. - Napravite kopiju ove datoteke kako bi ste na istoj vje�bali - (ako ste pokrenuli "vimtutor" ovo je ve� kopija). - - Vrlo je va�no primijetiti da je ovaj priru�nik namijenjen za vje�banje. - Preciznije, morate izvr�iti naredbe u Vim-u kako bi ste iste nau�ili - pravilno koristiti. Ako samo �itate tekst, zaboraviti �e te naredbe! - - Ako je CapsLock uklju�en ISKLJU�ITE ga. Pritiskajte tipku j kako - bi pomakli kursor sve dok Lekcija 1.1.1 ne ispuni ekran. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.1: POMICANJE KURSORA - - - ** Za pomicanje kursora, pritisnite h,j,k,l tipke kako je prikazano ** - ^ - k Savjet: h tipka je lijevo i pomi�e kursor lijevo. - < h l > l tipka je desno i pomi�e kursor desno. - j j izgleda kao strelica usmjerena dolje. - v - 1. Pomi�ite kursor po ekranu dok se ne naviknete na kori�tenje. - - 2. Dr�ite tipku (j) pritisnutom. - Sada znate kako do�i do sljede�e lekcije. - - 3. Koriste�i tipku j prije�ite na sljede�u lekciju 1.1.2. - -NAPOMENA: Ako niste sigurni �to ste zapravo pritisnuli uvijek koristite - tipku kako bi pre�li u Normal mod i onda poku�ajte ponovno. - -NAPOMENA: Kursorske tipke rade isto. Kori�tenje hjkl tipaka je znatno - br�e, nakon �to se jednom naviknete na njihovo kori�tenje. Stvarno! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.2: IZLAZ IZ VIM-a - - - !! UPOZORENJE: Prije izvo�enja bilo kojeg koraka, - pro�itajte cijelu lekciju!! - - 1. Pritisnite tipku (Vim je sada u Normal modu). - - 2. Otipkajte: :q! . - Izlaz iz editora, GUBE se sve napravljene promjene. - - 3. Kada se pojavi ljuska, utipkajte naredbu koja je pokrenula - ovaj priru�nik: vimtutor - - 4. Ako ste upamtili ove korake, izvr�ite ih redom od 1 do 3 - kako bi ponovno pokrenuli editor. - -NAPOMENA: :q! poni�tava sve promjene koje ste napravili. - U sljede�im lekcijama nau�it �e te kako promjene sa�uvati. - - 5. Pomaknite kursor na Lekciju 1.1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.3: PROMJENA TEKSTA - BRISANJE - - - ** Pritisnite x za brisanje znaka pod kursorom. ** - - 1. Pomaknite kursor na liniju ozna�enu s --->. - - 2. Kako bi ste ispravili pogre�ke, pomi�ite kursor dok se - ne bude nalazio na slovu kojeg trebate izbrisati. - - 3. Pritisnite tipku x kako bi uklonili ne�eljeno slovo. - - 4. Ponovite korake od 2 do 4 dok ne ispravite sve pogre�ke. - ----> KKKravaa jee pressko�ila mmjeseccc. - - 5. Nakon �to ispravite liniju, prije�ite na lekciju 1.1.4. - -NAPOMENA: Koriste�i ovaj priru�nik ne poku�avajte pamtiti - ve� u�ite primjenom. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.4: PROMJENA TEKSTA - UBACIVANJE - - - ** Pritisnite i za ubacivanje teksta ispred kursora. ** - - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - - 2. Kako bi napravili prvu liniju istovjetnoj drugoj, pomaknite - kursor na prvi znak POSLIJE kojeg �e te utipkati potreban tekst. - - 3. Pritisnite i te utipkajte potrebne nadopune. - - 4. Nakon �to ispravite pogre�ku pritisnite kako bi vratili Vim - u Normal mod. Ponovite korake od 2 do 4 kako bi ispravili sve pogre�ke. - ----> Nedje no teka od v lin. ----> Nedostaje ne�to teksta od ove linije. - - 5. Prije�ite na sljede�u lekciju. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.5: PROMJENA TEKSTA - DODAVANJE - - - ** Pritisnite A za dodavanje teksta. ** - - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - Nije va�no na kojem se slovu nalazi kursor na toj liniji. - - 2. Pritisnite A i napravite potrebne promjene. - - 3. Nakon �to ste dodali tekst, pritisnite - za povratak u Normal mod. - - 4. Pomaknite kursor na drugu liniju ozna�enu s ---> - i ponovite korake 2 i 3 dok ne popravite tekst. - ----> Ima ne�to teksta koji nedostaje n - Ima ne�to teksta koji nedostaje na ovoj liniji. ----> Ima ne�to teksta koji ne - Ima ne�to teksta koji nedostaje ba� ovdje. - - 5. Prije�ite na lekciju 1.1.6. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.6: PROMJENA DATOTEKE - - - ** Koristite :wq za spremanje teksta i napu�tanje Vim-a. ** - - !! UPOZORENJE: Prije izvr�avanja bilo kojeg koraka, pro�itajte lekciju!! - - 1. Iza�ite iz programa kao sto ste napravili u lekciji 1.1.2: :q! - - 2. Iz ljuske utipkajte sljede�u naredbu: vim tutor - 'vim' je naredba pokretanja Vim editora, 'tutor' je ime datoteke koju - �elite ure�ivati. Koristite datoteku koju imate ovlasti mijenjati. - - 3. Ubacite i izbri�ite tekst kao �to ste to napravili u lekcijama prije. - - 4. Sa�uvajte promjenjeni tekst i iza�ite iz Vim-a: :wq - - 5. Ponovno pokrenite vimtutor i nastavite �itati sa�etak koji sljedi. - - 6. Nakon sto pro�itate gornje korake i u potpunosti ih razumijete: - izvr�ite ih. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1 SA�ETAK - - - 1. Kursor se pomi�e strelicama ili pomo�u hjkl tipaka. - h (lijevo) j (dolje) k (gore) l (desno) - - 2. Pokretanje Vim-a iz ljuske: vim IME_DATOTEKE - - 3. Izlaz: :q! sve promjene su izgubljene. - ILI: :wq promjene su sa�uvane. - - 4. Brisanje znaka na kojem se nalazi kursor: x - - 5. Ubacivanja ili dodavanje teksta: - i utipkajte tekst unos ispred kursora - A utipkajte tekst dodavanje na kraju linije - -NAPOMENA: Tipkanjem tipke prebacuje Vim u Normal mod i - prekida ne�eljenu ili djelomi�no zavr�enu naredbu. - -Nastavite �itati Lekciju 2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.1: NAREDBE BRISANJA - - - ** Tipkajte dw za brisanje rije�i. ** - - 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. - - 2. Pomaknite kursor na liniju ozna�enu s --->. - - 3. Pomaknite kursor na po�etak rije�i koju treba izbrisati. - - 4. Otipkajte dw kako bi uklonili rije�. - -NAPOMENA: Vim �e prikazati slovo d na zadnjoj liniji kad ga otipkate. - Vim �eka da otipkate w . Ako je prikazano neko drugo slovo, - krivo ste otipkali; pritisnite i poku�ajte ponovno. - ----> Neke rije�i smije�no ne pripadaju na papir ovoj re�enici. - - 5. Ponovite korake 3 i 4 dok ne ispravite re�enicu; - prije�ite na Lekciju 1.2.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.2: JO� BRISANJA - - - ** Otipkajte d$ za brisanje znakova do kraja linije. ** - - 1. Pritisnite kako bi bili - sigurni da je Vim u Normal modu. - - 2. Pomaknite kursor na liniju ozna�enu s --->. - - 3. Pomaknite kursor do kraja ispravne re�enice - (POSLJE prve . ). - - 4. Otipkajte d$ - kako bi izbrisali sve znakove do kraja linije. - ----> Netko je utipkao kraj ove linije dvaput. kraj ove linije dvaput. - - 5. Prije�ite na Lekciju 1.2.3 za bolje obja�njenje. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.3: UKRATKO O OPERATORIMA I POKRETIMA - - - Mnogo naredbi koje mijenjaju tekst se sastoje od operatora i pokreta. - Oblik naredbe brisanja sa d operatorom je sljede�i: - - d pokret - - Pri �emu je: - d - operator brisanja. - pokret - ono na �emu �e se operacija izvr�avati (navedeno u nastavku). - - Kratka lista pokreta: - w - sve do po�etka sljede�e rije�i, NE UKLJU�UJU�I prvo slovo. - e - sve do kraja trenuta�ne rije�i, UKLJU�UJU�I zadnje slovo. - $ - sve do kraje linije, UKLJU�UJU�I zadnje slovo. - - Tipkanjem de �e se brisati od kursora do kraja rije�i. - -NAPOMENA: Pritiskaju�i samo pokrete dok ste u Normal modu bez operatora �e - pomicati kursor kao �to je navedeno. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.4: KORI�TENJE BROJANJA ZA POKRETE - - - ** Tipkanjem nekog broja prije pokreta, pokret se izvr�ava toliko puta. ** - - 1. Pomaknite kursor na liniju ozna�enu s --->. - - 2. Otipkajte 2w da pomaknete kursor dvije rije�i naprijed. - - 3. Otipkajte 3e da pomaknete kursor na kraj tre�e rije�i naprijed. - - 4. Otipkajte 0 (nulu) da pomaknete kursor na po�etak linije. - - 5. Ponovite korake 2 i 3 s nekim drugim brojevima. - ----> Re�enica sa rije�ima po kojoj mo�ete pomicati kursor. - - 6. Prije�ite na Lekciju 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.5: KORI�TENJE BROJANJA ZA VE�E BRISANJE - - - ** Tipkanje broja N s operatorom ponavlja ga N-puta. ** - - U kombinaciji operatora brisanja i pokreta spomenutih iznad - ubacujete broj prije pokreta kako bi izbrisali vi�e znakova: - - d broj pokret - - 1. Pomaknite kursor na prvo slovo u rije�i sa VELIKIM SLOVIMA - ozna�enu s --->. - - 2. Otipkajte 2dw da izbri�ete dvije rije�i sa VELIKIM SLOVIMA - - 3. Ponovite korake 1 i 2 sa razli�itim brojevima da izbri�ete - uzastopne rije�i sa VELIKIM SLOVIMA sa samo jednom naredbom. - ----> ova ABC�� D�E linija FGHI JK LMN OP rije�i je RS� TUVZ� popravljena. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.6: OPERIRANJE NAD LINIJAMA - - - ** Otipkajte dd za brisanje cijele linije. ** - - Zbog u�estalosti brisanja cijelih linija, dizajneri Vi-a su odlu�ili da - je lak�e brisati linije tipkanjem d dvaput. - - 1. Pomaknite kursor na drugu liniju u donjoj kitici. - 2. Otipkajte dd kako bi izbrisali liniju. - 3. Pomaknite kursor na �etvrtu liniju. - 4. Otipkajte 2dd kako bi izbrisali dvije linije. - ----> 1) Ru�e su crvene, ----> 2) Pla�a je super, ----> 3) Ljubice su plave, ----> 4) Imam auto, ----> 5) Satovi ukazuju vrijeme, ----> 6) �e�er je sladak ----> 7) Kao i ti. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.7: NAREDBA PONI�TENJA - - - ** Pritisnite u za poni�tenje zadnje naredbe, U za cijelu liniju. ** - - 1. Pomaknite kursor na liniju ozna�enu s ---> i postavite kursor na prvu - pogre�ku. - 2. Otipkajte x kako bi izbrisali prvi ne�eljeni znak. - 3. Otipkajte u kako bi poni�tili zadnju izvr�enu naredbu. - 4. Ovaj put ispravite sve pogre�ke na liniji koriste�i x naredbu. - 5. Sada utipkajte veliko U kako bi poni�tili sve promjene - na liniji, vra�aju�i je u prija�nje stanje. - 6. Sada utipkajte u nekoliko puta kako bi poni�tili U - i prija�nje naredbe. - 7. Sada utipkajte CTRL-R (dr�e�i CTRL tipku pritisnutom dok - ne pritisnete R) nekoliko puta kako bi vratili promjene - (poni�tili poni�tenja). - ----> Poopravite pogre�ke nna ovvoj liniji ii pooni�titeee ih. - - 8. Vrlo korisne naredbe. Prije�ite na sa�etak Lekcije 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2 SA�ETAK - - - 1. Brisanje od kursora do sljede�e rije�i: dw - 2. Brisanje od kursora do kraja linije: d$ - 3. Brisanje cijele linije: dd - - 4. Za ponavljanje pokreta prethodite mu broj: 2w - 5. Oblik naredbe mijenjanja: - operator [broj] pokret - gdje je: - operator - �to napraviti, npr. d za brisanje - [broj] - neobavezan broj ponavljanja pokreta - pokret - kretanje po tekstu po kojem se operira, - kao �to je: w (rije�), $ (kraj linije), itd. - - 6. Postavljanje kursora na po�etak linije: 0 - - 7. Za poni�tenje prethodnih promjena, pritisnite: u (malo u) - Za poni�tenje svih promjena na liniji, pritisnite: U (veliko U) - Za vra�anja promjena, utipkajte: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.1: NAREDBA POSTAVI - - - ** p za unos prethodno izbrisanog teksta iza kursora. ** - - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - - 2. Otipkajte dd kako bi izbrisali liniju i spremili je u Vim registar. - - 3. Pomaknite kursor na liniju c), IZNAD linije koju trebate unijeti. - - 4. Otipkajte p kako bi postavili liniju ispod kursora. - - 5. Ponovite korake 2 do 4 kako bi postavili sve linije u pravilnom - rasporedu. - ----> d) Mo�e� li i ti nau�iti? ----> b) Ljubice su plave, ----> c) Inteligencija je nau�ena, ----> a) Ru�e su crvene, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.2: NAREDBA PROMJENE - - - ** Otipkajte rx za zamjenu slova ispod kursora sa slovom x . ** - - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - - 2. Pomaknite kursor tako da se nalazi na prvoj pogre�ci. - - 3. Otipkajte r i nakon toga ispravan znak na tom mjestu. - - 4. Ponovite korake 2 i 3 sve dok prva - linije ne bude istovjetna drugoj. - ----> Kede ju ovu limija tupjana, natko je protuskao kruve tupke! ----> Kada je ova linija tipkana, netko je pritiskao krive tipke! - - 5. Prije�ite na Lekciju 1.3.2. - -NAPOMENA: Prisjetite da trebate u�iti vje�banjem, ne pam�enjem. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.3: OPERATOR MIJENJANJA - - - ** Za mijenjanje do kraja rije�i, istipkajte ce . ** - - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - - 2. Postavite kursor na a u lackmb. - - 3. Otipkajte ce i ispravite rije� (u ovom slu�aju otipkajte inija ). - - 4. Pritisnite i pomaknite kursor na sljede�i znak - kojeg je potrebno ispraviti. - - 5. Ponovite korake 3 i 4 sve dok prva re�enica ne postane istovjetna - drugoj. - ----> Ova lackmb ima nekoliko rjlcah koje trfcb mijdmlfsz. ----> Ova linija ima nekoliko rije�i koje treba mijenjati. - -Primijetite da ce bri�e rije� i postavlja Vim u Insert mod. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.4: JO� MIJENJANJA KORI�TENJEM c - - - ** Naredba mijenjanja se koristi sa istim pokretima kao i brisanje. ** - - 1. Operator mijenjanja se koristi na isti na�in kao i operator brisanja: - - c [broj] pokret - - 2. Pokreti su isti, npr: w (rije�) i $ (kraj linije). - - 3. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - - 4. Pomaknite kursor na prvu pogre�ku. - - 5. Otipkajte c$ i utipkajte ostatak linije tako da bude istovjetna - drugoj te pritisnite . - ----> Kraj ove linije treba pomo� tako da izgleda kao linija ispod. ----> Kraj ove linije treba ispraviti kori�tenjem c$ naredbe. - -NAPOMENA: Mo�ete koristiti Backspace za ispravljanje gre�aka. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3 SA�ETAK - - - 1. Za postavljanje teksta koji je upravo izbrisan, pritisnite p . Ovo - postavlja tekst IZA kursora (ako je pak linija izbrisana tekst se - postavlja na liniju ispod kursora). - - 2. Za promjenu znaka na kojem se nalazi kursor, pritisnite r i nakon toga - �eljeni znak. - - 3. Operator mijenjanja dozvoljava promjenu teksta od kursora do pozicije do - koje dovede pokret. tj. Otipkajte ce za mijenjanje od kursora do kraja - rije�i, c$ za mijenjanje od kursora do kraja linije. - - 4. Oblik naredbe mijenjanja: - - c [broj] pokret - -Prije�ite na sljede�u lekciju. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.1: POZICIJA KURSORA I STATUS DATOTEKE - - ** CTRL-G za prikaz pozicije kursora u datoteci i status datoteke. - Pritisnite G za pomicanje kursora na neku liniju u datoteci. ** - -NAPOMENA: Pro�itajte cijelu lekciju prije izvr�enja bilo kojeg koraka!! - - 1. Dr�ite Ctrl tipku pritisnutom i pritisnite g . Ukratko: CTRL-G. - Vim �e ispisati poruku na dnu ekrana sa imenom datoteke i pozicijom - kursora u datoteci. Zapamtite broj linije za 3. korak. - -NAPOMENA: Mo�ete vidjeti poziciju kursora u donjem desnom kutu ako - je postavka 'ruler' aktivirana (obja�njeno u 6. lekciji). - - 2. Pritisnite G za pomicanje kursora na kraj datoteke. - Otipkajte gg za pomicanje kursora na po�etak datoteke. - - 3. Otipkajte broj linije na kojoj ste bili maloprije i zatim G . Kursor - �e se vratiti na liniju na kojoj se nalazio kada ste otipkali CTRL-G. - - 4. Ako ste spremni, izvr�ite korake od 1 do 3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.2: NAREDBE TRA�ENJA - - ** Otipkajte / i nakon toga izraz kojeg �elite tra�iti. ** - - 1. U Normal modu otipkajte / znak. Primijetite da se znak - pojavio zajedno sa kursorom na dnu ekrana kao kod : naredbe. - - 2. Sada otipkajte 'grrrre�ka' . To je rije� koju zapravo tra�ite. - - 3. Za ponovno tra�enje istog izraza, otipkajte n . - Za tra�enje istog izraza ali u suprotnom smjeru, otipkajte N . - - 4. Za tra�enje izraza unatrag, koristite ? umjesto / . - - 5. Za povratak na prethodnu poziciju koristite CTRL-O (dr�ite Ctrl - pritisnutim dok ne pritisnete tipku o). Ponavljajte sve dok se ne - vratite na po�etak. CTRL-I sli�no kao CTRL-O ali u suprotnom smjeru. - ----> "pogrrrre�ka" je pogre�no; umjesto pogrrrre�ka treba stajati pogre�ka. - -NAPOMENA: Ako se tra�enjem do�e do kraja datoteke nastavit �e se od njenog - po�etka osim ako je postavka 'wrapscan' deaktivirana. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.3: TRA�ENJE PRIPADAJU�E ZAGRADE - - - ** Otipkajte % za pronalazak pripadaju�e ), ] ili } . ** - - 1. Postavite kursor na bilo koju od ( , [ ili { - otvorenih zagrada u liniji ozna�enoj s --->. - - 2. Otipkajte znak % . - - 3. Kursor �e se pomaknuti na pripadaju�u zatvorenu zagradu. - - 4. Otipkajte % kako bi pomakli kursor na drugu pripadaju�u zagradu. - - 5. Pomaknite kursor na neku od (,),[,],{ ili } i ponovite % naredbu. - ----> Linija ( testiranja obi�nih ( [ uglatih ] i { viti�astih } zagrada.)) - - -NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadaju�im zagradama! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.4: NAREDBE ZAMIJENE - - - ** Otipkajte :s/staro/novo/g da zamijenite 'staro' za 'novo'. ** - - 1. Pomaknite kursor na liniju ozna�enu s --->. - - 2. Otipkajte :s/cvr��/cvr� . Primjetite da ova naredba zamjenjuje - samo prvi "cvr��" u liniji. - - 3. Otipkajte :s/cvr��/cvr�/g . Dodavanje g stavke zna�i da �e se naredba - izvr�iti na cijeloj liniji, zamjenjivanjem svih "cvr��" u liniji. - ----> i cvr��i cvr��i cvr��ak na �voru crne smr�e. - - 4. Za zamjenu svih izraza u rasponu dviju linija, - otipkajte :#,#s/staro/novo/g #,# su brojevi linije datoteke na kojima - te izme�u njih �e se izvr�iti zamjena. - Otipkajte :%s/staro/novo/g za zamjenu svih izraza u cijeloj datoteci. - Otipkajte :%s/staro/novo/gc za pronalazak svakog izraza u datoteci i - potvrdu zamjene. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4 SA�ETAK - - - 1. CTRL-G prikazuje poziciju kursora u datoteci i status datoteke. - G postavlja kursor na zadnju liniju datoteke. - broj G postavlja kursor na broj liniju. - gg postavlja kursor na prvu liniju. - - 2. Tipkanje / sa izrazom tra�i UNAPRIJED taj izraz. - Tipkanje ? sa izrazom tra�i UNATRAG taj izraz. - Nakon naredbe tra�enja koristite n za pronalazak izraza u istom - smjeru, i N za pronalazak istog izraza ali u suprotnom smjeru. - CTRL-O vra�a kursor na prethodnu poziciju, CTRL-I na sljede�u poziciju. - - 3. Tipkanje % dok je kursor na zagradi pomi�e ga na pripadaju�u zagradu. - - 4. Za zamjenu prvog izraza staro za izraz novo :s/staro/novo - Za zamjenu svih izraza staro na cijeloj liniji :s/staro/novo/g - Za zamjenu svih izraza staro u rasponu linija #,# :#,#s/staro/novo/g - Za zamjenu u cijeloj datoteci :%s/staro/novo/g - Za potvrdu svake zamjene dodajte 'c' :%s/staro/novo/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.1: IZVR�AVANJE VANJSKIH NAREDBI - - - ** Otipkajte :! sa vanjskom naredbom koju �elite izvr�iti. ** - - 1. Otipkajte poznatu naredbu : kako bi kursor premjestili na dno - ekrana. Time omogu�avate unos naredbe u naredbenoj liniji. - - 2. Otipkajte znak ! (uskli�nik). Tako omogu�avate - izvr�avanje naredbe vanjske ljuske. - - 3. Kao primjer otipkajte ls nakon ! te pritisnite . - Ovo �e prikazati sadr�aj direktorija, kao da ste u ljusci. - Koristite :!dir ako :!ls ne radi. - -NAPOMENA: Mogu�e je izvr�avati bilo koju vanjsku naredbu na ovaj na�in, - zajedno sa njenim argumentima. - -NAPOMENA: Sve : naredbe se izvr�avaju nakon �to pritisnete - U daljnjem tekstu to ne�e uvijek biti napomenuto. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.2: VI�E O SPREMANJU DATOTEKA - - ** Za spremanje promjena, otipkajte :w IME_DATOTEKE. ** - - 1. Otipkajte :!dir ili :!ls za pregled direktorija. - Ve� znate da morate pritisnuti na kraju tipkanja. - - 2. Izaberite ime datoteke koja jo� ne postoji, npr. TEST. - - 3. Otipkajte: :w TEST (gdje je TEST ime koje ste prethodno odabrali.) - - 4. Time �e te spremiti cijelu datoteku (Vim Tutor) pod imenom TEST. - Za provjeru, otipkajte ponovno :!dir ili :!ls - za pregled direktorija. - -NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST , - datoteka bi bila potpuna kopija ove datoteke u trenutku - kada ste je spremili. - - 5. Izbri�ite datoteku tako da otipkate (MS-DOS): :!del TEST - ili (Unix): :!rm TEST - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.3: SPREMANJE OZNA�ENOG TEKSTA - - - ** Kako bi spremili dio datoteke, otipkajte v pokret :w IME_DATOTEKE ** - - 1. Pomaknite kursor na ovu liniju. - - 2. Pritisnite v i pomaknite kursor pet linija ispod ove. - Primijetite promjenu, ozna�eni tekst se razlikuje od obi�nog. - - 3. Pritisnite : znak. Na dnu ekrana pojavit �e se :'<,'> . - - 4. Otipkajte w TEST , pritom je TEST ime datoteke koja jo� ne postoji. - Provjerite da zaista pi�e :'<,'>w TEST - prije nego �to pritisnite . - - 5. Vim �e spremiti ozna�eni tekst u TEST. Provjerite sa :!dir ili :!ls . - Nemojte je jo� brisati! Koristiti �e te je u sljede�oj lekciji. - -NAPOMENA: Tipka v zapo�inje Vizualno ozna�avanje. Mo�ete pomicati kursor - unaokolo kako bi mijenjali veli�inu ozna�enog teksta. Mo�ete - koristiti i operatore. Npr, d �e izbrisati ozna�eni tekst. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.4: U�ITAVANJE DATOTEKA - - - ** Za ubacivanje sadr�aja datoteke, otipkajte :r IME_DATOTEKE ** - - 1. Postavite kursor iznad ove linije. - -NAPOMENA: Nakon �to izvr�ite 2. korak vidjeti �e te tekst iz Lekcije 1.5.3. - Stoga pomaknite kursor DOLJE kako bi ponovno vidjeli ovu lekciju. - - 2. U�itajte va�u TEST datoteku koriste�i naredbu :r TEST - gdje je TEST ime datoteke koju ste koristili u prethodnoj lekciji. - Sadr�aj u�itane datoteke je uba�en liniju ispod kursora. - - 3. Kako bi provjerili da je datoteka u�itana, vratite kursor unatrag i - primijetite dvije kopije Lekcije 1.5.3, originalnu i onu iz datoteke. - -NAPOMENA: Mo�ete tako�er u�itati ispis vanjske naredbe. Npr, :r !ls - �e u�itati ispis ls naredbe i postaviti ispis liniju ispod - kursora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5 SA�ETAK - - - 1. :!naredba izvr�ava vanjsku naredbu. - - Korisni primjeri: - (MS-DOS) (Unix) - :!dir :!ls - pregled direktorija. - :!del DATOTEKA :!rm DATOTEKA - bri�e datoteku DATOTEKA. - - 2. :w DATOTEKA zapisuje trenuta�nu datoteku na disk sa imenom DATOTEKA. - - 3. v pokret :w IME_DATOTEKE sprema vizualno ozna�ene linije u - datoteku IME_DATOTEKE. - - 4. :r IME_DATOTEKE u�itava datoteku IME_DATOTEKE sa diska i stavlja - njen sadr�aj liniju ispod kursora. - - 5. :r !dir u�itava ispis naredbe dir i postavlja sadr�aj ispisa liniju - ispod kursora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.1: NAREDBA OTVORI - - - ** Pritisnite o kako bi otvorili liniju ispod kursora - i pre�li u Insert mod. ** - - 1. Pomaknite kursor na sljede�u liniju ozna�enu s --->. - - 2. Otipkajte malo o kako bi otvorili novu liniju ISPOD kursora - i pre�li u Insert mod. - - 3. Otipkajte ne�to teksta i nakon toga pritisnite - kako bi napustili Insert mod. - ----> Nakon �to pritisnete o kursor �e pre�i u novu liniju u Insert mod. - - 4. Za otvaranje linije IZNAD kursora, otipkajte umjesto malog o veliko O , - Poku�ajte na donjoj liniji ozna�enoj s --->. - ----> Otvorite liniju iznad ove - otipkajte O dok je kursor na ovoj liniji. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.2: NAREDBA DODAJ - - - ** Otipkajte a za dodavanje teksta IZA kursora. ** - - 1. Pomaknite kursor na po�etak sljede�e linije ozna�ene s --->. - - 2. Tipkajte e dok se kursor ne nalazi na kraju li . - - 3. Otipkajte a (malo) kako bi dodali tekst IZA kursora. - - 4. Dopunite rije� kao �to je na liniji ispod. - Pritisnite za izlaz iz Insert moda. - - 5. Sa e prije�ite na sljede�u nepotpunu rije� i ponovite korake 3 i 4. - ----> Ova li omogu�ava vje dodav teksta nekoj liniji. ----> Ova linija omogu�ava vje�banje dodavanja teksta nekoj liniji. - -NAPOMENA: Sa i, a, i A prelazite u isti Insert mod, jedina - razlika je u poziciji od koje �e se tekst ubacivati. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.3: DRUGI NA�IN MIJENJANJA - - - ** Otipkajte veliko R kako bi zamijelili vi�e od jednog znaka. ** - - 1. Pomaknite kursor na prvu sljede�u liniju ozna�enu s --->. - Pomaknite kursor na po�etak prvog xxx . - - 2. Pritisnite R i otipkajte broj koji je liniju ispod, - tako da zamijeni xxx . - - 3. Pritisnite za izlaz iz Replace moda. - Primijetite da je ostatak linije ostao nepromjenjen. - - 5. Ponovite korake kako bi zamijenili preostali xxx. - ----> Zbrajanje: 123 plus xxx je xxx. ----> Zbrajanje: 123 plus 456 je 579. - -NAPOMENA: Replace mod je kao Insert mod, ali sa bitnom razlikom, - svaki otipkani znak bri�e ve� postoje�i. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.4: KOPIRANJE I LIJEPLJENJE TEKSTA - - - ** Koristite y operator za kopiranje a p za lijepljenje teksta. ** - - 1. Pomaknite kursor na liniju s ---> i postavite kursor nakon "a)". - - 2. Pokrenite Visual mod sa v i pomaknite kursor sve do ispred "prva". - - 3. Pritisnite y kako bi kopirali ozna�eni tekst. - - 4. Pomaknite kursor do kraja sljede�e linije: j$ - - 5. Pritisnite p kako bi zalijepili tekst. Onda utipkajte: druga . - - 6. Koristite Visual mod kako bi ozna�ili " linija.", kopirajte: y , kursor - postavite na kraj sljede�e linije: j$ i ondje zalijepite tekst: p . - ----> a) ovo je prva linija. - b) - -NAPOMENA: mo�ete koristiti y kao operator; yw kopira jednu rije�. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.5: MIJENJANJE POSTAVKI - - - ** Postavka: naredbe tra�enja i zamijene ne razlikuju VELIKA i mala slova ** - - 1. Potra�ite 'razlika' tipkanjem: /razlika - Nekoliko puta ponovite pritiskanjem n . - - 2. Aktivirajte 'ic' (Ignore case) postavku: :set ic - - 3. Ponovno potra�ite 'razlika' tipkanjem n - Primijetite da su sada i RAZLIKA i Razlika prona�eni. - - 4. Aktivirajte 'hlsearch' i 'incsearch' postavke: :set hls is - - 5. Otipkajte naredbu tra�enja i primijetite razlike: /razlika - - 6. Za deaktiviranje ic postavke koristite: :set noic - -NAPOMENA: Za neozna�avanje prona�enih izraza otipkajte: :nohlsearch -NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi - koristite \c u izrazu: /razlika\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6 SA�ETAK - - 1. Pritisnite o za otvaranje linije ISPOD kursora i prelazak u Insert mod. - Pritisnite O za otvaranje linije IZNAD kursora. - - 2. Pritisnite a za unos teksta IZA kursora. - Pritisnite A za unos teksta na kraju linije. - - 3. Naredba e pomi�e kursor na kraj rije�i. - - 4. Operator y kopira tekst, p ga lijepi. - - 5. Tipkanjem velikog R Vim prelazi u Replace mod dok ne pritisnete . - - 6. Tipkanjem ":set xxx" aktivira postavku "xxx". Neke postavke su: - 'ic' 'ignorecase' ne razlikuje velika/mala slova pri tra�enju - 'is' 'incsearch' tra�i nedovr�ene izraze - 'hls' 'hlsearch' ozna�i sve prona�ene izraze - Mo�ete koristite dugo ili kratko ime postavke. - - 7. Prethodite "no" imenu postavke za deaktiviranje iste: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.1: DOBIVANJE POMO�I - - - ** Koristite on-line sustav pomo�i ** - - Vim ima detaljan on-line sustav pomo�i. - Za po�etak, poku�ajte jedno od sljede�eg: - - pritisnite tipku (ako je va�a tipkovnica ima) - - pritisnite tipku (ako je va�a tipkovnica ima) - - utipkajte :help - - Pro�itajte tekst u prozoru pomo�i kako bi ste se znali slu�iti istom. - Tipkanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. - Otipkajte :q kako bi zatvorili prozor pomo�i. - - Prona�i �e te pomo� o bilo kojoj temi, tako da dodate upit samoj - ":help" naredbi. Poku�ajte (ne zaboravite pritisnuti ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.2: PRAVLJENJE SKRIPTE - - - ** Aktivirajte Vim mogu�nosti ** - - Vim ima mnogo vi�e alata od Vi-ja, ali ve�ina njih nije aktivirana. - Kako bi mogli koristiti vi�e mogu�nosti napravite "vimrc" datoteku. - - 1. Uredite "vimrc" datoteku. Ovo ovisi o va�em sistemu: - :e ~/.vimrc za Unix - :e ~/_vimrc za MS-Windows - - 2. Sada u�itajte primjer sadr�aja "vimrc" datoteke: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Sa�uvajte datoteku sa: - :w - - Sljede�eg puta kada pokrenete Vim, bojanje sintakse teksta biti �e - aktivirano. Sve va�e postavke mo�ete dodati u "vimrc" datoteku. - Za vi�e informacija otipkajte :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.3: AUTOMATSKO DOVR�AVANJE - - - ** Dovr�avanje iz naredbene linije pomo�u CTRL-D i ** - - 1. Provjerite da Vim nije u Vi modu: :set nocp - - 2. Pogledajte koje datoteke postoje u direktoriju: :!ls or :!dir - - 3. Otipkajte po�etak naredbe: :e - - 4. Tipkajte CTRL-D i prikazati �e se lista naredbi koje zapo�inju sa "e". - - 5. Pritisnite i Vim �e dopuniti unos u naredbu ":edit". - - 6. Dodajte razmak i po�etak datoteke: :edit FIL - - 7. Pritisnite . Vim �e nadopuniti ime datoteke (ako je jedinstveno). - -NAPOMENA: Mogu�e je dopuniti mnoge naredbe. Koristite CTRL-D i . - Naro�ito je korisno za :help naredbe. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7 SA�ETAK - - - 1. Otipkajte :help ili pritisnite ili za pomo�. - - 2. Otipkajte :help naredba kako bi dobili pomo� za naredba . - - 3. Otipkajte CTRL-W CTRL-W za prelazak u drugi prozor - - 4. Otipkajte :q kako bi zatvorili prozor pomo�i - - 5. Napravite vimrc skriptu za podizanje kako bi u nju spremali - va�e omiljene postavke. - - 6. Kada tipkate naredbu koja zapo�inje sa : - pritisnite CTRL-D kako bi vidjeli mogu�e valjane vrijednosti. - Pritisnite kako bi odabrali jednu od njih. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Kraj. Cilj priru�nika je da poka�e kratak pregled Vim editora, tek toliko - da omogu�i njegovo kori�tenje. Priru�nik nije potpun jer Vim ima mnogo vi�e - naredbi. Za vi�e informacija: ":help user-manual". - - Za �itanje i kori�tenje, preporu�amo: - Vim - Vi Improved - by Steve Oualline - Izdava�: New Riders - Prva knjiga potpuno posve�ena Vim-u. Vrlo korisna za po�etnike. - Sa mnogo primjera i slika. - Posjetite https://iccf-holland.org/click5.html - - Sljede�a knjiga je ne�to starija i vi�e o Vi-u nego o Vim-u, preporu�amo: - Learning the Vi Editor - by Linda Lamb - Izdava�: O'Reilly & Associates Inc. - Solidna knjiga, mo�ete saznati skoro sve �to mo�ete napraviti - u Vi-u. �esto izdanje ima ne�to informacija i o Vim-u. - - Ovaj priru�nik su napisali: Michael C. Pierce i Robert K. Ware, - Colorado School of Mines koriste�i ideje Charles Smith, - Colorado State University. E-po�ta: bware@mines.colorado.edu. - - Naknadne promjene napravio je Bram Moolenaar. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Preveo na hrvatski: Paul B. Mahol - Preinaka 1.42, Lipanj 2008 - - diff --git a/runtime/tutor/tutor1.hr.utf-8 b/runtime/tutor/tutor1.hr.utf-8 deleted file mode 100644 index cf3323a94e..0000000000 --- a/runtime/tutor/tutor1.hr.utf-8 +++ /dev/null @@ -1,972 +0,0 @@ -=============================================================================== -= D o b r o d o š l i u VIM p r i r u č n i k - Verzija 1.7 = -=============================================================================== - - Vim je vrlo moćan editor koji ima mnogo naredbi, previše da bi ih - se svih ovdje spomenulo. Namjena priručnika je objasniti dovoljno - naredbi kako bi početnici znatno lakše koristili ovaj svestran editor. - - Približno vrijeme potrebno za uspješan završetak priručnika je oko - 30 minuta a ovisi o tome koliko će te vremena odvojiti za vježbanje. - - UPOZORENJE: - Naredbe u ovom priručniku će promijeniti ovaj tekst. - Napravite kopiju ove datoteke kako bi ste na istoj vježbali - (ako ste pokrenuli "vimtutor" ovo je već kopija). - - Vrlo je važno primijetiti da je ovaj priručnik namijenjen za vježbanje. - Preciznije, morate izvršiti naredbe u Vim-u kako bi ste iste naučili - pravilno koristiti. Ako samo čitate tekst, zaboraviti će te naredbe! - - Ako je CapsLock uključen ISKLJUČITE ga. Pritiskajte tipku j kako - bi pomakli kursor sve dok Lekcija 1.1.1 ne ispuni ekran. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.1: POMICANJE KURSORA - - - ** Za pomicanje kursora, pritisnite h,j,k,l tipke kako je prikazano ** - ^ - k Savjet: h tipka je lijevo i pomiče kursor lijevo. - < h l > l tipka je desno i pomiče kursor desno. - j j izgleda kao strelica usmjerena dolje. - v - 1. Pomičite kursor po ekranu dok se ne naviknete na korištenje. - - 2. Držite tipku (j) pritisnutom. - Sada znate kako doći do sljedeće lekcije. - - 3. Koristeći tipku j prijeđite na sljedeću lekciju 1.1.2. - -NAPOMENA: Ako niste sigurni što ste zapravo pritisnuli uvijek koristite - tipku kako bi prešli u Normal mod i onda pokušajte ponovno. - -NAPOMENA: Kursorske tipke rade isto. Korištenje hjkl tipaka je znatno - brže, nakon što se jednom naviknete na njihovo korištenje. Stvarno! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.2: IZLAZ IZ VIM-a - - - !! UPOZORENJE: Prije izvođenja bilo kojeg koraka, - pročitajte cijelu lekciju!! - - 1. Pritisnite tipku (Vim je sada u Normal modu). - - 2. Otipkajte: :q! . - Izlaz iz editora, GUBE se sve napravljene promjene. - - 3. Kada se pojavi ljuska, utipkajte naredbu koja je pokrenula - ovaj priručnik: vimtutor - - 4. Ako ste upamtili ove korake, izvršite ih redom od 1 do 3 - kako bi ponovno pokrenuli editor. - -NAPOMENA: :q! poništava sve promjene koje ste napravili. - U sljedećim lekcijama naučit će te kako promjene sačuvati. - - 5. Pomaknite kursor na Lekciju 1.1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.3: PROMJENA TEKSTA - BRISANJE - - - ** Pritisnite x za brisanje znaka pod kursorom. ** - - 1. Pomaknite kursor na liniju označenu s --->. - - 2. Kako bi ste ispravili pogreške, pomičite kursor dok se - ne bude nalazio na slovu kojeg trebate izbrisati. - - 3. Pritisnite tipku x kako bi uklonili neželjeno slovo. - - 4. Ponovite korake od 2 do 4 dok ne ispravite sve pogreške. - ----> KKKravaa jee presskočila mmjeseccc. - - 5. Nakon što ispravite liniju, prijeđite na lekciju 1.1.4. - -NAPOMENA: Koristeći ovaj priručnik ne pokušavajte pamtiti - već učite primjenom. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.4: PROMJENA TEKSTA - UBACIVANJE - - - ** Pritisnite i za ubacivanje teksta ispred kursora. ** - - 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - - 2. Kako bi napravili prvu liniju istovjetnoj drugoj, pomaknite - kursor na prvi znak POSLIJE kojeg će te utipkati potreban tekst. - - 3. Pritisnite i te utipkajte potrebne nadopune. - - 4. Nakon što ispravite pogrešku pritisnite kako bi vratili Vim - u Normal mod. Ponovite korake od 2 do 4 kako bi ispravili sve pogreške. - ----> Nedje no teka od v lin. ----> Nedostaje nešto teksta od ove linije. - - 5. Prijeđite na sljedeću lekciju. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.5: PROMJENA TEKSTA - DODAVANJE - - - ** Pritisnite A za dodavanje teksta. ** - - 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - Nije važno na kojem se slovu nalazi kursor na toj liniji. - - 2. Pritisnite A i napravite potrebne promjene. - - 3. Nakon što ste dodali tekst, pritisnite - za povratak u Normal mod. - - 4. Pomaknite kursor na drugu liniju označenu s ---> - i ponovite korake 2 i 3 dok ne popravite tekst. - ----> Ima nešto teksta koji nedostaje n - Ima nešto teksta koji nedostaje na ovoj liniji. ----> Ima nešto teksta koji ne - Ima nešto teksta koji nedostaje baš ovdje. - - 5. Prijeđite na lekciju 1.1.6. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.6: PROMJENA DATOTEKE - - - ** Koristite :wq za spremanje teksta i napuštanje Vim-a. ** - - !! UPOZORENJE: Prije izvršavanja bilo kojeg koraka, pročitajte lekciju!! - - 1. Izađite iz programa kao sto ste napravili u lekciji 1.1.2: :q! - - 2. Iz ljuske utipkajte sljedeću naredbu: vim tutor - 'vim' je naredba pokretanja Vim editora, 'tutor' je ime datoteke koju - želite uređivati. Koristite datoteku koju imate ovlasti mijenjati. - - 3. Ubacite i izbrišite tekst kao što ste to napravili u lekcijama prije. - - 4. Sačuvajte promjenjeni tekst i izađite iz Vim-a: :wq - - 5. Ponovno pokrenite vimtutor i nastavite čitati sažetak koji sljedi. - - 6. Nakon sto pročitate gornje korake i u potpunosti ih razumijete: - izvršite ih. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1 SAŽETAK - - - 1. Kursor se pomiče strelicama ili pomoću hjkl tipaka. - h (lijevo) j (dolje) k (gore) l (desno) - - 2. Pokretanje Vim-a iz ljuske: vim IME_DATOTEKE - - 3. Izlaz: :q! sve promjene su izgubljene. - ILI: :wq promjene su sačuvane. - - 4. Brisanje znaka na kojem se nalazi kursor: x - - 5. Ubacivanja ili dodavanje teksta: - i utipkajte tekst unos ispred kursora - A utipkajte tekst dodavanje na kraju linije - -NAPOMENA: Tipkanjem tipke prebacuje Vim u Normal mod i - prekida neželjenu ili djelomično završenu naredbu. - -Nastavite čitati Lekciju 2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.1: NAREDBE BRISANJA - - - ** Tipkajte dw za brisanje riječi. ** - - 1. Pritisnite kako bi bili sigurni da je Vim u Normal modu. - - 2. Pomaknite kursor na liniju označenu s --->. - - 3. Pomaknite kursor na početak riječi koju treba izbrisati. - - 4. Otipkajte dw kako bi uklonili riječ. - -NAPOMENA: Vim će prikazati slovo d na zadnjoj liniji kad ga otipkate. - Vim čeka da otipkate w . Ako je prikazano neko drugo slovo, - krivo ste otipkali; pritisnite i pokušajte ponovno. - ----> Neke riječi smiješno ne pripadaju na papir ovoj rečenici. - - 5. Ponovite korake 3 i 4 dok ne ispravite rečenicu; - prijeđite na Lekciju 1.2.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.2: JOŠ BRISANJA - - - ** Otipkajte d$ za brisanje znakova do kraja linije. ** - - 1. Pritisnite kako bi bili - sigurni da je Vim u Normal modu. - - 2. Pomaknite kursor na liniju označenu s --->. - - 3. Pomaknite kursor do kraja ispravne rečenice - (POSLJE prve . ). - - 4. Otipkajte d$ - kako bi izbrisali sve znakove do kraja linije. - ----> Netko je utipkao kraj ove linije dvaput. kraj ove linije dvaput. - - 5. Prijeđite na Lekciju 1.2.3 za bolje objašnjenje. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.3: UKRATKO O OPERATORIMA I POKRETIMA - - - Mnogo naredbi koje mijenjaju tekst se sastoje od operatora i pokreta. - Oblik naredbe brisanja sa d operatorom je sljedeći: - - d pokret - - Pri čemu je: - d - operator brisanja. - pokret - ono na čemu će se operacija izvršavati (navedeno u nastavku). - - Kratka lista pokreta: - w - sve do početka sljedeće riječi, NE UKLJUČUJUĆI prvo slovo. - e - sve do kraja trenutačne riječi, UKLJUČUJUĆI zadnje slovo. - $ - sve do kraje linije, UKLJUČUJUĆI zadnje slovo. - - Tipkanjem de će se brisati od kursora do kraja riječi. - -NAPOMENA: Pritiskajući samo pokrete dok ste u Normal modu bez operatora će - pomicati kursor kao što je navedeno. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.4: KORIŠTENJE BROJANJA ZA POKRETE - - - ** Tipkanjem nekog broja prije pokreta, pokret se izvršava toliko puta. ** - - 1. Pomaknite kursor na liniju označenu s --->. - - 2. Otipkajte 2w da pomaknete kursor dvije riječi naprijed. - - 3. Otipkajte 3e da pomaknete kursor na kraj treće riječi naprijed. - - 4. Otipkajte 0 (nulu) da pomaknete kursor na početak linije. - - 5. Ponovite korake 2 i 3 s nekim drugim brojevima. - ----> Rečenica sa riječima po kojoj možete pomicati kursor. - - 6. Prijeđite na Lekciju 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.5: KORIŠTENJE BROJANJA ZA VEĆE BRISANJE - - - ** Tipkanje broja N s operatorom ponavlja ga N-puta. ** - - U kombinaciji operatora brisanja i pokreta spomenutih iznad - ubacujete broj prije pokreta kako bi izbrisali više znakova: - - d broj pokret - - 1. Pomaknite kursor na prvo slovo u riječi sa VELIKIM SLOVIMA - označenu s --->. - - 2. Otipkajte 2dw da izbrišete dvije riječi sa VELIKIM SLOVIMA - - 3. Ponovite korake 1 i 2 sa različitim brojevima da izbrišete - uzastopne riječi sa VELIKIM SLOVIMA sa samo jednom naredbom. - ----> ova ABCČĆ DĐE linija FGHI JK LMN OP riječi je RSŠ TUVZŽ popravljena. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.6: OPERIRANJE NAD LINIJAMA - - - ** Otipkajte dd za brisanje cijele linije. ** - - Zbog učestalosti brisanja cijelih linija, dizajneri Vi-a su odlučili da - je lakše brisati linije tipkanjem d dvaput. - - 1. Pomaknite kursor na drugu liniju u donjoj kitici. - 2. Otipkajte dd kako bi izbrisali liniju. - 3. Pomaknite kursor na četvrtu liniju. - 4. Otipkajte 2dd kako bi izbrisali dvije linije. - ----> 1) Ruže su crvene, ----> 2) Plaža je super, ----> 3) Ljubice su plave, ----> 4) Imam auto, ----> 5) Satovi ukazuju vrijeme, ----> 6) Šećer je sladak ----> 7) Kao i ti. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.7: NAREDBA PONIŠTENJA - - - ** Pritisnite u za poništenje zadnje naredbe, U za cijelu liniju. ** - - 1. Pomaknite kursor na liniju označenu s ---> i postavite kursor na prvu - pogrešku. - 2. Otipkajte x kako bi izbrisali prvi neželjeni znak. - 3. Otipkajte u kako bi poništili zadnju izvršenu naredbu. - 4. Ovaj put ispravite sve pogreške na liniji koristeći x naredbu. - 5. Sada utipkajte veliko U kako bi poništili sve promjene - na liniji, vraćajući je u prijašnje stanje. - 6. Sada utipkajte u nekoliko puta kako bi poništili U - i prijašnje naredbe. - 7. Sada utipkajte CTRL-R (držeći CTRL tipku pritisnutom dok - ne pritisnete R) nekoliko puta kako bi vratili promjene - (poništili poništenja). - ----> Poopravite pogreške nna ovvoj liniji ii pooništiteee ih. - - 8. Vrlo korisne naredbe. Prijeđite na sažetak Lekcije 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2 SAŽETAK - - - 1. Brisanje od kursora do sljedeće riječi: dw - 2. Brisanje od kursora do kraja linije: d$ - 3. Brisanje cijele linije: dd - - 4. Za ponavljanje pokreta prethodite mu broj: 2w - 5. Oblik naredbe mijenjanja: - operator [broj] pokret - gdje je: - operator - što napraviti, npr. d za brisanje - [broj] - neobavezan broj ponavljanja pokreta - pokret - kretanje po tekstu po kojem se operira, - kao što je: w (riječ), $ (kraj linije), itd. - - 6. Postavljanje kursora na početak linije: 0 - - 7. Za poništenje prethodnih promjena, pritisnite: u (malo u) - Za poništenje svih promjena na liniji, pritisnite: U (veliko U) - Za vraćanja promjena, utipkajte: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.1: NAREDBA POSTAVI - - - ** p za unos prethodno izbrisanog teksta iza kursora. ** - - 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - - 2. Otipkajte dd kako bi izbrisali liniju i spremili je u Vim registar. - - 3. Pomaknite kursor na liniju c), IZNAD linije koju trebate unijeti. - - 4. Otipkajte p kako bi postavili liniju ispod kursora. - - 5. Ponovite korake 2 do 4 kako bi postavili sve linije u pravilnom - rasporedu. - ----> d) Možeš li i ti naučiti? ----> b) Ljubice su plave, ----> c) Inteligencija je naučena, ----> a) Ruže su crvene, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.2: NAREDBA PROMJENE - - - ** Otipkajte rx za zamjenu slova ispod kursora sa slovom x . ** - - 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - - 2. Pomaknite kursor tako da se nalazi na prvoj pogrešci. - - 3. Otipkajte r i nakon toga ispravan znak na tom mjestu. - - 4. Ponovite korake 2 i 3 sve dok prva - linije ne bude istovjetna drugoj. - ----> Kede ju ovu limija tupjana, natko je protuskao kruve tupke! ----> Kada je ova linija tipkana, netko je pritiskao krive tipke! - - 5. Prijeđite na Lekciju 1.3.2. - -NAPOMENA: Prisjetite da trebate učiti vježbanjem, ne pamćenjem. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.3: OPERATOR MIJENJANJA - - - ** Za mijenjanje do kraja riječi, istipkajte ce . ** - - 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - - 2. Postavite kursor na a u lackmb. - - 3. Otipkajte ce i ispravite riječ (u ovom slučaju otipkajte inija ). - - 4. Pritisnite i pomaknite kursor na sljedeći znak - kojeg je potrebno ispraviti. - - 5. Ponovite korake 3 i 4 sve dok prva rečenica ne postane istovjetna - drugoj. - ----> Ova lackmb ima nekoliko rjlcah koje trfcb mijdmlfsz. ----> Ova linija ima nekoliko riječi koje treba mijenjati. - -Primijetite da ce briše riječ i postavlja Vim u Insert mod. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.4: JOŠ MIJENJANJA KORIŠTENJEM c - - - ** Naredba mijenjanja se koristi sa istim pokretima kao i brisanje. ** - - 1. Operator mijenjanja se koristi na isti način kao i operator brisanja: - - c [broj] pokret - - 2. Pokreti su isti, npr: w (riječ) i $ (kraj linije). - - 3. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - - 4. Pomaknite kursor na prvu pogrešku. - - 5. Otipkajte c$ i utipkajte ostatak linije tako da bude istovjetna - drugoj te pritisnite . - ----> Kraj ove linije treba pomoć tako da izgleda kao linija ispod. ----> Kraj ove linije treba ispraviti korištenjem c$ naredbe. - -NAPOMENA: Možete koristiti Backspace za ispravljanje grešaka. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3 SAŽETAK - - - 1. Za postavljanje teksta koji je upravo izbrisan, pritisnite p . Ovo - postavlja tekst IZA kursora (ako je pak linija izbrisana tekst se - postavlja na liniju ispod kursora). - - 2. Za promjenu znaka na kojem se nalazi kursor, pritisnite r i nakon toga - željeni znak. - - 3. Operator mijenjanja dozvoljava promjenu teksta od kursora do pozicije do - koje dovede pokret. tj. Otipkajte ce za mijenjanje od kursora do kraja - riječi, c$ za mijenjanje od kursora do kraja linije. - - 4. Oblik naredbe mijenjanja: - - c [broj] pokret - -Prijeđite na sljedeću lekciju. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.1: POZICIJA KURSORA I STATUS DATOTEKE - - ** CTRL-G za prikaz pozicije kursora u datoteci i status datoteke. - Pritisnite G za pomicanje kursora na neku liniju u datoteci. ** - -NAPOMENA: Pročitajte cijelu lekciju prije izvršenja bilo kojeg koraka!! - - 1. Držite Ctrl tipku pritisnutom i pritisnite g . Ukratko: CTRL-G. - Vim će ispisati poruku na dnu ekrana sa imenom datoteke i pozicijom - kursora u datoteci. Zapamtite broj linije za 3. korak. - -NAPOMENA: Možete vidjeti poziciju kursora u donjem desnom kutu ako - je postavka 'ruler' aktivirana (objašnjeno u 6. lekciji). - - 2. Pritisnite G za pomicanje kursora na kraj datoteke. - Otipkajte gg za pomicanje kursora na početak datoteke. - - 3. Otipkajte broj linije na kojoj ste bili maloprije i zatim G . Kursor - će se vratiti na liniju na kojoj se nalazio kada ste otipkali CTRL-G. - - 4. Ako ste spremni, izvršite korake od 1 do 3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.2: NAREDBE TRAŽENJA - - ** Otipkajte / i nakon toga izraz kojeg želite tražiti. ** - - 1. U Normal modu otipkajte / znak. Primijetite da se znak - pojavio zajedno sa kursorom na dnu ekrana kao kod : naredbe. - - 2. Sada otipkajte 'grrrreška' . To je riječ koju zapravo tražite. - - 3. Za ponovno traženje istog izraza, otipkajte n . - Za traženje istog izraza ali u suprotnom smjeru, otipkajte N . - - 4. Za traženje izraza unatrag, koristite ? umjesto / . - - 5. Za povratak na prethodnu poziciju koristite CTRL-O (držite Ctrl - pritisnutim dok ne pritisnete tipku o). Ponavljajte sve dok se ne - vratite na početak. CTRL-I slično kao CTRL-O ali u suprotnom smjeru. - ----> "pogrrrreška" je pogrešno; umjesto pogrrrreška treba stajati pogreška. - -NAPOMENA: Ako se traženjem dođe do kraja datoteke nastavit će se od njenog - početka osim ako je postavka 'wrapscan' deaktivirana. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.3: TRAŽENJE PRIPADAJUĆE ZAGRADE - - - ** Otipkajte % za pronalazak pripadajuće ), ] ili } . ** - - 1. Postavite kursor na bilo koju od ( , [ ili { - otvorenih zagrada u liniji označenoj s --->. - - 2. Otipkajte znak % . - - 3. Kursor će se pomaknuti na pripadajuću zatvorenu zagradu. - - 4. Otipkajte % kako bi pomakli kursor na drugu pripadajuću zagradu. - - 5. Pomaknite kursor na neku od (,),[,],{ ili } i ponovite % naredbu. - ----> Linija ( testiranja običnih ( [ uglatih ] i { vitičastih } zagrada.)) - - -NAPOMENA: Vrlo korisno u ispravljanju koda sa nepripadajućim zagradama! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.4: NAREDBE ZAMIJENE - - - ** Otipkajte :s/staro/novo/g da zamijenite 'staro' za 'novo'. ** - - 1. Pomaknite kursor na liniju označenu s --->. - - 2. Otipkajte :s/cvrćč/cvrč . Primjetite da ova naredba zamjenjuje - samo prvi "cvrćč" u liniji. - - 3. Otipkajte :s/cvrćč/cvrč/g . Dodavanje g stavke znači da će se naredba - izvršiti na cijeloj liniji, zamjenjivanjem svih "cvrćč" u liniji. - ----> i cvrćči cvrćči cvrćčak na čvoru crne smrče. - - 4. Za zamjenu svih izraza u rasponu dviju linija, - otipkajte :#,#s/staro/novo/g #,# su brojevi linije datoteke na kojima - te između njih će se izvršiti zamjena. - Otipkajte :%s/staro/novo/g za zamjenu svih izraza u cijeloj datoteci. - Otipkajte :%s/staro/novo/gc za pronalazak svakog izraza u datoteci i - potvrdu zamjene. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4 SAŽETAK - - - 1. CTRL-G prikazuje poziciju kursora u datoteci i status datoteke. - G postavlja kursor na zadnju liniju datoteke. - broj G postavlja kursor na broj liniju. - gg postavlja kursor na prvu liniju. - - 2. Tipkanje / sa izrazom traži UNAPRIJED taj izraz. - Tipkanje ? sa izrazom traži UNATRAG taj izraz. - Nakon naredbe traženja koristite n za pronalazak izraza u istom - smjeru, i N za pronalazak istog izraza ali u suprotnom smjeru. - CTRL-O vraća kursor na prethodnu poziciju, CTRL-I na sljedeću poziciju. - - 3. Tipkanje % dok je kursor na zagradi pomiče ga na pripadajuću zagradu. - - 4. Za zamjenu prvog izraza staro za izraz novo :s/staro/novo - Za zamjenu svih izraza staro na cijeloj liniji :s/staro/novo/g - Za zamjenu svih izraza staro u rasponu linija #,# :#,#s/staro/novo/g - Za zamjenu u cijeloj datoteci :%s/staro/novo/g - Za potvrdu svake zamjene dodajte 'c' :%s/staro/novo/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.1: IZVRŠAVANJE VANJSKIH NAREDBI - - - ** Otipkajte :! sa vanjskom naredbom koju želite izvršiti. ** - - 1. Otipkajte poznatu naredbu : kako bi kursor premjestili na dno - ekrana. Time omogućavate unos naredbe u naredbenoj liniji. - - 2. Otipkajte znak ! (uskličnik). Tako omogućavate - izvršavanje naredbe vanjske ljuske. - - 3. Kao primjer otipkajte ls nakon ! te pritisnite . - Ovo će prikazati sadržaj direktorija, kao da ste u ljusci. - Koristite :!dir ako :!ls ne radi. - -NAPOMENA: Moguće je izvršavati bilo koju vanjsku naredbu na ovaj način, - zajedno sa njenim argumentima. - -NAPOMENA: Sve : naredbe se izvršavaju nakon što pritisnete - U daljnjem tekstu to neće uvijek biti napomenuto. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.2: VIŠE O SPREMANJU DATOTEKA - - ** Za spremanje promjena, otipkajte :w IME_DATOTEKE. ** - - 1. Otipkajte :!dir ili :!ls za pregled direktorija. - Već znate da morate pritisnuti na kraju tipkanja. - - 2. Izaberite ime datoteke koja još ne postoji, npr. TEST. - - 3. Otipkajte: :w TEST (gdje je TEST ime koje ste prethodno odabrali.) - - 4. Time će te spremiti cijelu datoteku (Vim Tutor) pod imenom TEST. - Za provjeru, otipkajte ponovno :!dir ili :!ls - za pregled direktorija. - -NAPOMENA: Ako bi napustili Vim i ponovno ga pokrenuli sa vim TEST , - datoteka bi bila potpuna kopija ove datoteke u trenutku - kada ste je spremili. - - 5. Izbrišite datoteku tako da otipkate (MS-DOS): :!del TEST - ili (Unix): :!rm TEST - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.3: SPREMANJE OZNAČENOG TEKSTA - - - ** Kako bi spremili dio datoteke, otipkajte v pokret :w IME_DATOTEKE ** - - 1. Pomaknite kursor na ovu liniju. - - 2. Pritisnite v i pomaknite kursor pet linija ispod ove. - Primijetite promjenu, označeni tekst se razlikuje od običnog. - - 3. Pritisnite : znak. Na dnu ekrana pojavit će se :'<,'> . - - 4. Otipkajte w TEST , pritom je TEST ime datoteke koja još ne postoji. - Provjerite da zaista piše :'<,'>w TEST - prije nego što pritisnite . - - 5. Vim će spremiti označeni tekst u TEST. Provjerite sa :!dir ili :!ls . - Nemojte je još brisati! Koristiti će te je u sljedećoj lekciji. - -NAPOMENA: Tipka v započinje Vizualno označavanje. Možete pomicati kursor - unaokolo kako bi mijenjali veličinu označenog teksta. Možete - koristiti i operatore. Npr, d će izbrisati označeni tekst. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.4: UČITAVANJE DATOTEKA - - - ** Za ubacivanje sadržaja datoteke, otipkajte :r IME_DATOTEKE ** - - 1. Postavite kursor iznad ove linije. - -NAPOMENA: Nakon što izvršite 2. korak vidjeti će te tekst iz Lekcije 1.5.3. - Stoga pomaknite kursor DOLJE kako bi ponovno vidjeli ovu lekciju. - - 2. Učitajte vašu TEST datoteku koristeći naredbu :r TEST - gdje je TEST ime datoteke koju ste koristili u prethodnoj lekciji. - Sadržaj učitane datoteke je ubačen liniju ispod kursora. - - 3. Kako bi provjerili da je datoteka učitana, vratite kursor unatrag i - primijetite dvije kopije Lekcije 1.5.3, originalnu i onu iz datoteke. - -NAPOMENA: Možete također učitati ispis vanjske naredbe. Npr, :r !ls - će učitati ispis ls naredbe i postaviti ispis liniju ispod - kursora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5 SAŽETAK - - - 1. :!naredba izvršava vanjsku naredbu. - - Korisni primjeri: - (MS-DOS) (Unix) - :!dir :!ls - pregled direktorija. - :!del DATOTEKA :!rm DATOTEKA - briše datoteku DATOTEKA. - - 2. :w DATOTEKA zapisuje trenutačnu datoteku na disk sa imenom DATOTEKA. - - 3. v pokret :w IME_DATOTEKE sprema vizualno označene linije u - datoteku IME_DATOTEKE. - - 4. :r IME_DATOTEKE učitava datoteku IME_DATOTEKE sa diska i stavlja - njen sadržaj liniju ispod kursora. - - 5. :r !dir učitava ispis naredbe dir i postavlja sadržaj ispisa liniju - ispod kursora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.1: NAREDBA OTVORI - - - ** Pritisnite o kako bi otvorili liniju ispod kursora - i prešli u Insert mod. ** - - 1. Pomaknite kursor na sljedeću liniju označenu s --->. - - 2. Otipkajte malo o kako bi otvorili novu liniju ISPOD kursora - i prešli u Insert mod. - - 3. Otipkajte nešto teksta i nakon toga pritisnite - kako bi napustili Insert mod. - ----> Nakon što pritisnete o kursor će preći u novu liniju u Insert mod. - - 4. Za otvaranje linije IZNAD kursora, otipkajte umjesto malog o veliko O , - Pokušajte na donjoj liniji označenoj s --->. - ----> Otvorite liniju iznad ove - otipkajte O dok je kursor na ovoj liniji. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.2: NAREDBA DODAJ - - - ** Otipkajte a za dodavanje teksta IZA kursora. ** - - 1. Pomaknite kursor na početak sljedeće linije označene s --->. - - 2. Tipkajte e dok se kursor ne nalazi na kraju li . - - 3. Otipkajte a (malo) kako bi dodali tekst IZA kursora. - - 4. Dopunite riječ kao što je na liniji ispod. - Pritisnite za izlaz iz Insert moda. - - 5. Sa e prijeđite na sljedeću nepotpunu riječ i ponovite korake 3 i 4. - ----> Ova li omogućava vje dodav teksta nekoj liniji. ----> Ova linija omogućava vježbanje dodavanja teksta nekoj liniji. - -NAPOMENA: Sa i, a, i A prelazite u isti Insert mod, jedina - razlika je u poziciji od koje će se tekst ubacivati. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.3: DRUGI NAČIN MIJENJANJA - - - ** Otipkajte veliko R kako bi zamijelili više od jednog znaka. ** - - 1. Pomaknite kursor na prvu sljedeću liniju označenu s --->. - Pomaknite kursor na početak prvog xxx . - - 2. Pritisnite R i otipkajte broj koji je liniju ispod, - tako da zamijeni xxx . - - 3. Pritisnite za izlaz iz Replace moda. - Primijetite da je ostatak linije ostao nepromjenjen. - - 5. Ponovite korake kako bi zamijenili preostali xxx. - ----> Zbrajanje: 123 plus xxx je xxx. ----> Zbrajanje: 123 plus 456 je 579. - -NAPOMENA: Replace mod je kao Insert mod, ali sa bitnom razlikom, - svaki otipkani znak briše već postojeći. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.4: KOPIRANJE I LIJEPLJENJE TEKSTA - - - ** Koristite y operator za kopiranje a p za lijepljenje teksta. ** - - 1. Pomaknite kursor na liniju s ---> i postavite kursor nakon "a)". - - 2. Pokrenite Visual mod sa v i pomaknite kursor sve do ispred "prva". - - 3. Pritisnite y kako bi kopirali označeni tekst. - - 4. Pomaknite kursor do kraja sljedeće linije: j$ - - 5. Pritisnite p kako bi zalijepili tekst. Onda utipkajte: druga . - - 6. Koristite Visual mod kako bi označili " linija.", kopirajte: y , kursor - postavite na kraj sljedeće linije: j$ i ondje zalijepite tekst: p . - ----> a) ovo je prva linija. - b) - -NAPOMENA: možete koristiti y kao operator; yw kopira jednu riječ. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.5: MIJENJANJE POSTAVKI - - - ** Postavka: naredbe traženja i zamijene ne razlikuju VELIKA i mala slova ** - - 1. Potražite 'razlika' tipkanjem: /razlika - Nekoliko puta ponovite pritiskanjem n . - - 2. Aktivirajte 'ic' (Ignore case) postavku: :set ic - - 3. Ponovno potražite 'razlika' tipkanjem n - Primijetite da su sada i RAZLIKA i Razlika pronađeni. - - 4. Aktivirajte 'hlsearch' i 'incsearch' postavke: :set hls is - - 5. Otipkajte naredbu traženja i primijetite razlike: /razlika - - 6. Za deaktiviranje ic postavke koristite: :set noic - -NAPOMENA: Za neoznačavanje pronađenih izraza otipkajte: :nohlsearch -NAPOMENA: Bez razlikovanja velikih i malih slova u samo jednoj naredbi - koristite \c u izrazu: /razlika\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6 SAŽETAK - - 1. Pritisnite o za otvaranje linije ISPOD kursora i prelazak u Insert mod. - Pritisnite O za otvaranje linije IZNAD kursora. - - 2. Pritisnite a za unos teksta IZA kursora. - Pritisnite A za unos teksta na kraju linije. - - 3. Naredba e pomiče kursor na kraj riječi. - - 4. Operator y kopira tekst, p ga lijepi. - - 5. Tipkanjem velikog R Vim prelazi u Replace mod dok ne pritisnete . - - 6. Tipkanjem ":set xxx" aktivira postavku "xxx". Neke postavke su: - 'ic' 'ignorecase' ne razlikuje velika/mala slova pri traženju - 'is' 'incsearch' traži nedovršene izraze - 'hls' 'hlsearch' označi sve pronađene izraze - Možete koristite dugo ili kratko ime postavke. - - 7. Prethodite "no" imenu postavke za deaktiviranje iste: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.1: DOBIVANJE POMOĆI - - - ** Koristite on-line sustav pomoći ** - - Vim ima detaljan on-line sustav pomoći. - Za početak, pokušajte jedno od sljedećeg: - - pritisnite tipku (ako je vaša tipkovnica ima) - - pritisnite tipku (ako je vaša tipkovnica ima) - - utipkajte :help - - Pročitajte tekst u prozoru pomoći kako bi ste se znali služiti istom. - Tipkanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. - Otipkajte :q kako bi zatvorili prozor pomoći. - - Pronaći će te pomoć o bilo kojoj temi, tako da dodate upit samoj - ":help" naredbi. Pokušajte (ne zaboravite pritisnuti ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.2: PRAVLJENJE SKRIPTE - - - ** Aktivirajte Vim mogućnosti ** - - Vim ima mnogo više alata od Vi-ja, ali većina njih nije aktivirana. - Kako bi mogli koristiti više mogućnosti napravite "vimrc" datoteku. - - 1. Uredite "vimrc" datoteku. Ovo ovisi o vašem sistemu: - :e ~/.vimrc za Unix - :e ~/_vimrc za MS-Windows - - 2. Sada učitajte primjer sadržaja "vimrc" datoteke: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Sačuvajte datoteku sa: - :w - - Sljedećeg puta kada pokrenete Vim, bojanje sintakse teksta biti će - aktivirano. Sve vaše postavke možete dodati u "vimrc" datoteku. - Za više informacija otipkajte :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.3: AUTOMATSKO DOVRŠAVANJE - - - ** Dovršavanje iz naredbene linije pomoću CTRL-D i ** - - 1. Provjerite da Vim nije u Vi modu: :set nocp - - 2. Pogledajte koje datoteke postoje u direktoriju: :!ls or :!dir - - 3. Otipkajte početak naredbe: :e - - 4. Tipkajte CTRL-D i prikazati će se lista naredbi koje započinju sa "e". - - 5. Pritisnite i Vim će dopuniti unos u naredbu ":edit". - - 6. Dodajte razmak i početak datoteke: :edit FIL - - 7. Pritisnite . Vim će nadopuniti ime datoteke (ako je jedinstveno). - -NAPOMENA: Moguće je dopuniti mnoge naredbe. Koristite CTRL-D i . - Naročito je korisno za :help naredbe. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7 SAŽETAK - - - 1. Otipkajte :help ili pritisnite ili za pomoć. - - 2. Otipkajte :help naredba kako bi dobili pomoć za naredba . - - 3. Otipkajte CTRL-W CTRL-W za prelazak u drugi prozor - - 4. Otipkajte :q kako bi zatvorili prozor pomoći - - 5. Napravite vimrc skriptu za podizanje kako bi u nju spremali - vaše omiljene postavke. - - 6. Kada tipkate naredbu koja započinje sa : - pritisnite CTRL-D kako bi vidjeli moguće valjane vrijednosti. - Pritisnite kako bi odabrali jednu od njih. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Kraj. Cilj priručnika je da pokaže kratak pregled Vim editora, tek toliko - da omogući njegovo korištenje. Priručnik nije potpun jer Vim ima mnogo više - naredbi. Za više informacija: ":help user-manual". - - Za čitanje i korištenje, preporučamo: - Vim - Vi Improved - by Steve Oualline - Izdavač: New Riders - Prva knjiga potpuno posvećena Vim-u. Vrlo korisna za početnike. - Sa mnogo primjera i slika. - Posjetite https://iccf-holland.org/click5.html - - Sljedeća knjiga je nešto starija i više o Vi-u nego o Vim-u, preporučamo: - Learning the Vi Editor - by Linda Lamb - Izdavač: O'Reilly & Associates Inc. - Solidna knjiga, možete saznati skoro sve što možete napraviti - u Vi-u. Šesto izdanje ima nešto informacija i o Vim-u. - - Ovaj priručnik su napisali: Michael C. Pierce i Robert K. Ware, - Colorado School of Mines koristeći ideje Charles Smith, - Colorado State University. E-pošta: bware@mines.colorado.edu. - - Naknadne promjene napravio je Bram Moolenaar. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Preveo na hrvatski: Paul B. Mahol - Preinaka 1.42, Lipanj 2008 - - diff --git a/runtime/tutor/tutor1.hu b/runtime/tutor/tutor1.hu index 2e86f80bbe..f9482e40c6 100644 --- a/runtime/tutor/tutor1.hu +++ b/runtime/tutor/tutor1.hu @@ -1,295 +1,295 @@ =============================================================================== -== � d v � z � l j � k a V I M - o k t a t � b a n - 1.5-�s verzi� == +== Ü d v ö z ö l j ü k a V I M - o k t a t ó b a n - 1.5-ös verzió == =============================================================================== - A Vim egy nagyon hat�kony szerkeszt�, amelynek rengeteg utas�t�sa - van, t�l sok, hogy egy ilyen oktat�ban (tutorban), mint az itteni - mindet elmagyar�zzuk. Ez az oktat� arra t�rekszik, hogy annyit - elmagyar�zzon, amennyi el�g, hogy k�nnyed�n haszn�ljuk a Vim-et, az - �ltal�nos c�l� sz�vegszerkeszt�t. + A Vim egy nagyon hatékony szerkesztő, amelynek rengeteg utasítása + van, túl sok, hogy egy ilyen oktatóban (tutorban), mint az itteni + mindet elmagyarázzuk. Ez az oktató arra törekszik, hogy annyit + elmagyarázzon, amennyi elég, hogy könnyedén használjuk a Vim-et, az + általános célú szövegszerkesztőt. - A feladatok megold�s�hoz 25-30 perc sz�ks�ges att�l f�gg�en, - mennyit t�lt�nk a k�s�rletez�ssel. + A feladatok megoldásához 25-30 perc szükséges attól függően, + mennyit töltünk a kísérletezéssel. - A leck�ben szerepl� utas�t�sok m�dos�tani fogj�k a sz�veget. - K�sz�tsen m�solatot err�l a f�jlr�l, ha gyakorolni akar. - (Ha "vimtutor"-ral ind�totta, akkor ez m�r egy m�solat.) + A leckében szereplő utasítások módosítani fogják a szöveget. + Készítsen másolatot erről a fájlról, ha gyakorolni akar. + (Ha "vimtutor"-ral indította, akkor ez már egy másolat.) - Fontos meg�rteni, hogy ez az oktat� cselekedve tan�ttat. - Ez azt jelenti, hogy �nnek aj�nlott v�grehajtania az utas�t�sokat, - hogy megfelel�en megtanulja azokat. Ha csak olvassa, elfelejti! + Fontos megérteni, hogy ez az oktató cselekedve taníttat. + Ez azt jelenti, hogy Önnek ajánlott végrehajtania az utasításokat, + hogy megfelelően megtanulja azokat. Ha csak olvassa, elfelejti! - Most bizonyosodjon, meg, hogy a Caps-Lock gombja NINCS lenyomva, �s - Nyomja meg megfelel� sz�m�szor a j gombot, hogy az 1.1.1-es - lecke teljesen a k�perny�n legyen! + Most bizonyosodjon, meg, hogy a Caps-Lock gombja NINCS lenyomva, és + Nyomja meg megfelelő számúszor a j gombot, hogy az 1.1.1-es + lecke teljesen a képernyőn legyen! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.1. lecke: A KURZOR MOZGAT�SA + 1.1.1. lecke: A KURZOR MOZGATÁSA - ** A kurzor mozgat�s�hoz nyomja meg a h,j,k,l gombokat az al�bbi szerint. ** + ** A kurzor mozgatásához nyomja meg a h,j,k,l gombokat az alábbi szerint. ** ^ - k Tipp: A h billenty� van balra, �s balra mozgat - < h l > A l billenty� van jobbra, �s jobbra mozgat - j A j billenty� olyan, mint egy lefele ny�l + k Tipp: A h billentyű van balra, és balra mozgat + < h l > A l billentyű van jobbra, és jobbra mozgat + j A j billentyű olyan, mint egy lefele nyíl v - 1. Mozgassa a kurzort k�rbe az ablakban, am�g hozz� nem szokik! + 1. Mozgassa a kurzort körbe az ablakban, amíg hozzá nem szokik! - 2. Tartsa lenyomva a lefel�t (j), akkor ism�tl�dik! ----> Most tudja, hogyan mehet a k�vetkez� leck�re. + 2. Tartsa lenyomva a lefelét (j), akkor ismétlődik! +---> Most tudja, hogyan mehet a következő leckére. - 3. A lefel� gomb haszn�lat�val menjen a 1.1.2. leck�re! + 3. A lefelé gomb használatával menjen a 1.1.2. leckére! Megj: Ha nem biztos benne, mit nyomott meg, nyomja meg az -et, hogy - norm�l m�dba ker�lj�n, �s ism�telje meg a parancsot! + normál módba kerüljön, és ismételje meg a parancsot! -Megj: A kurzor gomboknak is m�k�dni�k kell, de a hjkl haszn�lat�val - sokkal gyorsabban tud, mozogni, ha hozz�szokik. +Megj: A kurzor gomboknak is működniük kell, de a hjkl használatával + sokkal gyorsabban tud, mozogni, ha hozzászokik. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.2. lecke: BE �S KIL�P�S A VIMB�L + 1.1.2. lecke: BE ÉS KILÉPÉS A VIMBŐL - !! MEGJ: Miel�tt v�grehajtja az al�bbi l�p�seket, olvassa v�gig a leck�t !! + !! MEGJ: Mielőtt végrehajtja az alábbi lépéseket, olvassa végig a leckét !! - 1. Nyomja meg az gombot (hogy biztosan norm�l m�dban legyen). + 1. Nyomja meg az gombot (hogy biztosan normál módban legyen). - 2. �rja: :q! . + 2. Írja: :q! . ----> Ezzel kil�p a szerkeszt�b�l a v�ltoz�sok MENT�SE N�LK�L. - Ha menteni szeretn� a v�ltoz�sokat �s kil�pni, �rja: +---> Ezzel kilép a szerkesztőből a változások MENTÉSE NÉLKÜL. + Ha menteni szeretné a változásokat és kilépni, írja: :wq - 3. Amikor a shell promptot l�tja, �rja be a parancsot, amely ebbe az - oktat�ba hozza: - Ez val�sz�n�leg: vimtutor - Norm�lis esetben ezt �rn�: vim tutor.hu + 3. Amikor a shell promptot látja, írja be a parancsot, amely ebbe az + oktatóba hozza: + Ez valószínűleg: vimtutor + Normális esetben ezt írná: vim tutor.hu ----> 'vim' jelenti a vimbe bel�p�st, 'tutor.hu' a f�jl, amit szerkeszteni k�v�n. +---> 'vim' jelenti a vimbe belépést, 'tutor.hu' a fájl, amit szerkeszteni kíván. - 4. Ha megjegyezte a l�p�seket �s biztos mag�ban, hajtsa v�gre a l�p�seket - 1-t�l 3-ig, hogy kil�pjen �s visszat�rjen a szerkeszt�be. Azut�n - menjen az 1.1.3. leck�re. + 4. Ha megjegyezte a lépéseket és biztos magában, hajtsa végre a lépéseket + 1-től 3-ig, hogy kilépjen és visszatérjen a szerkesztőbe. Azután + menjen az 1.1.3. leckére. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.3. lecke: SZ�VEG SZERKESZT�SE - T�RL�S + 1.1.3. lecke: SZÖVEG SZERKESZTÉSE - TÖRLÉS -** Norm�l m�dban nyomjon x-et, hogy a kurzor alatti karaktert t�r�lje. ** +** Normál módban nyomjon x-et, hogy a kurzor alatti karaktert törölje. ** - 1. Mozgassa a kurzort a ---> kezdet� sorra! + 1. Mozgassa a kurzort a ---> kezdetű sorra! - 2. A hib�k kijav�t�s�hoz mozgassa a kurzort am�g a t�rlend� karakter - f�l� nem �r. + 2. A hibák kijavításához mozgassa a kurzort amíg a törlendő karakter + fölé nem ér. - 3. Nyomja meg az x gombot, hogy t�r�lje a nem k�v�nt karaktert. + 3. Nyomja meg az x gombot, hogy törölje a nem kívánt karaktert. - 4. Ism�telje a 2, 3, 4-es l�p�seket, hogy kijav�tsa a mondatot. + 4. Ismételje a 2, 3, 4-es lépéseket, hogy kijavítsa a mondatot. ----> ��szi �jjjell izziik aa galaggonya rruuh�ja. +---> ŐŐszi éjjjell izziik aa galaggonya rruuhája. - 5. Ha a sor helyes, ugorjon a 1.1.4. leck�re. + 5. Ha a sor helyes, ugorjon a 1.1.4. leckére. -MEGJ: A tanul�s sor�n ne memoriz�lni pr�b�ljon, hanem haszn�lat sor�n tanuljon. +MEGJ: A tanulás során ne memorizálni próbáljon, hanem használat során tanuljon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.4. lecke: SZ�VEG SZERKESZT�SE - BESZ�R�S + 1.1.4. lecke: SZÖVEG SZERKESZTÉSE - BESZÚRÁS - ** Norm�l m�dban i megnyom�s�val lehet beilleszteni. ** + ** Normál módban i megnyomásával lehet beilleszteni. ** - 1. Az al�bbi els� ---> kezdet� sorra menjen. + 1. Az alábbi első ---> kezdetű sorra menjen. - 2. Ahhoz, hogy az els�t azonoss� tegye a m�sodikkal, mozgassa a kurzort - az els� karakterre, amely UT�N sz�veget kell besz�rni. + 2. Ahhoz, hogy az elsőt azonossá tegye a másodikkal, mozgassa a kurzort + az első karakterre, amely UTÁN szöveget kell beszúrni. - 3. Nyomjon i-t �s �rja be a megfelel� sz�veget. + 3. Nyomjon i-t és írja be a megfelelő szöveget. - 4. Amikor mindent be�rt, nyomjon -et, hogy Norm�l m�dba visszat�rjen. - Ism�telje a 2 �s 4 k�z�tti l�p�seket, hogy kijav�tsa a mondatot. + 4. Amikor mindent beírt, nyomjon -et, hogy Normál módba visszatérjen. + Ismételje a 2 és 4 közötti lépéseket, hogy kijavítsa a mondatot. ----> Az �that� so�l hizik p�r �sz. ----> Az itt l�that� sorb�l hi�nyzik p�r r�sz. +---> Az átható soól hizik pár ész. +---> Az itt látható sorból hiányzik pár rész. - 5. Ha m�r begyakorolta a besz�r�st, menjen az al�bbi �sszefoglal�ra. + 5. Ha már begyakorolta a beszúrást, menjen az alábbi összefoglalóra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1. LECKE �SSZEFOGLAL�JA + 1.1. LECKE ÖSSZEFOGLALÓJA 1. A kurzort vagy a nyilakkal vagy a hjkl gombokkal mozgathatja. h (balra) j (le) k (fel) l (jobbra) - 2. A Vimbe (a $ promptt�l) �gy l�phet be: vim FILENAME + 2. A Vimbe (a $ prompttól) így léphet be: vim FILENAME - 3. A Vimb�l �gy l�phet ki: :q! a v�ltoztat�sok eldob�s�val. - vagy �gy: :wq a v�ltoz�sok ment�s�vel. + 3. A Vimből így léphet ki: :q! a változtatások eldobásával. + vagy így: :wq a változások mentésével. - 4. A kurzor alatti karakter t�rl�se norm�l m�dban: x + 4. A kurzor alatti karakter törlése normál módban: x - 5. Sz�veg besz�r�sa a kurzor ut�n norm�l m�dban: - i g�pelje be a sz�veget + 5. Szöveg beszúrása a kurzor után normál módban: + i gépelje be a szöveget -MEGJ: Az megnyom�sa norm�l m�dba viszi, vagy megszak�t egy nem befejezett - r�szben befejezett parancsot. +MEGJ: Az megnyomása normál módba viszi, vagy megszakít egy nem befejezett + részben befejezett parancsot. -Most folytassuk a 1.2. leck�vel! +Most folytassuk a 1.2. leckével! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.1. lecke: T�RL� UTAS�T�SOK + 1.2.1. lecke: TÖRLŐ UTASÍTÁSOK - ** dw t�r�l a sz� v�g�ig. ** + ** dw töröl a szó végéig. ** - 1. Nyomjon -et, hogy megbizonyosodjon, hogy norm�l m�dban van! + 1. Nyomjon -et, hogy megbizonyosodjon, hogy normál módban van! - 2. Mozgassa a kurzort a ---> kezdet� sorra! + 2. Mozgassa a kurzort a ---> kezdetű sorra! - 3. Mozgassa a kurzort arra annak a sz�nak az elej�re, amit t�r�lni szeretne. - T�r�lje az �llatokat a mondatb�l. + 3. Mozgassa a kurzort arra annak a szónak az elejére, amit törölni szeretne. + Törölje az állatokat a mondatból. - 4. A sz� t�rl�s�hez �rja: dw + 4. A szó törléséhez írja: dw - MEGJ: Ha rosszul kezdte az utas�t�st csak nyomjon gombot - a megszak�t�s�hoz. + MEGJ: Ha rosszul kezdte az utasítást csak nyomjon gombot + a megszakításához. ----> P�r sz� kutya nem uhu illik pingvin a mondatba teh�n. +---> Pár szó kutya nem uhu illik pingvin a mondatba tehén. - 5. Ism�telje a 3 �s 4 k�z�tti utas�t�sokat am�g kell �s ugorjon a 1.2.2 leck�re! + 5. Ismételje a 3 és 4 közötti utasításokat amíg kell és ugorjon a 1.2.2 leckére! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.2. lecke: M�G T�BB T�RL� UTAS�T�S + 1.2.2. lecke: MÉG TÖBB TÖRLŐ UTASÍTÁS - ** d$ be�r�s�val a sor v�g�ig t�r�lhet. ** + ** d$ beírásával a sor végéig törölhet. ** - 1. Nyomjon -et, hogy megbizonyosodjon, hogy norm�l m�dban van! + 1. Nyomjon -et, hogy megbizonyosodjon, hogy normál módban van! - 2. Mozgassa a kurzort a ---> kezdet� sorra! + 2. Mozgassa a kurzort a ---> kezdetű sorra! - 3. Mozgassa a kurzort a helyes sor v�g�re (az els� . UT�N)! + 3. Mozgassa a kurzort a helyes sor végére (az első . UTÁN)! - 4. d$ beg�pel�s�vel t�r�lje a sor v�g�t! + 4. d$ begépelésével törölje a sor végét! ----> Valaki a sor v�g�t k�tszer g�pelte be. k�tszer g�pelte be. +---> Valaki a sor végét kétszer gépelte be. kétszer gépelte be. - 5. Menjen a 1.2.3. leck�re, hogy meg�rtse mi t�rt�nt! + 5. Menjen a 1.2.3. leckére, hogy megértse mi történt! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.3. lecke: UTAS�T�SOKR�L �S MOZG�SOKR�L + 1.2.3. lecke: UTASÍTÁSOKRÓL ÉS MOZGÁSOKRÓL - A d (delete=t�rl�s) utas�t�s form�ja a k�vetkez�: + A d (delete=törlés) utasítás formája a következő: - [sz�m] d mozg�s VAGY d [sz�m] mozg�s + [szám] d mozgás VAGY d [szám] mozgás Ahol: - sz�m - h�nyszor hajt�djon v�gre a parancs (elhagyhat�, alap�rt�k=1). - d - a t�rl�s (delete) utas�t�s. - mozg�s - amin a parancsnak teljes�lnie kell (al�bb list�zva). + szám - hányszor hajtódjon végre a parancs (elhagyható, alapérték=1). + d - a törlés (delete) utasítás. + mozgás - amin a parancsnak teljesülnie kell (alább listázva). - Mozg�sok r�vid list�ja: - w - a kurzort�l a sz� v�g�ig, bele�rtve a sz�k�zt. - e - a kurzort�l a sz� v�g�ig, NEM bele�rtve a sz�k�zt. - $ - a kurzort�l a sor v�g�ig. + Mozgások rövid listája: + w - a kurzortól a szó végéig, beleértve a szóközt. + e - a kurzortól a szó végéig, NEM beleértve a szóközt. + $ - a kurzortól a sor végéig. -MEGJ: Csup�n a mozg�s beg�pel�s�vel (parancs n�lk�l) - a kurzor mozg�s �ltal megadott helyre ker�l. +MEGJ: Csupán a mozgás begépelésével (parancs nélkül) + a kurzor mozgás által megadott helyre kerül. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.4. lecke: EG�SZ SOROK FELDOLGOZ�SA + 1.2.4. lecke: EGÉSZ SOROK FELDOLGOZÁSA - ** dd be�r�s�val t�r�lheti az eg�sz sort. ** + ** dd beírásával törölheti az egész sort. ** - A teljes sor t�rl�s�nek gyakoris�ga miatt a Vi tervez�i elhat�rozt�k, - hogy k�nnyebb lenne csup�n a d-t k�tszer megnyomni, hogy egy sort t�r�lj�nk. + A teljes sor törlésének gyakorisága miatt a Vi tervezői elhatározták, + hogy könnyebb lenne csupán a d-t kétszer megnyomni, hogy egy sort töröljünk. - 1. Mozgassa a kurzort az al�bbi kifejez�sek m�sodik sor�ra! - 2. dd beg�pel�s�vel t�r�lje a sort! + 1. Mozgassa a kurzort az alábbi kifejezések második sorára! + 2. dd begépelésével törölje a sort! 3. Menjen a 3. (eredetileg 4.) sorra! - 4. 2dd (ugyeb�r sz�m-utas�t�s-mozg�s) beg�pel�s�vel t�r�lj�n k�t sort! + 4. 2dd (ugyebár szám-utasítás-mozgás) begépelésével töröljön két sort! - 1) Alv� szegek a j�ghideg homokban, - 2) - kezdi a k�lt� - - 3) Plak�tmag�nyban �z� �jjelek. - 4) Pingvinek ne f�ljetek, - 5) T�volr�l egy vaku villant, - 6) �gve hagytad a folyos�n a villanyt. - 7) Ma ontj�k v�remet. + 1) Alvó szegek a jéghideg homokban, + 2) - kezdi a költő - + 3) Plakátmagányban ázó éjjelek. + 4) Pingvinek ne féljetek, + 5) Távolról egy vaku villant, + 6) Égve hagytad a folyosón a villanyt. + 7) Ma ontják véremet. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.5. lecke: A VISSZAVON�S (UNDO) PARANCS + 1.2.5. lecke: A VISSZAVONÁS (UNDO) PARANCS -** u g�pel�s�vel visszavonhat� az utols� parancs, U az eg�sz sort helyre�ll�tja. ** +** u gépelésével visszavonható az utolsó parancs, U az egész sort helyreállítja. ** - 1. Menj�nk az al�bbi ---> kezdet� sor els� hib�j�ra! - 2. x lenyom�s�val t�r�lje az els� felesleges karaktert! - 3. u megnyom�s�val vonja vissza az utols�nak v�grehajtott utas�t�st! - 4. M�sodj�ra jav�tson ki minden hib�t a sorban az x utas�t�ssal! - 5. Most nagy U -val �ll�tsa vissza a sor eredeti �llapot�t! - 6. Nyomja meg az u gombot p�rszor, hogy az U �s az azt megel�z� utas�t�sokat - vissza�ll�tsa! - 7. CTRL-R (CTRL gomb lenyom�sa mellett �ss�n R-t) p�rszor csin�lja �jra a + 1. Menjünk az alábbi ---> kezdetű sor első hibájára! + 2. x lenyomásával törölje az első felesleges karaktert! + 3. u megnyomásával vonja vissza az utolsónak végrehajtott utasítást! + 4. Másodjára javítson ki minden hibát a sorban az x utasítással! + 5. Most nagy U -val állítsa vissza a sor eredeti állapotát! + 6. Nyomja meg az u gombot párszor, hogy az U és az azt megelőző utasításokat + visszaállítsa! + 7. CTRL-R (CTRL gomb lenyomása mellett üssön R-t) párszor csinálja újra a visszavont parancsokat (redo)! ----> Jav��tsa a hhib�kaat ebbben a sooorban majd �ll�tsa visszaaa az eredetit. +---> Javíítsa a hhibákaat ebbben a sooorban majd állítsa visszaaa az eredetit. - 8. Ezek nagyon hasznos parancsok. Most ugorjon a 1.2. lecke �sszefoglal�j�ra. + 8. Ezek nagyon hasznos parancsok. Most ugorjon a 1.2. lecke összefoglalójára. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2. LECKE �SSZEFOGLAL�JA + 1.2. LECKE ÖSSZEFOGLALÓJA - 1. T�rl�s a kurzort�l a sz� v�g�ig: dw + 1. Törlés a kurzortól a szó végéig: dw - 2. T�rl�s a kurzort�l a sor v�g�ig: d$ + 2. Törlés a kurzortól a sor végéig: d$ - 3. Eg�sz sor t�rl�se: dd + 3. Egész sor törlése: dd - 4. Egy utas�t�s alakja norm�l m�dban: + 4. Egy utasítás alakja normál módban: - [sz�m] utas�t�s mozg�s VAGY utas�t�s [sz�m] mozg�s + [szám] utasítás mozgás VAGY utasítás [szám] mozgás ahol: - sz�m - h�nyszor ism�telj�k a parancsot - utas�t�s - mit tegy�nk, pl. d a t�rl�skor - mozg�s - mire hasson az utas�t�s, p�ld�ul w (sz�=word), - $ (a sor v�g�ig), stb. + szám - hányszor ismételjük a parancsot + utasítás - mit tegyünk, pl. d a törléskor + mozgás - mire hasson az utasítás, például w (szó=word), + $ (a sor végéig), stb. - 5. Az el�z� tett visszavon�sa (undo): u (kis u) - A sor �sszes v�ltoz�s�nak visszavon�sa: U (nagy U) - Visszavon�sok visszavon�sa: CTRL-R + 5. Az előző tett visszavonása (undo): u (kis u) + A sor összes változásának visszavonása: U (nagy U) + Visszavonások visszavonása: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.1. lecke: A BEILLESZT�S (PUT) PARANCS + 1.3.1. lecke: A BEILLESZTÉS (PUT) PARANCS - ** p le�t�s�vel az utols�nak t�r�ltet a kurzor ut�n illeszthetj�k. ** + ** p leütésével az utolsónak töröltet a kurzor után illeszthetjük. ** - 1. Mozgassuk a kurzort az al�bbi sorok els� sor�ra. + 1. Mozgassuk a kurzort az alábbi sorok első sorára. - 2. dd le�t�s�vel t�r�lj�k a sort �s elt�rol�dik a Vim puffer�ben. + 2. dd leütésével töröljük a sort és eltárolódik a Vim pufferében. - 3. Mozgassuk a kurzort azel�tt a sor EL�TTI sorba, ahov� mozgatni - szeretn�nk a t�r�lt sort. + 3. Mozgassuk a kurzort azelőtt a sor ELŐTTI sorba, ahová mozgatni + szeretnénk a törölt sort. - 4. Norm�l m�dban �rjunk p bet�t a t�r�lt sor beilleszt�s�hez. + 4. Normál módban írjunk p betűt a törölt sor beillesztéséhez. - 5. Folytassuk a 2-4. utas�t�sokkal hogy a helyes sorrendet kapjuk. + 5. Folytassuk a 2-4. utasításokkal hogy a helyes sorrendet kapjuk. d) Can you learn too? b) Violets are blue, @@ -299,352 +299,352 @@ MEGJ: Csup ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.2. lecke: AZ �T�R�S (REPLACE) PARANCS + 1.3.2. lecke: AZ ÁTÍRÁS (REPLACE) PARANCS -** r �s a karakterek le�t�s�vel a kurzor alatti karaktert megv�ltoztatjuk. ** +** r és a karakterek leütésével a kurzor alatti karaktert megváltoztatjuk. ** - 1. Mozgassuk a kurzort az els� ---> kezdet� sorra! + 1. Mozgassuk a kurzort az első ---> kezdetű sorra! - 2. Mozgassuk a kurzort az els� hiba f�l�! + 2. Mozgassuk a kurzort az első hiba fölé! - 3. r majd a k�v�nt karakter le�t�s�vel v�ltoztassuk meg a hib�sat! + 3. r majd a kívánt karakter leütésével változtassuk meg a hibásat! - 4. A 2. �s 3. l�p�sekkel jav�tsuk az �sszes hib�t! + 4. A 2. és 3. lépésekkel javítsuk az összes hibát! ---> Whan this lime was tuoed in, someone presswd some wrojg keys! ---> When this line was typed in, someone pressed some wrong keys! - 5. Menj�nk a 1.3.2. leck�re! + 5. Menjünk a 1.3.2. leckére! -MEGJ: Eml�kezzen, hogy nem memoriz�l�ssal, hanem gyakorl�ssal tanuljon. +MEGJ: Emlékezzen, hogy nem memorizálással, hanem gyakorlással tanuljon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.3.3. lecke: A CSERE (CHANGE) PARANCS - ** A sz� egy r�sz�nek megv�ltoztat�s�hoz �rjuk: cw . ** + ** A szó egy részének megváltoztatásához írjuk: cw . ** - 1. Mozgassuk a kurzort az els� ---> kezdet� sorra! + 1. Mozgassuk a kurzort az első ---> kezdetű sorra! - 2. Vigye a kurzort a Ezen sz� z bet�je f�l�! + 2. Vigye a kurzort a Ezen szó z betűje fölé! - 3. cw �s a helyes sz�r�sz (itt 'bben') be�r�s�val jav�tsa a sz�t! + 3. cw és a helyes szórész (itt 'bben') beírásával javítsa a szót! - 4. lenyom�sa ut�n a k�vetkez� hib�ra ugorjon (az els� cser�lend� + 4. lenyomása után a következő hibára ugorjon (az első cserélendő karakterre)! - 5. A 3. �s 4. l�p�sek ism�tl�s�vel az els� mondatot tegye a m�sodikkal - azonoss�! + 5. A 3. és 4. lépések ismétlésével az első mondatot tegye a másodikkal + azonossá! ----> Ezen a sorrrrr p�r sz�ra meg kell v�ltozzanak a change utask�r�s�. ----> Ebben a sorban p�r sz�t meg kell v�ltoztatni a change utas�t�ssal. +---> Ezen a sorrrrr pár szóra meg kell változzanak a change utaskíréső. +---> Ebben a sorban pár szót meg kell változtatni a change utasítással. -Vegy�k �szre, hogy a cw nem csak a sz�t �rja �t, hanem besz�r� -(insert) m�dba v�lt. +Vegyük észre, hogy a cw nem csak a szót írja át, hanem beszúró +(insert) módba vált. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.4. lecke: T�BBF�LE V�LTOZTAT�S c-VEL + 1.3.4. lecke: TÖBBFÉLE VÁLTOZTATÁS c-VEL - ** A c utas�t�s haszn�lhat� ugyanazokkal az mozg�sokkal mint a t�rl�s ** + ** A c utasítás használható ugyanazokkal az mozgásokkal mint a törlés ** - 1. A change utas�t�s a t�rl�ssel azonosan viselkedik. A forma: + 1. A change utasítás a törléssel azonosan viselkedik. A forma: - [sz�m] c mozg�s OR c [sz�m] mozg�s + [szám] c mozgás OR c [szám] mozgás - 2. A mozg�sok is azonosak, pl. w (sz�), $ (sorv�g), stb. + 2. A mozgások is azonosak, pl. w (szó), $ (sorvég), stb. - 3. Mozgassuk a kurzort az els� ---> kezdet� sorra! + 3. Mozgassuk a kurzort az első ---> kezdetű sorra! - 4. Menj�nk az els� hib�ra! + 4. Menjünk az első hibára! - 5. c$ beg�pel�s�vel a sorv�geket tegy�k azonoss� �s nyomjunk -et! + 5. c$ begépelésével a sorvégeket tegyük azonossá és nyomjunk -et! ----> Ennek a sornak a v�ge kiigaz�t�sra szorul, hogy megegyezzen a m�sodikkal. ----> Ennek a sornak a v�ge a c$ paranccsal v�ltoztathat� meg. +---> Ennek a sornak a vége kiigazításra szorul, hogy megegyezzen a másodikkal. +---> Ennek a sornak a vége a c$ paranccsal változtatható meg. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3. LECKE �SSZEFOGLAL�JA + 1.3. LECKE ÖSSZEFOGLALÓJA - 1. A m�r t�r�lt sort beilleszt�s�hez nyomjunk p-t. Ez a t�r�lt sz�veget - a kurzor UT�N helyezi (ha sor ker�lt t�rl�sre, a kurzor alatti sorba). + 1. A már törölt sort beillesztéséhez nyomjunk p-t. Ez a törölt szöveget + a kurzor UTÁN helyezi (ha sor került törlésre, a kurzor alatti sorba). - 2. A kurzor alatti karakter �t�r�s�hoz az r-et �s azt a karaktert - nyomjuk, amellyel az eredetit fel�l szeretn�nk �rni. + 2. A kurzor alatti karakter átírásához az r-et és azt a karaktert + nyomjuk, amellyel az eredetit felül szeretnénk írni. - 3. A v�ltoztat�s (c) utas�t�s a karaktert�l az mozg�s v�g�ig - v�ltoztatja meg az mozg�st. P�ld�ul a cw a kurzort�l a sz� v�g�ig, - a c$ a sor v�g�ig. + 3. A változtatás (c) utasítás a karaktertől az mozgás végéig + változtatja meg az mozgást. Például a cw a kurzortól a szó végéig, + a c$ a sor végéig. - 4. A v�ltoztat�s form�tuma: + 4. A változtatás formátuma: - [sz�m] c mozg�s VAGY c [sz�m] mozg�s + [szám] c mozgás VAGY c [szám] mozgás -Ugorjunk a k�vetkez� leck�re! +Ugorjunk a következő leckére! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.1. lecke: HELY �S F�JL�LLAPOT + 1.4.1. lecke: HELY ÉS FÁJLÁLLAPOT - ** CTRL-g megnyom�s�val megn�zhetj�k a hely�nket a f�jlban �s a f�jl �llapot�t. - SHIFT-G le�t�s�vel a f�jl adott sor�ra ugorhatunk. ** + ** CTRL-g megnyomásával megnézhetjük a helyünket a fájlban és a fájl állapotát. + SHIFT-G leütésével a fájl adott sorára ugorhatunk. ** - Megj: Olvassuk el az eg�sz leck�t a l�p�sek v�grehajt�sa el�tt!! + Megj: Olvassuk el az egész leckét a lépések végrehajtása előtt!! - 1. Tartsuk nyomva a Ctrl gombot �s nyomjunk g-t. Az �llapotsor - megjelenik a lap alj�n a f�jln�vvel �s az aktu�lis sor sorsz�m�val. - Jegyezz�k meg a sorsz�mot a 3. l�p�shez! + 1. Tartsuk nyomva a Ctrl gombot és nyomjunk g-t. Az állapotsor + megjelenik a lap alján a fájlnévvel és az aktuális sor sorszámával. + Jegyezzük meg a sorszámot a 3. lépéshez! - 2. Nyomjunk Shift-G-t a lap alj�ra ugr�shoz! + 2. Nyomjunk Shift-G-t a lap aljára ugráshoz! - 3. �ss�k be az eredeti sor sz�m�t, majd �ss�nk shift-G-t! Ezzel + 3. Üssük be az eredeti sor számát, majd üssünk shift-G-t! Ezzel visszajutunk az eredeti sorra ahol Ctrl-g-t nyomtunk. - (A be�rt sz�m NEM fog megjelenni a k�perny�n.) + (A beírt szám NEM fog megjelenni a képernyőn.) - 4. Ha megjegyezte a feladatot, hajtsa v�gre az 1-3. l�p�seket! + 4. Ha megjegyezte a feladatot, hajtsa végre az 1-3. lépéseket! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.2. lecke: A KERES�S (SEARCH) PARANCS + 1.4.2. lecke: A KERESÉS (SEARCH) PARANCS - ** / majd a k�v�nt kifejez�s be�r�s�val kereshetj�k meg a kifejez�st. ** + ** / majd a kívánt kifejezés beírásával kereshetjük meg a kifejezést. ** - 1. Norm�l m�dban �ss�nk / karaktert! Ez �s a kurzor megjelenik - a k�perny� alj�n, ahogy a : utas�t�s is. + 1. Normál módban üssünk / karaktert! Ez és a kurzor megjelenik + a képernyő alján, ahogy a : utasítás is. - 2. �rjuk be: 'hiibaa' ! Ez az a sz� amit keres�nk. + 2. Írjuk be: 'hiibaa' ! Ez az a szó amit keresünk. - 3. A kifejez�s �jabb keres�s�hez �ss�k le egyszer�en: n . - A kifejez�s ellenkez� ir�nyban t�rt�n� keres�s�hez ezt �ss�k be: Shift-N . + 3. A kifejezés újabb kereséséhez üssük le egyszerűen: n . + A kifejezés ellenkező irányban történő kereséséhez ezt üssük be: Shift-N . - 4. Ha visszafel� szeretne keresni, akkor ? kell a / helyett. + 4. Ha visszafelé szeretne keresni, akkor ? kell a / helyett. ----> "hiibaa" nem a helyes m�dja a hiba le�r�s�nak; a hiibaa egy hiba. +---> "hiibaa" nem a helyes módja a hiba leírásának; a hiibaa egy hiba. -Megj: Ha a keres�s el�ri a f�jl v�g�t, akkor az elej�n kezdi. +Megj: Ha a keresés eléri a fájl végét, akkor az elején kezdi. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.3. lecke: Z�R�JELEK P�RJ�NAK KERES�SE + 1.4.3. lecke: ZÁRÓJELEK PÁRJÁNAK KERESÉSE - ** % le�t�s�vel megtal�ljuk a ),], vagy } p�rj�t. ** + ** % leütésével megtaláljuk a ),], vagy } párját. ** - 1. Helyezze a kurzort valamelyik (, [, vagy { z�r�jelre a ---> kezdet� + 1. Helyezze a kurzort valamelyik (, [, vagy { zárójelre a ---> kezdetű sorban! - 2. �ss�n % karaktert! + 2. Üssön % karaktert! - 3. A kurzor a z�r�jel p�rj�ra fog ugrani. + 3. A kurzor a zárójel párjára fog ugrani. - 4. % le�t�s�vel visszaugrik az eredeti z�r�jelre. + 4. % leütésével visszaugrik az eredeti zárójelre. ----> Ez ( egy tesztsor (-ekkel, [-ekkel ] �s {-ekkel } a sorban. )) +---> Ez ( egy tesztsor (-ekkel, [-ekkel ] és {-ekkel } a sorban. )) Megj: Ez nagyon hasznos, ha olyan programot debugolunk, amelyben a - z�r�jelek nem p�rosak! + zárójelek nem párosak! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.4. lecke: A HIB�K KIJAV�T�S�NAK EGY M�DJA + 1.4.4. lecke: A HIBÁK KIJAVÍTÁSÁNAK EGY MÓDJA - ** :s/r�gi/�j/g beg�pel�s�vel az '�j'-ra cser�lj�k a 'r�gi'-t. ** + ** :s/régi/új/g begépelésével az 'új'-ra cseréljük a 'régi'-t. ** - 1. Menj�nk a ---> kezdet� sorra! + 1. Menjünk a ---> kezdetű sorra! - 2. �rjuk be: :s/eggy/egy . Ekkor csak az els� v�ltozik meg a + 2. Írjuk be: :s/eggy/egy . Ekkor csak az első változik meg a sorban. - 3. Most ezt �rjuk: :s/eggy/egg/g amely glob�lisan helyettes�t - a sorban, azaz minden el�fordul�st. - Ez a sorban minden el�fordul�st helyettes�t. + 3. Most ezt írjuk: :s/eggy/egg/g amely globálisan helyettesít + a sorban, azaz minden előfordulást. + Ez a sorban minden előfordulást helyettesít. ----> eggy heggy meggy, szembe j�n eggy m�sik heggy. +---> eggy heggy meggy, szembe jön eggy másik heggy. - 4. K�t sor k�z�tt a karaktersor minden el�fordul�s�nak helyettes�t�se: - :#,#s/r�gi/�j/g ahol #,# a k�t sor sorsz�ma. - :%s/r�gi/�j/g a f�jlbeli �sszes el�fordul�s helyettes�t�se. + 4. Két sor között a karaktersor minden előfordulásának helyettesítése: + :#,#s/régi/új/g ahol #,# a két sor sorszáma. + :%s/régi/új/g a fájlbeli összes előfordulás helyettesítése. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4. LECKE �SSZEFOGLAL�JA + 1.4. LECKE ÖSSZEFOGLALÓJA - 1. Ctrl-g ki�rja az kurzor hely�t a f�jlban �s a f�jl �llapot�t. - Shift-G a f�jl v�g�re megy, gg az elej�re. Egy sz�m ut�n - Shift-G az adott sz�m� sorra ugrik. + 1. Ctrl-g kiírja az kurzor helyét a fájlban és a fájl állapotát. + Shift-G a fájl végére megy, gg az elejére. Egy szám után + Shift-G az adott számú sorra ugrik. - 2. / ut�n egy kifejez�s EL�REFELE keresi a kifejez�st. - 2. ? ut�n egy kifejez�s VISSZAFELE keresi a kifejez�st. - Egy keres�s ut�n az n a k�vetkez� el�fordul�st keresi azonos ir�nyban - Shift-N az ellenkez� ir�nyban keres. + 2. / után egy kifejezés ELŐREFELE keresi a kifejezést. + 2. ? után egy kifejezés VISSZAFELE keresi a kifejezést. + Egy keresés után az n a következő előfordulást keresi azonos irányban + Shift-N az ellenkező irányban keres. - 3. % beg�pel�s�vel, ha (,),[,],{, vagy } karakteren vagyunk a z�r�jel - p�rj�ra ugrik. + 3. % begépelésével, ha (,),[,],{, vagy } karakteren vagyunk a zárójel + párjára ugrik. - 4. az els� r�gi helyettes�t�se �jjal a sorban :s/r�gi/�j - az �sszes r�gi helyettes�t�se �jjal a sorban :s/r�gi/�j/g - k�t sor k�z�tti kifejez�sekre :#,#s/r�gi/�j/g - # hely�n az aktu�lis sor (.) �s az utols� ($) is �llhat :.,$/r�gi/�j/g - A f�jlbeli �sszes el�fordul�s helyettes�t�se :%s/r�gi/�j/g - Mindenkori meger�s�t�sre v�r 'c' hat�s�ra :%s/r�gi/�j/gc + 4. az első régi helyettesítése újjal a sorban :s/régi/új + az összes régi helyettesítése újjal a sorban :s/régi/új/g + két sor közötti kifejezésekre :#,#s/régi/új/g + # helyén az aktuális sor (.) és az utolsó ($) is állhat :.,$/régi/új/g + A fájlbeli összes előfordulás helyettesítése :%s/régi/új/g + Mindenkori megerősítésre vár 'c' hatására :%s/régi/új/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.1. lecke: K�LS� PARANCS V�GREHAJT�SA + 1.5.1. lecke: KÜLSŐ PARANCS VÉGREHAJTÁSA - ** :! ut�n k�ls� parancsot �rva v�grehajt�dik a parancs. ** + ** :! után külső parancsot írva végrehajtódik a parancs. ** - 1. �rjuk be az ismer�s : parancsot, hogy a kurzort a k�perny� alj�ra - helyezz�k. Ez lehet�v� teszi egy parancs be�r�s�t. + 1. Írjuk be az ismerős : parancsot, hogy a kurzort a képernyő aljára + helyezzük. Ez lehetővé teszi egy parancs beírását. - 2. ! (felki�lt�jel) be�r�s�val tegy�k lehet�v� k�ls� h�j (shell)-parancs - v�grehajt�s�t. + 2. ! (felkiáltójel) beírásával tegyük lehetővé külső héj (shell)-parancs + végrehajtását. - 3. �rjunk p�ld�ul ls parancsot a ! ut�n majd �ss�nk -t. Ez ki - fogja list�zni a k�nyvt�runkat ugyan�gy, mintha a shell promptn�l - lenn�nk. Vagy �rja ezt :!dir ha az ls nem m�k�dik. + 3. Írjunk például ls parancsot a ! után majd üssünk -t. Ez ki + fogja listázni a könyvtárunkat ugyanúgy, mintha a shell promptnál + lennénk. Vagy írja ezt :!dir ha az ls nem működik. -Megj: Ilym�don b�rmely k�ls� utas�t�s v�grehajthat�. +Megj: Ilymódon bármely külső utasítás végrehajtható. -Megj: Minden : parancs ut�n -t kell �tni. +Megj: Minden : parancs után -t kell ütni. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.2. lecke: B�VEBBEN A F�JLOK �R�S�R�L + 1.5.2. lecke: BŐVEBBEN A FÁJLOK ÍRÁSÁRÓL - ** A f�jlok v�ltoz�sait �gy �rhatjuk ki :w F�JLN�V. ** + ** A fájlok változásait így írhatjuk ki :w FÁJLNÉV. ** - 1. :!dir vagy :!ls be�r�s�val list�zzuk a k�nyvt�runkat! - �n m�r tudja, hogy -t kell �tnie ut�na. + 1. :!dir vagy :!ls beírásával listázzuk a könyvtárunkat! + Ön már tudja, hogy -t kell ütnie utána. - 2. V�lasszon egy f�jlnevet, amely m�g nem l�tezik pl. TESZT! + 2. Válasszon egy fájlnevet, amely még nem létezik pl. TESZT! - 3. �rja: :w TESZT (ahol TESZT a v�lasztott f�jln�v)! + 3. Írja: :w TESZT (ahol TESZT a választott fájlnév)! - 4. Ez elmenti a teljes f�jlt (a Vim oktat�j�t) TESZT n�ven. - Ellen�rz�sk�pp �rjuk ism�t :!dir hogy l�ssuk a k�nyvt�rat! - (Felfel� gombbal : ut�n az el�z� utas�t�sok visszahozhat�ak.) + 4. Ez elmenti a teljes fájlt (a Vim oktatóját) TESZT néven. + Ellenőrzésképp írjuk ismét :!dir hogy lássuk a könyvtárat! + (Felfelé gombbal : után az előző utasítások visszahozhatóak.) -Megj: Ha �n kil�pne a Vimb�l �s �s visszat�rne a TESZT f�jln�vvel, akkor a - f�jl az oktat� ment�skori pontos m�solata lenne. +Megj: Ha Ön kilépne a Vimből és és visszatérne a TESZT fájlnévvel, akkor a + fájl az oktató mentéskori pontos másolata lenne. - 5. T�vol�tsa el a f�jlt (MS-DOS): :!del TESZT + 5. Távolítsa el a fájlt (MS-DOS): :!del TESZT vagy (Unix): :!rm TESZT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.3. lecke: EGY KIV�LASZTOTT R�SZ KI�R�SA + 1.5.3. lecke: EGY KIVÁLASZTOTT RÉSZ KIÍRÁSA - ** A f�jl egy r�sz�nek ki�r�s�hoz �rja :#,# w F�JLN�V ** + ** A fájl egy részének kiírásához írja :#,# w FÁJLNÉV ** - 1. :!dir vagy :!ls be�r�s�val list�zza a k�nyvt�rat, �s v�lasszon egy - megfelel� f�jlnevet, pl. TESZT. + 1. :!dir vagy :!ls beírásával listázza a könyvtárat, és válasszon egy + megfelelő fájlnevet, pl. TESZT. - 2. Mozgassa a kurzort ennek az oldalnak a tetej�re, �s nyomjon - Ctrl-g-t, hogy megtudja a sorsz�mot. JEGYEZZE MEG A SZ�MOT! + 2. Mozgassa a kurzort ennek az oldalnak a tetejére, és nyomjon + Ctrl-g-t, hogy megtudja a sorszámot. JEGYEZZE MEG A SZÁMOT! - 3. Most menjen a lap alj�ra, �s �sse be ism�t: Ctrl-g. EZT A SZ�MOT + 3. Most menjen a lap aljára, és üsse be ismét: Ctrl-g. EZT A SZÁMOT IS JEGYEZZE MEG! - 4. Ha csak ezt a r�sz�t szeretn� menteni a f�jlnak, �rja :#,# w TESZT - ahol #,# a k�t sorsz�m, amit megjegyzett, TESZT az �n f�jlneve. + 4. Ha csak ezt a részét szeretné menteni a fájlnak, írja :#,# w TESZT + ahol #,# a két sorszám, amit megjegyzett, TESZT az Ön fájlneve. - 5. Ism�t n�zze meg, hogy a f�jl ott van (:!dir) de NE t�r�lje. + 5. Ismét nézze meg, hogy a fájl ott van (:!dir) de NE törölje. - 6. Vimben l�tezik egy m�sik lehet�s�g: nyomja meg a Shift-V gombp�rt - az els� menteni k�v�nt soron, majd menjen le az utols�ra, ezut�n - �rja :w TESZT2 Ekkor a TESZT2 f�jlba ker�l a kijel�lt r�sz. + 6. Vimben létezik egy másik lehetőség: nyomja meg a Shift-V gombpárt + az első menteni kívánt soron, majd menjen le az utolsóra, ezután + írja :w TESZT2 Ekkor a TESZT2 fájlba kerül a kijelölt rész. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.4. lecke: F�JLOK VISSZA�LL�T�SA �S �SSZEF�Z�SE + 1.5.4. lecke: FÁJLOK VISSZAÁLLÍTÁSA ÉS ÖSSZEFŰZÉSE - ** Egy f�jl tartalm�nak beilleszt�s�hez �rja :r F�JLN�V ** + ** Egy fájl tartalmának beillesztéséhez írja :r FÁJLNÉV ** - 1. :!dir be�r�s�val n�zze meg, hogy az �n TESZT f�jlja l�tezik m�g. + 1. :!dir beírásával nézze meg, hogy az Ön TESZT fájlja létezik még. - 2. Helyezze a kurzort ennek az oldalnak a tetej�re. + 2. Helyezze a kurzort ennek az oldalnak a tetejére. -MEGJ: A 3. l�p�s ut�n az 1.5.3. leck�t fogja l�tni. Azut�n LEFEL� indulva - keresse meg ism�t ezt a leck�t. +MEGJ: A 3. lépés után az 1.5.3. leckét fogja látni. Azután LEFELÉ indulva + keresse meg ismét ezt a leckét. - 3. Most sz�rja be a TESZT nev� f�jlt a :r TESZT paranccsal, ahol - TESZT az �n f�jlj�nak a neve. + 3. Most szúrja be a TESZT nevű fájlt a :r TESZT paranccsal, ahol + TESZT az Ön fájljának a neve. -MEGJ: A f�jl, amit beillesztett a kurzora alatt helyezkedik el. +MEGJ: A fájl, amit beillesztett a kurzora alatt helyezkedik el. - 4. Hogy ellen�rizz�k, hogy a f�jlt t�nyleg beillesztett�k, menjen - vissza, �s n�zze meg, hogy k�tszer szerepel az 1.5.3. lecke! Az eredeti - mellett a f�jlb�l bem�solt is ott van. + 4. Hogy ellenőrizzük, hogy a fájlt tényleg beillesztettük, menjen + vissza, és nézze meg, hogy kétszer szerepel az 1.5.3. lecke! Az eredeti + mellett a fájlból bemásolt is ott van. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5. LECKE �SSZEFOGLAL�JA + 1.5. LECKE ÖSSZEFOGLALÓJA - 1. :!parancs v�grehajt egy k�ls� utas�t�st. + 1. :!parancs végrehajt egy külső utasítást. - P�r hasznos p�lda: + Pár hasznos példa: (MS-DOS) (Unix) - :!dir :!ls - k�nyvt�rlista ki�r�sa. - :!del F�JLN�V :!rm F�JLN�V - F�JLN�V nev� f�jl t�rl�se. + :!dir :!ls - könyvtárlista kiírása. + :!del FÁJLNÉV :!rm FÁJLNÉV - FÁJLNÉV nevű fájl törlése. - 2. :w F�JLN�V ki�rja a jelenlegi Vim-f�jlt a lemezre F�JN�V n�ven. + 2. :w FÁJLNÉV kiírja a jelenlegi Vim-fájlt a lemezre FÁJNÉV néven. - 3. :#,#w F�JLN�V ki�rja a k�t sorsz�m (#) k�z�tti sorokat F�JLN�V-be - M�sik lehet�s�g, hogy a kezd�sorn�l Shift-v-t nyom lemegy az utols� - sorra, majd ezt �ti be :w F�JLN�V + 3. :#,#w FÁJLNÉV kiírja a két sorszám (#) közötti sorokat FÁJLNÉV-be + Másik lehetőség, hogy a kezdősornál Shift-v-t nyom lemegy az utolsó + sorra, majd ezt üti be :w FÁJLNÉV - 4. :r F�JLN�V beolvassa a F�JLN�V f�jlt �s behelyezi a jelenlegi f�jlba - a kurzorpoz�ci� ut�ni sorba. + 4. :r FÁJLNÉV beolvassa a FÁJLNÉV fájlt és behelyezi a jelenlegi fájlba + a kurzorpozíció utáni sorba. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.1. lecke: A MEGNYIT�S (OPEN) PARANCS + 1.6.1. lecke: A MEGNYITÁS (OPEN) PARANCS -** o be�r�s�val nyit egy �j sort a kurzor alatt �s besz�r� m�dba v�lt ** +** o beírásával nyit egy új sort a kurzor alatt és beszúró módba vált ** - 1. Mozgassuk a kurzort a ---> kezdet� sorra. + 1. Mozgassuk a kurzort a ---> kezdetű sorra. - 2. o (kicsi) be�r�s�val nyisson egy sort a kurzor ALATT! Ekkor - automatikusan besz�r� (insert) m�dba ker�l. + 2. o (kicsi) beírásával nyisson egy sort a kurzor ALATT! Ekkor + automatikusan beszúró (insert) módba kerül. - 3. M�solja le a ---> jel� sort �s megnyom�s�val l�pjen ki - a besz�r� m�db�l. + 3. Másolja le a ---> jelű sort és megnyomásával lépjen ki + a beszúró módból. ----> Az o lenyom�sa ut�n a kurzor a k�vetkez� sor elej�n �ll besz�r� m�dban. +---> Az o lenyomása után a kurzor a következő sor elején áll beszúró módban. - 4. A kurzor FELETTI sor megnyit�s�hoz egyszer�en nagy O bet�t �rjon -kicsi helyett. Pr�b�lja ki a k�vetkez� soron! -Nyisson egy �j sort efelett Shift-O megnyom�s�val, mialatt a kurzor -ezen a soron �ll. + 4. A kurzor FELETTI sor megnyitásához egyszerűen nagy O betűt írjon +kicsi helyett. Próbálja ki a következő soron! +Nyisson egy új sort efelett Shift-O megnyomásával, mialatt a kurzor +ezen a soron áll. @@ -654,89 +654,89 @@ ezen a soron 1.6.2. lecke: AZ APPEND PARANCS - ** a lenyom�s�val a kurzor UT�N sz�rhatunk sz�veget. ** + ** a lenyomásával a kurzor UTÁN szúrhatunk szöveget. ** - 1. Mozgassuk a kurzort a k�vetkez� ---> kezdet� sor v�g�re �gy, - hogy norm�l m�dban $-t �r be. + 1. Mozgassuk a kurzort a következő ---> kezdetű sor végére úgy, + hogy normál módban $-t ír be. - 2. Kis "a" le�t�s�vel sz�veget sz�rhat be AM�G� a karakter m�g�, - amelyen a kurzor �ll. - (A nagy "A" az eg�sz sor v�g�re �rja a sz�veget.) + 2. Kis "a" leütésével szöveget szúrhat be AMÖGÉ a karakter mögé, + amelyen a kurzor áll. + (A nagy "A" az egész sor végére írja a szöveget.) -Megj: A Vimben a sor legv�g�re is lehet �llni, azonban ez el�dj�ben - a Vi-ban nem lehets�ges, ez�rt abban az a n�lk�l el�g k�r�lm�nyes - a sor v�g�hez sz�veget �rni. +Megj: A Vimben a sor legvégére is lehet állni, azonban ez elődjében + a Vi-ban nem lehetséges, ezért abban az a nélkül elég körülményes + a sor végéhez szöveget írni. - 3. Eg�sz�tse ki az els� sort. Vegye �szre, hogy az a utas�t�s (append) - teljesen egyezik az i-vel (insert) csup�n a besz�rt sz�veg helye - k�l�nb�zik. + 3. Egészítse ki az első sort. Vegye észre, hogy az a utasítás (append) + teljesen egyezik az i-vel (insert) csupán a beszúrt szöveg helye + különbözik. ----> Ez a sor lehet�v� teszi �nnek, hogy gyakorolja ----> Ez a sor lehet�v� teszi �nnek, hogy gyakorolja a sor v�g�re beilleszt�st. +---> Ez a sor lehetővé teszi Önnek, hogy gyakorolja +---> Ez a sor lehetővé teszi Önnek, hogy gyakorolja a sor végére beillesztést. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.3. lecke: AZ �T�R�S M�SIK V�LTOZATA + 1.6.3. lecke: AZ ÁTÍRÁS MÁSIK VÁLTOZATA - ** Nagy R be�r�s�val �rhat fel�l t�bb mint egy karaktert. ** + ** Nagy R beírásával írhat felül több mint egy karaktert. ** - 1. Mozgassuk a kurzort az els� ---> kezdet� sorra! + 1. Mozgassuk a kurzort az első ---> kezdetű sorra! - 2. Helyezze a kurzort az els� sz� elej�re amely elt�r a m�sodik - ---> kezdet� sor tartalm�t�l (a 'az utols�val' r�szt�l). + 2. Helyezze a kurzort az első szó elejére amely eltér a második + ---> kezdetű sor tartalmától (a 'az utolsóval' résztől). - 3. Nyomjon R karaktert �s �rja �t a sz�veg marad�k�t az els� sorban - �gy, hogy a k�t sor egyez� legyen. + 3. Nyomjon R karaktert és írja át a szöveg maradékát az első sorban + úgy, hogy a két sor egyező legyen. ----> Az els� sort tegye azonoss� az utols�val: haszn�lja a gombokat. ----> Az els� sort tegye azonoss� a m�sodikkal: �rjon R-t �s az �j sz�veget. +---> Az első sort tegye azonossá az utolsóval: használja a gombokat. +---> Az első sort tegye azonossá a másodikkal: írjon R-t és az új szöveget. - 4. Jegyezz�k meg, ha -et nyomok, akkor a v�ltozatlanul hagyott - sz�vegek v�ltozatlanok maradnak. + 4. Jegyezzük meg, ha -et nyomok, akkor a változatlanul hagyott + szövegek változatlanok maradnak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.4. lecke: BE�LL�T�SOK + 1.6.4. lecke: BEÁLLÍTÁSOK -** �ll�tsuk be, hogy a keres�s �s a helyettes�t�s ne f�ggj�n kis/NAGYbet�kt�l ** +** Állítsuk be, hogy a keresés és a helyettesítés ne függjön kis/NAGYbetűktől ** - 1. Keress�k meg az 'ignore'-t az be�rva: + 1. Keressük meg az 'ignore'-t az beírva: /ignore - Ezt ism�telj�k t�bbsz�r az n billenty�vel + Ezt ismételjük többször az n billentyűvel - 2. �ll�tsuk be az 'ic' (Ignore case) lehet�s�get �gy: + 2. Állítsuk be az 'ic' (Ignore case) lehetőséget így: :set ic - 3. Most keress�nk ism�t az 'ignore'-ra n-nel - Ism�telj�k meg t�bbsz�r a keres�st: n + 3. Most keressünk ismét az 'ignore'-ra n-nel + Ismételjük meg többször a keresést: n - 4. �ll�tsuk be a 'hlsearch' �s 'incsearch' lehet�s�geket: + 4. Állítsuk be a 'hlsearch' és 'incsearch' lehetőségeket: :set hls is - 5. Most ism�t �rjuk be a keres�parancsot, �s l�ssuk mi t�rt�nik: + 5. Most ismét írjuk be a keresőparancsot, és lássuk mi történik: /ignore - 6. A kiemel�st sz�ntess�k meg al�bbi utas�t�sok egyik�vel: + 6. A kiemelést szüntessük meg alábbi utasítások egyikével: :set nohls vagy :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6. LECKE �SSZEFOGLAL�JA + 1.6. LECKE ÖSSZEFOGLALÓJA - 1. o be�r�s�val �j sort nyitunk meg a sor ALATT �s a kurzor az �j - sorban lesz besz�r�s-m�dban. - Nagy O a sor FELETT nyit �j sort, �s oda ker�l a kurzor. + 1. o beírásával új sort nyitunk meg a sor ALATT és a kurzor az új + sorban lesz beszúrás-módban. + Nagy O a sor FELETT nyit új sort, és oda kerül a kurzor. - 2. a be�r�s�val az aktu�lis karaktert�l UT�N (jobbra) sz�rhatunk be sz�veget. - Nagy A automatikusan a sor legv�g�hez adja hozz� a sz�veget. + 2. a beírásával az aktuális karaktertől UTÁN (jobbra) szúrhatunk be szöveget. + Nagy A automatikusan a sor legvégéhez adja hozzá a szöveget. - 3. A nagy R be�t�s�vel �t�r� (replace) m�dba ker�l�nk lenyom�s�ig. + 3. A nagy R beütésével átíró (replace) módba kerülünk lenyomásáig. - 4. ":set xxx" be�r�s�val az "xxx" opci� �ll�that� be. + 4. ":set xxx" beírásával az "xxx" opció állítható be. @@ -747,21 +747,21 @@ Megj: A Vimben a sor legv ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.7. lecke: AZ ON-LINE S�G� PARANCSAI + 1.7. lecke: AZ ON-LINE SÚGÓ PARANCSAI - ** Az online s�g�rendszer haszn�lata ** + ** Az online súgórendszer használata ** - A Vim r�szletes s�g�val rendelkezik. Indul�shoz a k�vetkez�k egyik�t + A Vim részletes súgóval rendelkezik. Induláshoz a következők egyikét tegye: - nyomja meg a gombot (ha van ilyen) - nyomja meg az gombot (ha van ilyen) - - �rja be: :help + - írja be: :help - :q be�r�s�val z�rhatja be a s�g�ablakot. + :q beírásával zárhatja be a súgóablakot. - Majdnem minden t�mak�rr�l tal�lhat s�g�t, argumentum megad�s�val - ":help" utas�t�s . Pr�b�lja az al�bbiakat ki (-t ne felejts�k): + Majdnem minden témakörről találhat súgót, argumentum megadásával + ":help" utasítás . Próbálja az alábbiakat ki (-t ne felejtsük): :help w :help c_, 2006-2012 + Magyarította: Horváth Árpád , 2006-2012 diff --git a/runtime/tutor/tutor1.hu.cp1250 b/runtime/tutor/tutor1.hu.cp1250 deleted file mode 100644 index 2e86f80bbe..0000000000 --- a/runtime/tutor/tutor1.hu.cp1250 +++ /dev/null @@ -1,830 +0,0 @@ -=============================================================================== -== � d v � z � l j � k a V I M - o k t a t � b a n - 1.5-�s verzi� == -=============================================================================== - - A Vim egy nagyon hat�kony szerkeszt�, amelynek rengeteg utas�t�sa - van, t�l sok, hogy egy ilyen oktat�ban (tutorban), mint az itteni - mindet elmagyar�zzuk. Ez az oktat� arra t�rekszik, hogy annyit - elmagyar�zzon, amennyi el�g, hogy k�nnyed�n haszn�ljuk a Vim-et, az - �ltal�nos c�l� sz�vegszerkeszt�t. - - A feladatok megold�s�hoz 25-30 perc sz�ks�ges att�l f�gg�en, - mennyit t�lt�nk a k�s�rletez�ssel. - - A leck�ben szerepl� utas�t�sok m�dos�tani fogj�k a sz�veget. - K�sz�tsen m�solatot err�l a f�jlr�l, ha gyakorolni akar. - (Ha "vimtutor"-ral ind�totta, akkor ez m�r egy m�solat.) - - Fontos meg�rteni, hogy ez az oktat� cselekedve tan�ttat. - Ez azt jelenti, hogy �nnek aj�nlott v�grehajtania az utas�t�sokat, - hogy megfelel�en megtanulja azokat. Ha csak olvassa, elfelejti! - - Most bizonyosodjon, meg, hogy a Caps-Lock gombja NINCS lenyomva, �s - Nyomja meg megfelel� sz�m�szor a j gombot, hogy az 1.1.1-es - lecke teljesen a k�perny�n legyen! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.1. lecke: A KURZOR MOZGAT�SA - - - ** A kurzor mozgat�s�hoz nyomja meg a h,j,k,l gombokat az al�bbi szerint. ** - ^ - k Tipp: A h billenty� van balra, �s balra mozgat - < h l > A l billenty� van jobbra, �s jobbra mozgat - j A j billenty� olyan, mint egy lefele ny�l - v - 1. Mozgassa a kurzort k�rbe az ablakban, am�g hozz� nem szokik! - - 2. Tartsa lenyomva a lefel�t (j), akkor ism�tl�dik! ----> Most tudja, hogyan mehet a k�vetkez� leck�re. - - 3. A lefel� gomb haszn�lat�val menjen a 1.1.2. leck�re! - -Megj: Ha nem biztos benne, mit nyomott meg, nyomja meg az -et, hogy - norm�l m�dba ker�lj�n, �s ism�telje meg a parancsot! - -Megj: A kurzor gomboknak is m�k�dni�k kell, de a hjkl haszn�lat�val - sokkal gyorsabban tud, mozogni, ha hozz�szokik. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.2. lecke: BE �S KIL�P�S A VIMB�L - - - !! MEGJ: Miel�tt v�grehajtja az al�bbi l�p�seket, olvassa v�gig a leck�t !! - - 1. Nyomja meg az gombot (hogy biztosan norm�l m�dban legyen). - - 2. �rja: :q! . - ----> Ezzel kil�p a szerkeszt�b�l a v�ltoz�sok MENT�SE N�LK�L. - Ha menteni szeretn� a v�ltoz�sokat �s kil�pni, �rja: - :wq - - 3. Amikor a shell promptot l�tja, �rja be a parancsot, amely ebbe az - oktat�ba hozza: - Ez val�sz�n�leg: vimtutor - Norm�lis esetben ezt �rn�: vim tutor.hu - ----> 'vim' jelenti a vimbe bel�p�st, 'tutor.hu' a f�jl, amit szerkeszteni k�v�n. - - 4. Ha megjegyezte a l�p�seket �s biztos mag�ban, hajtsa v�gre a l�p�seket - 1-t�l 3-ig, hogy kil�pjen �s visszat�rjen a szerkeszt�be. Azut�n - menjen az 1.1.3. leck�re. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.3. lecke: SZ�VEG SZERKESZT�SE - T�RL�S - - -** Norm�l m�dban nyomjon x-et, hogy a kurzor alatti karaktert t�r�lje. ** - - 1. Mozgassa a kurzort a ---> kezdet� sorra! - - 2. A hib�k kijav�t�s�hoz mozgassa a kurzort am�g a t�rlend� karakter - f�l� nem �r. - - 3. Nyomja meg az x gombot, hogy t�r�lje a nem k�v�nt karaktert. - - 4. Ism�telje a 2, 3, 4-es l�p�seket, hogy kijav�tsa a mondatot. - ----> ��szi �jjjell izziik aa galaggonya rruuh�ja. - - 5. Ha a sor helyes, ugorjon a 1.1.4. leck�re. - -MEGJ: A tanul�s sor�n ne memoriz�lni pr�b�ljon, hanem haszn�lat sor�n tanuljon. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.4. lecke: SZ�VEG SZERKESZT�SE - BESZ�R�S - - - ** Norm�l m�dban i megnyom�s�val lehet beilleszteni. ** - - 1. Az al�bbi els� ---> kezdet� sorra menjen. - - 2. Ahhoz, hogy az els�t azonoss� tegye a m�sodikkal, mozgassa a kurzort - az els� karakterre, amely UT�N sz�veget kell besz�rni. - - 3. Nyomjon i-t �s �rja be a megfelel� sz�veget. - - 4. Amikor mindent be�rt, nyomjon -et, hogy Norm�l m�dba visszat�rjen. - Ism�telje a 2 �s 4 k�z�tti l�p�seket, hogy kijav�tsa a mondatot. - ----> Az �that� so�l hizik p�r �sz. ----> Az itt l�that� sorb�l hi�nyzik p�r r�sz. - - 5. Ha m�r begyakorolta a besz�r�st, menjen az al�bbi �sszefoglal�ra. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1. LECKE �SSZEFOGLAL�JA - - - 1. A kurzort vagy a nyilakkal vagy a hjkl gombokkal mozgathatja. - h (balra) j (le) k (fel) l (jobbra) - - 2. A Vimbe (a $ promptt�l) �gy l�phet be: vim FILENAME - - 3. A Vimb�l �gy l�phet ki: :q! a v�ltoztat�sok eldob�s�val. - vagy �gy: :wq a v�ltoz�sok ment�s�vel. - - 4. A kurzor alatti karakter t�rl�se norm�l m�dban: x - - 5. Sz�veg besz�r�sa a kurzor ut�n norm�l m�dban: - i g�pelje be a sz�veget - -MEGJ: Az megnyom�sa norm�l m�dba viszi, vagy megszak�t egy nem befejezett - r�szben befejezett parancsot. - -Most folytassuk a 1.2. leck�vel! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.1. lecke: T�RL� UTAS�T�SOK - - - ** dw t�r�l a sz� v�g�ig. ** - - 1. Nyomjon -et, hogy megbizonyosodjon, hogy norm�l m�dban van! - - 2. Mozgassa a kurzort a ---> kezdet� sorra! - - 3. Mozgassa a kurzort arra annak a sz�nak az elej�re, amit t�r�lni szeretne. - T�r�lje az �llatokat a mondatb�l. - - 4. A sz� t�rl�s�hez �rja: dw - - MEGJ: Ha rosszul kezdte az utas�t�st csak nyomjon gombot - a megszak�t�s�hoz. - ----> P�r sz� kutya nem uhu illik pingvin a mondatba teh�n. - - 5. Ism�telje a 3 �s 4 k�z�tti utas�t�sokat am�g kell �s ugorjon a 1.2.2 leck�re! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.2. lecke: M�G T�BB T�RL� UTAS�T�S - - - ** d$ be�r�s�val a sor v�g�ig t�r�lhet. ** - - 1. Nyomjon -et, hogy megbizonyosodjon, hogy norm�l m�dban van! - - 2. Mozgassa a kurzort a ---> kezdet� sorra! - - 3. Mozgassa a kurzort a helyes sor v�g�re (az els� . UT�N)! - - 4. d$ beg�pel�s�vel t�r�lje a sor v�g�t! - ----> Valaki a sor v�g�t k�tszer g�pelte be. k�tszer g�pelte be. - - - 5. Menjen a 1.2.3. leck�re, hogy meg�rtse mi t�rt�nt! - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.3. lecke: UTAS�T�SOKR�L �S MOZG�SOKR�L - - - A d (delete=t�rl�s) utas�t�s form�ja a k�vetkez�: - - [sz�m] d mozg�s VAGY d [sz�m] mozg�s - Ahol: - sz�m - h�nyszor hajt�djon v�gre a parancs (elhagyhat�, alap�rt�k=1). - d - a t�rl�s (delete) utas�t�s. - mozg�s - amin a parancsnak teljes�lnie kell (al�bb list�zva). - - Mozg�sok r�vid list�ja: - w - a kurzort�l a sz� v�g�ig, bele�rtve a sz�k�zt. - e - a kurzort�l a sz� v�g�ig, NEM bele�rtve a sz�k�zt. - $ - a kurzort�l a sor v�g�ig. - -MEGJ: Csup�n a mozg�s beg�pel�s�vel (parancs n�lk�l) - a kurzor mozg�s �ltal megadott helyre ker�l. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.4. lecke: EG�SZ SOROK FELDOLGOZ�SA - - - ** dd be�r�s�val t�r�lheti az eg�sz sort. ** - - A teljes sor t�rl�s�nek gyakoris�ga miatt a Vi tervez�i elhat�rozt�k, - hogy k�nnyebb lenne csup�n a d-t k�tszer megnyomni, hogy egy sort t�r�lj�nk. - - 1. Mozgassa a kurzort az al�bbi kifejez�sek m�sodik sor�ra! - 2. dd beg�pel�s�vel t�r�lje a sort! - 3. Menjen a 3. (eredetileg 4.) sorra! - 4. 2dd (ugyeb�r sz�m-utas�t�s-mozg�s) beg�pel�s�vel t�r�lj�n k�t sort! - - 1) Alv� szegek a j�ghideg homokban, - 2) - kezdi a k�lt� - - 3) Plak�tmag�nyban �z� �jjelek. - 4) Pingvinek ne f�ljetek, - 5) T�volr�l egy vaku villant, - 6) �gve hagytad a folyos�n a villanyt. - 7) Ma ontj�k v�remet. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.5. lecke: A VISSZAVON�S (UNDO) PARANCS - - -** u g�pel�s�vel visszavonhat� az utols� parancs, U az eg�sz sort helyre�ll�tja. ** - - 1. Menj�nk az al�bbi ---> kezdet� sor els� hib�j�ra! - 2. x lenyom�s�val t�r�lje az els� felesleges karaktert! - 3. u megnyom�s�val vonja vissza az utols�nak v�grehajtott utas�t�st! - 4. M�sodj�ra jav�tson ki minden hib�t a sorban az x utas�t�ssal! - 5. Most nagy U -val �ll�tsa vissza a sor eredeti �llapot�t! - 6. Nyomja meg az u gombot p�rszor, hogy az U �s az azt megel�z� utas�t�sokat - vissza�ll�tsa! - 7. CTRL-R (CTRL gomb lenyom�sa mellett �ss�n R-t) p�rszor csin�lja �jra a - visszavont parancsokat (redo)! - ----> Jav��tsa a hhib�kaat ebbben a sooorban majd �ll�tsa visszaaa az eredetit. - - 8. Ezek nagyon hasznos parancsok. Most ugorjon a 1.2. lecke �sszefoglal�j�ra. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2. LECKE �SSZEFOGLAL�JA - - - 1. T�rl�s a kurzort�l a sz� v�g�ig: dw - - 2. T�rl�s a kurzort�l a sor v�g�ig: d$ - - 3. Eg�sz sor t�rl�se: dd - - 4. Egy utas�t�s alakja norm�l m�dban: - - [sz�m] utas�t�s mozg�s VAGY utas�t�s [sz�m] mozg�s - ahol: - sz�m - h�nyszor ism�telj�k a parancsot - utas�t�s - mit tegy�nk, pl. d a t�rl�skor - mozg�s - mire hasson az utas�t�s, p�ld�ul w (sz�=word), - $ (a sor v�g�ig), stb. - - 5. Az el�z� tett visszavon�sa (undo): u (kis u) - A sor �sszes v�ltoz�s�nak visszavon�sa: U (nagy U) - Visszavon�sok visszavon�sa: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.1. lecke: A BEILLESZT�S (PUT) PARANCS - - - ** p le�t�s�vel az utols�nak t�r�ltet a kurzor ut�n illeszthetj�k. ** - - 1. Mozgassuk a kurzort az al�bbi sorok els� sor�ra. - - 2. dd le�t�s�vel t�r�lj�k a sort �s elt�rol�dik a Vim puffer�ben. - - 3. Mozgassuk a kurzort azel�tt a sor EL�TTI sorba, ahov� mozgatni - szeretn�nk a t�r�lt sort. - - 4. Norm�l m�dban �rjunk p bet�t a t�r�lt sor beilleszt�s�hez. - - 5. Folytassuk a 2-4. utas�t�sokkal hogy a helyes sorrendet kapjuk. - - d) Can you learn too? - b) Violets are blue, - c) Intelligence is learned, - a) Roses are red, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.2. lecke: AZ �T�R�S (REPLACE) PARANCS - - -** r �s a karakterek le�t�s�vel a kurzor alatti karaktert megv�ltoztatjuk. ** - - 1. Mozgassuk a kurzort az els� ---> kezdet� sorra! - - 2. Mozgassuk a kurzort az els� hiba f�l�! - - 3. r majd a k�v�nt karakter le�t�s�vel v�ltoztassuk meg a hib�sat! - - 4. A 2. �s 3. l�p�sekkel jav�tsuk az �sszes hib�t! - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. Menj�nk a 1.3.2. leck�re! - -MEGJ: Eml�kezzen, hogy nem memoriz�l�ssal, hanem gyakorl�ssal tanuljon. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.3. lecke: A CSERE (CHANGE) PARANCS - - - ** A sz� egy r�sz�nek megv�ltoztat�s�hoz �rjuk: cw . ** - - 1. Mozgassuk a kurzort az els� ---> kezdet� sorra! - - 2. Vigye a kurzort a Ezen sz� z bet�je f�l�! - - 3. cw �s a helyes sz�r�sz (itt 'bben') be�r�s�val jav�tsa a sz�t! - - 4. lenyom�sa ut�n a k�vetkez� hib�ra ugorjon (az els� cser�lend� - karakterre)! - - 5. A 3. �s 4. l�p�sek ism�tl�s�vel az els� mondatot tegye a m�sodikkal - azonoss�! - ----> Ezen a sorrrrr p�r sz�ra meg kell v�ltozzanak a change utask�r�s�. ----> Ebben a sorban p�r sz�t meg kell v�ltoztatni a change utas�t�ssal. - -Vegy�k �szre, hogy a cw nem csak a sz�t �rja �t, hanem besz�r� -(insert) m�dba v�lt. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.4. lecke: T�BBF�LE V�LTOZTAT�S c-VEL - - - ** A c utas�t�s haszn�lhat� ugyanazokkal az mozg�sokkal mint a t�rl�s ** - - 1. A change utas�t�s a t�rl�ssel azonosan viselkedik. A forma: - - [sz�m] c mozg�s OR c [sz�m] mozg�s - - 2. A mozg�sok is azonosak, pl. w (sz�), $ (sorv�g), stb. - - 3. Mozgassuk a kurzort az els� ---> kezdet� sorra! - - 4. Menj�nk az els� hib�ra! - - 5. c$ beg�pel�s�vel a sorv�geket tegy�k azonoss� �s nyomjunk -et! - ----> Ennek a sornak a v�ge kiigaz�t�sra szorul, hogy megegyezzen a m�sodikkal. ----> Ennek a sornak a v�ge a c$ paranccsal v�ltoztathat� meg. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3. LECKE �SSZEFOGLAL�JA - - - 1. A m�r t�r�lt sort beilleszt�s�hez nyomjunk p-t. Ez a t�r�lt sz�veget - a kurzor UT�N helyezi (ha sor ker�lt t�rl�sre, a kurzor alatti sorba). - - 2. A kurzor alatti karakter �t�r�s�hoz az r-et �s azt a karaktert - nyomjuk, amellyel az eredetit fel�l szeretn�nk �rni. - - 3. A v�ltoztat�s (c) utas�t�s a karaktert�l az mozg�s v�g�ig - v�ltoztatja meg az mozg�st. P�ld�ul a cw a kurzort�l a sz� v�g�ig, - a c$ a sor v�g�ig. - - 4. A v�ltoztat�s form�tuma: - - [sz�m] c mozg�s VAGY c [sz�m] mozg�s - -Ugorjunk a k�vetkez� leck�re! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.1. lecke: HELY �S F�JL�LLAPOT - - - ** CTRL-g megnyom�s�val megn�zhetj�k a hely�nket a f�jlban �s a f�jl �llapot�t. - SHIFT-G le�t�s�vel a f�jl adott sor�ra ugorhatunk. ** - - Megj: Olvassuk el az eg�sz leck�t a l�p�sek v�grehajt�sa el�tt!! - - 1. Tartsuk nyomva a Ctrl gombot �s nyomjunk g-t. Az �llapotsor - megjelenik a lap alj�n a f�jln�vvel �s az aktu�lis sor sorsz�m�val. - Jegyezz�k meg a sorsz�mot a 3. l�p�shez! - - 2. Nyomjunk Shift-G-t a lap alj�ra ugr�shoz! - - 3. �ss�k be az eredeti sor sz�m�t, majd �ss�nk shift-G-t! Ezzel - visszajutunk az eredeti sorra ahol Ctrl-g-t nyomtunk. - (A be�rt sz�m NEM fog megjelenni a k�perny�n.) - - 4. Ha megjegyezte a feladatot, hajtsa v�gre az 1-3. l�p�seket! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.2. lecke: A KERES�S (SEARCH) PARANCS - - - ** / majd a k�v�nt kifejez�s be�r�s�val kereshetj�k meg a kifejez�st. ** - - 1. Norm�l m�dban �ss�nk / karaktert! Ez �s a kurzor megjelenik - a k�perny� alj�n, ahogy a : utas�t�s is. - - 2. �rjuk be: 'hiibaa' ! Ez az a sz� amit keres�nk. - - 3. A kifejez�s �jabb keres�s�hez �ss�k le egyszer�en: n . - A kifejez�s ellenkez� ir�nyban t�rt�n� keres�s�hez ezt �ss�k be: Shift-N . - - 4. Ha visszafel� szeretne keresni, akkor ? kell a / helyett. - ----> "hiibaa" nem a helyes m�dja a hiba le�r�s�nak; a hiibaa egy hiba. - -Megj: Ha a keres�s el�ri a f�jl v�g�t, akkor az elej�n kezdi. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.3. lecke: Z�R�JELEK P�RJ�NAK KERES�SE - - - ** % le�t�s�vel megtal�ljuk a ),], vagy } p�rj�t. ** - - 1. Helyezze a kurzort valamelyik (, [, vagy { z�r�jelre a ---> kezdet� - sorban! - - 2. �ss�n % karaktert! - - 3. A kurzor a z�r�jel p�rj�ra fog ugrani. - - 4. % le�t�s�vel visszaugrik az eredeti z�r�jelre. - ----> Ez ( egy tesztsor (-ekkel, [-ekkel ] �s {-ekkel } a sorban. )) - -Megj: Ez nagyon hasznos, ha olyan programot debugolunk, amelyben a - z�r�jelek nem p�rosak! - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.4. lecke: A HIB�K KIJAV�T�S�NAK EGY M�DJA - - - ** :s/r�gi/�j/g beg�pel�s�vel az '�j'-ra cser�lj�k a 'r�gi'-t. ** - - 1. Menj�nk a ---> kezdet� sorra! - - 2. �rjuk be: :s/eggy/egy . Ekkor csak az els� v�ltozik meg a - sorban. - - 3. Most ezt �rjuk: :s/eggy/egg/g amely glob�lisan helyettes�t - a sorban, azaz minden el�fordul�st. - Ez a sorban minden el�fordul�st helyettes�t. - ----> eggy heggy meggy, szembe j�n eggy m�sik heggy. - - 4. K�t sor k�z�tt a karaktersor minden el�fordul�s�nak helyettes�t�se: - :#,#s/r�gi/�j/g ahol #,# a k�t sor sorsz�ma. - :%s/r�gi/�j/g a f�jlbeli �sszes el�fordul�s helyettes�t�se. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4. LECKE �SSZEFOGLAL�JA - - - 1. Ctrl-g ki�rja az kurzor hely�t a f�jlban �s a f�jl �llapot�t. - Shift-G a f�jl v�g�re megy, gg az elej�re. Egy sz�m ut�n - Shift-G az adott sz�m� sorra ugrik. - - 2. / ut�n egy kifejez�s EL�REFELE keresi a kifejez�st. - 2. ? ut�n egy kifejez�s VISSZAFELE keresi a kifejez�st. - Egy keres�s ut�n az n a k�vetkez� el�fordul�st keresi azonos ir�nyban - Shift-N az ellenkez� ir�nyban keres. - - 3. % beg�pel�s�vel, ha (,),[,],{, vagy } karakteren vagyunk a z�r�jel - p�rj�ra ugrik. - - 4. az els� r�gi helyettes�t�se �jjal a sorban :s/r�gi/�j - az �sszes r�gi helyettes�t�se �jjal a sorban :s/r�gi/�j/g - k�t sor k�z�tti kifejez�sekre :#,#s/r�gi/�j/g - # hely�n az aktu�lis sor (.) �s az utols� ($) is �llhat :.,$/r�gi/�j/g - A f�jlbeli �sszes el�fordul�s helyettes�t�se :%s/r�gi/�j/g - Mindenkori meger�s�t�sre v�r 'c' hat�s�ra :%s/r�gi/�j/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.1. lecke: K�LS� PARANCS V�GREHAJT�SA - - - ** :! ut�n k�ls� parancsot �rva v�grehajt�dik a parancs. ** - - 1. �rjuk be az ismer�s : parancsot, hogy a kurzort a k�perny� alj�ra - helyezz�k. Ez lehet�v� teszi egy parancs be�r�s�t. - - 2. ! (felki�lt�jel) be�r�s�val tegy�k lehet�v� k�ls� h�j (shell)-parancs - v�grehajt�s�t. - - 3. �rjunk p�ld�ul ls parancsot a ! ut�n majd �ss�nk -t. Ez ki - fogja list�zni a k�nyvt�runkat ugyan�gy, mintha a shell promptn�l - lenn�nk. Vagy �rja ezt :!dir ha az ls nem m�k�dik. - -Megj: Ilym�don b�rmely k�ls� utas�t�s v�grehajthat�. - -Megj: Minden : parancs ut�n -t kell �tni. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.2. lecke: B�VEBBEN A F�JLOK �R�S�R�L - - - ** A f�jlok v�ltoz�sait �gy �rhatjuk ki :w F�JLN�V. ** - - 1. :!dir vagy :!ls be�r�s�val list�zzuk a k�nyvt�runkat! - �n m�r tudja, hogy -t kell �tnie ut�na. - - 2. V�lasszon egy f�jlnevet, amely m�g nem l�tezik pl. TESZT! - - 3. �rja: :w TESZT (ahol TESZT a v�lasztott f�jln�v)! - - 4. Ez elmenti a teljes f�jlt (a Vim oktat�j�t) TESZT n�ven. - Ellen�rz�sk�pp �rjuk ism�t :!dir hogy l�ssuk a k�nyvt�rat! - (Felfel� gombbal : ut�n az el�z� utas�t�sok visszahozhat�ak.) - -Megj: Ha �n kil�pne a Vimb�l �s �s visszat�rne a TESZT f�jln�vvel, akkor a - f�jl az oktat� ment�skori pontos m�solata lenne. - - 5. T�vol�tsa el a f�jlt (MS-DOS): :!del TESZT - vagy (Unix): :!rm TESZT - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.3. lecke: EGY KIV�LASZTOTT R�SZ KI�R�SA - - - ** A f�jl egy r�sz�nek ki�r�s�hoz �rja :#,# w F�JLN�V ** - - 1. :!dir vagy :!ls be�r�s�val list�zza a k�nyvt�rat, �s v�lasszon egy - megfelel� f�jlnevet, pl. TESZT. - - 2. Mozgassa a kurzort ennek az oldalnak a tetej�re, �s nyomjon - Ctrl-g-t, hogy megtudja a sorsz�mot. JEGYEZZE MEG A SZ�MOT! - - 3. Most menjen a lap alj�ra, �s �sse be ism�t: Ctrl-g. EZT A SZ�MOT - IS JEGYEZZE MEG! - - 4. Ha csak ezt a r�sz�t szeretn� menteni a f�jlnak, �rja :#,# w TESZT - ahol #,# a k�t sorsz�m, amit megjegyzett, TESZT az �n f�jlneve. - - 5. Ism�t n�zze meg, hogy a f�jl ott van (:!dir) de NE t�r�lje. - - 6. Vimben l�tezik egy m�sik lehet�s�g: nyomja meg a Shift-V gombp�rt - az els� menteni k�v�nt soron, majd menjen le az utols�ra, ezut�n - �rja :w TESZT2 Ekkor a TESZT2 f�jlba ker�l a kijel�lt r�sz. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.4. lecke: F�JLOK VISSZA�LL�T�SA �S �SSZEF�Z�SE - - - ** Egy f�jl tartalm�nak beilleszt�s�hez �rja :r F�JLN�V ** - - 1. :!dir be�r�s�val n�zze meg, hogy az �n TESZT f�jlja l�tezik m�g. - - 2. Helyezze a kurzort ennek az oldalnak a tetej�re. - -MEGJ: A 3. l�p�s ut�n az 1.5.3. leck�t fogja l�tni. Azut�n LEFEL� indulva - keresse meg ism�t ezt a leck�t. - - 3. Most sz�rja be a TESZT nev� f�jlt a :r TESZT paranccsal, ahol - TESZT az �n f�jlj�nak a neve. - -MEGJ: A f�jl, amit beillesztett a kurzora alatt helyezkedik el. - - 4. Hogy ellen�rizz�k, hogy a f�jlt t�nyleg beillesztett�k, menjen - vissza, �s n�zze meg, hogy k�tszer szerepel az 1.5.3. lecke! Az eredeti - mellett a f�jlb�l bem�solt is ott van. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5. LECKE �SSZEFOGLAL�JA - - - 1. :!parancs v�grehajt egy k�ls� utas�t�st. - - P�r hasznos p�lda: - (MS-DOS) (Unix) - :!dir :!ls - k�nyvt�rlista ki�r�sa. - :!del F�JLN�V :!rm F�JLN�V - F�JLN�V nev� f�jl t�rl�se. - - 2. :w F�JLN�V ki�rja a jelenlegi Vim-f�jlt a lemezre F�JN�V n�ven. - - 3. :#,#w F�JLN�V ki�rja a k�t sorsz�m (#) k�z�tti sorokat F�JLN�V-be - M�sik lehet�s�g, hogy a kezd�sorn�l Shift-v-t nyom lemegy az utols� - sorra, majd ezt �ti be :w F�JLN�V - - 4. :r F�JLN�V beolvassa a F�JLN�V f�jlt �s behelyezi a jelenlegi f�jlba - a kurzorpoz�ci� ut�ni sorba. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.1. lecke: A MEGNYIT�S (OPEN) PARANCS - - -** o be�r�s�val nyit egy �j sort a kurzor alatt �s besz�r� m�dba v�lt ** - - 1. Mozgassuk a kurzort a ---> kezdet� sorra. - - 2. o (kicsi) be�r�s�val nyisson egy sort a kurzor ALATT! Ekkor - automatikusan besz�r� (insert) m�dba ker�l. - - 3. M�solja le a ---> jel� sort �s megnyom�s�val l�pjen ki - a besz�r� m�db�l. - ----> Az o lenyom�sa ut�n a kurzor a k�vetkez� sor elej�n �ll besz�r� m�dban. - - 4. A kurzor FELETTI sor megnyit�s�hoz egyszer�en nagy O bet�t �rjon -kicsi helyett. Pr�b�lja ki a k�vetkez� soron! -Nyisson egy �j sort efelett Shift-O megnyom�s�val, mialatt a kurzor -ezen a soron �ll. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.2. lecke: AZ APPEND PARANCS - - - ** a lenyom�s�val a kurzor UT�N sz�rhatunk sz�veget. ** - - 1. Mozgassuk a kurzort a k�vetkez� ---> kezdet� sor v�g�re �gy, - hogy norm�l m�dban $-t �r be. - - 2. Kis "a" le�t�s�vel sz�veget sz�rhat be AM�G� a karakter m�g�, - amelyen a kurzor �ll. - (A nagy "A" az eg�sz sor v�g�re �rja a sz�veget.) - -Megj: A Vimben a sor legv�g�re is lehet �llni, azonban ez el�dj�ben - a Vi-ban nem lehets�ges, ez�rt abban az a n�lk�l el�g k�r�lm�nyes - a sor v�g�hez sz�veget �rni. - - 3. Eg�sz�tse ki az els� sort. Vegye �szre, hogy az a utas�t�s (append) - teljesen egyezik az i-vel (insert) csup�n a besz�rt sz�veg helye - k�l�nb�zik. - ----> Ez a sor lehet�v� teszi �nnek, hogy gyakorolja ----> Ez a sor lehet�v� teszi �nnek, hogy gyakorolja a sor v�g�re beilleszt�st. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.3. lecke: AZ �T�R�S M�SIK V�LTOZATA - - - ** Nagy R be�r�s�val �rhat fel�l t�bb mint egy karaktert. ** - - 1. Mozgassuk a kurzort az els� ---> kezdet� sorra! - - 2. Helyezze a kurzort az els� sz� elej�re amely elt�r a m�sodik - ---> kezdet� sor tartalm�t�l (a 'az utols�val' r�szt�l). - - 3. Nyomjon R karaktert �s �rja �t a sz�veg marad�k�t az els� sorban - �gy, hogy a k�t sor egyez� legyen. - ----> Az els� sort tegye azonoss� az utols�val: haszn�lja a gombokat. ----> Az els� sort tegye azonoss� a m�sodikkal: �rjon R-t �s az �j sz�veget. - - 4. Jegyezz�k meg, ha -et nyomok, akkor a v�ltozatlanul hagyott - sz�vegek v�ltozatlanok maradnak. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.4. lecke: BE�LL�T�SOK - -** �ll�tsuk be, hogy a keres�s �s a helyettes�t�s ne f�ggj�n kis/NAGYbet�kt�l ** - - 1. Keress�k meg az 'ignore'-t az be�rva: - /ignore - Ezt ism�telj�k t�bbsz�r az n billenty�vel - - 2. �ll�tsuk be az 'ic' (Ignore case) lehet�s�get �gy: - :set ic - - 3. Most keress�nk ism�t az 'ignore'-ra n-nel - Ism�telj�k meg t�bbsz�r a keres�st: n - - 4. �ll�tsuk be a 'hlsearch' �s 'incsearch' lehet�s�geket: - :set hls is - - 5. Most ism�t �rjuk be a keres�parancsot, �s l�ssuk mi t�rt�nik: - /ignore - - 6. A kiemel�st sz�ntess�k meg al�bbi utas�t�sok egyik�vel: - :set nohls vagy :nohlsearch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6. LECKE �SSZEFOGLAL�JA - - - 1. o be�r�s�val �j sort nyitunk meg a sor ALATT �s a kurzor az �j - sorban lesz besz�r�s-m�dban. - Nagy O a sor FELETT nyit �j sort, �s oda ker�l a kurzor. - - 2. a be�r�s�val az aktu�lis karaktert�l UT�N (jobbra) sz�rhatunk be sz�veget. - Nagy A automatikusan a sor legv�g�hez adja hozz� a sz�veget. - - 3. A nagy R be�t�s�vel �t�r� (replace) m�dba ker�l�nk lenyom�s�ig. - - 4. ":set xxx" be�r�s�val az "xxx" opci� �ll�that� be. - - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.7. lecke: AZ ON-LINE S�G� PARANCSAI - - - ** Az online s�g�rendszer haszn�lata ** - - A Vim r�szletes s�g�val rendelkezik. Indul�shoz a k�vetkez�k egyik�t - tegye: - - nyomja meg a gombot (ha van ilyen) - - nyomja meg az gombot (ha van ilyen) - - �rja be: :help - - :q be�r�s�val z�rhatja be a s�g�ablakot. - - Majdnem minden t�mak�rr�l tal�lhat s�g�t, argumentum megad�s�val - ":help" utas�t�s . Pr�b�lja az al�bbiakat ki (-t ne felejts�k): - - :help w - :help c_, 2006-2012 - diff --git a/runtime/tutor/tutor1.hu.utf-8 b/runtime/tutor/tutor1.hu.utf-8 deleted file mode 100644 index f9482e40c6..0000000000 --- a/runtime/tutor/tutor1.hu.utf-8 +++ /dev/null @@ -1,830 +0,0 @@ -=============================================================================== -== Ü d v ö z ö l j ü k a V I M - o k t a t ó b a n - 1.5-ös verzió == -=============================================================================== - - A Vim egy nagyon hatékony szerkesztő, amelynek rengeteg utasítása - van, túl sok, hogy egy ilyen oktatóban (tutorban), mint az itteni - mindet elmagyarázzuk. Ez az oktató arra törekszik, hogy annyit - elmagyarázzon, amennyi elég, hogy könnyedén használjuk a Vim-et, az - általános célú szövegszerkesztőt. - - A feladatok megoldásához 25-30 perc szükséges attól függően, - mennyit töltünk a kísérletezéssel. - - A leckében szereplő utasítások módosítani fogják a szöveget. - Készítsen másolatot erről a fájlról, ha gyakorolni akar. - (Ha "vimtutor"-ral indította, akkor ez már egy másolat.) - - Fontos megérteni, hogy ez az oktató cselekedve taníttat. - Ez azt jelenti, hogy Önnek ajánlott végrehajtania az utasításokat, - hogy megfelelően megtanulja azokat. Ha csak olvassa, elfelejti! - - Most bizonyosodjon, meg, hogy a Caps-Lock gombja NINCS lenyomva, és - Nyomja meg megfelelő számúszor a j gombot, hogy az 1.1.1-es - lecke teljesen a képernyőn legyen! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.1. lecke: A KURZOR MOZGATÁSA - - - ** A kurzor mozgatásához nyomja meg a h,j,k,l gombokat az alábbi szerint. ** - ^ - k Tipp: A h billentyű van balra, és balra mozgat - < h l > A l billentyű van jobbra, és jobbra mozgat - j A j billentyű olyan, mint egy lefele nyíl - v - 1. Mozgassa a kurzort körbe az ablakban, amíg hozzá nem szokik! - - 2. Tartsa lenyomva a lefelét (j), akkor ismétlődik! ----> Most tudja, hogyan mehet a következő leckére. - - 3. A lefelé gomb használatával menjen a 1.1.2. leckére! - -Megj: Ha nem biztos benne, mit nyomott meg, nyomja meg az -et, hogy - normál módba kerüljön, és ismételje meg a parancsot! - -Megj: A kurzor gomboknak is működniük kell, de a hjkl használatával - sokkal gyorsabban tud, mozogni, ha hozzászokik. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.2. lecke: BE ÉS KILÉPÉS A VIMBŐL - - - !! MEGJ: Mielőtt végrehajtja az alábbi lépéseket, olvassa végig a leckét !! - - 1. Nyomja meg az gombot (hogy biztosan normál módban legyen). - - 2. Írja: :q! . - ----> Ezzel kilép a szerkesztőből a változások MENTÉSE NÉLKÜL. - Ha menteni szeretné a változásokat és kilépni, írja: - :wq - - 3. Amikor a shell promptot látja, írja be a parancsot, amely ebbe az - oktatóba hozza: - Ez valószínűleg: vimtutor - Normális esetben ezt írná: vim tutor.hu - ----> 'vim' jelenti a vimbe belépést, 'tutor.hu' a fájl, amit szerkeszteni kíván. - - 4. Ha megjegyezte a lépéseket és biztos magában, hajtsa végre a lépéseket - 1-től 3-ig, hogy kilépjen és visszatérjen a szerkesztőbe. Azután - menjen az 1.1.3. leckére. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.3. lecke: SZÖVEG SZERKESZTÉSE - TÖRLÉS - - -** Normál módban nyomjon x-et, hogy a kurzor alatti karaktert törölje. ** - - 1. Mozgassa a kurzort a ---> kezdetű sorra! - - 2. A hibák kijavításához mozgassa a kurzort amíg a törlendő karakter - fölé nem ér. - - 3. Nyomja meg az x gombot, hogy törölje a nem kívánt karaktert. - - 4. Ismételje a 2, 3, 4-es lépéseket, hogy kijavítsa a mondatot. - ----> ŐŐszi éjjjell izziik aa galaggonya rruuhája. - - 5. Ha a sor helyes, ugorjon a 1.1.4. leckére. - -MEGJ: A tanulás során ne memorizálni próbáljon, hanem használat során tanuljon. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1.4. lecke: SZÖVEG SZERKESZTÉSE - BESZÚRÁS - - - ** Normál módban i megnyomásával lehet beilleszteni. ** - - 1. Az alábbi első ---> kezdetű sorra menjen. - - 2. Ahhoz, hogy az elsőt azonossá tegye a másodikkal, mozgassa a kurzort - az első karakterre, amely UTÁN szöveget kell beszúrni. - - 3. Nyomjon i-t és írja be a megfelelő szöveget. - - 4. Amikor mindent beírt, nyomjon -et, hogy Normál módba visszatérjen. - Ismételje a 2 és 4 közötti lépéseket, hogy kijavítsa a mondatot. - ----> Az átható soól hizik pár ész. ----> Az itt látható sorból hiányzik pár rész. - - 5. Ha már begyakorolta a beszúrást, menjen az alábbi összefoglalóra. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.1. LECKE ÖSSZEFOGLALÓJA - - - 1. A kurzort vagy a nyilakkal vagy a hjkl gombokkal mozgathatja. - h (balra) j (le) k (fel) l (jobbra) - - 2. A Vimbe (a $ prompttól) így léphet be: vim FILENAME - - 3. A Vimből így léphet ki: :q! a változtatások eldobásával. - vagy így: :wq a változások mentésével. - - 4. A kurzor alatti karakter törlése normál módban: x - - 5. Szöveg beszúrása a kurzor után normál módban: - i gépelje be a szöveget - -MEGJ: Az megnyomása normál módba viszi, vagy megszakít egy nem befejezett - részben befejezett parancsot. - -Most folytassuk a 1.2. leckével! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.1. lecke: TÖRLŐ UTASÍTÁSOK - - - ** dw töröl a szó végéig. ** - - 1. Nyomjon -et, hogy megbizonyosodjon, hogy normál módban van! - - 2. Mozgassa a kurzort a ---> kezdetű sorra! - - 3. Mozgassa a kurzort arra annak a szónak az elejére, amit törölni szeretne. - Törölje az állatokat a mondatból. - - 4. A szó törléséhez írja: dw - - MEGJ: Ha rosszul kezdte az utasítást csak nyomjon gombot - a megszakításához. - ----> Pár szó kutya nem uhu illik pingvin a mondatba tehén. - - 5. Ismételje a 3 és 4 közötti utasításokat amíg kell és ugorjon a 1.2.2 leckére! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.2. lecke: MÉG TÖBB TÖRLŐ UTASÍTÁS - - - ** d$ beírásával a sor végéig törölhet. ** - - 1. Nyomjon -et, hogy megbizonyosodjon, hogy normál módban van! - - 2. Mozgassa a kurzort a ---> kezdetű sorra! - - 3. Mozgassa a kurzort a helyes sor végére (az első . UTÁN)! - - 4. d$ begépelésével törölje a sor végét! - ----> Valaki a sor végét kétszer gépelte be. kétszer gépelte be. - - - 5. Menjen a 1.2.3. leckére, hogy megértse mi történt! - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.3. lecke: UTASÍTÁSOKRÓL ÉS MOZGÁSOKRÓL - - - A d (delete=törlés) utasítás formája a következő: - - [szám] d mozgás VAGY d [szám] mozgás - Ahol: - szám - hányszor hajtódjon végre a parancs (elhagyható, alapérték=1). - d - a törlés (delete) utasítás. - mozgás - amin a parancsnak teljesülnie kell (alább listázva). - - Mozgások rövid listája: - w - a kurzortól a szó végéig, beleértve a szóközt. - e - a kurzortól a szó végéig, NEM beleértve a szóközt. - $ - a kurzortól a sor végéig. - -MEGJ: Csupán a mozgás begépelésével (parancs nélkül) - a kurzor mozgás által megadott helyre kerül. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.4. lecke: EGÉSZ SOROK FELDOLGOZÁSA - - - ** dd beírásával törölheti az egész sort. ** - - A teljes sor törlésének gyakorisága miatt a Vi tervezői elhatározták, - hogy könnyebb lenne csupán a d-t kétszer megnyomni, hogy egy sort töröljünk. - - 1. Mozgassa a kurzort az alábbi kifejezések második sorára! - 2. dd begépelésével törölje a sort! - 3. Menjen a 3. (eredetileg 4.) sorra! - 4. 2dd (ugyebár szám-utasítás-mozgás) begépelésével töröljön két sort! - - 1) Alvó szegek a jéghideg homokban, - 2) - kezdi a költő - - 3) Plakátmagányban ázó éjjelek. - 4) Pingvinek ne féljetek, - 5) Távolról egy vaku villant, - 6) Égve hagytad a folyosón a villanyt. - 7) Ma ontják véremet. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2.5. lecke: A VISSZAVONÁS (UNDO) PARANCS - - -** u gépelésével visszavonható az utolsó parancs, U az egész sort helyreállítja. ** - - 1. Menjünk az alábbi ---> kezdetű sor első hibájára! - 2. x lenyomásával törölje az első felesleges karaktert! - 3. u megnyomásával vonja vissza az utolsónak végrehajtott utasítást! - 4. Másodjára javítson ki minden hibát a sorban az x utasítással! - 5. Most nagy U -val állítsa vissza a sor eredeti állapotát! - 6. Nyomja meg az u gombot párszor, hogy az U és az azt megelőző utasításokat - visszaállítsa! - 7. CTRL-R (CTRL gomb lenyomása mellett üssön R-t) párszor csinálja újra a - visszavont parancsokat (redo)! - ----> Javíítsa a hhibákaat ebbben a sooorban majd állítsa visszaaa az eredetit. - - 8. Ezek nagyon hasznos parancsok. Most ugorjon a 1.2. lecke összefoglalójára. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.2. LECKE ÖSSZEFOGLALÓJA - - - 1. Törlés a kurzortól a szó végéig: dw - - 2. Törlés a kurzortól a sor végéig: d$ - - 3. Egész sor törlése: dd - - 4. Egy utasítás alakja normál módban: - - [szám] utasítás mozgás VAGY utasítás [szám] mozgás - ahol: - szám - hányszor ismételjük a parancsot - utasítás - mit tegyünk, pl. d a törléskor - mozgás - mire hasson az utasítás, például w (szó=word), - $ (a sor végéig), stb. - - 5. Az előző tett visszavonása (undo): u (kis u) - A sor összes változásának visszavonása: U (nagy U) - Visszavonások visszavonása: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.1. lecke: A BEILLESZTÉS (PUT) PARANCS - - - ** p leütésével az utolsónak töröltet a kurzor után illeszthetjük. ** - - 1. Mozgassuk a kurzort az alábbi sorok első sorára. - - 2. dd leütésével töröljük a sort és eltárolódik a Vim pufferében. - - 3. Mozgassuk a kurzort azelőtt a sor ELŐTTI sorba, ahová mozgatni - szeretnénk a törölt sort. - - 4. Normál módban írjunk p betűt a törölt sor beillesztéséhez. - - 5. Folytassuk a 2-4. utasításokkal hogy a helyes sorrendet kapjuk. - - d) Can you learn too? - b) Violets are blue, - c) Intelligence is learned, - a) Roses are red, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.2. lecke: AZ ÁTÍRÁS (REPLACE) PARANCS - - -** r és a karakterek leütésével a kurzor alatti karaktert megváltoztatjuk. ** - - 1. Mozgassuk a kurzort az első ---> kezdetű sorra! - - 2. Mozgassuk a kurzort az első hiba fölé! - - 3. r majd a kívánt karakter leütésével változtassuk meg a hibásat! - - 4. A 2. és 3. lépésekkel javítsuk az összes hibát! - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. Menjünk a 1.3.2. leckére! - -MEGJ: Emlékezzen, hogy nem memorizálással, hanem gyakorlással tanuljon. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.3. lecke: A CSERE (CHANGE) PARANCS - - - ** A szó egy részének megváltoztatásához írjuk: cw . ** - - 1. Mozgassuk a kurzort az első ---> kezdetű sorra! - - 2. Vigye a kurzort a Ezen szó z betűje fölé! - - 3. cw és a helyes szórész (itt 'bben') beírásával javítsa a szót! - - 4. lenyomása után a következő hibára ugorjon (az első cserélendő - karakterre)! - - 5. A 3. és 4. lépések ismétlésével az első mondatot tegye a másodikkal - azonossá! - ----> Ezen a sorrrrr pár szóra meg kell változzanak a change utaskíréső. ----> Ebben a sorban pár szót meg kell változtatni a change utasítással. - -Vegyük észre, hogy a cw nem csak a szót írja át, hanem beszúró -(insert) módba vált. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3.4. lecke: TÖBBFÉLE VÁLTOZTATÁS c-VEL - - - ** A c utasítás használható ugyanazokkal az mozgásokkal mint a törlés ** - - 1. A change utasítás a törléssel azonosan viselkedik. A forma: - - [szám] c mozgás OR c [szám] mozgás - - 2. A mozgások is azonosak, pl. w (szó), $ (sorvég), stb. - - 3. Mozgassuk a kurzort az első ---> kezdetű sorra! - - 4. Menjünk az első hibára! - - 5. c$ begépelésével a sorvégeket tegyük azonossá és nyomjunk -et! - ----> Ennek a sornak a vége kiigazításra szorul, hogy megegyezzen a másodikkal. ----> Ennek a sornak a vége a c$ paranccsal változtatható meg. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.3. LECKE ÖSSZEFOGLALÓJA - - - 1. A már törölt sort beillesztéséhez nyomjunk p-t. Ez a törölt szöveget - a kurzor UTÁN helyezi (ha sor került törlésre, a kurzor alatti sorba). - - 2. A kurzor alatti karakter átírásához az r-et és azt a karaktert - nyomjuk, amellyel az eredetit felül szeretnénk írni. - - 3. A változtatás (c) utasítás a karaktertől az mozgás végéig - változtatja meg az mozgást. Például a cw a kurzortól a szó végéig, - a c$ a sor végéig. - - 4. A változtatás formátuma: - - [szám] c mozgás VAGY c [szám] mozgás - -Ugorjunk a következő leckére! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.1. lecke: HELY ÉS FÁJLÁLLAPOT - - - ** CTRL-g megnyomásával megnézhetjük a helyünket a fájlban és a fájl állapotát. - SHIFT-G leütésével a fájl adott sorára ugorhatunk. ** - - Megj: Olvassuk el az egész leckét a lépések végrehajtása előtt!! - - 1. Tartsuk nyomva a Ctrl gombot és nyomjunk g-t. Az állapotsor - megjelenik a lap alján a fájlnévvel és az aktuális sor sorszámával. - Jegyezzük meg a sorszámot a 3. lépéshez! - - 2. Nyomjunk Shift-G-t a lap aljára ugráshoz! - - 3. Üssük be az eredeti sor számát, majd üssünk shift-G-t! Ezzel - visszajutunk az eredeti sorra ahol Ctrl-g-t nyomtunk. - (A beírt szám NEM fog megjelenni a képernyőn.) - - 4. Ha megjegyezte a feladatot, hajtsa végre az 1-3. lépéseket! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.2. lecke: A KERESÉS (SEARCH) PARANCS - - - ** / majd a kívánt kifejezés beírásával kereshetjük meg a kifejezést. ** - - 1. Normál módban üssünk / karaktert! Ez és a kurzor megjelenik - a képernyő alján, ahogy a : utasítás is. - - 2. Írjuk be: 'hiibaa' ! Ez az a szó amit keresünk. - - 3. A kifejezés újabb kereséséhez üssük le egyszerűen: n . - A kifejezés ellenkező irányban történő kereséséhez ezt üssük be: Shift-N . - - 4. Ha visszafelé szeretne keresni, akkor ? kell a / helyett. - ----> "hiibaa" nem a helyes módja a hiba leírásának; a hiibaa egy hiba. - -Megj: Ha a keresés eléri a fájl végét, akkor az elején kezdi. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.3. lecke: ZÁRÓJELEK PÁRJÁNAK KERESÉSE - - - ** % leütésével megtaláljuk a ),], vagy } párját. ** - - 1. Helyezze a kurzort valamelyik (, [, vagy { zárójelre a ---> kezdetű - sorban! - - 2. Üssön % karaktert! - - 3. A kurzor a zárójel párjára fog ugrani. - - 4. % leütésével visszaugrik az eredeti zárójelre. - ----> Ez ( egy tesztsor (-ekkel, [-ekkel ] és {-ekkel } a sorban. )) - -Megj: Ez nagyon hasznos, ha olyan programot debugolunk, amelyben a - zárójelek nem párosak! - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4.4. lecke: A HIBÁK KIJAVÍTÁSÁNAK EGY MÓDJA - - - ** :s/régi/új/g begépelésével az 'új'-ra cseréljük a 'régi'-t. ** - - 1. Menjünk a ---> kezdetű sorra! - - 2. Írjuk be: :s/eggy/egy . Ekkor csak az első változik meg a - sorban. - - 3. Most ezt írjuk: :s/eggy/egg/g amely globálisan helyettesít - a sorban, azaz minden előfordulást. - Ez a sorban minden előfordulást helyettesít. - ----> eggy heggy meggy, szembe jön eggy másik heggy. - - 4. Két sor között a karaktersor minden előfordulásának helyettesítése: - :#,#s/régi/új/g ahol #,# a két sor sorszáma. - :%s/régi/új/g a fájlbeli összes előfordulás helyettesítése. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.4. LECKE ÖSSZEFOGLALÓJA - - - 1. Ctrl-g kiírja az kurzor helyét a fájlban és a fájl állapotát. - Shift-G a fájl végére megy, gg az elejére. Egy szám után - Shift-G az adott számú sorra ugrik. - - 2. / után egy kifejezés ELŐREFELE keresi a kifejezést. - 2. ? után egy kifejezés VISSZAFELE keresi a kifejezést. - Egy keresés után az n a következő előfordulást keresi azonos irányban - Shift-N az ellenkező irányban keres. - - 3. % begépelésével, ha (,),[,],{, vagy } karakteren vagyunk a zárójel - párjára ugrik. - - 4. az első régi helyettesítése újjal a sorban :s/régi/új - az összes régi helyettesítése újjal a sorban :s/régi/új/g - két sor közötti kifejezésekre :#,#s/régi/új/g - # helyén az aktuális sor (.) és az utolsó ($) is állhat :.,$/régi/új/g - A fájlbeli összes előfordulás helyettesítése :%s/régi/új/g - Mindenkori megerősítésre vár 'c' hatására :%s/régi/új/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.1. lecke: KÜLSŐ PARANCS VÉGREHAJTÁSA - - - ** :! után külső parancsot írva végrehajtódik a parancs. ** - - 1. Írjuk be az ismerős : parancsot, hogy a kurzort a képernyő aljára - helyezzük. Ez lehetővé teszi egy parancs beírását. - - 2. ! (felkiáltójel) beírásával tegyük lehetővé külső héj (shell)-parancs - végrehajtását. - - 3. Írjunk például ls parancsot a ! után majd üssünk -t. Ez ki - fogja listázni a könyvtárunkat ugyanúgy, mintha a shell promptnál - lennénk. Vagy írja ezt :!dir ha az ls nem működik. - -Megj: Ilymódon bármely külső utasítás végrehajtható. - -Megj: Minden : parancs után -t kell ütni. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.2. lecke: BŐVEBBEN A FÁJLOK ÍRÁSÁRÓL - - - ** A fájlok változásait így írhatjuk ki :w FÁJLNÉV. ** - - 1. :!dir vagy :!ls beírásával listázzuk a könyvtárunkat! - Ön már tudja, hogy -t kell ütnie utána. - - 2. Válasszon egy fájlnevet, amely még nem létezik pl. TESZT! - - 3. Írja: :w TESZT (ahol TESZT a választott fájlnév)! - - 4. Ez elmenti a teljes fájlt (a Vim oktatóját) TESZT néven. - Ellenőrzésképp írjuk ismét :!dir hogy lássuk a könyvtárat! - (Felfelé gombbal : után az előző utasítások visszahozhatóak.) - -Megj: Ha Ön kilépne a Vimből és és visszatérne a TESZT fájlnévvel, akkor a - fájl az oktató mentéskori pontos másolata lenne. - - 5. Távolítsa el a fájlt (MS-DOS): :!del TESZT - vagy (Unix): :!rm TESZT - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.3. lecke: EGY KIVÁLASZTOTT RÉSZ KIÍRÁSA - - - ** A fájl egy részének kiírásához írja :#,# w FÁJLNÉV ** - - 1. :!dir vagy :!ls beírásával listázza a könyvtárat, és válasszon egy - megfelelő fájlnevet, pl. TESZT. - - 2. Mozgassa a kurzort ennek az oldalnak a tetejére, és nyomjon - Ctrl-g-t, hogy megtudja a sorszámot. JEGYEZZE MEG A SZÁMOT! - - 3. Most menjen a lap aljára, és üsse be ismét: Ctrl-g. EZT A SZÁMOT - IS JEGYEZZE MEG! - - 4. Ha csak ezt a részét szeretné menteni a fájlnak, írja :#,# w TESZT - ahol #,# a két sorszám, amit megjegyzett, TESZT az Ön fájlneve. - - 5. Ismét nézze meg, hogy a fájl ott van (:!dir) de NE törölje. - - 6. Vimben létezik egy másik lehetőség: nyomja meg a Shift-V gombpárt - az első menteni kívánt soron, majd menjen le az utolsóra, ezután - írja :w TESZT2 Ekkor a TESZT2 fájlba kerül a kijelölt rész. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5.4. lecke: FÁJLOK VISSZAÁLLÍTÁSA ÉS ÖSSZEFŰZÉSE - - - ** Egy fájl tartalmának beillesztéséhez írja :r FÁJLNÉV ** - - 1. :!dir beírásával nézze meg, hogy az Ön TESZT fájlja létezik még. - - 2. Helyezze a kurzort ennek az oldalnak a tetejére. - -MEGJ: A 3. lépés után az 1.5.3. leckét fogja látni. Azután LEFELÉ indulva - keresse meg ismét ezt a leckét. - - 3. Most szúrja be a TESZT nevű fájlt a :r TESZT paranccsal, ahol - TESZT az Ön fájljának a neve. - -MEGJ: A fájl, amit beillesztett a kurzora alatt helyezkedik el. - - 4. Hogy ellenőrizzük, hogy a fájlt tényleg beillesztettük, menjen - vissza, és nézze meg, hogy kétszer szerepel az 1.5.3. lecke! Az eredeti - mellett a fájlból bemásolt is ott van. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.5. LECKE ÖSSZEFOGLALÓJA - - - 1. :!parancs végrehajt egy külső utasítást. - - Pár hasznos példa: - (MS-DOS) (Unix) - :!dir :!ls - könyvtárlista kiírása. - :!del FÁJLNÉV :!rm FÁJLNÉV - FÁJLNÉV nevű fájl törlése. - - 2. :w FÁJLNÉV kiírja a jelenlegi Vim-fájlt a lemezre FÁJNÉV néven. - - 3. :#,#w FÁJLNÉV kiírja a két sorszám (#) közötti sorokat FÁJLNÉV-be - Másik lehetőség, hogy a kezdősornál Shift-v-t nyom lemegy az utolsó - sorra, majd ezt üti be :w FÁJLNÉV - - 4. :r FÁJLNÉV beolvassa a FÁJLNÉV fájlt és behelyezi a jelenlegi fájlba - a kurzorpozíció utáni sorba. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.1. lecke: A MEGNYITÁS (OPEN) PARANCS - - -** o beírásával nyit egy új sort a kurzor alatt és beszúró módba vált ** - - 1. Mozgassuk a kurzort a ---> kezdetű sorra. - - 2. o (kicsi) beírásával nyisson egy sort a kurzor ALATT! Ekkor - automatikusan beszúró (insert) módba kerül. - - 3. Másolja le a ---> jelű sort és megnyomásával lépjen ki - a beszúró módból. - ----> Az o lenyomása után a kurzor a következő sor elején áll beszúró módban. - - 4. A kurzor FELETTI sor megnyitásához egyszerűen nagy O betűt írjon -kicsi helyett. Próbálja ki a következő soron! -Nyisson egy új sort efelett Shift-O megnyomásával, mialatt a kurzor -ezen a soron áll. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.2. lecke: AZ APPEND PARANCS - - - ** a lenyomásával a kurzor UTÁN szúrhatunk szöveget. ** - - 1. Mozgassuk a kurzort a következő ---> kezdetű sor végére úgy, - hogy normál módban $-t ír be. - - 2. Kis "a" leütésével szöveget szúrhat be AMÖGÉ a karakter mögé, - amelyen a kurzor áll. - (A nagy "A" az egész sor végére írja a szöveget.) - -Megj: A Vimben a sor legvégére is lehet állni, azonban ez elődjében - a Vi-ban nem lehetséges, ezért abban az a nélkül elég körülményes - a sor végéhez szöveget írni. - - 3. Egészítse ki az első sort. Vegye észre, hogy az a utasítás (append) - teljesen egyezik az i-vel (insert) csupán a beszúrt szöveg helye - különbözik. - ----> Ez a sor lehetővé teszi Önnek, hogy gyakorolja ----> Ez a sor lehetővé teszi Önnek, hogy gyakorolja a sor végére beillesztést. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.3. lecke: AZ ÁTÍRÁS MÁSIK VÁLTOZATA - - - ** Nagy R beírásával írhat felül több mint egy karaktert. ** - - 1. Mozgassuk a kurzort az első ---> kezdetű sorra! - - 2. Helyezze a kurzort az első szó elejére amely eltér a második - ---> kezdetű sor tartalmától (a 'az utolsóval' résztől). - - 3. Nyomjon R karaktert és írja át a szöveg maradékát az első sorban - úgy, hogy a két sor egyező legyen. - ----> Az első sort tegye azonossá az utolsóval: használja a gombokat. ----> Az első sort tegye azonossá a másodikkal: írjon R-t és az új szöveget. - - 4. Jegyezzük meg, ha -et nyomok, akkor a változatlanul hagyott - szövegek változatlanok maradnak. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6.4. lecke: BEÁLLÍTÁSOK - -** Állítsuk be, hogy a keresés és a helyettesítés ne függjön kis/NAGYbetűktől ** - - 1. Keressük meg az 'ignore'-t az beírva: - /ignore - Ezt ismételjük többször az n billentyűvel - - 2. Állítsuk be az 'ic' (Ignore case) lehetőséget így: - :set ic - - 3. Most keressünk ismét az 'ignore'-ra n-nel - Ismételjük meg többször a keresést: n - - 4. Állítsuk be a 'hlsearch' és 'incsearch' lehetőségeket: - :set hls is - - 5. Most ismét írjuk be a keresőparancsot, és lássuk mi történik: - /ignore - - 6. A kiemelést szüntessük meg alábbi utasítások egyikével: - :set nohls vagy :nohlsearch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.6. LECKE ÖSSZEFOGLALÓJA - - - 1. o beírásával új sort nyitunk meg a sor ALATT és a kurzor az új - sorban lesz beszúrás-módban. - Nagy O a sor FELETT nyit új sort, és oda kerül a kurzor. - - 2. a beírásával az aktuális karaktertől UTÁN (jobbra) szúrhatunk be szöveget. - Nagy A automatikusan a sor legvégéhez adja hozzá a szöveget. - - 3. A nagy R beütésével átíró (replace) módba kerülünk lenyomásáig. - - 4. ":set xxx" beírásával az "xxx" opció állítható be. - - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - 1.7. lecke: AZ ON-LINE SÚGÓ PARANCSAI - - - ** Az online súgórendszer használata ** - - A Vim részletes súgóval rendelkezik. Induláshoz a következők egyikét - tegye: - - nyomja meg a gombot (ha van ilyen) - - nyomja meg az gombot (ha van ilyen) - - írja be: :help - - :q beírásával zárhatja be a súgóablakot. - - Majdnem minden témakörről találhat súgót, argumentum megadásával - ":help" utasítás . Próbálja az alábbiakat ki (-t ne felejtsük): - - :help w - :help c_, 2006-2012 - diff --git a/runtime/tutor/tutor1.info b/runtime/tutor/tutor1.info deleted file mode 100644 index dccf4be6f5..0000000000 Binary files a/runtime/tutor/tutor1.info and /dev/null differ diff --git a/runtime/tutor/tutor1.it b/runtime/tutor/tutor1.it index 73a2289f5d..235a1920d3 100644 --- a/runtime/tutor/tutor1.it +++ b/runtime/tutor/tutor1.it @@ -2,19 +2,19 @@ = Benvenuto alla G u i d a all'Editor V I M - Versione 1.7 = =============================================================================== - Vim � un Editor molto potente ed ha parecchi comandi, troppi per + Vim è un Editor molto potente ed ha parecchi comandi, troppi per spiegarli tutti in una guida come questa. Questa guida serve a descrivere quei comandi che ti permettono di usare facilmente Vim come Editor di uso generale. - Il tempo necessario per completare la guida � circa 25-30 minuti, + Il tempo necessario per completare la guida è circa 25-30 minuti, a seconda di quanto tempo dedichi alla sperimentazione. ATTENZIONE! I comandi nelle lezioni modificano questo testo. Fai una copia di questo - file per esercitarti (se hai usato "vimtutor", stai gi� usando una copia). + file per esercitarti (se hai usato "vimtutor", stai già usando una copia). - � importante non scordare che questa guida vuole insegnare tramite + È importante non scordare che questa guida vuole insegnare tramite l'uso. Questo vuol dire che devi eseguire i comandi per impararli davvero. Se leggi il testo e basta, dimenticherai presto i comandi! @@ -27,22 +27,22 @@ ** Per muovere il cursore, premi i tasti h,j,k,l come indicato. ** ^ - k NOTA: Il tasto h � a sinistra e muove a sinistra. - < h l > Il tasto l � a destra e muove a destra. - j Il tasto j ricorda una freccia in gi�. + k NOTA: Il tasto h è a sinistra e muove a sinistra. + < h l > Il tasto l è a destra e muove a destra. + j Il tasto j ricorda una freccia in giù. v - 1. Muovi il cursore sullo schermo finch� non ti senti a tuo agio. + 1. Muovi il cursore sullo schermo finché non ti senti a tuo agio. - 2. Tieni schiacciato il tasto "gi�" (j) finch� non si ripete il movimento. + 2. Tieni schiacciato il tasto "giù" (j) finché non si ripete il movimento. Adesso sai come arrivare fino alla lezione seguente. - 3. Usando il tasto "gi�" spostati alla Lezione 1.1.2. + 3. Usando il tasto "giù" spostati alla Lezione 1.1.2. NOTA: Quando non sei sicuro del tasto che hai premuto, premi per andare - in Modalit� Normale [Normal Mode]. Poi ri-immetti il comando che volevi. + in Modalità Normale [Normal Mode]. Poi ri-immetti il comando che volevi. NOTA: I tasti con le frecce fanno lo stesso servizio. Ma usando hjkl riesci - a muoverti molto pi� rapidamente, dopo che ci si abitua. Davvero! + a muoverti molto più rapidamente, dopo che ci si abitua. Davvero! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.1.2: USCIRE DA VIM @@ -50,10 +50,10 @@ NOTA: I tasti con le frecce fanno lo stesso servizio. Ma usando hjkl riesci !! NOTA: Prima di eseguire quanto richiesto, leggi la Lezione per intero!! - 1. Premi il tasto (per assicurarti di essere in Modalit� Normale). + 1. Premi il tasto (per assicurarti di essere in Modalità Normale). 2. Batti: :q! . - Cos� esci dall'Editor SCARTANDO qualsiasi modifica fatta. + Così esci dall'Editor SCARTANDO qualsiasi modifica fatta. 3. Quando vedi il PROMPT della Shell, batti il comando con cui sei arrivato qui. Sarebbe: vimtutor @@ -64,7 +64,7 @@ NOTA: I tasti con le frecce fanno lo stesso servizio. Ma usando hjkl riesci NOTA: :q! SCARTA qualsiasi modifica fatta. In una delle prossime lezioni imparerai come salvare un file che hai modificato. - 5. Muovi in gi� il cursore per passare alla lezione 1.1.3. + 5. Muovi in giù il cursore per passare alla lezione 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -73,18 +73,18 @@ NOTA: :q! SCARTA qualsiasi modifica fatta. In una delle prossime ** Premere x per cancellare il carattere sotto al cursore ** - 1. Muovi il cursore alla linea pi� sotto, indicata da --->. + 1. Muovi il cursore alla linea più sotto, indicata da --->. 2. Per correggere errori, muovi il cursore fino a posizionarlo sopra il carattere da cancellare. 3. Premi il tasto x per cancellare il carattere sbagliato. - 4. Ripeti i passi da 2 a 4 finch� la frase � corretta. + 4. Ripeti i passi da 2 a 4 finché la frase è corretta. ----> La mmucca salt�� finnoo allaa lunnna. +---> La mmucca saltòò finnoo allaa lunnna. - 5. Ora che la linea � corretta, vai alla Lezione 1.1.4 + 5. Ora che la linea è corretta, vai alla Lezione 1.1.4 NOTA: Mentre segui questa guida, non cercare di imparare a memoria, ma impara facendo pratica. @@ -103,7 +103,7 @@ NOTA: Mentre segui questa guida, non cercare di imparare a memoria, 3. Premi i e batti le aggiunte opportune. - 4. Quando un errore � corretto, premi per tornare in Modalit� Normale. + 4. Quando un errore è corretto, premi per tornare in Modalità Normale. Ripeti i passi da 2 a 4 fino a completare la correzione della frase. ---> C'era del tsto mncnt questa . @@ -120,19 +120,19 @@ NOTA: Mentre segui questa guida, non cercare di imparare a memoria, ** Premere A per aggiungere testo a fine linea. ** 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. - Non importa dove � posizionato il cursore sulla linea stessa. + Non importa dove è posizionato il cursore sulla linea stessa. 2. Batti A e inserisci le necessarie aggiunte. - 3. Alla fine della aggiunta premi per tornare in modalit� Normale. + 3. Alla fine della aggiunta premi per tornare in modalità Normale. 4. Muovi il cursore alla seconda linea indicata ---> e ripeti i passi 2 e 3 per correggere questa frase. ----> C'� del testo che manca da qu - C'� del testo che manca da questa linea. ----> C'� anche del testo che ma - C'� anche del testo che manca qui. +---> C'è del testo che manca da qu + C'è del testo che manca da questa linea. +---> C'è anche del testo che ma + C'è anche del testo che manca qui. 5. Quando sei a tuo agio nell'aggiunta di testo vai alla lezione 1.1.6. @@ -147,7 +147,7 @@ NOTA: Mentre segui questa guida, non cercare di imparare a memoria, 1. Esci da Vim come hai fatto nella lezione 1.1.2: :q! 2. Quando vedi il PROMPT della Shell, batti il comando: vim tutor - 'vim' � il comando per richiamare Vim, 'tutor' � il nome del file che + 'vim' è il comando per richiamare Vim, 'tutor' è il nome del file che desideri modificare. Usa un file che possa essere modificato. 3. Inserisci e cancella testo come hai imparato nelle lezioni precedenti. @@ -164,7 +164,7 @@ NOTA: Mentre segui questa guida, non cercare di imparare a memoria, 1. Il cursore si muove usando i tasti con le frecce o i tasti hjkl. - h (sinistra) j (gi�) k (su) l (destra) + h (sinistra) j (giù) k (su) l (destra) 2. Per eseguire Vim dal PROMPT della Shell batti: vim NOMEFILE @@ -177,7 +177,7 @@ NOTA: Mentre segui questa guida, non cercare di imparare a memoria, i batti testo inserito inserisci prima del cursore A batti testo aggiunto aggiungi a fine linea -NOTA: premendo ritornerai in Modalit� Normale o annullerai +NOTA: premendo ritornerai in Modalità Normale o annullerai un comando errato che puoi aver inserito in parte. Ora continua con la Lezione 1.2. @@ -188,7 +188,7 @@ Ora continua con la Lezione 1.2. ** Batti dw per cancellare una parola. ** - 1. Premi per accertarti di essere in Modalit� Normale. + 1. Premi per accertarti di essere in Modalità Normale. 2. Muovi il cursore fino alla linea qui sotto, indicata da --->. @@ -196,13 +196,13 @@ Ora continua con la Lezione 1.2. 4. Batti dw per cancellare la parola. -NOTA: La lettera d sar� visibile sull'ultima linea dello schermo mentre la +NOTA: La lettera d sarà visibile sull'ultima linea dello schermo mentre la batti. Vim attende che tu batta w . Se vedi una lettera diversa da d hai battuto qualcosa di sbagliato; premi e ricomincia. ---> Ci sono le alcune parole gioia che non c'entrano carta in questa frase. - 5. Ripeti i passi 3 e 4 finch� la frase � corretta, poi vai alla Lezione 1.2.2. + 5. Ripeti i passi 3 e 4 finché la frase è corretta, poi vai alla Lezione 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -211,7 +211,7 @@ NOTA: La lettera d sar ** Batti d$ per cancellare fino a fine linea. ** - 1. Premi per accertarti di essere in Modalit� Normale. + 1. Premi per accertarti di essere in Modalità Normale. 2. Muovi il cursore fino alla linea qui sotto, indicata da --->. @@ -233,12 +233,12 @@ NOTA: La lettera d sar Molti comandi di modifica testi consistono in un operatore e un movimento. - Il formato del comando di cancellazione con l'operatore d � il seguente: + Il formato del comando di cancellazione con l'operatore d è il seguente: d movimento Dove: - d - � l'operatore di cancellazione + d - è l'operatore di cancellazione movimento - indica dove l'operatore va applicato (lista qui sotto). Breve lista di movimenti: @@ -248,8 +248,8 @@ NOTA: La lettera d sar Quindi se batti de cancelli dal cursore fino a fine parola. -NOTA: Se batti solo il movimento mentre sei in Modalit� Normale, senza - nessun operatore, il cursore si muover� come specificato. +NOTA: Se batti solo il movimento mentre sei in Modalità Normale, senza + nessun operatore, il cursore si muoverà come specificato. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.2.4: USO DI UN CONTATORE PER UN MOVIMENTO @@ -259,7 +259,7 @@ NOTA: Se batti solo il movimento mentre sei in Modalit 1. Muovi il cursore fino all'inizio della linea qui sotto, indicata da --->. - 2. Batti 2w per spostare il cursore due parole pi� avanti. + 2. Batti 2w per spostare il cursore due parole più avanti. 3. Batti 3e per spostare il cursore alla fine della terza parola seguente. @@ -267,7 +267,7 @@ NOTA: Se batti solo il movimento mentre sei in Modalit 5. Ripeti i passi 2 e 3 usando numeri differenti. ----> Questa � solo una linea con parole all'interno della quale puoi muoverti. +---> Questa è solo una linea con parole all'interno della quale puoi muoverti. 6. Vai alla Lezione 1.2.5. @@ -281,7 +281,7 @@ NOTA: Se batti solo il movimento mentre sei in Modalit ** Se batti un numero prima di un movimento, lo ripeti altrettante volte. ** Nella combinazione dell'operatore cancella e di un movimento, descritto prima, - inserite un contatore prima del movimento per cancellare di pi�: + inserite un contatore prima del movimento per cancellare di più: d numero movimento 1. Muovi il cursore alla prima parola MAIUSCOLA nella riga indicata da --->. @@ -291,7 +291,7 @@ NOTA: Se batti solo il movimento mentre sei in Modalit 3. Ripeti i passi 1 e 2 con un contatore diverso per cancellare le parole MAIUSCOLE consecutive con un solo comando ----> questa ABC DE linea FGHI JK LMN OP di parole � Q RS TUV ora ripulita. +---> questa ABC DE linea FGHI JK LMN OP di parole è Q RS TUV ora ripulita. @@ -303,7 +303,7 @@ NOTA: Se batti solo il movimento mentre sei in Modalit ** Batti dd per cancellare un'intera linea. ** Per la frequenza con cui capita di cancellare linee intere, chi ha - disegnato Vi ha deciso che sarebbe stato pi� semplice battere + disegnato Vi ha deciso che sarebbe stato più semplice battere due d consecutive per cancellare una linea. 1. Muovi il cursore alla linea 2) nella frase qui sotto. @@ -312,12 +312,12 @@ NOTA: Se batti solo il movimento mentre sei in Modalit 4. Batti 2dd per cancellare due linee. ---> 1) Le rose sono rosse, ----> 2) Il fango � divertente, +---> 2) Il fango è divertente, ---> 3) Le viole sono blu, ---> 4) Io ho un'automobile, ---> 5) Gli orologi segnano il tempo, ----> 6) Lo zucchero � dolce, ----> 7) E cos� sei anche tu. +---> 6) Lo zucchero è dolce, +---> 7) E così sei anche tu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -332,8 +332,8 @@ NOTA: Se batti solo il movimento mentre sei in Modalit 3. Adesso batti u per annullare l'ultimo comando eseguito. 4. Ora invece, correggi tutti gli errori sulla linea usando il comando x . 5. Adesso batti una U Maiuscola per riportare la linea al suo stato originale. - 6. Adesso batti u pi� volte per annullare la U e i comandi precedenti. - 7. Adesso batti pi� volte CTRL-r (tieni il tasto CTRL schiacciato + 6. Adesso batti u più volte per annullare la U e i comandi precedenti. + 7. Adesso batti più volte CTRL-r (tieni il tasto CTRL schiacciato mentre batti r) per rieseguire i comandi (annullare l'annullamento). ---> Correeggi gli errori ssu quuesta linea e riimpiazzali coon "undo". @@ -350,8 +350,8 @@ NOTA: Se batti solo il movimento mentre sei in Modalit 1. Per cancellare dal cursore fino alla parola seguente batti: dw 2. Per cancellare dal cursore fino alla fine della linea batti: d$ 3. Per cancellare un'intera linea batti: dd - 4. Per eseguire pi� volte un movimento, mettici davanti un numero: 2w - 5. Il formato per un comando di modifica �: + 4. Per eseguire più volte un movimento, mettici davanti un numero: 2w + 5. Il formato per un comando di modifica è: operatore [numero] movimento dove: @@ -401,7 +401,7 @@ NOTA: Se batti solo il movimento mentre sei in Modalit 3. Batti r e poi il carattere che dovrebbe stare qui. - 4. Ripeti i passi 2 e 3 finch� la prima linea � uguale alla seconda. + 4. Ripeti i passi 2 e 3 finché la prima linea è uguale alla seconda. ---> Ammattendo quetta lince, qualcuno ho predato alcuni tosti sballiati! ---> Immettendo questa linea, qualcuno ha premuto alcuni tasti sbagliati! @@ -426,12 +426,12 @@ NOTA: Ricordati che dovresti imparare con la pratica, non solo leggendo. 4. Premi e vai sul prossimo carattere da modificare. - 5. Ripeti i passi 3 e 4 finch� la prima frase � uguale alla seconda. + 5. Ripeti i passi 3 e 4 finché la prima frase è uguale alla seconda. ---> Questa lubw ha alcune pptfd da asdert usgfk l'operatore CHANGE. ---> Questa linea ha alcune parole da cambiare usando l'operatore CHANGE. -Nota che ce cancella la parola, e ti mette anche in Modalit� Inserimento +Nota che ce cancella la parola, e ti mette anche in Modalità Inserimento [Insert Mode] @@ -440,7 +440,7 @@ Nota che ce cancella la parola, e ti mette anche in Modalit ** L'operatore c [CHANGE] agisce sugli stessi movimenti di d [DELETE] ** - 1. L'operatore CHANGE si comporta come DELETE. Il formato �: + 1. L'operatore CHANGE si comporta come DELETE. Il formato è: c [numero] movimento @@ -464,7 +464,7 @@ NOTA: Puoi usare il tasto Backspace se devi correggere errori di battitura. 1. Per reinserire del testo appena cancellato, batti p . Questo inserisce [pone] il testo cancellato DOPO il cursore (se era stata tolta - una linea intera, questa verr� messa nella linea SOTTO il cursore). + una linea intera, questa verrà messa nella linea SOTTO il cursore). 2. Per rimpiazzare il carattere sotto il cursore, batti r e poi il carattere che vuoi sostituire. @@ -473,7 +473,7 @@ NOTA: Puoi usare il tasto Backspace se devi correggere errori di battitura. arriva il movimento. Ad es. Batti ce per cambiare dal cursore fino alla fine della parola, c$ per cambiare fino a fine linea. - 4. Il formato di change �: + 4. Il formato di change è: c [numero] movimento @@ -490,17 +490,17 @@ Ora vai alla prossima Lezione. NOTA: Leggi l'intera Lezione prima di eseguire un qualsiasi passo!! 1. Tieni premuto il tasto CTRL e batti g . Ossia batti CTRL-G. - Un messaggio apparir� in fondo alla pagina con il NOME FILE e la + Un messaggio apparirà in fondo alla pagina con il NOME FILE e la posizione nel file. Ricordati il numero della linea per il Passo 3. NOTA: La posizione del cursore si vede nell'angolo in basso a destra dello - schermo, se � impostata l'opzione 'ruler' (righello, vedi :help ruler). + schermo, se è impostata l'opzione 'ruler' (righello, vedi :help ruler). 2. Premi G [G Maiuscolo] per posizionarti in fondo al file. Batti gg per posizionarti in cima al file. 3. Batti il numero della linea in cui ti trovavi e poi G . Questo ti - riporter� fino alla linea in cui ti trovavi quando avevi battuto CTRL-g. + riporterà fino alla linea in cui ti trovavi quando avevi battuto CTRL-g. 4. Se ti senti sicuro nel farlo, esegui i passi da 1 a 3. @@ -509,10 +509,10 @@ NOTA: La posizione del cursore si vede nell'angolo in basso a destra dello ** Batti / seguito da una frase per ricercare quella frase. ** - 1. in Modalit� Normale batti il carattere / . Nota che la "/" e il cursore + 1. in Modalità Normale batti il carattere / . Nota che la "/" e il cursore sono visibili in fondo dello schermo come quando si usa il comando : . - 2. Adesso batti 'errroore' . Questa � la parola che vuoi ricercare. + 2. Adesso batti 'errroore' . Questa è la parola che vuoi ricercare. 3. Per ricercare ancora la stessa frase, batti soltanto n . Per ricercare la stessa frase in direzione opposta, batti N . @@ -523,7 +523,7 @@ NOTA: La posizione del cursore si vede nell'angolo in basso a destra dello schiacciato mentre premi la lettera o). Ripeti CTRL-O per andare ancora indietro. Puoi usare CTRL-I per tornare in avanti. ----> "errroore" non � il modo giusto di digitare errore; errroore � un errore. +---> "errroore" non è il modo giusto di digitare errore; errroore è un errore. NOTA: Quando la ricerca arriva a fine file, ricomincia dall'inizio del file, a meno che l'opzione 'wrapscan' sia stata disattivata. @@ -537,14 +537,14 @@ NOTA: Quando la ricerca arriva a fine file, ricomincia dall'inizio del file, 2. Adesso batti il carattere % . - 3. Il cursore si sposter� sulla parentesi corrispondente. + 3. Il cursore si sposterà sulla parentesi corrispondente. 4. Batti % per muovere il cursore all'altra parentesi corrispondente. ----> Questa ( � una linea di test con (, [ ] e { } al suo interno. )) +---> Questa ( è una linea di test con (, [ ] e { } al suo interno. )) -NOTA: Questo � molto utile nel "debug" di un programma con parentesi errate! +NOTA: Questo è molto utile nel "debug" di un programma con parentesi errate! @@ -564,7 +564,7 @@ NOTA: Questo sostituire "globalmente" sulla linea, ossia tutte le occorrenze di "lla" sulla linea. ----> lla stagione migliore per lla fioritura � lla primavera. +---> lla stagione migliore per lla fioritura è lla primavera. 4. Per cambiare ogni ricorrenza di una stringa di caratteri tra due linee, batti :#,#s/vecchio/nuovo/g dove #,# sono i numeri che delimitano @@ -586,7 +586,7 @@ NOTA: Questo Battendo ? seguito da una frase ricerca ALL'INDIETRO quella frase. DOPO una ricerca batti n per trovare la prossima occorrenza nella stessa direzione, oppure N per cercare in direzione opposta. - CTRL-O ti porta alla posizione precedente, CTRL-I a quella pi� nuova. + CTRL-O ti porta alla posizione precedente, CTRL-I a quella più nuova. 3. Battendo % mentre il cursore si trova su (,),[,],{, oppure } ti posizioni sulla corrispondente parentesi. @@ -603,9 +603,9 @@ NOTA: Questo ** Batti :! seguito da un comando esterno per eseguire quel comando. ** 1. Batti il comando : per posizionare il cursore in fondo allo schermo. - Ci� ti permette di immettere un comando dalla linea comandi. + Ciò ti permette di immettere un comando dalla linea comandi. - 2. Adesso batti il carattere ! (punto esclamativo). Ci� ti permette di + 2. Adesso batti il carattere ! (punto esclamativo). Ciò ti permette di eseguire qualsiasi comando esterno si possa eseguire nella "shell". 3. Ad esempio batti ls dopo il ! e poi premi . Questo @@ -626,17 +626,17 @@ NOTA: Tutti i comandi : devono essere terminati premendo ** Per salvare le modifiche apportate a un testo batti :w NOMEFILE. ** 1. Batti :!dir or :!ls per procurarti una lista della tua directory. - Gi� sai che devi premere dopo aver scritto il comando. + Già sai che devi premere dopo aver scritto il comando. 2. Scegli un NOMEFILE che ancora non esista, ad es. TEST . - 3. Adesso batti: :w TEST (dove TEST � il NOMEFILE che hai scelto). + 3. Adesso batti: :w TEST (dove TEST è il NOMEFILE che hai scelto). 4. Questo salva l'intero file ("tutor.it") con il nome di TEST. Per verifica batti ancora :!dir o :!ls per listare la tua directory. NOTA: Se esci da Vim e riesegui Vim battendo vim TEST , il file aperto - sar� una copia esatta di "tutor.it" al momento del salvataggio. + sarà una copia esatta di "tutor.it" al momento del salvataggio. 5. Ora cancella il file battendo (MS-DOS): :!del TEST o (Unix): :!rm TEST @@ -652,17 +652,17 @@ NOTA: Se esci da Vim e riesegui Vim battendo vim TEST , il file aperto 2. Premi v e muovi il cursore fino alla linea numerata 5., qui sotto. Nota che il testo viene evidenziato. - 3. Batti il carattere : . In fondo allo schermo apparir� :'<,'> . + 3. Batti il carattere : . In fondo allo schermo apparirà :'<,'> . - 4. Batti w TEST , dove TEST � il nome di un file non ancora esistente. + 4. Batti w TEST , dove TEST è il nome di un file non ancora esistente. Verifica che si veda :'<,'>w TEST prima di dare . - 5. Vim scriver� nel file TEST le linee che hai selezionato. Usa :!dir - o :!ls per controllare che esiste. Non cancellarlo ora! Ti servir� + 5. Vim scriverà nel file TEST le linee che hai selezionato. Usa :!dir + o :!ls per controllare che esiste. Non cancellarlo ora! Ti servirà nella prossima lezione. NOTA: Battere v inizia una selezione visuale. Puoi muovere il cursore - come vuoi, e rendere la selezione pi� piccola o pi� grande. Poi + come vuoi, e rendere la selezione più piccola o più grande. Poi puoi usare un operatore per agire sul testo selezionato. Ad es., d cancella il testo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -676,11 +676,11 @@ NOTA: Battere v inizia una selezione visuale. Puoi muovere il cursore NOTA: Dopo aver eseguito il Passo 2 vedrai il testo della Lezione 1.5.3. Quindi spostati IN GIU' per tornare ancora a questa Lezione. - 2. Ora inserisci il tuo file TEST con il comando :r TEST dove TEST � + 2. Ora inserisci il tuo file TEST con il comando :r TEST dove TEST è il nome che hai usato per creare il file. - Il file richiesto � inserito sotto la linea in cui si trova il cursore. + Il file richiesto è inserito sotto la linea in cui si trova il cursore. - 3. Per verificare che un file � stato inserito, torna indietro col cursore + 3. Per verificare che un file è stato inserito, torna indietro col cursore e nota che ci sono ora 2 copie della Lezione 1.5.3, quella originale e quella che viene dal file. @@ -704,10 +704,10 @@ NOTA: Puoi anche leggere l'output prodotto da un comando esterno. Ad es. visuale nel file NOMEFILE. 4. :r NOMEFILE legge il file NOMEFILE da disco e lo inserisce nel file - che stai modificando, dopo la linea in cui � posizionato il cursore. + che stai modificando, dopo la linea in cui è posizionato il cursore. 5. :r !dir legge l'output del comando dir e lo inserisce dopo la - linea in cui � posizionato il cursore. + linea in cui è posizionato il cursore. @@ -716,21 +716,21 @@ NOTA: Puoi anche leggere l'output prodotto da un comando esterno. Ad es. ** Batti o per aprire una linea sotto il cursore ** - ** e passare in Modalit� Inserimento. ** + ** e passare in Modalità Inserimento. ** 1. Muovi il cursore fino alla linea qui sotto, indicata da --->. 2. Batti la lettera minuscola o per aprire una linea sotto il cursore e - passare in Modalit� Inserimento. + passare in Modalità Inserimento. 3. Poi inserisci del testo e premi per uscire dalla - Modalit� Inserimento. + Modalità Inserimento. ----> Dopo battuto o il cursore � sulla linea aperta (in Modalit� Inserimento). +---> Dopo battuto o il cursore è sulla linea aperta (in Modalità Inserimento). 4. Per aprire una linea SOPRA il cursore, batti una O maiuscola, invece che una o minuscola. Prova sulla linea qui sotto. ----> Apri una linea SOPRA questa battendo O mentre il cursore � su questa linea. +---> Apri una linea SOPRA questa battendo O mentre il cursore è su questa linea. @@ -741,27 +741,27 @@ NOTA: Puoi anche leggere l'output prodotto da un comando esterno. Ad es. 1. Muovi il cursore all'inizio della linea qui sotto, indicata da --->. - 2. Batti e finch� il cursore arriva alla fine di li . + 2. Batti e finché il cursore arriva alla fine di li . 3. Batti una a (minuscola) per aggiungere testo DOPO il cursore. 4. Completa la parola come mostrato nella linea successiva. Premi - per uscire dalla Modalit� Inserimento. + per uscire dalla Modalità Inserimento. 5. Usa e per passare alla successiva parola incompleta e ripeti i passi 3 e 4. ----> Questa li ti permetter� di esercit ad aggiungere testo a una linea. ----> Questa linea ti permetter� di esercitarti ad aggiungere testo a una linea. +---> Questa li ti permetterà di esercit ad aggiungere testo a una linea. +---> Questa linea ti permetterà di esercitarti ad aggiungere testo a una linea. -NOTA: a, i ed A entrano sempre in Modalit� Inserimento, la sola differenza - � dove verranno inseriti i caratteri. +NOTA: a, i ed A entrano sempre in Modalità Inserimento, la sola differenza + è dove verranno inseriti i caratteri. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lezione 1.6.3: UN ALTRO MODO DI RIMPIAZZARE [REPLACE] - ** Batti una R maiuscola per rimpiazzare pi� di un carattere. ** + ** Batti una R maiuscola per rimpiazzare più di un carattere. ** 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. Muovi il cursore all'inizio del primo xxx . @@ -769,7 +769,7 @@ NOTA: a, i ed A entrano sempre in Modalit 2. Ora batti R e batti il numero che vedi nella linea seguente, in modo che rimpiazzi l' xxx . - 3. Premi per uscire dalla Modalit� Replace. Nota che il resto della + 3. Premi per uscire dalla Modalità Replace. Nota che il resto della linea resta invariato. 4. Ripeti i passi in modo da rimpiazzare l'altro xxx . @@ -777,7 +777,7 @@ NOTA: a, i ed A entrano sempre in Modalit ---> Aggiungendo 123 a xxx si ottiene xxx. ---> Aggiungendo 123 a 456 si ottiene 579. -NOTA: La Modalit� Replace � come la Modalit� Inserimento, ma ogni carattere +NOTA: La Modalità Replace è come la Modalità Inserimento, ma ogni carattere che viene battuto ricopre un carattere esistente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -788,7 +788,7 @@ NOTA: La Modalit 1. Vai alla linea indicata da ---> qui sotto, e metti il cursore dopo "a)". - 2. Entra in Modalit� Visuale con v e metti il cursore davanti a "primo". + 2. Entra in Modalità Visuale con v e metti il cursore davanti a "primo". 3. Batti y per copiare [yank] il testo evidenziato. @@ -796,10 +796,10 @@ NOTA: La Modalit 5. Batti p per incollare [paste] il testo. Poi batti: a secondo . - 6. Usa la Modalit� Visuale per selezionare " elemento.", copialo con y , + 6. Usa la Modalità Visuale per selezionare " elemento.", copialo con y , Vai alla fine della linea successiva con j$ e incolla il testo con p . ----> a) questo � il primo elemento. +---> a) questo è il primo elemento. b) NOTA: Puoi usare y come operatore; yw copia una parola [word]. @@ -810,7 +810,7 @@ NOTA: Puoi usare y come operatore; yw copia una parola [word]. ** durante la ricerca/sostituzione ** 1. Ricerca 'nota' battendo: /nota - Ripeti la ricerca pi� volte usando il tasto n + Ripeti la ricerca più volte usando il tasto n 2. Imposta l'opzione 'ic' (Ignore Case, [Ignora maiuscolo/minuscolo]) battendo: :set ic @@ -830,7 +830,7 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c Lezione 1.6 SOMMARIO 1. Batti o per aggiungere una linea SOTTO il cursore ed entrare in - Modalit� Inserimento. + Modalità Inserimento. Batti O per aggiungere una linea SOPRA il cursore. 2. Batti a per inserire testo DOPO il cursore. @@ -840,7 +840,7 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c 4. L'operatore y copia del testo, p incolla del testo. - 5. Batti R per entrare in Modalit� Replace, e ne esci premendo . + 5. Batti R per entrare in Modalità Replace, e ne esci premendo . 6. Batti ":set xxx" per impostare l'opzione "xxx". Alcun opzioni sono: 'ic' 'ignorecase' ignorare maiuscole/minuscole nella ricerca @@ -856,8 +856,8 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c Vim ha un esauriente sistema di aiuto on-line. Per cominciare, prova una di queste alternative: - - premi il tasto (se ce n'� uno) - - premi il tasto (se ce n'� uno) + - premi il tasto (se ce n'è uno) + - premi il tasto (se ce n'è uno) - batti :help OPPURE :h Leggi il testo nella finestra di aiuto per vedere come funziona l'aiuto. @@ -877,8 +877,8 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c ** Attiva le opzioni Vim ** - Vim ha molte pi� opzioni di Vi, ma molte di esse sono predefinite inattive. - Per cominciare a usare pi� opzioni, devi creare un file "vimrc". + Vim ha molte più opzioni di Vi, ma molte di esse sono predefinite inattive. + Per cominciare a usare più opzioni, devi creare un file "vimrc". 1. Comincia a editare il file "vimrc". Questo dipende dal tuo sistema: :e ~/.vimrc per Unix @@ -891,7 +891,7 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c 3. Scrivi il file con: :w - La prossima volta che apri Vim, sar� abilitata la colorazione sintattica. + La prossima volta che apri Vim, sarà abilitata la colorazione sintattica. Puoi aggiungere a questo file "vimrc" tutte le tue impostazioni preferite. Per maggiori informazioni batti: :help vimrc-intro @@ -901,7 +901,7 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c ** Completamento linea comandi con CTRL-D e ** - 1. Imposta Vim in modalit� compatibile: :set nocp + 1. Imposta Vim in modalità compatibile: :set nocp 2. Guarda i file esistenti nella directory: :!ls o :!dir @@ -913,9 +913,9 @@ NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c 6. Ora batti uno spazio e l'inizio del nome di un file esistente: :edit FIL - 7. Premi . Vim completer� il nome del file (se � il solo possibile). + 7. Premi . Vim completerà il nome del file (se è il solo possibile). -NOTA: Il completamento � disponibile per molti comandi. Prova a battere +NOTA: Il completamento è disponibile per molti comandi. Prova a battere CTRL-D e . Particolarmente utile per :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -942,9 +942,9 @@ NOTA: Il completamento ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Qui finisce la Guida a Vim. Il suo intento � di fornire una breve panoramica + Qui finisce la Guida a Vim. Il suo intento è di fornire una breve panoramica dell'Editor Vim, che ti consenta di usare l'Editor abbastanza facilmente. - Questa guida � largamente incompleta poich� Vim ha moltissimi altri comandi. + Questa guida è largamente incompleta poiché Vim ha moltissimi altri comandi. Puoi anche leggere il manuale utente (anche in italiano): ":help user-manual". Per ulteriore lettura e studio, raccomandiamo: @@ -953,13 +953,13 @@ NOTA: Il completamento Contiene molti esempi e figure. Vedi https://iccf-holland.org/click5.html - Quest'altro libro � pi� su Vi che su Vim, ma � pure consigliato: + Quest'altro libro è più su Vi che su Vim, ma è pure consigliato: Learning the Vi Editor - di Linda Lamb e Arnold Robbins Editore: O'Reilly & Associates Inc. - � un buon libro per imparare quasi tutto ci� che puoi voler fare con Vi. + È un buon libro per imparare quasi tutto ciò che puoi voler fare con Vi. Ne esiste una traduzione italiana, basata su una vecchia edizione. - Questa guida � stata scritta da Michael C. Pierce e Robert K. Ware, + Questa guida è stata scritta da Michael C. Pierce e Robert K. Ware, Colorado School of Mines, usando idee fornite da Charles Smith, Colorado State University - E-mail: bware@mines.colorado.edu Modificato per Vim da Bram Moolenaar. diff --git a/runtime/tutor/tutor1.it.utf-8 b/runtime/tutor/tutor1.it.utf-8 deleted file mode 100644 index 235a1920d3..0000000000 --- a/runtime/tutor/tutor1.it.utf-8 +++ /dev/null @@ -1,967 +0,0 @@ -=============================================================================== -= Benvenuto alla G u i d a all'Editor V I M - Versione 1.7 = -=============================================================================== - - Vim è un Editor molto potente ed ha parecchi comandi, troppi per - spiegarli tutti in una guida come questa. Questa guida serve a - descrivere quei comandi che ti permettono di usare facilmente - Vim come Editor di uso generale. - - Il tempo necessario per completare la guida è circa 25-30 minuti, - a seconda di quanto tempo dedichi alla sperimentazione. - - ATTENZIONE! - I comandi nelle lezioni modificano questo testo. Fai una copia di questo - file per esercitarti (se hai usato "vimtutor", stai già usando una copia). - - È importante non scordare che questa guida vuole insegnare tramite - l'uso. Questo vuol dire che devi eseguire i comandi per impararli - davvero. Se leggi il testo e basta, dimenticherai presto i comandi! - - Adesso, assicurati che il tasto BLOCCA-MAIUSCOLO non sia schiacciato - e premi il tasto j tanto da muovere il cursore fino a che la - Lezione 1.1.1 riempia completamente lo schermo. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.1.1: MOVIMENTI DEL CURSORE - - - ** Per muovere il cursore, premi i tasti h,j,k,l come indicato. ** - ^ - k NOTA: Il tasto h è a sinistra e muove a sinistra. - < h l > Il tasto l è a destra e muove a destra. - j Il tasto j ricorda una freccia in giù. - v - 1. Muovi il cursore sullo schermo finché non ti senti a tuo agio. - - 2. Tieni schiacciato il tasto "giù" (j) finché non si ripete il movimento. - Adesso sai come arrivare fino alla lezione seguente. - - 3. Usando il tasto "giù" spostati alla Lezione 1.1.2. - -NOTA: Quando non sei sicuro del tasto che hai premuto, premi per andare - in Modalità Normale [Normal Mode]. Poi ri-immetti il comando che volevi. - -NOTA: I tasti con le frecce fanno lo stesso servizio. Ma usando hjkl riesci - a muoverti molto più rapidamente, dopo che ci si abitua. Davvero! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.1.2: USCIRE DA VIM - - - !! NOTA: Prima di eseguire quanto richiesto, leggi la Lezione per intero!! - - 1. Premi il tasto (per assicurarti di essere in Modalità Normale). - - 2. Batti: :q! . - Così esci dall'Editor SCARTANDO qualsiasi modifica fatta. - - 3. Quando vedi il PROMPT della Shell, batti il comando con cui sei arrivato - qui. Sarebbe: vimtutor - - 4. Se hai memorizzato questi comandi e ti senti pronto, esegui i passi - da 1 a 3 per uscire e rientrare nell'Editor. - -NOTA: :q! SCARTA qualsiasi modifica fatta. In una delle prossime - lezioni imparerai come salvare un file che hai modificato. - - 5. Muovi in giù il cursore per passare alla lezione 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.1.3: MODIFICA DI TESTI - CANCELLAZIONE - - - ** Premere x per cancellare il carattere sotto al cursore ** - - 1. Muovi il cursore alla linea più sotto, indicata da --->. - - 2. Per correggere errori, muovi il cursore fino a posizionarlo sopra il - carattere da cancellare. - - 3. Premi il tasto x per cancellare il carattere sbagliato. - - 4. Ripeti i passi da 2 a 4 finché la frase è corretta. - ----> La mmucca saltòò finnoo allaa lunnna. - - 5. Ora che la linea è corretta, vai alla Lezione 1.1.4 - -NOTA: Mentre segui questa guida, non cercare di imparare a memoria, - ma impara facendo pratica. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.1.4: MODIFICA DI TESTI - INSERIMENTO - - - ** Premere i per inserire testo. ** - - 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. - - 2. Per rendere la prima linea uguale alla seconda, muovi il cursore sopra - il primo carattere DOPO la posizione in cui il testo va inserito. - - 3. Premi i e batti le aggiunte opportune. - - 4. Quando un errore è corretto, premi per tornare in Modalità Normale. - Ripeti i passi da 2 a 4 fino a completare la correzione della frase. - ----> C'era del tsto mncnt questa . ----> C'era del testo mancante da questa linea. - - 5. Quando sei a tuo agio nell'inserimento di testo vai alla lezione 1.1.5. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.1.5: MODIFICA DI TESTI - AGGIUNTA - - - ** Premere A per aggiungere testo a fine linea. ** - - 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. - Non importa dove è posizionato il cursore sulla linea stessa. - - 2. Batti A e inserisci le necessarie aggiunte. - - 3. Alla fine della aggiunta premi per tornare in modalità Normale. - - 4. Muovi il cursore alla seconda linea indicata ---> e ripeti - i passi 2 e 3 per correggere questa frase. - ----> C'è del testo che manca da qu - C'è del testo che manca da questa linea. ----> C'è anche del testo che ma - C'è anche del testo che manca qui. - - 5. Quando sei a tuo agio nell'aggiunta di testo vai alla lezione 1.1.6. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.1.6: MODIFICARE UN FILE - - - ** Usare :wq per salvare un file e uscire. ** - - !! NOTA: Prima di eseguire quanto richiesto, leggi la Lezione per intero!! - - 1. Esci da Vim come hai fatto nella lezione 1.1.2: :q! - - 2. Quando vedi il PROMPT della Shell, batti il comando: vim tutor - 'vim' è il comando per richiamare Vim, 'tutor' è il nome del file che - desideri modificare. Usa un file che possa essere modificato. - - 3. Inserisci e cancella testo come hai imparato nelle lezioni precedenti. - - 4. Salva il file ed esci da Vim con: :wq - - 5. Rientra in vimtutor e scendi al sommario che segue. - - 6. Dopo aver letto i passi qui sopra ed averli compresi: eseguili. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.1 SOMMARIO - - - 1. Il cursore si muove usando i tasti con le frecce o i tasti hjkl. - h (sinistra) j (giù) k (su) l (destra) - - 2. Per eseguire Vim dal PROMPT della Shell batti: vim NOMEFILE - - 3. Per uscire da Vim batti: :q! per uscire senza salvare. - oppure batti: :wq per uscire salvando modifiche. - - 4. Per cancellare il carattere sotto al cursore batti: x - - 5. Per inserire testo subito prima del cursore batti: - i batti testo inserito inserisci prima del cursore - A batti testo aggiunto aggiungi a fine linea - -NOTA: premendo ritornerai in Modalità Normale o annullerai - un comando errato che puoi aver inserito in parte. - -Ora continua con la Lezione 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.2.1: COMANDI DI CANCELLAZIONE - - - ** Batti dw per cancellare una parola. ** - - 1. Premi per accertarti di essere in Modalità Normale. - - 2. Muovi il cursore fino alla linea qui sotto, indicata da --->. - - 3. Muovi il cursore all'inizio di una parola che vuoi cancellare. - - 4. Batti dw per cancellare la parola. - -NOTA: La lettera d sarà visibile sull'ultima linea dello schermo mentre la - batti. Vim attende che tu batta w . Se vedi una lettera diversa - da d hai battuto qualcosa di sbagliato; premi e ricomincia. - ----> Ci sono le alcune parole gioia che non c'entrano carta in questa frase. - - 5. Ripeti i passi 3 e 4 finché la frase è corretta, poi vai alla Lezione 1.2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.2.2: ALTRI COMANDI DI CANCELLAZIONE - - - ** Batti d$ per cancellare fino a fine linea. ** - - 1. Premi per accertarti di essere in Modalità Normale. - - 2. Muovi il cursore fino alla linea qui sotto, indicata da --->. - - 3. Muovi il cursore alla fine della linea corretta (DOPO il primo . ). - - 4. Batti d$ per cancellare fino a fine linea. - ----> Qualcuno ha battuto la fine di questa linea due volte. linea due volte. - - - 5. Vai alla Lezione 1.2.3 per capire il funzionamento di questo comando. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.2.3: OPERATORI E MOVIMENTI - - - Molti comandi di modifica testi consistono in un operatore e un movimento. - Il formato del comando di cancellazione con l'operatore d è il seguente: - - d movimento - - Dove: - d - è l'operatore di cancellazione - movimento - indica dove l'operatore va applicato (lista qui sotto). - - Breve lista di movimenti: - w - fino a inizio della parola seguente, ESCLUSO il suo primo carattere. - e - alla fine della parola corrente, COMPRESO il suo ultimo carattere. - $ - dal cursore fino a fine linea, COMPRESO l'ultimo carattere della linea. - - Quindi se batti de cancelli dal cursore fino a fine parola. - -NOTA: Se batti solo il movimento mentre sei in Modalità Normale, senza - nessun operatore, il cursore si muoverà come specificato. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.2.4: USO DI UN CONTATORE PER UN MOVIMENTO - - - ** Se batti un numero prima di un movimento, lo ripeti altrettante volte. ** - - 1. Muovi il cursore fino all'inizio della linea qui sotto, indicata da --->. - - 2. Batti 2w per spostare il cursore due parole più avanti. - - 3. Batti 3e per spostare il cursore alla fine della terza parola seguente. - - 4. Batti 0 (zero) per posizionarti all'inizio della linea. - - 5. Ripeti i passi 2 e 3 usando numeri differenti. - ----> Questa è solo una linea con parole all'interno della quale puoi muoverti. - - 6. Vai alla Lezione 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.2.5: USO DI UN CONTATORE PER CANCELLARE DI PIU' - - - ** Se batti un numero prima di un movimento, lo ripeti altrettante volte. ** - - Nella combinazione dell'operatore cancella e di un movimento, descritto prima, - inserite un contatore prima del movimento per cancellare di più: - d numero movimento - - 1. Muovi il cursore alla prima parola MAIUSCOLA nella riga indicata da --->. - - 2. Batti d2w per cancellare le due parole MAIUSCOLE - - 3. Ripeti i passi 1 e 2 con un contatore diverso per cancellare le parole - MAIUSCOLE consecutive con un solo comando - ----> questa ABC DE linea FGHI JK LMN OP di parole è Q RS TUV ora ripulita. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.2.6: LAVORARE SU LINEE INTERE - - ** Batti dd per cancellare un'intera linea. ** - - Per la frequenza con cui capita di cancellare linee intere, chi ha - disegnato Vi ha deciso che sarebbe stato più semplice battere - due d consecutive per cancellare una linea. - - 1. Muovi il cursore alla linea 2) nella frase qui sotto. - 2. Batti dd per cancellare la linea. - 3. Ora spostati alla linea 4). - 4. Batti 2dd per cancellare due linee. - ----> 1) Le rose sono rosse, ----> 2) Il fango è divertente, ----> 3) Le viole sono blu, ----> 4) Io ho un'automobile, ----> 5) Gli orologi segnano il tempo, ----> 6) Lo zucchero è dolce, ----> 7) E così sei anche tu. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.2.7: IL COMANDO UNDO [ANNULLA] - - ** Premi u per annullare gli ultimi comandi eseguiti. ** - ** Premi U per annullare le modifiche all'ultima linea. ** - - 1. Muovi il cursore fino alla linea qui sotto, indicata da --->. - e posizionati sul primo errore. - 2. Batti x per cancellare il primo carattere sbagliato. - 3. Adesso batti u per annullare l'ultimo comando eseguito. - 4. Ora invece, correggi tutti gli errori sulla linea usando il comando x . - 5. Adesso batti una U Maiuscola per riportare la linea al suo stato originale. - 6. Adesso batti u più volte per annullare la U e i comandi precedenti. - 7. Adesso batti più volte CTRL-r (tieni il tasto CTRL schiacciato - mentre batti r) per rieseguire i comandi (annullare l'annullamento). - ----> Correeggi gli errori ssu quuesta linea e riimpiazzali coon "undo". - - 8. Questi comandi sono molto utili. Ora spostati al Sommario della Lezione 1.2. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.2 SOMMARIO - - - 1. Per cancellare dal cursore fino alla parola seguente batti: dw - 2. Per cancellare dal cursore fino alla fine della linea batti: d$ - 3. Per cancellare un'intera linea batti: dd - 4. Per eseguire più volte un movimento, mettici davanti un numero: 2w - 5. Il formato per un comando di modifica è: - - operatore [numero] movimento - dove: - operatore - indica il da farsi, ad es. d per [delete] cancellare - [numero] - contatore facoltativo di ripetizione del movimento - movimento - spostamento nel testo su cui operare, ad es. - w [word] parola, $ (fino a fine linea), etc. - - 6. Per andare a inizio linea usate uno zero: 0 - 7. Per annullare i comandi precedenti, batti: u (u minuscola) - Per annullare tutte le modifiche a una linea batti: U (U maiuscola) - Per annullare l'annullamento ["redo"] batti: CTRL-r - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.3.1: IL COMANDO PUT [METTI, PONI] - - - ** Batti p per porre [put] testo (cancellato prima) dopo il cursore. ** - - 1. Muovi il cursore alla prima linea indicata con ---> qui in basso. - - 2. Batti dd per cancellare la linea e depositarla in un registro di Vim. - - 3. Muovi il cursore fino alla linea c) SOPRA quella dove andrebbe messa - la linea appena cancellata. - - 4. Batti p per mettere la linea sotto il cursore. - - 5. Ripeti i passi da 2 a 4 per mettere tutte le linee nel giusto ordine. - ----> d) Puoi impararla tu? ----> b) Le viole sono blu, ----> c) La saggezza si impara, ----> a) Le rose sono rosse, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.3.2: IL COMANDO REPLACE [RIMPIAZZARE] - - - ** Batti rx per rimpiazzare il carattere sotto al cursore con x . ** - - 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. - - 2. Muovi il cursore fino a posizionarlo sopra il primo errore. - - 3. Batti r e poi il carattere che dovrebbe stare qui. - - 4. Ripeti i passi 2 e 3 finché la prima linea è uguale alla seconda. - ----> Ammattendo quetta lince, qualcuno ho predato alcuni tosti sballiati! ----> Immettendo questa linea, qualcuno ha premuto alcuni tasti sbagliati! - - 5. Ora passa alla Lezione 1.3.3. - -NOTA: Ricordati che dovresti imparare con la pratica, non solo leggendo. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.3.3: L'OPERATORE CHANGE [CAMBIA] - - - ** Per cambiare fino alla fine di una parola, batti ce . ** - - 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. - - 2. Posiziona il cursore alla u in lubw. - - 3. Batti ce e la parola corretta (in questo caso, batti inea ). - - 4. Premi e vai sul prossimo carattere da modificare. - - 5. Ripeti i passi 3 e 4 finché la prima frase è uguale alla seconda. - ----> Questa lubw ha alcune pptfd da asdert usgfk l'operatore CHANGE. ----> Questa linea ha alcune parole da cambiare usando l'operatore CHANGE. - -Nota che ce cancella la parola, e ti mette anche in Modalità Inserimento - [Insert Mode] - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.3.4: ALTRI CAMBIAMENTI USANDO c - -** L'operatore c [CHANGE] agisce sugli stessi movimenti di d [DELETE] ** - - 1. L'operatore CHANGE si comporta come DELETE. Il formato è: - - c [numero] movimento - - 2. I movimenti sono gli stessi, - ad es. w (word, parola), $ (fine linea), etc. - - 3. Muovi il cursore alla prima linea qui sotto, indicata da --->. - - 4. Posiziona il cursore al primo errore. - - 5. Batti c$ e inserisci resto della linea utilizzando come modello la - linea seguente, e quando hai finito premi - ----> La fine di questa linea deve essere aiutata a divenire come la seguente. ----> La fine di questa linea deve essere corretta usando il comando c$ . - -NOTA: Puoi usare il tasto Backspace se devi correggere errori di battitura. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.3 SOMMARIO - - - 1. Per reinserire del testo appena cancellato, batti p . Questo - inserisce [pone] il testo cancellato DOPO il cursore (se era stata tolta - una linea intera, questa verrà messa nella linea SOTTO il cursore). - - 2. Per rimpiazzare il carattere sotto il cursore, batti r e poi il - carattere che vuoi sostituire. - - 3. L'operatore change ti permette di cambiare dal cursore fino a dove - arriva il movimento. Ad es. Batti ce per cambiare dal cursore - fino alla fine della parola, c$ per cambiare fino a fine linea. - - 4. Il formato di change è: - - c [numero] movimento - -Ora vai alla prossima Lezione. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.4.1: POSIZIONAMENTO E SITUAZIONE FILE - - ** Batti CTRL-G per vedere a che punto sei nel file e la situazione ** - ** del file. Batti G per raggiungere una linea nel file. ** - - NOTA: Leggi l'intera Lezione prima di eseguire un qualsiasi passo!! - - 1. Tieni premuto il tasto CTRL e batti g . Ossia batti CTRL-G. - Un messaggio apparirà in fondo alla pagina con il NOME FILE e la - posizione nel file. Ricordati il numero della linea per il Passo 3. - -NOTA: La posizione del cursore si vede nell'angolo in basso a destra dello - schermo, se è impostata l'opzione 'ruler' (righello, vedi :help ruler). - - 2. Premi G [G Maiuscolo] per posizionarti in fondo al file. - Batti gg per posizionarti in cima al file. - - 3. Batti il numero della linea in cui ti trovavi e poi G . Questo ti - riporterà fino alla linea in cui ti trovavi quando avevi battuto CTRL-g. - - 4. Se ti senti sicuro nel farlo, esegui i passi da 1 a 3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.4.2: IL COMANDO SEARCH [RICERCA] - - ** Batti / seguito da una frase per ricercare quella frase. ** - - 1. in Modalità Normale batti il carattere / . Nota che la "/" e il cursore - sono visibili in fondo dello schermo come quando si usa il comando : . - - 2. Adesso batti 'errroore' . Questa è la parola che vuoi ricercare. - - 3. Per ricercare ancora la stessa frase, batti soltanto n . - Per ricercare la stessa frase in direzione opposta, batti N . - - 4. Per ricercare una frase nella direzione opposta, usa ? al posto di / . - - 5. Per tornare dove eri prima nel file premi CTRL-O (tieni il tasto CTRL - schiacciato mentre premi la lettera o). Ripeti CTRL-O per andare ancora - indietro. Puoi usare CTRL-I per tornare in avanti. - ----> "errroore" non è il modo giusto di digitare errore; errroore è un errore. -NOTA: Quando la ricerca arriva a fine file, ricomincia dall'inizio del file, - a meno che l'opzione 'wrapscan' sia stata disattivata. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.4.3: RICERCA DI PARENTESI CORRISPONDENTI - - - ** Batti % per trovare una ),], o } corrispondente. ** - - 1. Posiziona il cursore su una (, [, o { nella linea sotto, indicata da --->. - - 2. Adesso batti il carattere % . - - 3. Il cursore si sposterà sulla parentesi corrispondente. - - 4. Batti % per muovere il cursore all'altra parentesi corrispondente. - ----> Questa ( è una linea di test con (, [ ] e { } al suo interno. )) - - -NOTA: Questo è molto utile nel "debug" di un programma con parentesi errate! - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.4.4: L'OPERATORE SOSTITUZIONE (SUBSTITUTE) - - ** Batti :s/vecchio/nuovo/g per sostituire 'nuovo' a 'vecchio'. ** - - 1. Muovi il cursore fino alla linea qui sotto, indicata da --->. - - 2. Batti :s/lla/la . Nota che questo comando cambia solo - LA PRIMA occorrenza di "lla" sulla linea. - - 3. Adesso batti :s/lla/la/g . Aggiungendo la flag g si chiede di - sostituire "globalmente" sulla linea, ossia tutte le occorrenze - di "lla" sulla linea. - ----> lla stagione migliore per lla fioritura è lla primavera. - - 4. Per cambiare ogni ricorrenza di una stringa di caratteri tra due linee, - batti :#,#s/vecchio/nuovo/g dove #,# sono i numeri che delimitano - il gruppo di linee in cui si vuole sostituire. - Batti :%s/vecchio/nuovo/g per cambiare ogni occorrenza nell'intero file. - Batti :%s/vecchio/nuovo/gc per trovare ogni occorrenza nell'intero file - ricevendo per ognuna una richiesta se - effettuare o meno la sostituzione. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.4 SOMMARIO - - -1. CTRL-G visualizza a che punto sei nel file e la situazione del file. - G [G Maiuscolo] ti porta all'ultima linea del file. - numero G ti porta alla linea con quel numero. - gg ti porta alla prima linea del file. - -2. Battendo / seguito da una frase ricerca IN AVANTI quella frase. - Battendo ? seguito da una frase ricerca ALL'INDIETRO quella frase. - DOPO una ricerca batti n per trovare la prossima occorrenza nella - stessa direzione, oppure N per cercare in direzione opposta. - CTRL-O ti porta alla posizione precedente, CTRL-I a quella più nuova. - -3. Battendo % mentre il cursore si trova su (,),[,],{, oppure } - ti posizioni sulla corrispondente parentesi. - -4. Per sostituire "nuovo" al primo "vecchio" in 1 linea batti :s/vecchio/nuovo - Per sostituire "nuovo" ad ogni "vecchio" in 1 linea batti :s/vecchio/nuovo/g - Per sostituire frasi tra 2 numeri di linea [#] batti :#,#s/vecchio/nuovo/g - Per sostituire tutte le occorrenze nel file batti :%s/vecchio/nuovo/g - Per chiedere conferma ogni volta aggiungi 'c' :%s/vecchio/nuovo/gc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.5.1: COME ESEGUIRE UN COMANDO ESTERNO - - - ** Batti :! seguito da un comando esterno per eseguire quel comando. ** - - 1. Batti il comando : per posizionare il cursore in fondo allo schermo. - Ciò ti permette di immettere un comando dalla linea comandi. - - 2. Adesso batti il carattere ! (punto esclamativo). Ciò ti permette di - eseguire qualsiasi comando esterno si possa eseguire nella "shell". - - 3. Ad esempio batti ls dopo il ! e poi premi . Questo - visualizza una lista della tua directory, proprio come se fossi in una - "shell". Usa :!dir se ls non funziona. [Unix: ls MS-DOS: dir] - -NOTA: E' possibile in questo modo eseguire un comando a piacere, specificando - anche dei parametri per i comandi stessi. - -NOTA: Tutti i comandi : devono essere terminati premendo - Da qui in avanti non lo ripeteremo ogni volta. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.5.2: ANCORA SULLA SCRITTURA DEI FILE - - - ** Per salvare le modifiche apportate a un testo batti :w NOMEFILE. ** - - 1. Batti :!dir or :!ls per procurarti una lista della tua directory. - Già sai che devi premere dopo aver scritto il comando. - - 2. Scegli un NOMEFILE che ancora non esista, ad es. TEST . - - 3. Adesso batti: :w TEST (dove TEST è il NOMEFILE che hai scelto). - - 4. Questo salva l'intero file ("tutor.it") con il nome di TEST. - Per verifica batti ancora :!dir o :!ls per listare la tua directory. - -NOTA: Se esci da Vim e riesegui Vim battendo vim TEST , il file aperto - sarà una copia esatta di "tutor.it" al momento del salvataggio. - - 5. Ora cancella il file battendo (MS-DOS): :!del TEST - o (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.5.3: SELEZIONARE IL TESTO DA SCRIVERE - - ** Per salvare una porzione di file, batti v movimento :w NOMEFILE ** - - 1. Muovi il cursore su questa linea. - - 2. Premi v e muovi il cursore fino alla linea numerata 5., qui sotto. - Nota che il testo viene evidenziato. - - 3. Batti il carattere : . In fondo allo schermo apparirà :'<,'> . - - 4. Batti w TEST , dove TEST è il nome di un file non ancora esistente. - Verifica che si veda :'<,'>w TEST prima di dare . - - 5. Vim scriverà nel file TEST le linee che hai selezionato. Usa :!dir - o :!ls per controllare che esiste. Non cancellarlo ora! Ti servirà - nella prossima lezione. - -NOTA: Battere v inizia una selezione visuale. Puoi muovere il cursore - come vuoi, e rendere la selezione più piccola o più grande. Poi - puoi usare un operatore per agire sul testo selezionato. - Ad es., d cancella il testo. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.5.4: INSERIRE E RIUNIRE FILE - - - ** Per inserire il contenuto di un file, batti :r NOMEFILE ** - - 1. Posiziona il cursore appena sopra questa riga. - -NOTA: Dopo aver eseguito il Passo 2 vedrai il testo della Lezione 1.5.3. - Quindi spostati IN GIU' per tornare ancora a questa Lezione. - - 2. Ora inserisci il tuo file TEST con il comando :r TEST dove TEST è - il nome che hai usato per creare il file. - Il file richiesto è inserito sotto la linea in cui si trova il cursore. - - 3. Per verificare che un file è stato inserito, torna indietro col cursore - e nota che ci sono ora 2 copie della Lezione 1.5.3, quella originale e - quella che viene dal file. - -NOTA: Puoi anche leggere l'output prodotto da un comando esterno. Ad es. - :r !ls legge l'output del comando ls e lo inserisce sotto la linea - in cui si trova il cursore. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.5 SOMMARIO - - - 1. :!comando esegue un comando esterno. - - Alcuni esempi utili sono [in MSDOS]: - :!dir - visualizza lista directory - :!del NOMEFILE - cancella file NOMEFILE. - - 2. :w NOMEFILE scrive su disco il file che stai editando con nome NOMEFILE. - - 3. v movimento :w NOMEFILE salva le linee selezionate in maniera - visuale nel file NOMEFILE. - - 4. :r NOMEFILE legge il file NOMEFILE da disco e lo inserisce nel file - che stai modificando, dopo la linea in cui è posizionato il cursore. - - 5. :r !dir legge l'output del comando dir e lo inserisce dopo la - linea in cui è posizionato il cursore. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.6.1: IL COMANDO OPEN [APRIRE] - - - ** Batti o per aprire una linea sotto il cursore ** - ** e passare in Modalità Inserimento. ** - - 1. Muovi il cursore fino alla linea qui sotto, indicata da --->. - - 2. Batti la lettera minuscola o per aprire una linea sotto il cursore e - passare in Modalità Inserimento. - - 3. Poi inserisci del testo e premi per uscire dalla - Modalità Inserimento. - ----> Dopo battuto o il cursore è sulla linea aperta (in Modalità Inserimento). - - 4. Per aprire una linea SOPRA il cursore, batti una O maiuscola, invece - che una o minuscola. Prova sulla linea qui sotto. ----> Apri una linea SOPRA questa battendo O mentre il cursore è su questa linea. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.6.2: IL COMANDO APPEND [AGGIUNGERE] - - ** Batti a per inserire testo DOPO il cursore. ** - - 1. Muovi il cursore all'inizio della linea qui sotto, indicata da --->. - - 2. Batti e finché il cursore arriva alla fine di li . - - 3. Batti una a (minuscola) per aggiungere testo DOPO il cursore. - - 4. Completa la parola come mostrato nella linea successiva. Premi - per uscire dalla Modalità Inserimento. - - 5. Usa e per passare alla successiva parola incompleta e ripeti i passi - 3 e 4. - ----> Questa li ti permetterà di esercit ad aggiungere testo a una linea. ----> Questa linea ti permetterà di esercitarti ad aggiungere testo a una linea. - -NOTA: a, i ed A entrano sempre in Modalità Inserimento, la sola differenza - è dove verranno inseriti i caratteri. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.6.3: UN ALTRO MODO DI RIMPIAZZARE [REPLACE] - - - ** Batti una R maiuscola per rimpiazzare più di un carattere. ** - - 1. Muovi il cursore alla prima linea qui sotto, indicata da --->. Muovi il - cursore all'inizio del primo xxx . - - 2. Ora batti R e batti il numero che vedi nella linea seguente, in modo - che rimpiazzi l' xxx . - - 3. Premi per uscire dalla Modalità Replace. Nota che il resto della - linea resta invariato. - - 4. Ripeti i passi in modo da rimpiazzare l'altro xxx . - ----> Aggiungendo 123 a xxx si ottiene xxx. ----> Aggiungendo 123 a 456 si ottiene 579. - -NOTA: La Modalità Replace è come la Modalità Inserimento, ma ogni carattere - che viene battuto ricopre un carattere esistente. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.6.4: COPIA E INCOLLA DEL TESTO - - - ** usa l'operatore y per copiare del testo e p per incollarlo ** - - 1. Vai alla linea indicata da ---> qui sotto, e metti il cursore dopo "a)". - - 2. Entra in Modalità Visuale con v e metti il cursore davanti a "primo". - - 3. Batti y per copiare [yank] il testo evidenziato. - - 4. Muovi il cursore alla fine della linea successiva: j$ - - 5. Batti p per incollare [paste] il testo. Poi batti: a secondo . - - 6. Usa la Modalità Visuale per selezionare " elemento.", copialo con y , - Vai alla fine della linea successiva con j$ e incolla il testo con p . - ----> a) questo è il primo elemento. - b) - -NOTA: Puoi usare y come operatore; yw copia una parola [word]. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.6.5: SET [IMPOSTA] UN'OPZIONE - - ** Imposta un'opzione per ignorare maiuscole/minuscole ** - ** durante la ricerca/sostituzione ** - - 1. Ricerca 'nota' battendo: /nota - Ripeti la ricerca più volte usando il tasto n - - 2. Imposta l'opzione 'ic' (Ignore Case, [Ignora maiuscolo/minuscolo]) - battendo: :set ic - - 3. Ora ricerca ancora 'nota' premendo il tasto n - Troverai adesso anche Nota e NOTA . - - 4. Imposta le opzioni 'hlsearch' e 'incsearch' :set hls is - - 5. Ora batti ancora il comando di ricerca, e guarda cosa succede: /nota - - 6. Per disabilitare il riconoscimento di maiuscole/minuscole batti: :set noic -NOTA: Per non evidenziare le occorrenze trovate batti: :nohlsearch -NOTA: Per ignorare maiuscole/minuscole solo per una ricerca, usa \c - nel comando di ricerca: /nota\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.6 SOMMARIO - - 1. Batti o per aggiungere una linea SOTTO il cursore ed entrare in - Modalità Inserimento. - Batti O per aggiungere una linea SOPRA il cursore. - - 2. Batti a per inserire testo DOPO il cursore. - Batti A per inserire testo alla fine della linea. - - 3. Il comando e sposta il cursore alla fine di una parola. - - 4. L'operatore y copia del testo, p incolla del testo. - - 5. Batti R per entrare in Modalità Replace, e ne esci premendo . - - 6. Batti ":set xxx" per impostare l'opzione "xxx". Alcun opzioni sono: - 'ic' 'ignorecase' ignorare maiuscole/minuscole nella ricerca - 'is' 'incsearch' mostra occorrenze parziali durante una ricerca - 'hls' 'hlsearch' evidenzia tutte le occorrenze di una ricerca - Puoi usare sia il nome completo di un'opzione che quello abbreviato. - - 7. Usa il prefisso "no" per annullare una opzione: :set noic -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.7.1: OTTENERE AIUTO - - ** Usa il sistema di aiuto on-line ** - - Vim ha un esauriente sistema di aiuto on-line. Per cominciare, prova una di - queste alternative: - - premi il tasto (se ce n'è uno) - - premi il tasto (se ce n'è uno) - - batti :help OPPURE :h - - Leggi il testo nella finestra di aiuto per vedere come funziona l'aiuto. - Batti CTRL-W CTRL-W per passare da una finestra all'altra. - Batti :q per chiudere la finestra di aiuto. - - Puoi trovare aiuto su quasi tutto, dando un argomento al comando ":help" - Prova questi (non dimenticare di premere ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.7.2: PREPARARE UNO SCRIPT INIZIALE - - ** Attiva le opzioni Vim ** - - Vim ha molte più opzioni di Vi, ma molte di esse sono predefinite inattive. - Per cominciare a usare più opzioni, devi creare un file "vimrc". - - 1. Comincia a editare il file "vimrc". Questo dipende dal tuo sistema: - :e ~/.vimrc per Unix - :e ~/_vimrc per MS-Windows - - 2. Ora leggi i contenuti del file "vimrc" distribuito come esempio: - - :r $VIMRUNTIME/vimrc_example.vim - - 3. Scrivi il file con: - :w - - La prossima volta che apri Vim, sarà abilitata la colorazione sintattica. - Puoi aggiungere a questo file "vimrc" tutte le tue impostazioni preferite. - Per maggiori informazioni batti: :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.7.3: COMPLETAMENTO - - - ** Completamento linea comandi con CTRL-D e ** - - 1. Imposta Vim in modalità compatibile: :set nocp - - 2. Guarda i file esistenti nella directory: :!ls o :!dir - - 3. Batti l'inizio di un comando: :e - - 4. Premi CTRL-D e Vim ti mostra una lista di comandi che iniziano per "e". - - 5. Premi e Vim completa per te il nome comando come ":edit". - - 6. Ora batti uno spazio e l'inizio del nome di un file esistente: :edit FIL - - 7. Premi . Vim completerà il nome del file (se è il solo possibile). - -NOTA: Il completamento è disponibile per molti comandi. Prova a battere - CTRL-D e . Particolarmente utile per :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 1.7 Sommario - - - 1. Batti :help o premi o per aprire una finestra di aiuto. - - 2. Batti :help comando per avere aiuto su comando . - - 3. Batti CTRL-W CTRL-W per saltare alla prossima finestra. - - 4. Batti :q per chiudere la finestra di aiuto. - - 5. Crea uno script iniziale vimrc contenente le tue impostazioni preferite. - - 6. Mentre batti un comando : , premi CTRL-D per vedere i possibili - completamenti. Premi per usare il completamento desiderato. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Qui finisce la Guida a Vim. Il suo intento è di fornire una breve panoramica - dell'Editor Vim, che ti consenta di usare l'Editor abbastanza facilmente. - Questa guida è largamente incompleta poiché Vim ha moltissimi altri comandi. - Puoi anche leggere il manuale utente (anche in italiano): ":help user-manual". - - Per ulteriore lettura e studio, raccomandiamo: - Vim - Vi Improved - di Steve Oualline Editore: New Riders - Il primo libro completamente dedicato a Vim. Utile specie per principianti. - Contiene molti esempi e figure. - Vedi https://iccf-holland.org/click5.html - - Quest'altro libro è più su Vi che su Vim, ma è pure consigliato: - Learning the Vi Editor - di Linda Lamb e Arnold Robbins - Editore: O'Reilly & Associates Inc. - È un buon libro per imparare quasi tutto ciò che puoi voler fare con Vi. - Ne esiste una traduzione italiana, basata su una vecchia edizione. - - Questa guida è stata scritta da Michael C. Pierce e Robert K. Ware, - Colorado School of Mines, usando idee fornite da Charles Smith, - Colorado State University - E-mail: bware@mines.colorado.edu - Modificato per Vim da Bram Moolenaar. - Segnalare refusi ad Antonio Colombo - E-mail: azc100@gmail.com -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.ja.utf-8 b/runtime/tutor/tutor1.ja similarity index 100% rename from runtime/tutor/tutor1.ja.utf-8 rename to runtime/tutor/tutor1.ja diff --git a/runtime/tutor/tutor1.ja.euc b/runtime/tutor/tutor1.ja.euc deleted file mode 100644 index 4d6d3b9d38..0000000000 --- a/runtime/tutor/tutor1.ja.euc +++ /dev/null @@ -1,977 +0,0 @@ -=============================================================================== -= V I M �� �� (���塼�ȥꥢ��) �� �� �� �� �� - Version 1.7 = -=============================================================================== - - Vim �ϡ����Υ��塼�ȥꥢ�����������ˤ�¿���������Υ��ޥ�ɤ���������� - �˶��Ϥʥ��ǥ������Ǥ������Υ��塼�ȥꥢ��ϡ����ʤ��� Vim ����ǽ���ǥ� - �����Ȥ��ƻȤ����ʤ���褦�ˤʤ�Τ˽�ʬ�ʥ��ޥ�ɤˤĤ��������򤹤�褦 - �ˤʤäƤ��ޤ��� - - ���塼�ȥꥢ���λ����Τ�ɬ�פʻ��֤ϡ��Ф������ޥ�ɤ��Τˤɤ�� - �����֤�Ȥ��Τ��ˤ���ޤ��������褽30ʬ�Ǥ��� - - ATTENTION: - �ʲ��������ѥ��ޥ�ɤˤϤ���ʸ�Ϥ��ѹ������Τ⤢��ޤ���������Ϥ���� - �˥��ԡ���������ޤ��礦("vimtutor"�����ʤ�С����˥��ԡ�����Ƥ��ޤ�)�� - - ���Υ��塼�ȥꥢ�뤬���Ȥ����ȤdzФ�������ȤߤˤʤäƤ��뤳�Ȥ򡢿��� - �Ƥ����ʤ���Фʤ�ޤ����������ؽ�����ˤϥ��ޥ�ɤ�ºݤ˻�ʤ���� - �ʤ�ʤ��ΤǤ���ʸ�Ϥ��ɤ�������ʤ�С����ä�˺��Ƥ��ޤ��ޤ�! - - ������Caps���å�������������Ƥ��ʤ����Ȥ��ǧ�����塢���̤˥�å���1.1.1 - ������ɽ�������Ȥ����ޤǡ�j �����򲡤��ƥ���������ư���ޤ��礦�� -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.1.1: ��������ΰ�ư - - - ** ����������ư����ˤϡ���������ͤ� h,j,k,l �򲡤��ޤ��� ** - ^ - k �ҥ��: h �����Ϻ������˰�ư���ޤ��� - < h l > l �����ϱ������˰�ư���ޤ��� - j j �����ϲ���������Τ褦�ʥ����Ǥ��� - v - 1. ��ư�˴����ޤǡ������꡼��ǥ��������ư�����ޤ��礦�� - - 2. ���ؤΥ���(j)�򲡤��ĤŤ���ȡ�Ϣ³���ư�ư�Ǥ��ޤ��� - ����Ǽ��Υ�å���˰�ư������ˡ���狼��ޤ����͡� - - 3. ���ؤΥ�����Ȥäơ���å���1.1.2 �˰�ư���ޤ��礦�� - -NOTE: ���򥿥��פ��Ƥ��뤫Ƚ��ʤ��ʤä��顢�򲡤��ƥΡ��ޥ�⡼�ɤˤ� - �ޤ������줫�����Ϥ��褦�Ȥ��Ƥ������ޥ�ɤ�����Ϥ��ޤ��礦�� - -NOTE: �������륭���Ǥ��ư�Ǥ��ޤ��������� hjkl �˰��ٴ���Ƥ��ޤ��С��Ϥ뤫 - ��®����ư���뤳�Ȥ��Ǥ���Ǥ��礦������ޥ���! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.1.2: VIM �ε�ư�Ƚ�λ - - - !! NOTE: �ʲ��Τ����륹�ƥåפ�Ԥ����ˡ����Υ�å�����ɤߤޤ��礦!! - - 1. �����򲡤��ޤ��礦��(�μ¤˥Ρ��ޥ�⡼�ɤˤ��뤿��) - - 2. ���Τ褦�˥�����: :q! - ����ˤ���Խ��������Ƥ���¸�����˥��ǥ�������λ���ޤ��� - - 3. ���Υ��塼�ȥꥢ���Ϥ��٤Υ��ޥ�ɤ�¹Ԥ���ȡ����������ޤ��� - ���Υ��ޥ�ɤ�: vimtutor - - 4. ����ޤǤΥ��ƥåפ�Ф��������Ĥ����ʤ�С����ƥå� 1 ���� 3 �ޤǤ�� - �ݤ˻�ơ�Vim ��1�ٽ�λ���Ƥ���Ƥӵ�ư���ޤ��礦�� - -NOTE: :q! �����Ƥ��ѹ����˴����ޤ�����å���ˤ��ѹ���ե�������� - ¸������ˡ�ˤĤ��Ƥ��ٶ����Ƥ����ޤ��礦�� - - 5. 1.1.3�ޤǥ���������ư�����ޤ��礦�� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.1.3: �ƥ������Խ� - ��� - - - ** �Ρ��ޥ�⡼�ɤˤƥ�������β���ʸ����������ˤ� x �򲡤��ޤ��� ** - - 1. �ʲ��� ---> �ȼ����줿�Ԥ˥���������ư���ޤ��礦�� - - 2. �ְ㤤�������뤿��ˡ��������ǽ��ʸ���ޤǥ���������ư���ޤ��� - - 3. ��ɬ�פ�ʸ���� x �򲡤��ƺ�����ޤ��礦�� - - 4. ʸ���������ʤ�ޤ� ���ƥå� 2 ���� 4 �򷫤��֤��ޤ��礦�� - ----> ���� �������� �� �ĤĤ��� �� �������Ƥ� �ȤӤϤͤ��� - - 5. �Ԥ��������ʤä��顢��å��� 1.1.4 �ؿʤߤޤ��礦�� - -NOTE: ���ƤΥ�å�����̤��ơ��Ф��褦�Ȥ���ΤǤϤʤ��ºݤˤ�äƤߤޤ��礦�� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.1.4: �ƥ������Խ� - ���� - - - ** �Ρ��ޥ�⡼�ɤˤƥƥ����Ȥ���������ˤ� i �򲡤��ޤ��� ** - - 1. �ʲ��� ---> �ȼ����줿�ǽ�ιԤ˥���������ư���ޤ��礦�� - - 2. 1���ܤ�2���ܤ�Ʊ���ͤˤ��뤿��ˡ��ƥ����Ȥ��������ʤ���Фʤ�ʤ����� - �μ���ʸ���˥���������ư���ޤ��� - - 3. i �����򲡤��Ƥ��顢�ɲä�ɬ�פ�ʸ���򥿥��פ��ޤ��礦�� - - 4. �ְ㤤���������� �򲡤��ƥ��ޥ�ɥ⡼�ɤ���ꡢ������ʸ�ˤʤ��� - �˥��ƥå� 2 ���� 4 �򷫤��֤��ޤ��礦�� - ----> ���� �ˤ� ­��ʤ� �ƥ����� ���롣 ----> ���� �� �ˤ� ���Ĥ� ­��ʤ� �ƥ����� �� ���롣 - - 5. ��������ˡ���狼�ä����å��� 1.1.5 �ؿʤߤޤ��礦�� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.1.5: �ƥ������Խ� - �ɲ� - - - ** �ƥ����Ȥ��ɲä���ˤ� A �򲡤��ޤ��礦�� ** - - 1. �ʲ��� ---> �ȼ����줿�ǽ�ιԤ˥���������ư���ޤ��礦�� - �������뤬���ιԤΤɤ�ʸ����ˤ��äƤ⤫�ޤ��ޤ��� - - 2. �ɲä�ɬ�פʾ��� A �򥿥��פ��ޤ��礦�� - - 3. �ƥ����Ȥ��ɲä��������顢 �򲡤��ƥΡ��ޥ�⡼�ɤ����ޤ��礦�� - - 4. 2���ܤ� ---> �ȼ����줿���ذ�ư�������ƥå� 2 ���� 3 �򷫤��֤���ʸˡ - �������ޤ��礦�� - ----> �����ˤϴְ�ä��ƥ����Ȥ����� - �����ˤϴְ�ä��ƥ����Ȥ�����ޤ��� ----> �����ˤ�ְ�ä��ƥ��� - �����ˤ�ְ�ä��ƥ����Ȥ�����ޤ��� - - 5. �ƥ����Ȥ��ɲä��ڲ��ˤʤäƤ������å��� 1.1.6 �ؿʤߤޤ��礦�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.1.6: �ե�������Խ� - - ** �ե��������¸���ƽ�λ����ˤ� :wq �ȥ����פ��ޤ��� ** - - !! NOTE: �ʲ��Υ��ƥåפ�¹Ԥ������ˡ��ޤ����Τ��ɤ�Ǥ�������!! - - 1. �̤�ü����������Ϥ����ǰʲ������Ƥ�ԤäƤ��������������Ǥʤ���С� - ��å��� 1.1.2 �Ǥ�ä��褦�� :q! �򥿥��פ��ơ����Υ��塼�ȥꥢ���λ - ���ޤ��� - - 2. ������ץ���ץȤǤ��Υ��ޥ�ɤ򥿥��פ��ޤ�: vim file.txt - 'vim' �� Vim ���ǥ�����ư���륳�ޥ�ɡ�'file.txt' ���Խ��������ե����� - ��̾���Ǥ����ѹ��Ǥ���ե������̾����Ȥ��ޤ��礦�� - - 3. ���Υ�å���dzؤ���褦�ˡ��ƥ����Ȥ�������������ޤ��� - - 4. �ѹ���ե��������¸���ޤ�: :wq - - 5. ���ƥå� 1 �� vimtutor ��λ�������� vimtutor ����ٵ�ư�����ʲ��� - ����ؿʤߤޤ��礦�� - - 6. �ʾ�Υ��ƥåפ��ɤ�����򤷤���Ǥ����¹Ԥ��ޤ��礦�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.1 ���� - - - 1. �����������������⤷���� hjkl �����ǰ�ư���ޤ��� - h (��) j (��) k (��) l (��) - - 2. Vim ��ư����ˤϥץ���ץȤ��� vim �ե�����̾ �ȥ����פ��ޤ��� - - 3. Vim ��λ����ˤ� :q! �ȥ����פ��ޤ�(�ѹ����˴�)�� - �⤷���� :wq �ȥ����פ��ޤ�(�ѹ�����¸)�� - - 4. ��������β���ʸ����������ˤϡ��Ρ��ޥ�⡼�ɤ� x �ȥ����פ��ޤ��� - - 5. ��������ΰ��֤�ʸ������������ˤϡ��Ρ��ޥ�⡼�ɤ� i �ȥ����פ��ޤ��� - i �ƥ����ȤΥ����� ����������֤��ɲ� - A �ƥ����Ȥ��ɲ� �������ɲ� - -NOTE: �����򲡤��ȥΡ��ޥ�⡼�ɤ˰ܹԤ��ޤ������κݡ��ְ�ä��������� - ��Υ��ޥ�ɤ���ä����Ȥ��Ǥ��ޤ��� - -���ơ�³���ƥ�å��� 1.2 ��Ϥ�ޤ��礦�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.2.1: ������ޥ�� - - - ** ñ��������ޤǤ�������ˤ� dw �ȥ����פ��ޤ��礦�� ** - - 1. �μ¤˥Ρ��ޥ�⡼�ɤˤ��뤿�� �򲡤��ޤ��礦�� - - 2. �ʲ��� ---> �ȼ����줿�Ԥ˥���������ư���ޤ��礦�� - - 3. �ä�����ñ�����Ƭ�˥���������ư���ޤ��礦�� - - 4. ñ��������뤿��� dw �ȥ����פ��ޤ��礦�� - - NOTE: d �򥿥��פ���ȡ�����ʸ���������꡼��κDz��Ԥ˸����ޤ���Vim �� - ���ʤ��� w �򥿥��פ���Τ��ԤäƤ��ޤ����⤷ d �ʳ���ʸ����ɽ�����줿 - ���ϲ����ְ�äƤ��ޤ��� �򲡤��Ƥ��ľ���ޤ��礦�� - ----> ���� ʸ �� �ˤ� �����Ĥ��� ���Τ��� ɬ�פΤʤ� ñ�� �� �ޤޤ�� ���ޤ��� - - 5. 3 ���� 4 �ޤǤ�ʸ���������ʤ�ޤǷ����֤�����å��� 1.2.2 �ؿʤߤޤ��礦�� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.2.2: ����¾�κ�����ޥ�� - - - ** �Ԥ������ޤǤ�������ˤ� d$ �ȥ����פ��ޤ��礦�� ** - - 1. �μ¤˥Ρ��ޥ�⡼�ɤˤ��뤿�� �򲡤��ޤ��礦�� - - 2. �ʲ��� ---> �ȼ����줿�Ԥ˥���������ư���ޤ��礦�� - - 3. ������ʸ�������إ���������ư���ޤ��礦(�ǽ�� �� �θ�Ǥ�)�� - - 4. �����ޤǺ������Τ� d$ �ȥ����פ��ޤ��礦�� - ----> ï�������ιԤκǸ��2�٥����פ��ޤ����� 2�٥����פ��ޤ����� - - - 5. �ɤ��������Ȥ����򤹤뤿��ˡ���å��� 1.2.3 �ؿʤߤޤ��礦�� - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.2.3: ���ڥ졼���ȥ⡼����� - - - �ƥ����Ȥ��ѹ���ä���¿���Υ��ޥ�ɤϥ��ڥ졼���ȥ⡼����󤫤�ʤ�ޤ��� - ������ޥ�� d �Υ��ڥ졼���ϼ����ͤˤʤäƤ��ޤ�: - - d �⡼����� - - ���줾��: - d - ������ޥ�ɡ� - �⡼����� - �����Ф���Ư�������뤫(�ʲ��˵󤲤ޤ�)�� - - �⡼���������ΰ���: - w - ����������֤�������ޤ�ñ��������ޤǡ� - e - ����������֤�������ޤޤʤ�ñ��������ޤǡ� - $ - ����������֤�������ޤǡ� - - �Ĥޤ� de �ȥ����פ���ȡ�����������֤���ñ��ν����ޤǤ������ޤ��� - -NOTE: �����������ͤϡ��Ρ��ޥ�⡼�ɤˤƥ��ڥ졼���ʤ��˥⡼�����򲡤��� - �ߤޤ��礦���������뤬��Ū������Ǽ��������֤˰�ư����Ϥ��Ǥ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.2.4: �⡼�����˥�����Ȥ���Ѥ��� - - - ** �����Ԥ����������֤��Υ⡼���������˿��ͤ򥿥��פ��ޤ��� ** - - 1. �ʲ��� ---> �ȼ����줿�Ԥ���Ƭ�˥���������ư���ޤ��� - - 2. 2w �򥿥��פ���ñ��2��ʬ��˰�ư���ޤ��� - - 3. 3e �򥿥��פ���3���ܤ�ñ��ν�ü�˰�ư���ޤ��� - - 4. 0 (����)�򥿥��פ��ƹ�Ƭ�˰�ư���ޤ��� - - 5. ���ƥå� 2 �� 3 ��㤦���ͤ�ȤäƷ����֤��ޤ��� - ----> This is just a line with words you can move around in. - - 6. ��å��� 1.2.5 �˿ʤߤޤ��礦�� - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.2.5: ���¿���������뤿��˥�����Ȥ���Ѥ��� - - - ** ���ڥ졼���ȥ�����Ȥ򥿥��פ���ȡ�������ʣ���󷫤��֤���ޤ��� ** - - ���Ҥκ���Υ��ڥ졼���ȥ⡼�������Ȥ߹�碌�˥�����Ȥ��ɲä��뤳�Ȥǡ� - ���¿���κ�����Ԥ��ޤ�: - d ���� �⡼����� - - 1. ---> �ȼ����줿�Ԥκǽ����ʸ����ñ��˥���������ư���ޤ��礦�� - - 2. ��ʸ����ñ��2�Ĥ� d2w �ȥ����פ��ƺ�����ޤ��� - - 3. Ϣ³������ʸ����ñ��򡢰ۤʤ륫����Ȥ���ꤷ��1�ĤΥ��ޥ�ɤǺ������ - ���ƥå� 1 �� 2 �򷫤��֤��ޤ��� - ----> ����ABC DE�Ԥ�FGHI JK LMN OPñ���Q RS TUV���ˤʤä��� - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.2.6: �Ԥ���� - - - ** �����Τ�������ˤ� dd �ȥ����פ��ޤ��� ** - - �����Τ����������٤�¿���Τǡ�Vi�Υǥ����ʡ��ϹԤκ���� d ��2�󥿥��פ� - ������ñ�ʤ�Τ˷��ޤ����� - - 1. �ʲ��ζ��2���ܤ˥���������ư���ޤ��� - 2. dd �ȥ����פ��ƹԤ������ޤ��� - 3. �����4���ܤ˰�ư���ޤ��� - 4. 2dd �ȥ����פ���2�Ԥ������ޤ��� - ----> 1) �Х���֤��� ----> 2) �Ĥޤ�ʤ���Τϳڤ����� ----> 3) ���ߥ���Ĥ��� ----> 4) ��ϼ֤��äƤ��롢 ----> 5) ���פ������𤲤롢 ----> 6) �����ϴŤ� ----> 7) ���ޥ���ʡ� - -2�󥿥��פ�1�Ԥ��Ф��ƺ��Ѥ�������ˡ�ϰʲ��ǽҤ٤륪�ڥ졼���Ǥ�ư��ޤ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.2.7: ���ľ�����ޥ�� - - - ** �Ǹ�Υ��ޥ�ɤ���ä��ˤ� u �򲡤��ޤ���U �Ϲ����Τμ��ä��Ǥ��� ** - - 1. �ʲ��� ---> �ȼ����줿�Ԥ˥���������ư�����ǽ�δְ㤤�˥������� - ���ư���ޤ��礦�� - 2. x �򥿥��פ��ƺǽ�Τ���ʤ�ʸ���������ޤ��礦�� - 3. ������u �򥿥��פ��ƺǸ�˼¹Ԥ������ޥ�ɤ���ä��ޤ��礦�� - 4. ���٤ϡ�x ����Ѥ��ƹ���θ�������ƽ������ޤ��礦�� - 5. ��ʸ���� U �򥿥��פ��ơ��Ԥ򸵤ξ��֤��ᤷ�ޤ��礦�� - 6. u �򥿥��פ���ľ���� U ���ޥ�ɤ���ä��ޤ��礦�� - 7. �Ǥϥ��ޥ�ɤ�Ƽ¹Ԥ���Τ� CTRL-R (CTRL �򲡤����ޤ� R ���Ǥ�)����� - �����פ��Ƥߤޤ��礦(���ä��μ��ä�)�� - ----> ���ΤιԤΤδְ㤤������������Ǥ����ν��������ä��ޤޤ����� - - 8. ����ϤȤƤ������ʥ��ޥ�ɤǤ���������å��� 1.2 ����ؿʤߤޤ��礦�� - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.2 ���� - - - 1. ����������֤��鼡��ñ��ޤǤ�������ˤ� dw �ȥ����פ��ޤ��� - 2. ����������֤���ñ��������ޤǤ�������ˤ� de �ȥ����פ��ޤ��� - 3. ����������֤���Ԥ������ޤǤ�������ˤ� d$ �ȥ����פ��ޤ��� - 4. �����Τ�������ˤ� dd �ȥ����פ��ޤ��� - - 5. �⡼�����򷫤��֤��ˤϿ��ͤ���Ϳ���ޤ�: 2w - 6. �ѹ����Ѥ��륳�ޥ�ɤη����� - ���ڥ졼�� [����] �⡼����� - ���줾��: - ���ڥ졼�� - ��� d ����Dz��򤹤뤫�� - [����] - ���Υ��ޥ�ɤ򲿲󷫤��֤����� - �⡼����� - w (ñ��)�� e (ñ������)��$ (����)�ʤɤ���ǡ��ƥ����Ȥ� - �����Ф���Ư�������뤫�� - - 7. �Ԥ���Ƭ�˰�ư����ˤϥ�������Ѥ��ޤ�: 0 - - 8. �����ư�����ä�: u (��ʸ�� u) - �����Τ��ѹ�����ä�: U (��ʸ�� U) - ���ä��μ��ä�: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.3.1: Ž���դ����ޥ�� - - - ** �Ǹ�˺�����줿�Ԥ򥫡�����θ��Ž���դ���ˤ� p �򥿥��פ��ޤ��� ** - - 1. ---> �ȼ����줿�ʲ��κǽ�ιԤ˥���������ư���ޤ��礦�� - - 2. dd �ȥ����פ��ƹԤ�������Vim �Υ쥸�����˳�Ǽ���ޤ��礦�� - - 3. ��������Ԥ����褢��٤����֤ξ�ιԤǤ��� c) �Ԥޤǡ�����������ư���� - �ޤ��礦�� - - 4. �Ρ��ޥ�⡼�ɤ� p �򥿥��פ��Ƴ�Ǽ�����Ԥ򥫡�����β����ᤷ�ޤ��� - - 5. ���֤��������ʤ��ͤ˥��ƥå� 2 ���� 4 �򷫤��֤��ޤ��礦�� - ----> d) ������ؤ֤��Ȥ��Ǥ���? ----> b) ���ߥ���Ĥ��� ----> c) �ηäȤϳؤ֤�Ρ� ----> a) �Х���֤��� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.3.2: �֤��������ޥ�� - - - ** ��������β���ʸ���� x ���֤�������ˤ� rx �򥿥��פ��ޤ��� ** - - 1. �ʲ��� ---> �ȼ����줿�ǽ�ιԤ˥���������ư���ޤ��礦�� - - 2. �ǽ�δְ㤤����Ƭ�˥���������ư���ޤ��礦�� - - 3. r �ȥ����פ����ְ�äƤ���ʸ�����֤������롢������ʸ���򥿥��פ��ޤ��礦�� - - 4. �ǽ�ιԤ��������ʤ�ޤǥ��ƥå� 2 ���� 3 �򷫤��֤��ޤ��礦�� - ----> ���ι����Ϥ������͡����οͤϴ��Ĥ����ä������򲡤��⤷��! ----> ���ιԤ����Ϥ������ˡ����οͤϴ��Ĥ��ְ�ä������򲡤��ޤ���! - - 5. ��������å��� 1.3.3 �ؿʤߤޤ��礦�� - -NOTE: �ºݤ˻�ޤ��礦���褷�ƳФ�������ˤϤ��ʤ����ȡ� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.3.3: �ѹ����ޥ�� - - - ** ñ��������ޤǤ��ѹ�����ˤ� ce �ȥ����פ��ޤ��� ** - - 1. �ʲ��� ---> �ȼ����줿�ǽ�ιԤ˥���������ư���ޤ��礦�� - - 2. lubw �� u �ΰ��֤˥���������ư���ޤ��礦�� - - 3. ce �ȥ����פ���������ñ��򥿥��פ��ޤ��礦(���ξ�� 'ine' �ȥ�����)�� - - 4. �򥿥��פ��Ƥ��鼡�δְ㤤(�ѹ����٤�ʸ������Ƭ)�˰�ư���ޤ��� - - 5. �ǽ�ιԤ����ιԤ��ͤˤʤ�ޤǥ��ƥå� 3 �� 4 �򷫤��֤��ޤ��� - ----> This lubw has a few wptfd that mrrf changing usf the change operator. ----> This line has a few words that need changing using the change operator. - -ce ��ñ����������塢�����⡼�ɤ����뤳�Ȥ����դ��ޤ��礦�� -cc ��Ʊ�����Ȥ�����Τ��Ф��ƹԤ��ޤ��� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.3.4: c ����Ѥ�������¾���ѹ� - - - ** �ѹ����ڥ졼���ϡ������Ʊ���ͤ˥⡼��������Ѥ��ޤ��� ** - - 1. �ѹ����ڥ졼���ϡ������Ʊ���褦��ư��򤷤ޤ������η����� - - c [����] �⡼����� - - 2. �⡼������Ʊ���ǡ�w ��ñ�졢 $ �Ϲ����ʤɤȤ��ä���ΤǤ��� - - 3. �ʲ��� ---> �ȼ����줿�ǽ�ιԤ˥���������ư���ޤ��礦�� - - 4. �ǽ�δְ㤤�إ���������ư���ޤ��礦�� - - 5. c$ �ȥ����פ��ƹԤλĤ�򣲹��ܤ��ͤˤ��� �򲡤��ޤ��礦�� - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - -NOTE: ��������δְ㤤�ϥХå����ڡ���������Ȥä�ľ�����Ȥ�Ǥ��ޤ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.3 ���� - - - 1. ���˺�����줿�ƥ����Ȥ�����֤���ˤϡ�p �򥿥��פ��ޤ�������Ϻ���� - �줿�ƥ����Ȥ򥫡�����θ���������ޤ�(��ñ�̤Ǻ�����줿�Τʤ�С����� - ����Τ��뼡�ιԤ���������ޤ�)�� - - 2. ��������β���ʸ�����֤�������ˤϡ�r �򥿥��פ����塢������֤������� - ʸ���򥿥��פ��ޤ��� - - 3. �ѹ����ޥ�ɤǤϥ���������֤�������Υ⡼�����ǻ��ꤵ��뽪ü�ޤǤ��� - �����뤳�Ȥ���ǽ�Ǥ����㤨�� ce �ʤ�Х���������֤���ñ��ν����ޤǡ� - c$ �ʤ�йԤν����ޤǤ��ѹ����ޤ��� - - 4. �ѹ����ޥ�ɤη����� - - c [����] �⡼����� - -���������Υ�å���ؿʤߤޤ��礦�� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.4.1: ���֤ȥե�����ξ��� - - ** �ե�������Ǥΰ��֤ȥե�����ξ��֤�ɽ������ˤ� CTRL-G �򥿥��פ��ޤ��� - �ե�������Τ���Ԥ˰�ư����ˤ� G �򥿥��פ��ޤ��� ** - - NOTE: ���ƥåפ�¹Ԥ������ˡ����Υ�å������Ƥ��ܤ��̤��ޤ��礦!! - - 1. CTRL �򲡤����ޤ� g �򲡤��ޤ��礦���������� CTRL-G �ȸƤ�Ǥ��ޤ��� - �ڡ����ΰ��ֲ��˥ե�����̾�ȹ��ֹ椬ɽ�������Ϥ��Ǥ��� ���ƥå� 3�Τ��� - �˹��ֹ��Ф��Ƥ����ޤ��礦�� - -NOTE: ���̤α������˥�������ΰ��֤�ɽ������Ƥ��뤫�⤷��ޤ��󡣤���� - 'ruler' ���ץ����(:help 'ruler' �򻲾�)�����ꤹ�뤳�Ȥ�ɽ������ޤ��� - - 2. �ե�����κDz��Ԥ˰�ư���뤿��� G �򥿥��פ��ޤ��礦�� - �ե��������Ƭ�˰�ư����ˤ� gg �ȥ����פ��ޤ��礦�� - - 3. ��ۤɤιԤ��ֹ�򥿥��פ� G �򥿥��פ��ޤ��礦���ǽ�� CTRL-G �򲡤����� - ����ä����Ϥ��Ǥ��� - - 4. ���������Ƥ��饹�ƥå� 1 ���� 3 ��¹Ԥ��ޤ��礦�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.4.2: �������ޥ�� - - - ** ���򸡺�����ˤ� / �ȡ���������������򥿥��פ��ޤ��� ** - - 1. �Ρ��ޥ�⡼�ɤ� / �Ȥ���ʸ���򥿥��פ��ޤ������̰��ֲ��� : ���ޥ�ɤ� - Ʊ���ͤ� / ������뤳�Ȥ˵��Ť��Ǥ��礦�� - - 2. �Ǥϡ�'errroor' �ȥ����פ��ޤ��礦�����줬����������ñ��Ǥ��� - - 3. Ʊ������⤦���ٸ�������Ȥ��� ñ�� n �򥿥��פ��ޤ��� - �������˸��򸡺�����Ȥ��� N �򥿥��פ��ޤ��� - - 4. �������˸��򸡺�������ϡ�/ ������� ? ���ޥ�ɤ���Ѥ��ޤ��� - - 5. ���ξ������ˤ� CTRL-O (Ctrl �򲡤�³���ʤ���ʸ�� o �򥿥���)�򥿥��פ� - �ޤ�����������ˤϤ���򷫤��֤��ޤ���CTRL-I ���������Ǥ��� - ----> "errroor" �� error �ȥ��ڥ뤬�㤤�ޤ�; errroor �Ϥ����� error �Ǥ��� -NOTE: �������ե�����ν�����ã����ȡ����ץ���� 'wrapscan' �����ꤵ��Ƥ��� - ���ϡ��ե��������Ƭ���鸡����³�Ԥ��ޤ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.4.3: �б������̤򸡺� - - - ** �б����� ),] �� } �򸡺�����ˤ� % �򥿥��פ��ޤ��� ** - - 1. ���� ---> �Ǽ����줿�Ԥ� (,[ �� { �Τɤ줫�˥���������ư���ޤ��礦�� - - 2. ������ % �ȥ����פ��ޤ��礦�� - - 3. ����������б������̤˰�ư����Ϥ��Ǥ��� - - 4. �ǽ�γ�̤˰�ư����ˤ� % �ȥ����פ��ޤ��礦�� - - 5. ¾�� (,),[,],{ �� } �ǥ���������ư����% �����򤷤Ƥ��뤫��ǧ���ޤ��礦�� - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - - -NOTE: ���ε�ǽ�ϳ�̤����פ��Ƥ��ʤ��ץ�������ǥХå�����ΤˤȤƤ���Ω�� - �ޤ��� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.4.4: �ְ㤤���ѹ�������ˡ - - - ** 'old' �� 'new' ���ִ�����ˤ� :s/old/new/g �ȥ����פ��ޤ��� ** - - 1. �ʲ��� ---> �ȼ����줿�Ԥ˥���������ư���ޤ��礦�� - - 2. :s/thee/the �ȥ����פ��ޤ��礦�����Υ��ޥ�ɤϤ��ιԤǺǽ�˸��� - ���ä���Τˤ����Ԥ��뤳�Ȥ˵���Ĥ��ޤ��礦�� - - 3. �Ǥ� :s/thee/the/g �ȥ����פ��ޤ��礦���ɲä��� g �ե饰�Ϲ����Τ��ִ��� - �뤳�Ȥ��̣���ޤ��������ѹ��Ϥ��ιԤǸ��Ĥ��ä����Ƥβս���Ф��ƹԤ�� - �ޤ��� - ----> thee best time to see thee flowers is in thee spring. - - 4. ʣ���Ԥ��鸫�Ĥ���ʸ�������Ƥβս���ѹ�����ˤ� - :#,#s/old/new/g #,# �ˤ��֤��������ϰϤγ��ϤȽ�λ�ι��ֹ����ꤹ�롣 - :%s/old/new/g �ե��������ΤǸ��Ĥ����Τ��Ф����ѹ����롣 - :%s/old/new/gc �ե��������ΤǸ��Ĥ����Τ��Ф��ơ�1��1�ij�ǧ��Ȥ�� - �����ѹ����롣 - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.4 ���� - - - 1. CTRL-G �ϥե�����Ǥΰ��֤ȥե�����ξܺ٤�ɽ�����ޤ��� - G �ϥե�����κDz��Ԥ˰�ư���ޤ��� - ���� G �Ϥ��ιԤ˰�ư���ޤ��� - gg ����Ƭ�Ԥ˰�ư���ޤ��� - - 2. / �θ�˸��򥿥��פ���������˸��򸡺����ޤ��� - ? �θ�˸��򥿥��פ���ȸ����˸��򸡺����ޤ��� - �����θ�� n ��Ʊ�������μ��θ�����N �ϵ������θ����򤷤ޤ��� - CTRL-O �Ͼ������˰ܤ���CTRL-I �Ͼ��򼡤˰�ư���ޤ��� - - 3. (,),[,],{, �⤷���� } ��˥������뤬������֤� % �򥿥��פ�����Фˤʤ�ʸ - ���ذ�ư���ޤ��� - - 4. ���߹Ԥκǽ�� old �� new ���ִ����롣 :s/old/new - ���߹Ԥ����Ƥ� old �� new ���ִ����롣 :s/old/new/g - 2�Ĥ� # �Ԥδ֤Ǹ����ִ����롣 :#,#s/old/new/g - �ե������������Ƥθ��������ִ����롣 :%s/old/new/g - 'c' ��ä�����ִ����٤˳�ǧ����롣 :%s/old/new/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.5.1: �������ޥ�ɤ�¹Ԥ�����ˡ - - - ** :! �θ�˼¹Ԥ��볰�����ޥ�ɤ򥿥��פ��ޤ��� ** - - 1. ���̤κDz����˥������뤬��ư����褦������Ƥ���� : �򥿥��פ��ޤ��礦�� - ����ǥ��ޥ�ɥ饤��̿�᤬�����פǤ����ͤˤʤ�ޤ��� - - 2. ������ ! �Ȥ���ʸ��(��ò��)�򥿥��פ��ޤ��礦�� - ����dz��������륳�ޥ�ɤ��¹ԤǤ����ͤˤʤ�ޤ��� - - 3. ��Ȥ��� ! ��³���� ls �ȥ����פ� �򲡤��ޤ��礦�� - ������ץ���ץȤΤ褦�˥ǥ��쥯�ȥ�ΰ�����ɽ�������Ϥ��Ǥ��� - �⤷���� ls ��ư���ʤ��ʤ�� :!dir ����Ѥ��ޤ��礦�� - -NOTE: ������ˡ�ˤ�äƤ����륳�ޥ�ɤ��¹Ԥ��뤳�Ȥ��Ǥ��ޤ������������� - ��Ϳ�����ޤ��� - -NOTE: ���Ƥ� : ���ޥ�ɤ� �򲡤��ƽ�λ���ʤ���Фʤ�ޤ��� - �ʹߤǤϤ��Τ��Ȥ˸��ڤ��ޤ��� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.5.2: ����¾�Υե�����ؽ񤭹��� - - - ** �ե�������ѹ�����¸����ˤ� :w �ե�����̾ �ȥ����פ��ޤ��� ** - - 1. �ǥ��쥯�ȥ�ΰ��������뤿��� :!dir �⤷���� :!ls �ȥ����פ��ޤ��礦�� - ���Τ��� �򲡤��Τϴ��ˤ�¸�ΤǤ��͡� - - 2. TEST �Τ褦�ˡ����Υǥ��쥯�ȥ��̵���ե�����̾�������Ӥޤ��� - - 3. �Ǥ� :w TEST �ȥ����פ��ޤ��礦 (TEST �ϡ�������ե�����̾�Ǥ�)�� - - 4. ����ˤ��ե��������Τ� TEST �Ȥ���̾������¸����ޤ��� - �⤦���� :!dir �⤷���� :!ls �ȥ����פ��ƥǥ��쥯�ȥ���ǧ���Ƥߤޤ��礦�� - -NOTE: ������ Vim ��λ�����ե�����̾ TEST �ȶ��˵�ư����ȡ���¸�������� - ���塼�ȥꥢ���ʣ�����Ǥ��夬��Ϥ��Ǥ��� - - 5. ����ˡ����Τ褦�˥����פ��ƥե������ä��ޤ��礦(Windows): :!del TEST - �⤷����(Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.5.3: ���򤷤��񤭹��� - - -** �ե�����ΰ�������¸����ˤϡ�v �⡼������ :w FILENAME �򥿥��פ��ޤ��� ** - - 1. ���ιԤ˥���������ư���ޤ��� - - 2. v �򲡤����ʲ�����5���ܤ˥���������ư���ޤ����ƥ����Ȥ���Ĵɽ�������� - �����ܤ��Ʋ������� - - 3. ʸ�� : �򲡤��ȡ����̤κDz����� :'<,'> ������ޤ��� - - 4. w TEST (TEST ��¸�ߤ��ʤ��ե�����̾)�򥿥��פ��ޤ��� - �򲡤����� :'<,'>w TEST �ȤʤäƤ��뤳�Ȥ��ǧ���Ʋ������� - - 5. Vim �� TEST �Ȥ����ե���������򤵤줿�Ԥ�񤭹���Ǥ��礦�� - :!dir �⤷���� :!ls �Ǥ�����ǧ���ޤ��� - ����Ϻ�����ʤ��Ǥ����Ʋ����������Υ�å���ǻ��Ѥ��ޤ��� - -NOTE: v �򲡤��ȡ�Visual ���򤬻Ϥޤ�ޤ������������ư�������Ȥǡ������ϰϤ� - �礭���⾮������Ǥ��ޤ�������ˡ����������ϰϤ��Ф��ƥ��ڥ졼����Ŭ�� - �Ǥ��ޤ����㤨�� d �ϥƥ����Ȥ������ޤ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.5.4: �ե�����μ���ȹ�ʻ - - - ** �ե��������Ȥ���������ˤ� :r �ե�����̾ �ȥ����פ��ޤ��� ** - - 1. ��������򤳤ιԤΤ�����˹�碌�ޤ��� - -NOTE: ���ƥå� 2 �μ¹Ը塢��å��� 1.5.3 �Υƥ����Ȥ�����ޤ������˲����äƤ� - �Υ�å���˰�ư���ޤ��礦�� - - 2. �Ǥ� TEST �Ȥ����ե������ :r TEST �Ȥ������ޥ�ɤ��ɤ߹��ߤޤ��礦�� - �����Ǥ��� TEST �ϻȤ��ե������̾���Τ��ȤǤ��� - �ɤ߹��ޤ줿�ե�����ϡ���������Ԥβ��ˤ���ޤ��� - - 3. ��������ե�������ǧ���Ƥߤޤ��礦������������᤹�ȡ���å���1.5.3 �� - ���ꥸ�ʥ�ȥե�����ˤ���Τ�2�Ĥ����뤳�Ȥ��狼��ޤ��� - -NOTE: �������ޥ�ɤν��Ϥ��ɤ߹��ळ�Ȥ�Ǥ��ޤ����㤨�С� - :r !ls �� ls ���ޥ�ɤν��Ϥ򥫡�����ʲ����ɤ߹��ߤޤ��� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.5 ���� - - - 1. :!command �ˤ�ä� �������ޥ�ɤ�¹Ԥ��롣 - - �褯�Ȥ���: - (Windows) (Unix) - :!dir :!ls - �ǥ��쥯�ȥ���ΰ����򸫤롣 - :!del FILENAME :!rm FILENAME - �ե�����������롣 - - 2. :w �ե�����̾ �ˤ�äƥե�����̾�Ȥ����ե����뤬�ǥ������˽񤭹��ޤ�롣 - - 3. v �⡼������ :w FILENAME �Ȥ���ȡ��ӥ��奢������Ԥ��ե��������¸�� - ��롣 - - 4. :r �ե�����̾ �ˤ��ե�����̾�Ȥ����ե����뤬�ǥ������������ޤ졢 - ����������֤β�����������롣 - - 5. :r !dir �� dir ���ޥ�ɤν��Ϥ򥫡�������ְʲ����ɤ߹��ࡣ - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.6.1: �����ץ󥳥ޥ�� - - - ** o �򥿥��פ���ȡ���������β��ιԤ������������⡼�ɤ�����ޤ��� ** - - 1. �ʲ��� ---> �ȼ����줿�ǽ�ιԤ˥���������ư���ޤ��礦�� - - 2. o (��ʸ��) �򥿥��פ��ơ���������β��ιԤ򳫤��������⡼�ɤ�����ޤ��� - - 3. �����Ĥ�ʸ���򥿥��פ��Ƥ��顢�����⡼�ɤ�λ����٤� �� - �����פ��ޤ��� - ----> o �򥿥��פ���ȥ�������ϳ������Ԥذ�ư�������⡼�ɤ�����ޤ��� - - 4. ��������ξ�ιԤ���������ˤϡ���ʸ���� o �ǤϤʤ���ñ�����ʸ���� O - �򥿥��פ��ޤ������ιԤǻ�Ƥߤޤ��礦�� - ----> ���ιԤξ����������ˤϡ����ιԤإ���������֤��� O �򥿥��פ��ޤ��� - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.6.2: �ɲå��ޥ�� - - - ** ��������μ��ΰ��֤���ƥ����Ȥ��ɲä���ˤ� a �ȥ����פ��ޤ��� ** - - 1. ��������� ---> �Ǽ����줿�ǽ�ιԤذ�ư���ޤ��礦�� - - 2. e �򲡤��� li �ν�ü���ޤǥ���������ư���ޤ��� - - 3. ��������θ���˥ƥ����Ȥ��ɲä��뤿��� a (��ʸ��) �򥿥��פ��ޤ��� - - 4. ���β��ιԤΤ褦��ñ��˴��������ޤ��������⡼�ɤ�ȴ����٤� �� - ���ޤ��� - - 5. e ��ȤäƼ����Դ�����ñ��ذ�ư�������ƥå� 3 �� 4 �򷫤��֤��ޤ��� - ----> This li will allow you to pract appendi text to a line. ----> This line will allow you to practice appending text to a line. - -NOTE: a, i �� A ��Ʊ�������⡼�ɤذܤ�ޤ�����ʸ���������������֤������ۤʤ� - �ޤ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.6.3: ����¾���ִ���ˡ - - - ** 1ʸ���ʾ���֤�������ˤ���ʸ���� R �ȥ����פ��ޤ��礦�� ** - - 1. �ʲ��� ---> �ȼ����줿�Ԥ˥���������ư���ޤ����ǽ�� xxx ����Ƭ�˰�ư�� - �ޤ��� - - 2. R �򲡤��ơ�2���ܤο��ͤ򥿥��פ��뤳�Ȥǡ�xxx ���ִ�����ޤ��� - - 3. �ִ��⡼�ɤ�ȴ����ˤ� �򲡤��ޤ����ԤλĤ꤬�ѹ�����Ƥ��ʤ��ޤޤ� - �ʤ뤳�Ȥ����դ��Ƥ��������� - - 4. �Ĥä� xxx �򥹥ƥåפ򷫤��֤����ִ����ޤ��礦�� - ----> Adding 123 to xxx gives you xxx. ----> Adding 123 to 456 gives you 579. - -NOTE: �ִ��⡼�ɤ������⡼�ɤ˻��Ƥ��ޤ��������ƤΥ����פ��줿ʸ���ϴ�¸��ʸ�� - �������ޤ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.6.4: �ƥ����ȤΥ��ԡ��ȥڡ����� - - - ** �ƥ����ȤΥ��ԡ��ˤϥ��ڥ졼�� y �򡢥ڡ����Ȥˤ� p ��Ȥ��ޤ��� ** - - 1. ---> �ȼ����줿�Ԥذ�ư������������� "a)" �θ���֤��Ƥ����ޤ��� - - 2. v �ǥӥ��奢��⡼�ɤ򳫻Ϥ���"first" �μ����ޤǥ���������ư���ޤ��� - - 3. y �򥿥��פ��ƶ�Ĵɽ�����줿�ƥ����Ȥ� yank (���ԡ�)���ޤ��� - - 4. ���ιԤι����ޤǥ���������ư���ޤ�: j$ - - 5. p �򲡤���Ž���դ�(put)�Ƥ��顢���򥿥��פ��ޤ�: a second - - 6. �ӥ��奢��⡼�ɤ� " item." �����򤷡�y �ǥ�󥯡����ιԤι����ޤ� j$ �� - ��ư���� p �ǥƥ����Ȥ򤽤��� put ���ޤ��� - ----> a) this is the first item. - b) - - NOTE: y �򥪥ڥ졼���Ȥ��ƻȤ����Ȥ�Ǥ��ޤ���yw ��ñ���1�� yank ���ޤ��� - yy �ϹԤ�1�� yank ����p �Ǥ��ιԤ� put ���ޤ��� -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.6.5: ���ץ��������� - - - ** �������ִ��κݤ���ʸ��/��ʸ����̵�뤹��ˤϡ����ץ��������ꤷ�ޤ��� ** - - 1. �����ͤ����Ϥ��� 'ignore' �򸡺����ޤ��礦: /ignore - n �򲡤��Ʋ��٤������򷫤��֤��ޤ��� - - 2. �����ͤ����Ϥ��� 'ic' (Ignore Case ��ά) ���ץ��������ꤷ�ޤ�: :set ic - - 3. �Ǥ� n �ˤ�äƤ⤦1�� 'ignore' �򸡺����ޤ��� - n �򲡤��Ƥ���˿��󸡺��򷫤��֤��ޤ��礦�� - - 4. 'hlsearch' �� 'incsearch' ���ץ��������ꤷ�ޤ��礦: :set hls is - - 5. �������ޥ�ɤ�����Ϥ��ơ����������뤫���Ƥߤޤ��礦: /ignore - - 6. ��ʸ����ʸ���ζ��̤�̵���ˤ���ˤϼ����ͤ����Ϥ��ޤ�: :set noic - -NOTE: �ޥå��ζ�Ĵɽ�������ˤϼ����ͤ����Ϥ��ޤ�: :nohlsearch -NOTE: 1�Ĥθ������ޥ�ɤ�����ʸ����ʸ���ζ��̤��᤿���ʤ�С������� \c - ����Ѥ��ޤ�: /ignore\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.6 ���� - - 1. o �򥿥��פ���ȥ�������β��ιԤ򳫤��ơ������������⡼�ɤˤʤ롣 - O (��ʸ��) �򥿥��פ���ȥ�������ξ�ιԤ������⡼�ɤˤʤ롣 - - 2. ����������ʸ���μ�����ƥ����Ȥ��ɲä���ˤ� a �ȥ����פ��롣 - �����˥ƥ����Ȥ���������ˤ���ʸ�� A �򥿥��פ��롣 - - 3. e ���ޥ�ɤ�ñ��ν�ü�˥���������ư���롣 - - 4. y ���ڥ졼���ϥƥ����Ȥ� yank (���ԡ�)����p �Ϥ���� put (�ڡ�����)���롣 - - 5. ��ʸ���� R �򥿥��פ�����ִ��⡼�ɤ����ꡢ �򲡤���ȴ���롣 - - 6. ":set xxx" �ȥ����פ���ȥ��ץ���� "xxx" �����ꤵ��롣 - 'ic' 'ignorecase' ����������ʸ����ʸ���ζ��̤��ʤ� - 'is' 'incsearch' �����ե졼������ʬ�ޥå����Ƥ�����ʬ��ɽ������ - 'hls' 'hlsearch' �ޥå����뤹�٤Ƥ�Ĵɽ������ - Ĺ������û�������ɤ���Υ��ץ����̾�Ǥ���ѤǤ��ޤ��� - - 7. ���ץ�����̵���ˤ���ˤ� "no" ����Ϳ����: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.7.1: ����饤��إ�ץ��ޥ�� - - - ** ����饤��إ�פ���Ѥ��ޤ��礦 ** - - Vim �ˤϹ��Ϥˤ錄�륪��饤��إ�ץ����ƥब����ޤ��� - �إ�פ򳫻Ϥ���ˤϡ������3�ĤΤɤ줫1�Ĥ��Ƥߤޤ��礦: - - �إ�ץ��� �򲡤�(�⤷����ʤ��)�� - - �����򲡤�(�⤷����ʤ��)�� - - :help �ȥ����פ��롣 - - �إ�ץ�����ɥ��Υƥ����Ȥ��ɤ�ȡ��إ�פ�ư�����Ǥ��ޤ��� - CTRL-W CTRL-W �ȥ����פ���� �إ�ץ�����ɥ��إ����פ��ޤ��� - :q �ȥ����פ���� �إ�ץ�����ɥ����Ĥ����ޤ��� - - ":help" ���ޥ�ɤ˰�����Ϳ���뤳�Ȥˤ�ꡢ��������̾�Υإ�פ򸫤Ĥ��뤳�� - ���Ǥ��ޤ����������Ƥߤޤ��礦( �򥿥��פ�˺��ʤ��褦��): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.7.2: ��ư������ץȤκ��� - - ** Vim ����ħ��ȯ������ ** - - Vim �ˤ� Vi ����¿������ħ��Ƨ�ޤ��Ƥ��ޤ��������ΤۤȤ�ɤϽ�����֤ˤ� - �����ԲĤȤʤäƤ��ޤ������¿������ħ��Ȥ��Ϥ����ˤ� "vimrc" �ե����� - ��������ޤ��� - - 1. "vimrc" �ե�������Խ��򳫻Ϥ��ޤ�������ϥ����ƥ�˰�¸���ޤ��� - :e ~/.vimrc UNIX ���� - :e ~/_vimrc Windows ���� - - 2. �����ǥ���ץ�� "vimrc" ���ɤ߹��ߤޤ��� - :r $VIMRUNTIME/vimrc_example.vim - - 3. �ʲ��Τ褦�˥ե�����ؽ񤭹��ߤޤ��� - :w - - ���� Vim ��ư����ȡ����Ť���ʸ���Ȥ���褦�ˤʤ�Ǥ��礦�� - ���� "vimrc" �ե�����ء������ߤ�������ɲä��뤳�Ȥ��Ǥ��ޤ��� - ���¿���ξ��������ˤ� :help vimrc-intro �ȥ����פ��ޤ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.7.3: �䴰 - - - ** CTRL-D �� �ǥ��ޥ�ɥ饤����䴰���� ** - - 1. �ߴ��⡼�ɤǤʤ����Ȥ��ǧ���ޤ�: :set nocp - - 2. ���ߤΥǥ��쥯�ȥ�˺ߤ�ե������ :!ls �� :!dir �dz�ǧ���ޤ��� - - 3. ���ޥ�ɤ���Ƭ�򥿥��פ��ޤ�: :e - - 4. CTRL-D �򲡤��� Vim �� "e" ����Ϥޤ륳�ޥ�ɤΰ�����ɽ�����ޤ��� - - 5. d �ȥ����פ���� Vim �� ":edit" �Ȥ������ޥ��̾���䴰���ޤ��� - - 6. ����˶���ȡ���¸�Υե�����̾�λϤޤ��ä��ޤ�: :edit FIL - - 7. �򲡤��� Vim ��̾�����䴰���ޤ���(�⤷��Ĥ���̵���ä����) - -NOTE: �䴰��¿���Υ��ޥ�ɤ�ư��ޤ��������� CTRL-D �� �����ƤߤƤ��� - �������ä� :help �κݤ���Ω���ޤ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��å��� 1.7 ���� - - - 1. �إ�ץ�����ɥ��򳫤��ˤ� :help �Ȥ��뤫 �⤷���� �򲡤��� - - 2. ���ޥ��(cmd)�Υإ�פ򸡺�����ˤ� :help cmd �ȥ����פ��롣 - - 3. �̤Υ�����ɥ��إ����פ���ˤ� CTRL-W CTRL-W �ȥ����פ��롣 - - 4. �إ�ץ�����ɥ����Ĥ���ˤ� :q �ȥ����פ��롣 - - 5. �����ߤ�������ݤĤˤ� vimrc ��ư������ץȤ�������롣 - - 6. : command �Dz�ǽ���䴰�򸫤�ˤ� CTRL-D �򥿥��פ��롣 - �䴰����Ѥ���ˤ� �򲡤��� - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - ����ˤ� Vim �Υ��塼�ȥꥢ��򽪤��ޤ������ǥ������ñ�ˡ������⽼ʬ�� - �Ȥ����Ȥ��Ǥ���褦�ˤȡ�Vim �λ��ij�ǰ�������Τߤ������褦�Ȥ��ޤ����� - Vim �ˤϤ����¿���Υ��ޥ�ɤ����ꡢ���������Ƥ��������뤳�ȤϤǤ��ޤ��� - �ʹߤϥ桼�����ޥ˥奢��򻲾Ȥ�������: ":help user-manual" - - ����ʸ�γؽ��Τ���ˡ������ܤ�������ޤ��� - Vim - Vi Improved - by Steve Oualline - ���Ǽ�: New Riders - �ǽ���ܤϴ����� Vim �Τ���˽񤫤�ޤ������Ȥ�櫓�鿴�ԤˤϤ�����Ǥ��� - ¿�����������Ǥ��Ǻܤ���Ƥ��ޤ��� - ����URL�򻲾Ȥ��Ʋ����� https://iccf-holland.org/click5.html - - ���� Vim ���� Vi �ˤĤ��ƽ񤫤줿�Ť��ܤǤ����������ޤ�: - Learning the Vi Editor - by Linda Lamb - ���Ǽ�: O'Reilly & Associates Inc. - Vi �Ǥ�ꤿ���Ȼפ����Ȥۤ����Ƥ��Τ뤳�Ȥ��Ǥ����ɽ�Ǥ��� - ��6�ǤǤϡ�Vim �ˤĤ��Ƥξ����ޤޤ�Ƥ��ޤ��� - - ���Υ��塼�ȥꥢ��� Colorado State University �� Charles Smith �Υ����ǥ� - ���ˡ�Colorado School of Mines �� Michael C. Pierce �� Robert K. Ware �� - ξ̾�ˤ�äƽ񤫤�ޤ����� E-mail: bware@mines.colorado.edu. - - Modified for Vim by Bram Moolenaar. - - ���ܸ��� ���� �ٹ� - vim-jp������ - �ƽ� ¼�� ��Ϻ - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - vi:set ts=8 sts=4 sw=4 tw=78: diff --git a/runtime/tutor/tutor1.ja.sjis b/runtime/tutor/tutor1.ja.sjis deleted file mode 100644 index ea1207e9d7..0000000000 --- a/runtime/tutor/tutor1.ja.sjis +++ /dev/null @@ -1,977 +0,0 @@ -=============================================================================== -= V I M �� �{ (�`���[�g���A��) �� �� �� �� �� - Version 1.7 = -=============================================================================== - - Vim �́A���̃`���[�g���A���Ő�������ɂ͑���������̃R�}���h���������� - �ɋ��͂ȃG�f�B�^�[�ł��B���̃`���[�g���A���́A���Ȃ��� Vim �𖜔\�G�f�B - �^�[�Ƃ��Ďg�����Ȃ���悤�ɂȂ�̂ɏ\���ȃR�}���h�ɂ‚��Đ���������悤 - �ɂȂ��Ă��܂��B - - �`���[�g���A������������̂ɕK�v�Ȏ��Ԃ́A�o�����R�}���h�������̂ɂǂꂾ - �����Ԃ��g���̂��ɂ����܂����A���悻30���ł��B - - ATTENTION: - �ȉ��̗��K�p�R�}���h�ɂ͂��̕��͂�ύX������̂�����܂��B���K���n�߂�O - �ɃR�s�[���쐬���܂��傤("vimtutor"�����Ȃ�΁A���ɃR�s�[����Ă��܂�)�B - - ���̃`���[�g���A�����A�g�����ƂŊo������d�g�݂ɂȂ��Ă��邱�Ƃ��A�S�� - �Ă����Ȃ���΂Ȃ�܂���B�������w�K����ɂ̓R�}���h�����ۂɎ����Ȃ���� - �Ȃ�Ȃ��̂ł��B���͂�ǂ񂾂����Ȃ�΁A�����ƖY��Ă��܂��܂�! - - �����ACaps���b�N�L�[��������Ă��Ȃ����Ƃ��m�F������A��ʂɃ��b�X��1.1.1 - ���S���\�������Ƃ���܂ŁAj �L�[�������ăJ�[�\�����ړ����܂��傤�B -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.1.1: �J�[�\���̈ړ� - - - ** �J�[�\�����ړ�����ɂ́A�������l�� h,j,k,l �������܂��B ** - ^ - k �q���g: h �L�[�͍������Ɉړ����܂��B - < h l > l �L�[�͉E�����Ɉړ����܂��B - j j �L�[�͉����L�[�̂悤�ȃL�[�ł��B - v - 1. �ړ��Ɋ����܂ŁA�X�N���[���ŃJ�[�\���ړ������܂��傤�B - - 2. ���ւ̃L�[(j)�������‚Â���ƁA�A�����Ĉړ��ł��܂��B - ����Ŏ��̃��b�X���Ɉړ�������@���킩��܂����ˁB - - 3. ���ւ̃L�[���g���āA���b�X��1.1.2 �Ɉړ����܂��傤�B - -NOTE: �����^�C�v���Ă��邩����Ȃ��Ȃ�����A�������ăm�[�}�����[�h�ɂ� - �܂��B���ꂩ����͂��悤�Ƃ��Ă����R�}���h���ē��͂��܂��傤�B - -NOTE: �J�[�\���L�[�ł��ړ��ł��܂��B������ hjkl �Ɉ�x����Ă��܂��΁A�͂邩 - �ɑ����ړ����邱�Ƃ��ł���ł��傤�B����}�W��! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.1.2: VIM �̋N���ƏI�� - - - !! NOTE: �ȉ��̂�����X�e�b�v���s���O�ɁA���̃��b�X����ǂ݂܂��傤!! - - 1. �L�[�������܂��傤�B(�m���Ƀm�[�}�����[�h�ɂ��邽��) - - 2. ���̂悤�Ƀ^�C�v: :q! - ����ɂ��ҏW�������e��ۑ������ɃG�f�B�^���I�����܂��B - - 3. ���̃`���[�g���A�����n�߂�ׂ̃R�}���h�����s����ƁA�����ɖ߂�܂��B - ���̃R�}���h��: vimtutor - - 4. ����܂ł̃X�e�b�v���o�����M���‚����Ȃ�΁A�X�e�b�v 1 ���� 3 �܂ł��� - �ۂɎ����āAVim ��1�x�I�����Ă���ĂыN�����܂��傤�B - -NOTE: :q! �͑S�Ă̕ύX��j�����܂��B���b�X���ɂĕύX���t�@�C���ɕ� - ��������@�ɂ‚��Ă��׋����Ă����܂��傤�B - - 5. 1.1.3�܂ŃJ�[�\�����ړ������܂��傤�B - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.1.3: �e�L�X�g�ҏW - �폜 - - - ** �m�[�}�����[�h�ɂăJ�[�\���̉��̕������폜����ɂ� x �������܂��B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�s�ɃJ�[�\�����ړ����܂��傤�B - - 2. �ԈႢ���C�����邽�߂ɁA�폜����ŏ��̕����܂ŃJ�[�\�����ړ����܂��B - - 3. �s�K�v�ȕ����� x �������č폜���܂��傤�B - - 4. �����������Ȃ�܂� �X�e�b�v 2 ���� 4 ���J��Ԃ��܂��傤�B - ----> ���� �������� �� �‚‚��� �� �������Ă� �Ƃт͂˂��� - - 5. �s���������Ȃ�����A���b�X�� 1.1.4 �֐i�݂܂��傤�B - -NOTE: �S�Ẵ��b�X����ʂ��āA�o���悤�Ƃ���̂ł͂Ȃ����ۂɂ���Ă݂܂��傤�B - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.1.4: �e�L�X�g�ҏW - �}�� - - - ** �m�[�}�����[�h�ɂăe�L�X�g��}������ɂ� i �������܂��B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�ŏ��̍s�ɃJ�[�\�����ړ����܂��傤�B - - 2. 1�s�ڂ�2�s�ڂƓ����l�ɂ��邽�߂ɁA�e�L�X�g��}�����Ȃ���΂Ȃ�Ȃ��ʒu - �̎��̕����ɃJ�[�\�����ړ����܂��B - - 3. i �L�[�������Ă���A�lj����K�v�ȕ������^�C�v���܂��傤�B - - 4. �ԈႢ���C�������� �������ăR�}���h���[�h�ɖ߂�A���������ɂȂ�l - �ɃX�e�b�v 2 ���� 4 ���J��Ԃ��܂��傤�B - ----> ���� �ɂ� ����Ȃ� �e�L�X�g ����B ----> ���� �s �ɂ� ��‚� ����Ȃ� �e�L�X�g �� ����B - - 5. �}���̕��@���킩�����烌�b�X�� 1.1.5 �֐i�݂܂��傤�B - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.1.5: �e�L�X�g�ҏW - �lj� - - - ** �e�L�X�g��lj�����ɂ� A �������܂��傤�B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�ŏ��̍s�ɃJ�[�\�����ړ����܂��傤�B - �J�[�\�������̍s�̂ǂ̕�����ɂ����Ă����܂��܂���B - - 2. �lj����K�v�ȏꏊ�� A ���^�C�v���܂��傤�B - - 3. �e�L�X�g��lj����I������A �������ăm�[�}�����[�h�ɖ߂�܂��傤�B - - 4. 2�s�ڂ� ---> �Ǝ����ꂽ�ꏊ�ֈړ����A�X�e�b�v 2 ���� 3 ���J��Ԃ��ĕ��@ - ���C�����܂��傤�B - ----> �����ɂ͊Ԉ�����e�L�X�g������ - �����ɂ͊Ԉ�����e�L�X�g������܂��B ----> �����ɂ��Ԉ�����e�L�X - �����ɂ��Ԉ�����e�L�X�g������܂��B - - 5. �e�L�X�g�̒lj����y���ɂȂ��Ă����烌�b�X�� 1.1.6 �֐i�݂܂��傤�B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.1.6: �t�@�C���̕ҏW - - ** �t�@�C����ۑ����ďI������ɂ� :wq �ƃ^�C�v���܂��B ** - - !! NOTE: �ȉ��̃X�e�b�v�����s����O�ɁA�܂��S�̂�ǂ�ł�������!! - - 1. �ʂ̒[��������ꍇ�͂����ňȉ��̓��e���s���Ă��������B�����łȂ���΁A - ���b�X�� 1.1.2 �ł�����悤�� :q! ���^�C�v���āA���̃`���[�g���A�����I�� - ���܂��B - - 2. �V�F���v�����v�g�ł��̃R�}���h���^�C�v���܂�: vim file.txt - 'vim' �� Vim �G�f�B�^���N������R�}���h�A'file.txt' �͕ҏW�������t�@�C�� - �̖��O�ł��B�ύX�ł���t�@�C���̖��O���g���܂��傤�B - - 3. �O�̃��b�X���Ŋw�񂾂悤�ɁA�e�L�X�g��}���A�폜���܂��B - - 4. �ύX���t�@�C���ɕۑ����܂�: :wq - - 5. �X�e�b�v 1 �� vimtutor ���I�������ꍇ�� vimtutor ���ēx�N�����A�ȉ��� - �v��֐i�݂܂��傤�B - - 6. �ȏ�̃X�e�b�v��ǂ�ŗ���������ł�������s���܂��傤�B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.1 �v�� - - - 1. �J�[�\���͖��L�[�������� hjkl �L�[�ňړ����܂��B - h (��) j (��) k (��) l (�E) - - 2. Vim ���N������ɂ̓v�����v�g���� vim �t�@�C���� �ƃ^�C�v���܂��B - - 3. Vim ���I������ɂ� :q! �ƃ^�C�v���܂�(�ύX��j��)�B - �������� :wq �ƃ^�C�v���܂�(�ύX��ۑ�)�B - - 4. �J�[�\���̉��̕������폜����ɂ́A�m�[�}�����[�h�� x �ƃ^�C�v���܂��B - - 5. �J�[�\���̈ʒu�ɕ�����}������ɂ́A�m�[�}�����[�h�� i �ƃ^�C�v���܂��B - i �e�L�X�g�̃^�C�v �J�[�\���ʒu�ɒlj� - A �e�L�X�g�̒lj� �s���ɒlj� - -NOTE: �L�[�������ƃm�[�}�����[�h�Ɉڍs���܂��B���̍ہA�Ԉ��������͓r - ���̃R�}���h�����������Ƃ��ł��܂��B - -���āA�����ă��b�X�� 1.2 ���n�߂܂��傤�B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.2.1: �폜�R�}���h - - - ** �P��̖����܂ł��폜����ɂ� dw �ƃ^�C�v���܂��傤�B ** - - 1. �m���Ƀm�[�}�����[�h�ɂ��邽�� �������܂��傤�B - - 2. �ȉ��� ---> �Ǝ����ꂽ�s�ɃJ�[�\�����ړ����܂��傤�B - - 3. ���������P��̐擪�ɃJ�[�\�����ړ����܂��傤�B - - 4. �P����폜���邽�߂� dw �ƃ^�C�v���܂��傤�B - - NOTE: d ���^�C�v����ƁA���̕������X�N���[���̍ʼn��s�Ɍ����܂��BVim �� - ���Ȃ��� w ���^�C�v����̂�҂��Ă��܂��B���� d �ȊO�̕������\�����ꂽ - ���͉����Ԉ���Ă��܂��B �������Ă�蒼���܂��傤�B - ----> ���� �� �� �ɂ� �����‚��� ���̂��� �K�v�̂Ȃ� �P�� �� �܂܂�� ���܂��B - - 5. 3 ���� 4 �܂ł𕶂��������Ȃ�܂ŌJ��Ԃ��A���b�X�� 1.2.2 �֐i�݂܂��傤�B - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.2.2: ���̑��̍폜�R�}���h - - - ** �s�̖����܂ł��폜����ɂ� d$ �ƃ^�C�v���܂��傤�B ** - - 1. �m���Ƀm�[�}�����[�h�ɂ��邽�� �������܂��傤�B - - 2. �ȉ��� ---> �Ǝ����ꂽ�s�ɃJ�[�\�����ړ����܂��傤�B - - 3. ���������̖����փJ�[�\�����ړ����܂��傤(�ŏ��� �B �̌�ł�)�B - - 4. �s���܂ō폜����̂� d$ �ƃ^�C�v���܂��傤�B - ----> �N�������̍s�̍Ō��2�x�^�C�v���܂����B 2�x�^�C�v���܂����B - - - 5. �ǂ��������Ƃ��������邽�߂ɁA���b�X�� 1.2.3 �֐i�݂܂��傤�B - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.2.3: �I�y���[�^�ƃ��[�V���� - - - �e�L�X�g�ɕύX�������鑽���̃R�}���h�̓I�y���[�^�ƃ��[�V��������Ȃ�܂��B - �폜�R�}���h d �̃I�y���[�^�͎��̗l�ɂȂ��Ă��܂�: - - d ���[�V���� - - ���ꂼ��: - d - �폜�R�}���h�B - ���[�V���� - ���ɑ΂��ē��������邩(�ȉ��ɋ����܂�)�B - - ���[�V�����ꗗ�̈ꕔ: - w - �J�[�\���ʒu����󔒂��܂ޒP��̖����܂ŁB - e - �J�[�\���ʒu����󔒂��܂܂Ȃ��P��̖����܂ŁB - $ - �J�[�\���ʒu����s���܂ŁB - - �‚܂� de �ƃ^�C�v����ƁA�J�[�\���ʒu����P��̏I���܂ł��폜���܂��B - -NOTE: �`���������l�́A�m�[�}�����[�h�ɂăI�y���[�^�Ȃ��Ƀ��[�V������������ - �݂܂��傤�B�J�[�\�����ړI��ꗗ�Ŏ������ʒu�Ɉړ�����͂��ł��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.2.4: ���[�V�����ɃJ�E���g���g�p���� - - - ** ������s�������J��Ԃ��̃��[�V�����̑O�ɐ��l���^�C�v���܂��B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�s�̐擪�ɃJ�[�\�����ړ����܂��B - - 2. 2w ���^�C�v���ĒP��2�•���Ɉړ����܂��B - - 3. 3e ���^�C�v����3�–ڂ̒P��̏I�[�Ɉړ����܂��B - - 4. 0 (�[��)���^�C�v���čs���Ɉړ����܂��B - - 5. �X�e�b�v 2 �� 3 ���Ⴄ���l���g���ČJ��Ԃ��܂��B - ----> This is just a line with words you can move around in. - - 6. ���b�X�� 1.2.5 �ɐi�݂܂��傤�B - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.2.5: ��葽�����폜���邽�߂ɃJ�E���g���g�p���� - - - ** �I�y���[�^�ƃJ�E���g���^�C�v����ƁA���̑��삪������J��Ԃ���܂��B ** - - ���q�̍폜�̃I�y���[�^�ƃ��[�V�����̑g�ݍ��킹�ɃJ�E���g��lj����邱�ƂŁA - ��葽���̍폜���s���܂�: - d ���l ���[�V���� - - 1. ---> �Ǝ����ꂽ�s�̍ŏ��̑啶���̒P��ɃJ�[�\�����ړ����܂��傤�B - - 2. �啶���̒P��2�‚� d2w �ƃ^�C�v���č폜���܂��B - - 3. �A�������啶���̒P����A�قȂ�J�E���g���w�肵��1�‚̃R�}���h�ō폜���A - �X�e�b�v 1 �� 2 ���J��Ԃ��܂��B - ----> ����ABC DE�s��FGHI JK LMN OP�P���Q RS TUV�Y��ɂȂ����B - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.2.6: �s�̑��� - - - ** �s�S�̂��폜����ɂ� dd �ƃ^�C�v���܂��B ** - - �s�S�̂��폜����p�x�������̂ŁAVi�̃f�U�C�i�[�͍s�̍폜�� d ��2��^�C�v�� - �����ȒP�Ȃ��̂Ɍ��߂܂����B - - 1. �ȉ��̋��2�s�ڂɃJ�[�\�����ړ����܂��B - 2. dd �ƃ^�C�v���čs���폜���܂��B - 3. �����4�s�ڂɈړ����܂��B - 4. 2dd �ƃ^�C�v����2�s���폜���܂��B - ----> 1) �o���͐Ԃ��A ----> 2) �‚܂�Ȃ����̂͊y�����A ----> 3) �X�~���͐‚��A ----> 4) ���͎Ԃ������Ă���A ----> 5) ���v��������������A ----> 6) �����͊Â� ----> 7) �I�}�G���i�[ - -2��^�C�v��1�s�ɑ΂��č�p��������@�͈ȉ��ŏq�ׂ�I�y���[�^�ł����삵�܂��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.2.7: ��蒼���R�}���h - - - ** �Ō�̃R�}���h���������ɂ� u �������܂��BU �͍s�S�̂̎������ł��B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�s�ɃJ�[�\�����ړ����A�ŏ��̊ԈႢ�ɃJ�[�\�� - ���ړ����܂��傤�B - 2. x ���^�C�v���čŏ��̂���Ȃ��������폜���܂��傤�B - 3. �����Au ���^�C�v���čŌ�Ɏ��s�����R�}���h���������܂��傤�B - 4. ���x�́Ax ���g�p���čs���̌���S�ďC�����܂��傤�B - 5. �啶���� U ���^�C�v���āA�s�����̏�Ԃɖ߂��܂��傤�B - 6. u ���^�C�v���Ē��O�� U �R�}���h���������܂��傤�B - 7. �ł̓R�}���h���Ď��s����̂� CTRL-R (CTRL ���������܂� R ��ł�)�𐔉� - �^�C�v���Ă݂܂��傤(�������̎�����)�B - ----> ���̂̍s�̂̊ԈႢ���C���X���A��ł����̏C�������������܂܂����B - - 8. ����͂ƂĂ��֗��ȃR�}���h�ł��B�������b�X�� 1.2 �v��֐i�݂܂��傤�B - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.2 �v�� - - - 1. �J�[�\���ʒu���玟�̒P��܂ł��폜����ɂ� dw �ƃ^�C�v���܂��B - 2. �J�[�\���ʒu����P��̖����܂ł��폜����ɂ� de �ƃ^�C�v���܂��B - 3. �J�[�\���ʒu����s�̖����܂ł��폜����ɂ� d$ �ƃ^�C�v���܂��B - 4. �s�S�̂��폜����ɂ� dd �ƃ^�C�v���܂��B - - 5. ���[�V�������J��Ԃ��ɂ͐��l��t�^���܂�: 2w - 6. �ύX�ɗp����R�}���h�̌`���� - �I�y���[�^ [���l] ���[�V���� - ���ꂼ��: - �I�y���[�^ - �폜 d �̗ނʼn������邩�B - [���l] - ���̃R�}���h������J��Ԃ����B - ���[�V���� - w (�P��)�� e (�P�ꖖ��)�A$ (�s��)�Ȃǂ̗ނŁA�e�L�X�g�� - ���ɑ΂��ē��������邩�B - - 7. �s�̐擪�Ɉړ�����ɂ̓[�����g�p���܂�: 0 - - 8. �O��̓����������: u (������ u) - �s�S�̂̕ύX��������: U (�啶�� U) - �������̎�����: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.3.1: �\��t���R�}���h - - - ** �Ō�ɍ폜���ꂽ�s���J�[�\���̌�ɓ\��t����ɂ� p ���^�C�v���܂��B ** - - 1. ---> �Ǝ����ꂽ�ȉ��̍ŏ��̍s�ɃJ�[�\�����ړ����܂��傤�B - - 2. dd �ƃ^�C�v���čs���폜���AVim �̃��W�X�^�Ɋi�[���܂��傤�B - - 3. �폜�����s���{������ׂ��ʒu�̏�̍s�ł��� c) �s�܂ŁA�J�[�\�����ړ����� - �܂��傤�B - - 4. �m�[�}�����[�h�� p ���^�C�v���Ċi�[�����s���J�[�\���̉��ɖ߂��܂��B - - 5. ���Ԃ��������Ȃ�l�ɃX�e�b�v 2 ���� 4 ���J��Ԃ��܂��傤�B - ----> d) �M�����w�Ԃ��Ƃ��ł���? ----> b) �X�~���͐‚��A ----> c) �m�b�Ƃ͊w�Ԃ��́A ----> a) �o���͐Ԃ��A - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.3.2: �u�������R�}���h - - - ** �J�[�\���̉��̕����� x �ɒu��������ɂ� rx ���^�C�v���܂��B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�ŏ��̍s�ɃJ�[�\�����ړ����܂��傤�B - - 2. �ŏ��̊ԈႢ�̐擪�ɃJ�[�\�����ړ����܂��傤�B - - 3. r �ƃ^�C�v���A�Ԉ���Ă��镶����u��������A�������������^�C�v���܂��傤�B - - 4. �ŏ��̍s���������Ȃ�܂ŃX�e�b�v 2 ���� 3 ���J��Ԃ��܂��傤�B - ----> ���̍���l�͂������ˁA���̐l�͊�‚��������L�[������������! ----> ���̍s����͂������ɁA���̐l�͊�‚��Ԉ�����L�[�������܂���! - - 5. �����A���b�X�� 1.3.3 �֐i�݂܂��傤�B - -NOTE: ���ۂɎ����܂��傤�B�����Ċo���邾���ɂ͂��Ȃ����ƁB - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.3.3: �ύX�R�}���h - - - ** �P��̖����܂ł�ύX����ɂ� ce �ƃ^�C�v���܂��B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�ŏ��̍s�ɃJ�[�\�����ړ����܂��傤�B - - 2. lubw �� u �̈ʒu�ɃJ�[�\�����ړ����܂��傤�B - - 3. ce �ƃ^�C�v���A�������P����^�C�v���܂��傤(���̏ꍇ 'ine' �ƃ^�C�v)�B - - 4. ���^�C�v���Ă��玟�̊ԈႢ(�ύX���ׂ������̐擪)�Ɉړ����܂��B - - 5. �ŏ��̍s�����̍s�̗l�ɂȂ�܂ŃX�e�b�v 3 �� 4 ���J��Ԃ��܂��B - ----> This lubw has a few wptfd that mrrf changing usf the change operator. ----> This line has a few words that need changing using the change operator. - -ce �͒P����폜������A�}�����[�h�ɓ��邱�Ƃɒ��ӂ��܂��傤�B -cc �͓������Ƃ��s�S�̂ɑ΂��čs���܂��B - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.3.4: c ���g�p�������̑��̕ύX - - - ** �ύX�I�y���[�^�́A�폜�Ɠ����l�Ƀ��[�V�������g�p���܂��B ** - - 1. �ύX�I�y���[�^�́A�폜�Ɠ����悤�ȓ�������܂��B���̌`���� - - c [���l] ���[�V���� - - 2. ���[�V�����������ŁAw �͒P��A $ �͍s���ȂǂƂ��������̂ł��B - - 3. �ȉ��� ---> �Ǝ����ꂽ�ŏ��̍s�ɃJ�[�\�����ړ����܂��傤�B - - 4. �ŏ��̊ԈႢ�փJ�[�\�����ړ����܂��傤�B - - 5. c$ �ƃ^�C�v���čs�̎c����Q�s�ڂ̗l�ɂ��A �������܂��傤�B - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - -NOTE: �^�C�v���̊ԈႢ�̓o�b�N�X�y�[�X�L�[���g���Ē������Ƃ��ł��܂��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.3 �v�� - - - 1. ���ɍ폜���ꂽ�e�L�X�g���Ĕz�u����ɂ́Ap ���^�C�v���܂��B����͍폜�� - �ꂽ�e�L�X�g���J�[�\���̌�ɑ}�����܂�(�s�P�ʂō폜���ꂽ�̂Ȃ�΁A�J�[ - �\���̂��鎟�̍s�ɑ}������܂�)�B - - 2. �J�[�\���̉��̕�����u��������ɂ́Ar ���^�C�v������A�����u�������� - �������^�C�v���܂��B - - 3. �ύX�R�}���h�ł̓J�[�\���ʒu�������̃��[�V�����Ŏw�肳���I�[�܂ł�� - �X���邱�Ƃ��”\�ł��B�Ⴆ�� ce �Ȃ�΃J�[�\���ʒu����P��̏I���܂ŁA - c$ �Ȃ�΍s�̏I���܂ł�ύX���܂��B - - 4. �ύX�R�}���h�̌`���� - - c [���l] ���[�V���� - -�����A���̃��b�X���֐i�݂܂��傤�B - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.4.1: �ʒu�ƃt�@�C���̏�� - - ** �t�@�C�����ł̈ʒu�ƃt�@�C���̏�Ԃ�\������ɂ� CTRL-G ���^�C�v���܂��B - �t�@�C�����̂���s�Ɉړ�����ɂ� G ���^�C�v���܂��B ** - - NOTE: �X�e�b�v�����s����O�ɁA���̃��b�X���S�Ăɖڂ�ʂ��܂��傤!! - - 1. CTRL ���������܂� g �������܂��傤�B���̑���� CTRL-G �ƌĂ�ł��܂��B - �y�[�W�̈�ԉ��Ƀt�@�C�����ƍs�ԍ����\�������͂��ł��B �X�e�b�v 3�̂��� - �ɍs�ԍ����o���Ă����܂��傤�B - -NOTE: ��ʂ̉E�����ɃJ�[�\���̈ʒu���\������Ă��邩������܂���B����� - 'ruler' �I�v�V����(:help 'ruler' ���Q��)��ݒ肷�邱�Ƃŕ\������܂��B - - 2. �t�@�C���̍ʼn��s�Ɉړ����邽�߂� G ���^�C�v���܂��傤�B - �t�@�C���̐擪�Ɉړ�����ɂ� gg �ƃ^�C�v���܂��傤�B - - 3. ��قǂ̍s�̔ԍ����^�C�v�� G ���^�C�v���܂��傤�B�ŏ��� CTRL-G ���������s - �ɖ߂��ė���͂��ł��B - - 4. ���M�����Ă���X�e�b�v 1 ���� 3 �����s���܂��傤�B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.4.2: �����R�}���h - - - ** ������������ɂ� / �ƁA�O��������������^�C�v���܂��B ** - - 1. �m�[�}�����[�h�� / �Ƃ����������^�C�v���܂��B��ʈ�ԉ��� : �R�}���h�� - �����l�� / ������邱�ƂɋC�Â��ł��傤�B - - 2. �ł́A'errroor' �ƃ^�C�v���܂��傤�B���ꂪ�����������P��ł��B - - 3. ��������������x��������Ƃ��� �P�� n ���^�C�v���܂��B - �t�����Ɍ�����������Ƃ��� N ���^�C�v���܂��B - - 4. �t�����Ɍ�����������ꍇ�́A/ �̑���� ? �R�}���h���g�p���܂��B - - 5. ���̏ꏊ�ɖ߂�ɂ� CTRL-O (Ctrl �����������Ȃ��當�� o ���^�C�v)���^�C�v�� - �܂��B����ɖ߂�ɂ͂�����J��Ԃ��܂��BCTRL-I �͑O�����ł��B - ----> "errroor" �� error �ƃX�y�����Ⴂ�܂�; errroor �͂����� error �ł��B -NOTE: �������t�@�C���̏I���ɒB����ƁA�I�v�V���� 'wrapscan' ���ݒ肳��Ă��� - �ꍇ�́A�t�@�C���̐擪���猟���𑱍s���܂��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.4.3: �Ή����銇�ʂ����� - - - ** �Ή����� ),] �� } ����������ɂ� % ���^�C�v���܂��B ** - - 1. ���� ---> �Ŏ����ꂽ�s�� (,[ �� { �̂ǂꂩ�ɃJ�[�\�����ړ����܂��傤�B - - 2. ������ % �ƃ^�C�v���܂��傤�B - - 3. �J�[�\���͑Ή����銇�ʂɈړ�����͂��ł��B - - 4. �ŏ��̊��ʂɈړ�����ɂ� % �ƃ^�C�v���܂��傤�B - - 5. ���� (,),[,],{ �� } �ŃJ�[�\�����ړ����A% ���������Ă��邩�m�F���܂��傤�B - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - - -NOTE: ���̋@�\�͊��ʂ���v���Ă��Ȃ��v���O�������f�o�b�O����̂ɂƂĂ��𗧂� - �܂��B - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.4.4: �ԈႢ��ύX������@ - - - ** 'old' �� 'new' �ɒu������ɂ� :s/old/new/g �ƃ^�C�v���܂��B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�s�ɃJ�[�\�����ړ����܂��傤�B - - 2. :s/thee/the �ƃ^�C�v���܂��傤�B���̃R�}���h�͂��̍s�ōŏ��Ɍ��� - ���������̂ɂ����s���邱�ƂɋC���‚��܂��傤�B - - 3. �ł� :s/thee/the/g �ƃ^�C�v���܂��傤�B�lj����� g �t���O�͍s�S�̂�u���� - �邱�Ƃ��Ӗ����܂��B���̕ύX�͂��̍s�Ō��‚������S�Ẳӏ��ɑ΂��čs��� - �܂��B - ----> thee best time to see thee flowers is in thee spring. - - 4. �����s���猩�‚��镶���̑S�Ẳӏ���ύX����ɂ� - :#,#s/old/new/g #,# �ɂ͒u��������͈͂̊J�n�ƏI���̍s�ԍ����w�肷��B - :%s/old/new/g �t�@�C���S�̂Ō��‚�����̂ɑ΂��ĕύX����B - :%s/old/new/gc �t�@�C���S�̂Ō��‚�����̂ɑ΂��āA1��1�Šm�F���Ƃ�� - ����ύX����B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.4 �v�� - - - 1. CTRL-G �̓t�@�C���ł̈ʒu�ƃt�@�C���̏ڍׂ�\�����܂��B - G �̓t�@�C���̍ʼn��s�Ɉړ����܂��B - ���l G �͂��̍s�Ɉړ����܂��B - gg �͐擪�s�Ɉړ����܂��B - - 2. / �̌�Ɍ����^�C�v����ƑO���Ɍ����������܂��B - ? �̌�Ɍ����^�C�v����ƌ���Ɍ����������܂��B - �����̌�� n �͓��������̎��̌������AN �͋t�����̌��������܂��B - CTRL-O �͏ꏊ��O�Ɉڂ��ACTRL-I �͏ꏊ�����Ɉړ����܂��B - - 3. (,),[,],{, �������� } ��ɃJ�[�\���������Ԃ� % ���^�C�v����Ƒ΂ɂȂ镶 - ���ֈړ����܂��B - - 4. ���ݍs�̍ŏ��� old �� new �ɒu������B :s/old/new - ���ݍs�̑S�Ă� old �� new �ɒu������B :s/old/new/g - 2�‚� # �s�̊ԂŌ���u������B :#,#s/old/new/g - �t�@�C���̒��̑S�Ă̌�������u������B :%s/old/new/g - 'c' ��������ƒu���̓x�Ɋm�F�����߂�B :%s/old/new/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.5.1: �O���R�}���h�����s������@ - - - ** :! �̌�Ɏ��s����O���R�}���h���^�C�v���܂��B ** - - 1. ��ʂ̍ʼn����ɃJ�[�\�����ړ�����悤�A����e���� : ���^�C�v���܂��傤�B - ����ŃR�}���h���C�����߂��^�C�v�ł���l�ɂȂ�܂��B - - 2. ������ ! �Ƃ�������(���Q��)���^�C�v���܂��傤�B - ����ŊO���V�F���R�}���h�����s�ł���l�ɂȂ�܂��B - - 3. ��Ƃ��� ! �ɑ����� ls �ƃ^�C�v�� �������܂��傤�B - �V�F���v�����v�g�̂悤�Ƀf�B���N�g���̈ꗗ���\�������͂��ł��B - �������� ls �������Ȃ��Ȃ�� :!dir ���g�p���܂��傤�B - -NOTE: ���̕��@�ɂ���Ă�����R�}���h�����s���邱�Ƃ��ł��܂��B���������� - ���^�����܂��B - -NOTE: �S�Ă� : �R�}���h�� �������ďI�����Ȃ���΂Ȃ�܂���B - �ȍ~�ł͂��̂��ƂɌ��y���܂���B - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.5.2: ���̑��̃t�@�C���֏������� - - - ** �t�@�C���֕ύX��ۑ�����ɂ� :w �t�@�C���� �ƃ^�C�v���܂��B ** - - 1. �f�B���N�g���̈ꗗ�𓾂邽�߂� :!dir �������� :!ls �ƃ^�C�v���܂��傤�B - ���̂��� �������̂͊��ɂ����m�ł��ˁB - - 2. TEST �̂悤�ɁA���̃f�B���N�g���ɖ����t�@�C��������‘I�т܂��B - - 3. �ł� :w TEST �ƃ^�C�v���܂��傤 (TEST �́A�I�񂾃t�@�C�����ł�)�B - - 4. ����ɂ��t�@�C���S�̂� TEST �Ƃ������O�ŕۑ�����܂��B - ������x :!dir �������� :!ls �ƃ^�C�v���ăf�B���N�g�����m�F���Ă݂܂��傤�B - -NOTE: ������ Vim ���I�����A�t�@�C���� TEST �Ƌ��ɋN������ƁA�ۑ��������� - �`���[�g���A���̕������ł��オ��͂��ł��B - - 5. ����ɁA���̂悤�Ƀ^�C�v���ăt�@�C���������܂��傤(Windows): :!del TEST - ��������(Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.5.3: �I�������������� - - -** �t�@�C���̈ꕔ��ۑ�����ɂ́Av ���[�V������ :w FILENAME ���^�C�v���܂��B ** - - 1. ���̍s�ɃJ�[�\�����ړ����܂��B - - 2. v �������A�ȉ��̑�5���ڂɃJ�[�\�����ړ����܂��B�e�L�X�g�������\�������� - �ɒ��ڂ��ĉ������B - - 3. ���� : �������ƁA��ʂ̍ʼn����� :'<,'> ������܂��B - - 4. w TEST (TEST �͑��݂��Ȃ��t�@�C����)���^�C�v���܂��B - �������O�� :'<,'>w TEST �ƂȂ��Ă��邱�Ƃ��m�F���ĉ������B - - 5. Vim �� TEST �Ƃ����t�@�C���ɑI�����ꂽ�s���������ނł��傤�B - :!dir �������� :!ls �ł�����m�F���܂��B - ����͍폜���Ȃ��ł����ĉ������B���̃��b�X���Ŏg�p���܂��B - -NOTE: v �������ƁAVisual �I�����n�܂�܂��B�J�[�\���𓮂������ƂŁA�I��͈͂� - �傫�������������ł��܂��B����ɁA���̑I��͈͂ɑ΂��ăI�y���[�^��K�p - �ł��܂��B�Ⴆ�� d �̓e�L�X�g���폜���܂��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.5.4: �t�@�C���̎捞�ƍ��� - - - ** �t�@�C���̒��g��}������ɂ� :r �t�@�C���� �ƃ^�C�v���܂��B ** - - 1. �J�[�\�������̍s�̂�����ɍ��킹�܂��B - -NOTE: �X�e�b�v 2 �̎��s��A���b�X�� 1.5.3 �̃e�L�X�g������܂��B���ɉ������Ă� - �̃��b�X���Ɉړ����܂��傤�B - - 2. �ł� TEST �Ƃ����t�@�C���� :r TEST �Ƃ����R�}���h�œǂݍ��݂܂��傤�B - �����ł��� TEST �͎g���t�@�C���̖��O�̂��Ƃł��B - �ǂݍ��܂ꂽ�t�@�C���́A�J�[�\���s�̉��ɂ���܂��B - - 3. ��荞�񂾃t�@�C�����m�F���Ă݂܂��傤�B�J�[�\����߂��ƁA���b�X��1.5.3 �� - �I���W�i���ƃt�@�C���ɂ����̂�2�‚����邱�Ƃ��킩��܂��B - -NOTE: �O���R�}���h�̏o�͂�ǂݍ��ނ��Ƃ��ł��܂��B�Ⴆ�΁A - :r !ls �� ls �R�}���h�̏o�͂��J�[�\���ȉ��ɓǂݍ��݂܂��B - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.5 �v�� - - - 1. :!command �ɂ���� �O���R�}���h�����s����B - - �悭�g����: - (Windows) (Unix) - :!dir :!ls - �f�B���N�g�����̈ꗗ������B - :!del FILENAME :!rm FILENAME - �t�@�C�����폜����B - - 2. :w �t�@�C���� �ɂ���ăt�@�C�����Ƃ����t�@�C�����f�B�X�N�ɏ������܂��B - - 3. v ���[�V������ :w FILENAME �Ƃ���ƁA�r�W���A���I���s���t�@�C���ɕۑ��� - ���B - - 4. :r �t�@�C���� �ɂ��t�@�C�����Ƃ����t�@�C�����f�B�X�N����荞�܂�A - �J�[�\���ʒu�̉��ɑ}�������B - - 5. :r !dir �� dir �R�}���h�̏o�͂��J�[�\���ʒu�ȉ��ɓǂݍ��ށB - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.6.1: �I�[�v���R�}���h - - - ** o ���^�C�v����ƁA�J�[�\���̉��̍s���J���A�}�����[�h�ɓ���܂��B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�ŏ��̍s�ɃJ�[�\�����ړ����܂��傤�B - - 2. o (������) ���^�C�v���āA�J�[�\���̉��̍s���J���A�}�����[�h�ɓ���܂��B - - 3. �����‚��������^�C�v���Ă���A�}�����[�h���I������ׂ� �� - �^�C�v���܂��B - ----> o ���^�C�v����ƃJ�[�\���͊J�����s�ֈړ����}�����[�h�ɓ���܂��B - - 4. �J�[�\���̏�̍s�ɑ}������ɂ́A�������� o �ł͂Ȃ��A�P���ɑ啶���� O - ���^�C�v���܂��B���̍s�Ŏ����Ă݂܂��傤�B - ----> ���̍s�̏�֑}������ɂ́A���̍s�փJ�[�\����u���� O ���^�C�v���܂��B - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.6.2: �lj��R�}���h - - - ** �J�[�\���̎��̈ʒu����e�L�X�g��lj�����ɂ� a �ƃ^�C�v���܂��B ** - - 1. �J�[�\���� ---> �Ŏ����ꂽ�ŏ��̍s�ֈړ����܂��傤�B - - 2. e �������� li �̏I�[���܂ŃJ�[�\�����ړ����܂��B - - 3. �J�[�\���̌��Ƀe�L�X�g��lj����邽�߂� a (������) ���^�C�v���܂��B - - 4. ���̉��̍s�̂悤�ȒP��Ɋ��������܂��B�}�����[�h�𔲂���ׂ� ���� - ���܂��B - - 5. e ���g���Ď��̕s���S�ȒP��ֈړ����A�X�e�b�v 3 �� 4 ���J��Ԃ��܂��B - ----> This li will allow you to pract appendi text to a line. ----> This line will allow you to practice appending text to a line. - -NOTE: a, i �� A �͓����}�����[�h�ֈڂ�܂����A�������}�������ʒu�������قȂ� - �܂��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.6.3: ���̑��̒u�����@ - - - ** 1�����ȏ��u��������ɂ͑啶���� R �ƃ^�C�v���܂��傤�B ** - - 1. �ȉ��� ---> �Ǝ����ꂽ�s�ɃJ�[�\�����ړ����܂��B�ŏ��� xxx �̐擪�Ɉړ��� - �܂��B - - 2. R �������āA2�s�ڂ̐��l���^�C�v���邱�ƂŁAxxx ���u������܂��B - - 3. �u�����[�h�𔲂���ɂ� �������܂��B�s�̎c�肪�ύX����Ă��Ȃ��܂܂� - �Ȃ邱�Ƃɒ��ӂ��Ă��������B - - 4. �c���� xxx ���X�e�b�v���J��Ԃ��Ēu�����܂��傤�B - ----> Adding 123 to xxx gives you xxx. ----> Adding 123 to 456 gives you 579. - -NOTE: �u�����[�h�͑}�����[�h�Ɏ��Ă��܂����A�S�Ẵ^�C�v���ꂽ�����͊����̕��� - ���폜���܂��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.6.4: �e�L�X�g�̃R�s�[�ƃy�[�X�g - - - ** �e�L�X�g�̃R�s�[�ɂ̓I�y���[�^ y ���A�y�[�X�g�ɂ� p ���g���܂��B ** - - 1. ---> �Ǝ����ꂽ�s�ֈړ����A�J�[�\���� "a)" �̌�ɒu���Ă����܂��B - - 2. v �Ńr�W���A�����[�h���J�n���A"first" �̎�O�܂ŃJ�[�\�����ړ����܂��B - - 3. y ���^�C�v���ċ����\�����ꂽ�e�L�X�g�� yank (�R�s�[)���܂��B - - 4. ���̍s�̍s���܂ŃJ�[�\�����ړ����܂�: j$ - - 5. p �������ē\��t��(put)�Ă���A�����^�C�v���܂�: a second - - 6. �r�W���A�����[�h�� " item." ��I�����Ay �Ń����N�A���̍s�̍s���܂� j$ �� - �ړ����A p �Ńe�L�X�g�������� put ���܂��B - ----> a) this is the first item. - b) - - NOTE: y ���I�y���[�^�Ƃ��Ďg�����Ƃ��ł��܂��Byw �͒P���1�� yank ���܂��B - yy �͍s��1�� yank ���Ap �ł��̍s�� put ���܂��B -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.6.5: �I�v�V�����̐ݒ� - - - ** ������u���̍ۂɑ啶��/�������𖳎�����ɂ́A�I�v�V������ݒ肵�܂��B ** - - 1. ���̗l�ɓ��͂��� 'ignore' ���������܂��傤: /ignore - n �������ĉ��x���������J��Ԃ��܂��B - - 2. ���̗l�ɓ��͂��� 'ic' (Ignore Case �̗�) �I�v�V������ݒ肵�܂�: :set ic - - 3. �ł� n �ɂ���Ă���1�x 'ignore' ���������܂��B - n �������Ă���ɐ��񌟍����J��Ԃ��܂��傤�B - - 4. 'hlsearch' �� 'incsearch' �I�v�V������ݒ肵�܂��傤: :set hls is - - 5. �����R�}���h���ē��͂��āA�����N���邩���Ă݂܂��傤: /ignore - - 6. �啶���������̋�ʂ𖳌��ɂ���ɂ͎��̗l�ɓ��͂��܂�: :set noic - -NOTE: �}�b�`�̋����\������߂�ɂ͎��̗l�ɓ��͂��܂�: :nohlsearch -NOTE: 1�‚̌����R�}���h�����啶���������̋�ʂ���߂����Ȃ�΁A������ \c - ���g�p���܂�: /ignore\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.6 �v�� - - 1. o ���^�C�v����ƃJ�[�\���̉��̍s���J���āA�����ő}�����[�h�ɂȂ�B - O (�啶��) ���^�C�v����ƃJ�[�\���̏�̍s�ő}�����[�h�ɂȂ�B - - 2. �J�[�\����̕����̎�����e�L�X�g��lj�����ɂ� a �ƃ^�C�v����B - �s���Ƀe�L�X�g��}������ɂ͑啶�� A ���^�C�v����B - - 3. e �R�}���h�͒P��̏I�[�ɃJ�[�\�����ړ�����B - - 4. y �I�y���[�^�̓e�L�X�g�� yank (�R�s�[)���Ap �͂���� put (�y�[�X�g)����B - - 5. �啶���� R ���^�C�v����ƒu�����[�h�ɓ���A �������Ɣ�����B - - 6. ":set xxx" �ƃ^�C�v����ƃI�v�V���� "xxx" ���ݒ肳���B - 'ic' 'ignorecase' �������ɑ啶���������̋�ʂ��Ȃ� - 'is' 'incsearch' �����t���[�Y�ɕ����}�b�`���Ă��镔����\������ - 'hls' 'hlsearch' �}�b�`���邷�ׂĂ������\������ - �������A�Z�����A�ǂ���̃I�v�V�������ł��g�p�ł��܂��B - - 7. �I�v�V�����𖳌��ɂ���ɂ� "no" ��t�^����: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.7.1: �I�����C���w���v�R�}���h - - - ** �I�����C���w���v���g�p���܂��傤 ** - - Vim �ɂ͍L�͂ɂ킽��I�����C���w���v�V�X�e��������܂��B - �w���v���J�n����ɂ́A�����3�‚̂ǂꂩ1�‚������Ă݂܂��傤: - - �w���v�L�[ ������(��������Ȃ��)�B - - �L�[������(��������Ȃ��)�B - - :help �ƃ^�C�v����B - - �w���v�E�B���h�E�̃e�L�X�g��ǂނƁA�w���v�̓��삪�����ł��܂��B - CTRL-W CTRL-W �ƃ^�C�v����� �w���v�E�B���h�E�փW�����v���܂��B - :q �ƃ^�C�v����� �w���v�E�B���h�E���‚����܂��B - - ":help" �R�}���h�Ɉ�����^���邱�Ƃɂ��A������薼�̃w���v�����‚��邱�� - ���ł��܂��B�����������Ă݂܂��傤( ���^�C�v���Y��Ȃ��悤��): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.7.2: �N���X�N���v�g�̍쐬 - - ** Vim �̓����𔭊����� ** - - Vim �ɂ� Vi ���������̓����𓥂܂��Ă��܂����A���̂قƂ�ǂ͏�����Ԃɂ� - �g�p�s�‚ƂȂ��Ă��܂��B��葽���̓������g���͂��߂�ɂ� "vimrc" �t�@�C�� - ���쐬���܂��B - - 1. "vimrc" �t�@�C���̕ҏW���J�n���܂��B����̓V�X�e���Ɉˑ����܂��B - :e ~/.vimrc UNIX ���� - :e ~/_vimrc Windows ���� - - 2. �����ŃT���v���� "vimrc" ��ǂݍ��݂܂��B - :r $VIMRUNTIME/vimrc_example.vim - - 3. �ȉ��̂悤�Ƀt�@�C���֏������݂܂��B - :w - - ���� Vim ���N������ƁA�F�Â��\�����g����悤�ɂȂ�ł��傤�B - ���� "vimrc" �t�@�C���ցA���D�݂̐ݒ��lj����邱�Ƃ��ł��܂��B - ��葽���̏��𓾂�ɂ� :help vimrc-intro �ƃ^�C�v���܂��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.7.3: �⊮ - - - ** CTRL-D �� �ŃR�}���h���C����⊮���� ** - - 1. �݊����[�h�łȂ����Ƃ��m�F���܂�: :set nocp - - 2. ���݂̃f�B���N�g���ɍ݂�t�@�C���� :!ls �� :!dir �Ŋm�F���܂��B - - 3. �R�}���h�̐擪���^�C�v���܂�: :e - - 4. CTRL-D �������� Vim �� "e" ����n�܂�R�}���h�̈ꗗ��\�����܂��B - - 5. d �ƃ^�C�v����� Vim �� ":edit" �Ƃ����R�}���h����⊮���܂��B - - 6. ����ɋ󔒂ƁA�����̃t�@�C�����̎n�܂�������܂�: :edit FIL - - 7. �������� Vim �͖��O��⊮���܂��B(������‚������������ꍇ) - -NOTE: �⊮�͑����̃R�}���h�œ��삵�܂��B������ CTRL-D �� �����Ă݂Ă��� - �����B���� :help �̍ۂɖ𗧂��܂��B - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���b�X�� 1.7 �v�� - - - 1. �w���v�E�B���h�E���J���ɂ� :help �Ƃ��邩 �������� �������B - - 2. �R�}���h(cmd)�̃w���v����������ɂ� :help cmd �ƃ^�C�v����B - - 3. �ʂ̃E�B���h�E�փW�����v����ɂ� CTRL-W CTRL-W �ƃ^�C�v����B - - 4. �w���v�E�B���h�E��‚���ɂ� :q �ƃ^�C�v����B - - 5. ���D�݂̐ݒ��ۂ‚ɂ� vimrc �N���X�N���v�g���쐬����B - - 6. : command �ʼn”\�ȕ⊮������ɂ� CTRL-D ���^�C�v����B - �⊮���g�p����ɂ� �������B - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - ����ɂ� Vim �̃`���[�g���A�����I���܂��B�G�f�B�^���ȒP�ɁA�������[���� - �g�����Ƃ��ł���悤�ɂƁAVim �̎��ŠT�O�̗v�_�݂̂�`���悤�Ƃ��܂����B - Vim �ɂ͂���ɑ����̃R�}���h������A�����őS�Ă�������邱�Ƃ͂ł��܂���B - �ȍ~�̓��[�U�[�}�j���A�����Q�Ƃ�������: ":help user-manual" - - ����Ȍ�̊w�K�̂��߂ɁA���̖{�𐄑E���܂��B - Vim - Vi Improved - by Steve Oualline - �o�Ŏ�: New Riders - �ŏ��̖{�͊��S�� Vim �̂��߂ɏ�����܂����B�Ƃ�킯���S�҂ɂ͂����߂ł��B - �����̗���}�ł��f�ڂ���Ă��܂��B - ����URL���Q�Ƃ��ĉ����� https://iccf-holland.org/click5.html - - ���� Vim ���� Vi �ɂ‚��ď����ꂽ�Â��{�ł������E���܂�: - Learning the Vi Editor - by Linda Lamb - �o�Ŏ�: O'Reilly & Associates Inc. - Vi �ł�肽���Ǝv�����ƂقڑS�Ă�m�邱�Ƃ��ł���Ǐ��ł��B - ��6�łł́AVim �ɂ‚��Ă̏����܂܂�Ă��܂��B - - ���̃`���[�g���A���� Colorado State University �� Charles Smith �̃A�C�f�A - ����ɁAColorado School of Mines �� Michael C. Pierce �� Robert K. Ware �� - �����ɂ���ď�����܂����B E-mail: bware@mines.colorado.edu. - - Modified for Vim by Bram Moolenaar. - - ���{��� ���{ �׍O - vim-jp�`�[�� - �ďC ���� ���Y - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - vi:set ts=8 sts=4 sw=4 tw=78: diff --git a/runtime/tutor/tutor1.ko.euc b/runtime/tutor/tutor1.ko.euc deleted file mode 100644 index 6e06251196..0000000000 --- a/runtime/tutor/tutor1.ko.euc +++ /dev/null @@ -1,968 +0,0 @@ -=============================================================================== -= �� ������ (VIM Tutor) �� ���� ���� ȯ���մϴ� - Version 1.7 = -=============================================================================== - - ��(Vim)�� �� �����̿��� �� ������ �� ���� ��ŭ ���� ������ ���� - �ſ� ������ �������Դϴ�. �� �����̴� ���� ���� ��õ�� ������� ����� - �� �ֵ��� ����� ���ɿ� ���� �����ϰ� �ֽ��ϴ�. - - �� �����̸� ���� ������ �ǽ��ϴ� ���� �󸶳� �ð��� ���� ���� ���� - 25-30 �� ������ �ɸ��ϴ�. - - �� ������ ���Ե� ������ ������ ��Ĩ�ϴ�. �� ������ ���纻�� ���� - �����ϼ���. (vimtutor �� ���� �����ߴٸ�, �̹� ���纻�� ����ϴ� - ���Դϴ�.) - - �߿��� ����, �� �����̰� ���� �Ẹ�鼭 ��쵵�� �����Ǿ� �ִٴ� ���Դϴ�. - ������ ����� ��������, ���� �����غ��� ���� �ʿ��մϴ�. ������ �д� - �͸����δ�, ������ �ؾ������ �� ���Դϴ�. - - �� ����, Caps Lock(Shift-Lock) Ű�� �������� ������ Ȯ���غ��ð�, j Ű�� - ����� ������ Lesson 1.1.1�� ȭ�鿡 ���� ������ ���������ô�. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.1: Ŀ�� �����̱� - - ** Ŀ���� �����̷���, ǥ�õ� ��� h,j,k,l Ű�� �����ʽÿ�. ** - ^ - k ��Ʈ: h Ű�� ���ʿ� ������, �������� �����Դϴ�. - < h l > l Ű�� �����ʿ� ������, ���������� - j �����Դϴ�. - v j Ű�� �Ʒ����� ȭ��ǥó�� ������ϴ�. - - 1. �ͼ����� ������ Ŀ���� ��ũ�� �󿡼� ������ ���ʽÿ�. - - 2. �Ʒ� ����Ű (j)�� �ݺ��Է��� �� ������ ������ ��ʽÿ�. - ���� ���� lesson���� ���� ����� �˰� �Ǿ����ϴ�. - - 3. �Ʒ� ����Ű�� �̿��Ͽ�, Lesson 1.1.2 �� ���ʽÿ�. - -����: ������ �ʴ� ���𰡰� �Է��� �Ǿ��ٸ�, �� ������, ���� ���� - ���ư��ʽÿ�. �� �Ŀ� ���ϴ� ������ �ٽ� �Է��Ͻʽÿ�. - -����: Ŀ��Ű ���� �۵��� ���Դϴ�. ������ hjkl�� �ͼ�������, Ŀ��Ű���� - �ξ� ������ �̵��� �� ���� ���Դϴ�. ������! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.2: ���� �����ϰ� ������ - - - !! ����: �Ʒ� �ִ� �ܰ踦 �����ϱ� ����, �� lesson ��ü�� �����ʽÿ�!! - - 1. Ű�� ������ Ȯ���ϰ� ���� ���� ���� ���ɴϴ�. - - 2. ������ ���� �Է��մϴ�: :q! - �̷��� �ϸ�, �ٲ� ������ *�������� �ʰ�* �����⸦ ���������ϴ�. - - 3. �� ������Ʈ�� ���δٸ�, �ٽ� �����̷� ���ƿ��� ���� ������ ���� - �Է��մϴ�. - vimtutor - �Ǵ� ������ ���� ���� �ֽ��ϴ�. - vim tutor.ko - ----> 'vim' �� �� ������� ���� ���� ���ϸ�, 'tutor.ko'�� �����Ϸ��� - ������ ���մϴ�. - - 4. ������ �̾߱��� �ܰ踦 ����Ͽ�����, Ȯ���� ����, 1���� 3������ - �����Ͽ� �����⸦ �����ٰ� �ٽ� ���� ���ʽÿ�. - -����: :q! �� �ٲ� ������ �������� �ʽ��ϴ�. �� �� lesson���� - ��� ���� ������ �����ϴ��� ��� �� �ֽ��ϴ�. - - 5. �� �� Ŀ���� �Ʒ��� ������ Lesson 1.1.3 ���� ���ʽÿ�. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.3: �ؽ�Ʈ ���� - ����� - - -** ���� ��忡�� x �� ������ Ŀ���� ��ġ�� ���� ���ڸ� ���� �� �ֽ��ϴ�. ** - - 1. ----> �� ǥ�õ� ������ Ŀ���� �Űܺ��ʽÿ�. - - 2. ��Ÿ�� �����ϱ� ����, Ŀ���� ���� ���� ���� ������ ���ʽÿ�. - - 3. x Ű�� ������ �������� ���ڸ� ����ʽÿ�. - - 4. 2���� 4������ �ݺ��Ͽ� ������ �ùٸ��� �ǵ��� �Ͽ� ���ʽÿ�. - ----> The ccow jumpedd ovverr thhe mooon. - - 5. ������ ��Ȯ�����ٸ�, Lesson 1.1.4�� ���ʽÿ�. - -����: �� �����̸� ���鼭 �ܿ���� ��������, ���� ����غ��鼭 ������ - �ٶ��ϴ�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.4: �ؽ�Ʈ ���� - ���� (INSERTION) - - - ** ���� ��忡�� i �� ������ �ؽ�Ʈ�� �Է��� �� �ֽ��ϴ�. ** - - 1. Ŀ���� ù��° ---> �� ǥ�õ� �ٷ� �����Դϴ�. - - 2. ù��° ���� �ι�° �ٰ� �Ȱ��� ������Դϴ�. �ؽ�Ʈ�� ������ - �� �������� ù��° ���� ���� Ŀ���� �Ű� �����ϴ�. - - 3. i Ű�� ���� ��, �ʿ��� ������ �Է��մϴ�. - - 4. ������ �Ŀ��� �� ������ ���� ���� ���ư��ϴ�. - ������ �ùٸ��� ����� ���� 2���� 4�� ������ �ݺ��մϴ�. - ----> There is text misng this . ----> There is some text missing from this line. - - 5. �ؽ�Ʈ�� �����ϴ� ���� �ͼ������ٸ�, Lesson 1.1.5�� ���ʽÿ�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.5: �ý�Ʈ ���� - �߰� (APPENDING) - - - ** A �� �Է��� �ؽ�Ʈ�� �߰��� �� �ֽ��ϴ�. ** - - 1. Ŀ���� ù��° ---> �� ǥ�õ� �ٷ� �����Դϴ�. - Ŀ���� ���� �� ��� �ִ� ��������ϴ�. - - 2. A Ű�� ���� �ʿ��� ������ �Է��մϴ�. - - 3. ������ ��� �Է��� �� �� ���� ���� ���� ���ư��ϴ�. - - 4. Ŀ���� �ι�° ---> �� ǥ�õ� �ٷ� �����Դϴ�. - ������ �ùٸ��� ����� ���� 2���� 3�� ������ �ݺ��մϴ�. - ----> There is some text missing from th - There is some text missing from this line. ----> There is also some text miss - There is also some text missing here. - - 5. �ؽ�Ʈ�� �߰��ϴ� �� �ͼ������ٸ�, Lesson 1.1.6���� ���ʽÿ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.6: ���� ���� - - ** :wq �� �̿��Ͽ� ������ �����ϰ� �������� �� �ֽ��ϴ�. ** - - !! ����: �Ʒ� �ִ� �ܰ踦 �����ϱ� ����, �� lesson ��ü�� �����ʽÿ�!! - - 1. lesson 1.1.2���� ����� ��ó�� :q!�� �����⸦ ���� �� �ֽ��ϴ�. - ����, �ٸ� �͹̳ο� ���� �����ϴٸ�, �Ʒ��� �ܰ踦 �ٸ� �͹̳ο��� �غ��ϴ�. - - 2. �� ������Ʈ�� ������ ���� �Է��մϴ�: vim tutor - 'vim' �� �� ������ ������ ���� ���ɾ�, 'tutor'�� �����ϰ��� �ϴ� - ������ �̸� �Դϴ�. - - 3. �տ��� ����� ��ó�� �ؽ�Ʈ�� �����ϰ� ����������. - - 4. ���� ���ɾ �̿��� ���� ���� �κ��� �����ϰ� ���������ϴ�: :wq - - 5. ���� 1���� vimtutor�� ���������ٰ� �ٽ� ���Դٸ�, �Ʒ��� ������ ������� �Ѿ���� �սô�. - - 6. �� ��� �ܰ踦 �� �а� ������ �Ŀ� ���� �غ�����. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.1 ��� - - - 1. Ŀ���� ������ ������ ȭ��ǥ Ű�� hjkl Ű�� �̿��մϴ�. - h (����) j (�Ʒ�) k (��) l (������) - - 2. �� ������Ʈ���� ���� �����Ϸ��� vim FILENAME - - 3. ������ ������ ������ ä�� ������ ������������ :q! - ������ �� ������ ������������ :wq - - 4. ���� ��忡�� Ŀ���� ��ġ�� ���� ���ڸ� ������� x �� �Է��մϴ�. - - 5. ���� ��忡�� Ŀ���� ��ġ�� ���� �ؽ�Ʈ�� �����Ϸ��� - i �� ���� �� �ؽ�Ʈ�� �Է��ϰ� Ŀ�� �տ� �����մϴ�. - A �� ���� �� �ؽ�Ʈ�� �Է��ϰ� ���� �ڿ� �߰� �մϴ�. - -����: �� ���� ���� ���ư��� �� ����, ��ġ �ʴ� �����̳� ������ �Էµ��� - ���� ������ ����ϴ� ������ ���ϴ�. - -�׷� Lesson 1.2�� �����սô�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.1: ����(DELETION) ���� - - - ** �� �ܾ ������ ������� dw ��� ġ�� �˴ϴ�. ** - - 1. Ű�� ������ Ȯ���ϰ� ���� ���� ���� ���ɴϴ�. - - 2. �Ʒ��� ---> �� ǥ�õ� �� ���� Ŀ���� �ű�ϴ�. - - 3. �������� �ܾ��� ó������ Ŀ���� �ű�ϴ�. - - 4. dw ��� �ļ� �� �ܾ ����ϴ�. - - ����: ������ ���Ѵ�� �ϸ� ȭ���� ������ �ٿ� dw ��� ���ڰ� ǥ�õ˴ϴ�. - �߸� �ƴٸ�, �� ������ �ٽ� �����Ͻʽÿ�. - ----> There are a some words fun that don't belong paper in this sentence. - - 5. 3, 4�� ������ �ٽ� �Ͽ� ������ ��Ȯ�ϰ� ���� �� Lesson 1.2.2�� ���ʽÿ�. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.2: �ٸ� ���� ���� - - ** d$ ��� ġ�� �� �� ������ �������ϴ�. ** - - 1. Ű�� ������ Ȯ���ϰ� ���� ���� ���� ���ɴϴ�. - - 2. �Ʒ��� ---> �� ǥ�õ� �� ���� Ŀ���� �ű�ϴ�. - - 3. �ùٸ� ���� ������ Ŀ���� �ű�ϴ�. (ù��°�� ������ . �����Դϴ�.) - - 4. d$ ��� �ļ� �� ������ ����ϴ�. - ----> Somebody typed the end of this line twice. end of this line twice. - - - 5. � ���� �Ͼ���� �����ϱ� ���� Lesson 1.2.3 ���� ���ʽÿ�. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.3: ���ɰ� ���� ��� ���� - - - ���� ���� d�� ������ ������ �����ϴ�. - - d ��� - - ���⼭: - d - ����� ���� - ��� - �Ʒ��� ���õ� ��� ���� ������ ���� - - ���� ������ ����� ����: - w - Ŀ������ �� �ܾ��� ������ (���� ����.) - e - Ŀ������ �� �ܾ��� ������ (������ �������� ����.) - $ - Ŀ������ �� ���� ������ - - ���� ���, de �� Ŀ���� ��ġ���� �ش� �ܾ��� ������ ����ϴ�. - -����: ȣ����� �ִٸ�, ���� ��忡�� ���� ���� ����� �Է��غ��ʽÿ�. - ������ �̾߱��� ����� ��Ͽ� ���� Ŀ���� �����̰� �˴ϴ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.4: ��� �ݺ� �����ϱ� - - - ** ��� ������ ���ڸ� �־��ָ� �� ��ŭ �ݺ� �˴ϴ�. ** - - 1. �Ʒ��� ---> �� ǥ�õ� �� ���� Ŀ���� �ű�ϴ�. - - 2. 2w �Է��Ͽ� Ŀ���� �ܾ� �� �� �ڷ� �ű�ϴ�. - - 3. 3e �Է��Ͽ� Ŀ���� �ڷ� �� ��° �ܾ��� ������ �ű�ϴ�. - - 4. 0 (zero) �� �Է��Ͽ� ������ ���ۺκ����� �����Դϴ�. - - 5. 2���� 3������ �ٸ� ���ڷ� �ݺ��� ���ϴ�. - ----> This is just a line with words you can move around in. - - 6. Lesson 1.2.5�� ���ʽÿ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.5: ������ �ݺ� �����ϱ� - - - ** ���ɰ� ���ڸ� �Բ� ����ϸ� �׸�ŭ �ݺ� ���� �˴ϴ�. ** - - ������ ���� ���ɰ� ����� ���հ� ����, ��� ������ Ƚ���� �־� �� ���� ���� �� �� �ֽ��ϴ�: - d Ƚ�� ��� - - 1. �Ʒ� ---> ǥ�õ� �ٿ��� Ŀ���� ù��° �빮�� �ܾ�� �ű�ϴ�. - - 2. d2w�� �Է��Ͽ� �� �빮�� �ܾ ����ϴ�. - - 3. �̾����� �빮�� �ܾ���� 1���� 2������ �ܰ踦 �̿��� Ƚ���� �ٲپ� ������ ���ϴ�. - ----> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.6: �� ��ü �����ϱ� - - - - ** dd ��� ġ�� �� ��ü�� ����ϴ�. ** - - �� ��ü�� ����� ���� ��� ������, Vi�� ������ �� �������, ������ d�� - �ι� ���޾� ġ�� �� ���� ���� �� �ֵ��� �Ͽ����ϴ�. - - 1. Ŀ���� �Ʒ� ���� �ܶ��� �ι�° �ٷ� �������ʽÿ�. - 2. dd �� �Է��Ͽ� �� ���� ����ʽÿ�. - 3. �׷� ���� �׹�° �ٷ� ���ʽÿ�. - 4. 2dd ��� �Է��Ͽ� ������ ����ϴ�. ( Ƚ��-����-����� ����ϼ���. ) - ----> 1) Roses are red, ----> 2) Mud is fun, ----> 3) Violets are blue, ----> 4) I have a car, ----> 5) Clocks tell time, ----> 6) Sugar is sweet ----> 7) And so are you. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.7: ���(UNDO) ���� - - - ** u �� ������ ������ ������ ��ҵǸ�, U �� �� ��ü�� �����մϴ�. ** - - 1. Ŀ���� ---> �� ǥ�õ� �ٷ� �̵��� �� ù��° �߸��� �κ� ���� �ű�ϴ�. - 2. x �� �Է��Ͽ� ù��° �߸��� ���ڸ� ����ϴ�. - 3. �׷� ���� u �� �Է��Ͽ� ���������� ����� ������ ����մϴ�. - 4. �̹����� x ������ �̿��Ͽ� �� ���� ��� ������ �����غ��ô�. - 5. �빮�� U �� ������ �� ���� ���� ���·� �������� ���ʽÿ�. - 6. �̹����� u �� �� �� ������ U �� ���� ������ ����غ��ô�. - 7. CTRL-R (CTRL Ű�� ���� ���¿��� R�� ������ ��) �� �� �� ������ - ������ �ٽ� �����غ��ô�. (����� ���� �����.) - ----> Fiix the errors oon thhis line and reeplace them witth undo. - - 8. �� ������ �ſ� �����մϴ�. �׷� Lesson 1.2 ������� �Ѿ���� �սô�. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.2 ��� - - - 1. Ŀ���� ��ġ�� ������ �ܾ��� ������ �������: dw - 2. Ŀ���� ��ġ�� ������ �� ������ �������: d$ - 3. �� ��ü�� �������: dd - - 4. Ƚ���� �Բ� ����� �ݺ� ��Ű����: 2w - 5. ���� ��忡�� ������ ������ ������ ������ �����ϴ�: - - [Ƚ��] ���� ��� �Ǵ� ���� [Ƚ��] ��� - - ���⼭: - Ƚ�� - �� ������ �� �� �ݺ��� ���ΰ� - ���� - � ������ ���� ���ΰ� ( ���� ���, ������ ���� d ) - ��� - ������ ������ ���, ���� ��� w (�ܾ�), $ (���� ��) ��. - - 6. Ŀ���� ���� �� ������ �ű����: 0 - - 7. ���� �ൿ�� ����Ϸ���: u (�ҹ��� u) - �� �ٿ��� ������ ���� ��� ����Ϸ���: U (�빮�� U) - ����� ���� �ٽ� �����Ϸ���: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.1: ���̱�(PUT) ���� - - - ** p �� �Է��Ͽ� ���������� ���� ������ Ŀ�� �ڿ� ���Դϴ�. ** - - 1. �Ʒ��� �ִ� ������ ù �ٷ� Ŀ���� �����̽ʽÿ�. - - 2. dd �� �Է��Ͽ� �� ���� ������ ���� ���ۿ� �����մϴ�. - - 3. �Ʊ� ���� ���� ������ ��ġ�� *���ٷ�* Ŀ���� �ű�ϴ�. - - 4. ���� ��忡��, p �� �Է��Ͽ� �� ���� ����� �� �ڸ��� �ű�ϴ�. - - 5. 2���� 4�� �ݺ��Ͽ� ��� ���� ������ �ٷ� �����ʽÿ�. - - d) Can you learn too? - b) Violets are blue, - c) Intelligence is learned, - a) Roses are red, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.2: ġȯ(REPLACE) ���� - - - ** Ŀ�� �Ʒ��� ���� �ϳ��� �ٲٷ���, r �� ���� �� �ٲ� ���ڸ� �Է��մϴ�. ** - - 1. Ŀ���� ---> �� ǥ�õ� ù �ٷ� �ű�ϴ�. - - 2. Ŀ���� �߸��� ù �κ����� �ű�ϴ�. - - 3. r �� ���� ��, �߸��� �κ��� ���� �� ���ڸ� �Է��մϴ�. - - 4. 2���� 3�� ������ �ݺ��Ͽ�, ù ���� ������ �����Ͻʽÿ�. - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. Lesson 1.3.2 �� �̵��սô�. - -����: �ܿ��� ����, ���� �غ��鼭 ������ �Ѵٴ� ���� ���� ���ʽÿ�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.3: ��ȯ(CHANGE) ���� - - - ** �� �ܾ��� ��ü�� �ٲٷ���, ce �� ġ�ʽÿ�. ** - - 1. Ŀ���� ---> �� ǥ�õ� ù�ٷ� �ű�ϴ�. - - 2. Ŀ���� lubw ���� u ���� �÷������ϴ�. - - 3. ce ��� ������ �� �ܾ ��Ȯ�ϰ� �����մϴ�. (�� ���, 'ine' �� Ĩ�ϴ�.) - - 4. �� ���� �� ���� ������ ���ϴ� (�����Ǿ���� ù ���ڷ� ���ϴ�.) - - 5. 3���� 4�� ������ �ݺ��Ͽ� ù��° ������ �ι�° ����� ������ ����ϴ�. - ----> This lubw has a few wptfd that mrrf changing usf the change command. ----> This line has a few words that need changing using the change command. - -ce �� �ܾ ġȯ�ϴ� �� �Ӹ� �ƴ϶�, ������ ������ �� �ֵ��� �Ѵٴ� �Ϳ� -�����սô�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.4: c �� �̿��� �ٸ� ��ȯ ���� - - - ** ��ȯ ������ ������ �� �̿��� ��� ���� ������ �� �ֽ��ϴ�. ** - - 1. ��ȯ ������ ������ ������ ������� �����մϴ�. ������ ������ �����ϴ�: - - [Ƚ��] c ��� �Ǵ� c [Ƚ��] ��� - - 2. ���� ������ ��� ���� �����ϴ�. w (�ܾ�), $ (���� ��) ���� �ֽ��ϴ�. - - 3. ---> �� ǥ�õ� ù�ٷ� �̵��մϴ�. - - 4. ù ���� ���� Ŀ���� �ű�ϴ�. - - 5. c$ �� �Է��Ͽ�, �� ���� �������� �ι�° ��ó�� �ǵ��� ������ �� �� - �����ʽÿ�. - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - -����: �Է��ϴ� ������ �齺���̽��� �̿��� �� �ֽ��ϴ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.3 ��� - - - 1. �̹� ���� ������ �ǵ�������, p �� �����ʽÿ�. �� ������ Ŀ�� *������* - ������ ������ ���Դϴ�(PUT). (�� ���� ���� ��쿡�� Ŀ�� ���� �ٿ� - ������ ������ �ٽ��ϴ�.) - - 2. Ŀ�� �Ʒ��� ���ڸ� ġȯ�Ϸ���(REPLACE), r �� ���� �� ���� ���� ��� - �ٲپ� ���� ���ڸ� �Է��մϴ�. - - 3. ��ȯ ����(CHANGE)�� Ŀ������ ���� ������ ����� ������ �ٲ� �� �ִ� - �����Դϴ�. ���� ���, Ŀ�� ��ġ���� �ܾ��� ������ �ٲٷ��� ce �� - �Է��ϸ� �Ǹ�, c$ �� �� ������ �ٲٴ� �� ���Դϴ�. - - 4. ��ȯ ������ ������ ������ �����ϴ�: - - [Ƚ��] c ��� �Ǵ� c [Ƚ��] ��� - -����ؼ� ���� Lesson �� �����սô�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.1: ��ġ�� ������ ���� - - - ** CTRL-G �� ������ ���� �������� ���� ��ġ�� ������ ���¸� �� �� �ֽ��ϴ�. - G �� ������ ���� ���� ������ �ٷ� �̵��մϴ�. ** - - ����: �Ʒ��� �ܰ踦 �����ϱ� ����, �� Lesson ��ü�� ���� �����ʽÿ�. - - 1. CTRL Ű�� ���� ���¿��� g �� �����ϴ�. ���� �̸��� ���� ��ġ�� ���� - ǥ�õ� �������� ȭ�� �Ʒ��� ǥ�õ� ���Դϴ�. 3��° �ܰ踦 ���� �� - �� ��ȣ�� ����ϰ� ��ʽÿ�. - -����: Ŀ���� ȭ�� ������ �ϴ����� �Ű��� ���� ���δٸ�, - �̴� 'ruler' �ɼ��� ���õ� ��� �Դϴ�. (:help 'ruler' �� ���� �ϼ���.) - - 2. G �� ������ ������ ���������� �̵��մϴ�. - gg �� ������ ������ ���� �κ����� �̵��մϴ�. - - 3. �Ʊ� ����ߴ� �� ��ȣ�� �Է��� �� G �� �����ʽÿ�. �̷��� �ϸ� - ó���� CTRL-G �� ������ ��ҷ� �ǵ��ư��� �� ���Դϴ�. - (��ȣ�� �Է��� ��, �̰��� ȭ�鿡 ǥ�õ��� �ʽ��ϴ�.) - - 4. �ڽ��� ����ٸ�, 1���� 3������ �����غ��ʽÿ�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.2: ã�� ���� - - - ** / �� ���� �� �˻��� ������ �Է��Ͻʽÿ�. ** - - 1. ���� ��忡�� / �� �Է��Ͻʽÿ�. : ���ɿ����� ����������, ȭ�� �Ʒ��� - / �� Ŀ���� ǥ�õ� ���Դϴ�. - - 2. 'errroor' ��� ģ �� �� ġ�ʽÿ�. �� �ܾ ã������ �մϴ�. - - 3. ���� ������ �ٽ� ã������, ������ n �� �Է��Ͻʽÿ�. - ���� ������ �ݴ� �������� ã������, Shift-N �� �Է��Ͻʽÿ�. - - 4. ������ ���������� ã������, / ��� ? �� �̿��ϸ� �˴ϴ�. - - 5. ���� �ִ� ������ ���ư��� ���ؼ��� CTRL-O �� �̿��ϸ� �˴ϴ�. �ݺ��ϸ� �� �������ε� - �� �� �ֽ��ϴ�. CTRL-I �� �ٽ� �ڷ� �� ���� �ֽ��ϴ�. - ----> "errroor" is not the way to spell error; errroor is an error. - -����: ã�� �߿� ������ ���� �ٴٸ��� �Ǹ�, ������ ó������ �ٽ� ã�� �˴ϴ�. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.3: ��ȣ�� ¦ ã�� - - - ** % �� ������ ), ], } �� ¦�� ã���ϴ�. ** - - 1. Ŀ���� ---> �� ǥ�õ� ���� (, [, { �� �ϳ��� ������ �����ϴ�. - - 2. % �� �Է��� ���ô�. - - 3. Ŀ���� ¦�� �´� ��ȣ�� �̵��� ���Դϴ�. - - 4. % �� �Է��Ͽ�, ���� ��ȣ�� �ǵ��� �ɽô�. - - 5. Ŀ���� �ٸ� (,),[,],{ Ȥ�� } �� ������ % �� �Է��� ���ϴ�. - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - -����: ¦�� ���� �ʴ� ��ȣ�� �ִ� ���α׷��� ������� ���� �ſ� �����մϴ�! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.4: ġȯ(SUBTITUTE) ���� - - - ** :s/old/new/g �ϸ� 'old' �� 'new' �� ġȯ(SUBTITUTE)�մϴ�. ** - - 1. Ŀ���� ---> �� ǥ�õ� �ٿ� ������ �����ϴ�. - - 2. :s/thee/the �� �Է��� �� �� Ĩ�ϴ�. �� ������ �� �ٿ��� - ó������ �߰ߵ� �͸� �ٲ۴ٴ� �Ϳ� �����Ͻʽÿ�. - - 3. �̹����� :s/thee/the/g �� �Է��մϴ�. �̴� �� �� ��ü(globally)�� - ġȯ�Ѵٴ� ���� �ǹ��մϴ�. - ----> thee best time to see thee flowers is in thee spring. - - 4. �� �� ������ ��� ���ڿ��� ���� ġȯ�Ϸ��� ������ ���� �մϴ�, - :#,#s/old/new/g #,# �� �� ���� �ٹ�ȣ�� ���մϴ�. - :%s/old/new/g ���� ��ü���� �߰ߵ� ��� ���� ġȯ�ϴ� ����Դϴ�. - :%s/old/new/gc ���� ��ü���� �߰ߵ� ��� ���� ã��, ġȯ���� �� - ���� ������Ʈ�� �����մϴ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.4 ��� - - 1. CTRL-G ������ ���¿� ���� �������� ���� ��ġ�� ǥ���մϴ�. - G ������ ������ �̵��մϴ�. - ���� G �ش� �ٷ� �̵��մϴ�. - gg ù ��° �������� �̵��մϴ�. - - 2. / �� �Է��� �� ������ �Է��ϸ� �� ������ �Ʒ��������� ã���ϴ�. - ? �� �Է��� �� ������ �Է��ϸ� ���������� ã���ϴ�. - �˻� ��, n �� �Է��ϸ� ���� �������� ���� ������ ã����, - Shift-N �� �Է��ϸ� �ݴ� �������� ã���ϴ�. - CTRL-O �� ������ ��ġ��, CTRL-I�� ���ο� ��ġ�� �Ű��ݴϴ�. - - 3. Ŀ���� (,),[,],{,} ���� ���� ���� % �� �Է��ϸ� �����ϴ� ¦�� - ã�ư��ϴ�. - - 4. � �ٿ� ó�� �����ϴ� old�� new�� �ٲٷ��� :s/old/new - �� �ٿ� �����ϴ� ��� old�� new�� �ٲٷ��� :s/old/new/g - �� �� #,# ���̿��� ġȯ�� �Ϸ��� :#,#s/old/new/g - ���� ���� ��� ������ ġȯ�Ϸ��� :%s/old/new/g - �ٲ� ������ Ȯ���� ��ġ���� 'c'�� �ٿ��� :%s/old/new/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.1: �ܺ� ���� �����ϴ� ��� - - - ** :! �� �Է��� �� �����Ϸ��� ������ �Է��Ͻʽÿ�. ** - - 1. ģ���� ������ : �� �Է��ϸ� Ŀ���� ȭ�� �Ʒ��� �̵��մϴ�. ������ - �Է��� �� �ְ� �˴ϴ�. - - 2. ���� ! (����ǥ) �� �Է��Ͻʽÿ�. �̷��� �ϸ� �ܺ� �� ������ ������ - �� �ֽ��ϴ�. - - 3. ������ ! ������ ls �� �Է��� �� �� �ĺ��ʽÿ�. �� ������Ʈ - ����ó�� ���丮�� ����� ��µ� ���Դϴ�. ls �� �������� �ʴ´ٸ� - :!dir �� �õ��� ���ʽÿ�. - -����: � �ܺ� ���ɵ� �� ������� ������ �� �ֽ��ϴ�. - -����: ��� : ������ �� �ľ� ������ �˴ϴ�. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.2: ���� �ڼ��� ���� ���� - - - ** ������ ������ ���Ϸ� �����Ϸ���, :w FILENAME �Ͻʽÿ�. ** - - 1. :!dir �Ǵ� :!ls �� �Է��Ͽ� ���丮�� ����Ʈ�� ���ɴϴ�. - ���� ���� �� �� �ľ��Ѵٴ� ���� �̹� �˰� ���� ���Դϴ�. - - 2. TEST ó�� �������� �ʴ� ���� �̸��� �ϳ� �����ʽÿ�. - - 3. ���� :w TEST ��� �Է��Ͻʽÿ�. (TEST�� ����� ������ ���� �̸��Դϴ�.) - - 4. �̷��� �ϸ� �� ������ ���� ��ü�� TEST��� �̸����� �����մϴ�. - Ȯ���Ϸ���, :!dir �� �ٽ� �Է��Ͽ�, ���丮�� ���캸�ʽÿ�. - -����: ���� ������ ��, ���� �ٽ� �����Ͽ� TEST��� ������ ����, �� ������ - �������� ���� �Ϻ��� ���� ���纻�� ���Դϴ�. - - 5. ���� �� ������ ����ô�. - (MS-DOS����): !del TEST - (Unix����): !rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.3: ���������� �����ϴ� ���� - - ** ������ �Ϻθ� �����Ϸ���, v ��� :w FILENAME �� �Է��մϴ�. ** - - 1. �� �ٷ� Ŀ���� �����ɴϴ�. - - 2. v �� ������ Ŀ���� �Ʒ� �ټ���°�� �ű�ϴ�. �� ��, ���ڿ����� ���̶���Ʈ ���� �ָ��մϴ�. - - 3. : �� �����ϴ�. ȭ�� �ϴܿ� :'<,'> �� ��Ÿ���ϴ�. - - 4. w TEST �� �Է��մϴ�. ���⼭ TEST�� ���� �̸��̸� ���� �����Ǿ� ���� �ʽ��ϴ�. �� - ������ ��, :'<,'>w TEST �� �ԷµǾ����� Ȯ�� �մϴ�. - - 5. ���� ���õ� ������� TEST ���Ͽ� �Է��մϴ�. :!dir Ȥ�� :!ls�� �̿��Ͽ� ������ ����������� - Ȯ���Ͻʽÿ�. ���� �������� ���ʽÿ�! ���� �������� �� ������ ����մϴ�. - -���� : v �� ���� ���־�(Visual) ������ �����մϴ�. Ŀ���� �ֺ����� ������ ���� �κ��� ������ �� - �ֽ��ϴ�. �׸��� ���ɾ �̿��� �ش� ���ڿ��� ������ �� �ֽ��ϴ�. ���� ���, d �� �̿��� - ������ ���� �ֽ��ϴ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.4: ���� �о���̱�, ��ġ�� - - - ** � ������ ������ �����Ϸ���, :r FILENAME �Ͻʽÿ� ** - - 1. Ŀ���� �� ���� �ٷ� ���� �ű�ʽÿ�. - -����: 3��° �ܰ踦 �����ϸ�, Lesson 1.5.3 �� ���� �� ���Դϴ�. �׷��� �Ǹ� - �� lesson���� �ٽ� �������ʽÿ�. - - 2. ���� TEST ������ �о���Խô�. :r TEST ������ ����Ͻʽÿ�. TEST �� - ������ �̸��Դϴ�. �о���� ������ Ŀ���� ��ġ�� ���� �Ʒ����� ���̰� �˴ϴ�. - - 3. ������ �о�鿩�� ���� Ȯ���ϱ� ����, �ڷ� �̵��ؼ� ���� ������ ���Ͽ��� - �о���� ����, �̷��� Lesson 1.5.3 �� �ι� �ݺ��Ǿ����� Ȯ���Ͻʽÿ�. - -����: �ܺ� ���ɾ��� ������� ���� �� �ֽ��ϴ�. ���� ���, :r !ls �� ls ���ɾ ���� ������� - �о� Ŀ�� �ٷ� �Ʒ��� ��Ĩ�ϴ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.5 ��� - - - 1. :!command �� �̿��Ͽ� �ܺ� ������ �����մϴ�. - - ������ ��: - (MS-DOS) (Unix) - :!dir :!ls - ���丮�� ����� �����ش�. - :!del FILENAME :!rm FILENAME - FILENAME�̶�� ������ �����. - - 2. :w FILENAME �ϸ� ���� ������ ����ϴ� ������ FILENAME�̶�� �̸����� - ��ũ�� �����մϴ�. - - 3. v ���� :w FILENAME �� ���־� ��忡�� ���õ� ������� ���� FILENAME�� �����մϴ�. - - 4. :r FILENAME �� ��ũ���� FILENAME�̶�� ������ �ҷ��鿩�� Ŀ�� ��ġ - �ڿ� ���� ������ ����ֽ��ϴ�. - - 5. :r !dir �� dir ���ɾ��� ������� ���� Ŀ���� ��ġ �Ʒ��� �����ϴ�. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.1: �� �� ����(OPEN) ���� - - - ** o �� ������ Ŀ�� �Ʒ��� ���� ����� ���� ��尡 �˴ϴ�. ** - - 1. �Ʒ��� ---> �� ǥ�õ� �ٷ� Ŀ���� �ű�ʽÿ�. - - 2. o (�ҹ���)�� �ļ� Ŀ�� *�Ʒ���* ���� �ϳ� ���ʽÿ�. ���� ��尡 �˴ϴ�. - - 3. ---> �� ǥ�õ� ���� ������ �� �� ������ ���� ��忡�� �����ʽÿ�. - ----> After typing o the cursor is placed on the open line in Insert mode. - - 4. Ŀ�� *����* ���� �ϳ� �������, �ҹ��� o ��� �빮�� O �� ġ�� �˴ϴ�. - �Ʒ� �ִ� �ٿ� ���� �� ������ �������ʽÿ�. - ----> Open up a line above this by typing O while the cursor is on this line. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.2: �߰�(APPEND) ���� - - - ** a �� ������ Ŀ�� *������* ���� �Է��� �� �ֽ��ϴ�. ** - - 1. Ŀ���� ---> �� ǥ�õ� ù��° ���� ������ �ű�ϴ�. - - 2. e �� ���� li �� ������ Ŀ���� �ű�ϴ�. - - 3. �ҹ��� a �� Ŀ�� �Ʒ� ���� *����*�� ���� �߰��� �� �ֽ��ϴ�. - - 4. �Ʒ��ٰ� ���� ������ �ϼ��� ���ϴ�. �� �̿��� ����(Insert) ��带 �����ϴ�. - - 5. e �� �̿��� ���� ��ĥ �ܾ�� ������ 3���� 4������ �ݺ��մϴ�. - -����: �׷��� �Ͻø� ���� ���� ���� �߰��� �ϱ� ���� i�� ������, Ŀ�� �Ʒ��� - �ִ� ���ڸ� �ݺ��ϰ�, ���� �����ְ�, �� ���� ���� ���� ���ƿͼ�, - Ŀ���� ���������� �ű�� ���������� x���� ������ �ϴ� ���ŷο��� ���Ͻ� - �� �ֽ��ϴ�. - - 3. ���� ù ���� �ϼ��Ͻʽÿ�. �߰� ������ �ؽ�Ʈ�� �ԷµǴ� ��ġ �ܿ��� - ���� ���� ������ ���ٴ� ���� �����Ͻʽÿ�. - ----> This li will allow you to pract appendi text to a line. ----> This line will allow you to practice appending text to a line. - -����: a, i �׸��� A �� �ؽ�Ʈ�� �ԷµǴ� ��ġ �ܿ��� ���� ���� ������ ���ٴ� ���� �����Ͻʽÿ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.3: ġȯ(REPLACE) �� �ٸ� ���� - - - ** �빮�� R �� �Է��ϸ� �ϳ� �̻��� ���ڸ� �ٲ� �� �ֽ��ϴ�. ** - - 1. ---> �� ǥ�õ� ù��° �ٷ� ������ Ŀ���� xxx�� ������ �ű�ϴ�. - - 2. R �� �Է��� ��, �ι�° �ٰ� ���� ���ڸ� �Է��� xxx�� ġȯ�մϴ�. - - 3. �� ���� ġȯ ��带 ���������ϴ�. ������ ������ �״�� ���� �ִ��� Ȯ���մϴ�. - - 4. �� �ܰ�� �ݺ��Ͽ� ���� ��� xxx�� ġȯ�մϴ�. - ----> Adding 123 to xxx gives you xxx. ----> Adding 123 to 456 gives you 579. - -����: ġȯ ���� ���� ���� ����մϴ�. ������ �Էµ� ���ڵ��� ���� ���ڵ��� �����ϴ� ���� �ٸ��ϴ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.4: ���� ���� �ٿ��ֱ�(COPY AND PASTE) - - - ** y �� �̿��� �����ϰ� p �� �ٿ� �ֽ��ϴ�. ** - - 1. ---> �� ǥ�õ� �ٷ� ������ Ŀ���� "a)" �ڷ� �ű�ϴ�. - - 2. v �� ���� ���־� ��带 �����ϰ� "first" �ٷ� �ձ��� Ŀ���� �����Դϴ�. - - 3. y �� ���� ���̶���Ʈ �� �κ��� ����(yank (copy))�մϴ�. - - 4. Ŀ���� ���� ������ ������ �ű�ϴ�: j$ - - 5. p �� ���� ���ڿ��� �ٿ� �ֽ��ϴ�.(paste) �׸��� second �� �Է��մϴ�. - - 6. ���־� ��带 �̿��� " item."�� ����, y �� ����, j$ ���� ���� ���� ������ ������ - p �� �ܾ �ٿ� �ֽ��ϴ�. - ----> a) this is the first item. - b) - - ����: y ���� ���ɾ�� ��� �����մϴ�. ���� ���, yw �� �� �ܾ �����մϴ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.5: �ɼ� ����(SET) - - ** ã�⳪ �ٲٱ⿡�� ��ҹ��� ������ ���ֱ� ���� �ɼ��� �����մϴ� ** - - 1. ������ �Է��Ͽ� 'ignore' �� ã���ʽÿ�: /ignore - n Ű�� �̿��Ͽ� ������ �ݺ��Ͻʽÿ�. - - 2. 'ic' (��ҹ��� ���� ����, Ignore case) �ɼ��� �����Ͻʽÿ�: - :set ic - - 3. n Ű�� ������ 'ignore' �� �ٽ� ã�ƺ��ʽÿ�. - ���� ignore�� IGNORE ��� �˻��Ǵ� ���� �ָ��մϴ�. - - 4. 'hlsearch' �� 'incsearch' �ɼ��� �����սô�. - :set hls is - - 5. ã�� ������ �ٽ� �Է��Ͽ�, � ���� �Ͼ���� Ȯ���� ���ʽÿ�: - /ignore - - 6. ��ҹ��� ������ ���� ���ؼ���, ������ ���� �Է��մϴ�: - :set noic - -����: ã�� ������ ����(HIGHLIGHT)�� ���� ���ַ���: :nohlsearch -����: ����, �˻� �ѹ��� ���ؼ��� ��ҹ��� ���� ������ ���� �ʹٸ� \c �� �̿��� �� �ֽ��ϴ�. - : /ignore\c - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.6 ��� - - - 1. o �� �Է��ϸ� Ŀ�� *�Ʒ���* �� ���� ������, Ŀ���� ���� ���� - ���� �� ���� ��ġ�ϰ� �˴ϴ�. - �빮�� O �� �Է��ϸ� Ŀ���� �ִ� ���� *����* �� ���� ���� �˴ϴ�. - - 2. a �� �Է��ϸ� Ŀ�� *������* ���� �Է��� �� �ֽ��ϴ�. - �빮�� A �� �Է��ϸ� �ڵ����� �� ���� ���� ���ڸ� �߰��ϰ� �˴ϴ�. - - 3. e �� �Է��ϸ� �ܾ��� ������ �����Դϴ�. - - 4. y �� �Է��ϸ� ����(yank (copy))��, p �� �Է��ϸ� �ٿ� �ֱⰡ �˴ϴ�. - - 5. �빮�� R �� �Է��ϸ� �� ������ ������ ������ �ٲٱ� ��尡 �˴ϴ�. - - 6. ":set xxx" �� �ϸ� "xxx" �ɼ��� �����˴ϴ�.: - 'ic' 'ignorecase' �˻��� ��ҹ��� ������ ���� �ʽ��ϴ�. - 'is' 'incsearch' �˻���� �κ� �˻� ����� �����ݴϴ�. - 'hls' 'hlsearch' �˻� ������� ���̶���Ʈ���ݴϴ�. - �ɼ��� ��ü �̸� Ȥ�� ���� �̸� ��� ��� �����մϴ�. - - 7. �տ� "no"�� �ٿ� �ɼ��� �� �� �ֽ��ϴ�: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.7.1: �¶��� ���� ���� - - - ** �¶��� ���� �ý��� ����ϱ� ** - - ���� �� ���� �¶��� ���� �ý����� �����մϴ�. ������ ������, - ���� ������ �� �ϳ��� �õ��غ��ʽÿ�: - - Ű�� ������. (Ű�� �ִ� ���) - - Ű�� ������. (Ű�� �ִ� ���) - - :help ��� �Է��Ѵ�. - - ���� â�� �������� :q ��� �Է��Ͻʽÿ�. - CTRL-W CTRL-W �ٸ��� ������� �Ѿ�ϴ�. - :q ���� �����츦 �ݽ��ϴ�. - - ":help" ��� ���ɿ� ���ڸ� �ָ� � ������ ���� ������ ã�� �� �ֽ��ϴ�. - ���� ������ ���� ���ʽÿ�. ( Ű�� ������ ���� ���� ���ʽÿ�.) - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.7.2: ���� ��ũ��Ʈ ����� - - ** ���� ��� �ѱ� ** - - ���� Vi ���� �ξ� ���� ����� ������ ������, ��κ��� �⺻������ �۵����� - �ʽ��ϴ�. �� ���� ����� �Ẹ����, "vimrc" ��� ������ ������ �մϴ�. - - 1. "vimrc" ������ �����սô�. �� ������ ����ϴ� �ý��ۿ� ���� �ٸ��ϴ�: - :e ~/.vimrc Unix�� ��� - :e ~/_vimrc MS-Windows�� ��� - - 2. ���� "vimrc"�� ������ �о���Դϴ�: - :r $VIMRUNTIME/vimrc_example.vim - - 3. ������ ���� �Ͽ� ������ �����մϴ�: - :w - - ���� ���� ���� �����ϸ�, ���� ����(syntax highlighting)�� ���� ���Դϴ�. - ��� ���ϴ� ������ �� "vimrc" ���Ͽ� �־�� �� �ֽ��ϴ�. - �� �ڼ��� ������ :help vimrc-intro�� ���� �ϼ���. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.7.3: ���ɾ� �ϼ��ϱ� - - - ** CTRL-D �� �̿��Ͽ� ���ɾ �ϼ��� �� �ֽ��ϴ�.** - - 1. ���� vim�� ȣȯ ��尡 �ƴ����� Ȯ���մϴ�: :set nocp - - 2. ���丮�� ������ �����ϴ��� ���� Ȯ�� �մϴ�.: :!ls Ȥ�� :!dir - - 3. ������ ���� ���ɾ �Է��մϴ�: :e - - 4. CTRL-D �� ������ "e"�� �����ϴ� ��� ���ɾ���� �� �� �ֽ��ϴ�. - - 5. �� ���� ":edit" ���ɾ �ϼ��� ���ϴ�. - - 6. ���� ��ĭ �ϳ��� �߰��� ��, �����ϴ� ���� �̸��� �� �κ��� �Է��մϴ�: :edit FIL - - 7. �� ���� ���� �̸��� �ϼ� ��ŵ�ϴ�. - -����: �ϼ��ϱ�� ���� ���ɾ�� ����� �� �ֽ��ϴ�. CTRL-D�� �� ��������! - Ư��, :help ���� ������ ���Դϴ�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.7 ��� - - - 1. ������ ���� ���� :help Ȥ�� Ȥ�� �� �����ϴ�. - - 2. cmd �� ���� ������ ���� ���ؼ��� :help cmd �� �Է��մϴ�. - - 3. CTRL-W CTRL-W �� �̿��� �ٸ� ������� �Ѿ�ϴ�. - - 4. :q �� ���� �����츦 �������ɴϴ�. - - 5. vimrc ���� ��ũ��Ʈ�� �̿��� ��ȣ�ϴ� ������ ������ �� �ֽ��ϴ�. - - 6. : ���ɾ �Է��Ҷ�, CTRL-D �� ���� ������ ���ɾ���� ���� �ֽ��ϴ�. - �� ���� �ϼ� �����մϴ�. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - �̰����� �� �����̸� ��Ĩ�ϴ�. �� �����̴� �� �����⿡ ���� ������ ���並 - �����ֱ� ���� �ǵ��� ���۵Ǿ�����, �� �����⸦ ���� ������ ����ϱ⿡ - ����� ���Դϴ�. ������ �� �����̿ʹ� ���� �� ���� ��ŭ �ξ� ���� ������ - �ֽ��ϴ�. ���� ����� �Ŵ����� �����ʽÿ�: ":help user-manual" - - ���� �ڼ��� �а� �����Ϸ���, ���� å�� ��õ�� �帳�ϴ�: - Vim - Vi Improved - by Steve Oualline - ���ǻ�: New Riders - �� å�� ������ ���� ���ؼ��� �ٷ�� �ֽ��ϴ�. Ư�� �ʺ��ڵ鿡�� �����մϴ�. - ���� ������ �׸��� �ֽ��ϴ�. - ������ �����Ͻʽÿ�: https://iccf-holland.org/click5.html - - ���� å�� �� ������ å���� �����ٴ� Vi�� ���� �ٷ�� ������, ���� ��õ�� �� - �մϴ�: - Learning the Vi Editor - by Linda Lamb - ���ǻ�: O'Reilly & Associates Inc. - Vi�� �ϰ� ���� ���� ��� �Ϳ� ���� �� �� �ִ� ���� å�Դϴ�. - ������° �������� ���� ���� ������ �����ϰ� �ֽ��ϴ�. - - �� �����̴� Colorado School of Mines�� Michael C. Pierce �� - Robert K. Ware �� Colorado State University�� Charles Smith �� ���̵� - �����Ͽ� ����ϴ�. - . E-mail: bware@mines.colorado.edu. - - Modified for Vim by Bram Moolenaar. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.ko.utf-8 b/runtime/tutor/tutor1.ko.utf-8 deleted file mode 100644 index 60f1f488dc..0000000000 --- a/runtime/tutor/tutor1.ko.utf-8 +++ /dev/null @@ -1,968 +0,0 @@ -=============================================================================== -= 빔 길잡이 (VIM Tutor) 에 오신 것을 환영합니다 - Version 1.7 = -=============================================================================== - - 빔(Vim)은 이 길잡이에서 다 설명할 수 없을 만큼 많은 명령을 가진 - 매우 강력한 편집기입니다. 이 길잡이는 빔을 쉽게 전천후 편집기로 사용할 - 수 있도록 충분한 명령에 대해 설명하고 있습니다. - - 이 길잡이를 떼는 데에는 실습하는 데에 얼마나 시간을 쓰는 가에 따라서 - 25-30 분 정도가 걸립니다. - - 이 연습에 포함된 명령은 내용을 고칩니다. 이 파일의 복사본을 만들어서 - 연습하세요. (vimtutor 를 통해 시작했다면, 이미 복사본을 사용하는 - 중입니다.) - - 중요한 것은, 이 길잡이가 직접 써보면서 배우도록 고려되어 있다는 것입니다. - 명령을 제대로 익히려면, 직접 실행해보는 것이 필요합니다. 내용을 읽는 - 것만으로는, 명령을 잊어버리게 될 것입니다. - - 자 이제, Caps Lock(Shift-Lock) 키가 눌려있지 않은지 확인해보시고, j 키를 - 충분히 눌러서 Lesson 1.1.1이 화면에 가득 차도록 움직여봅시다. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.1: 커서 움직이기 - - ** 커서를 움직이려면, 표시된 대로 h,j,k,l 키를 누르십시오. ** - ^ - k 힌트: h 키는 왼쪽에 있으며, 왼쪽으로 움직입니다. - < h l > l 키는 오른쪽에 있으며, 오른쪽으로 - j 움직입니다. - v j 키는 아래방향 화살표처럼 생겼습니다. - - 1. 익숙해질 때까지 커서를 스크린 상에서 움직여 보십시오. - - 2. 아래 방향키 (j)를 반복입력이 될 때까지 누르고 계십시오. - 이제 다음 lesson으로 가는 방법을 알게 되었습니다. - - 3. 아래 방향키를 이용하여, Lesson 1.1.2 로 가십시오. - -참고: 원하지 않는 무언가가 입력이 되었다면, 를 눌러서, 명령 모드로 - 돌아가십시오. 그 후에 원하는 명령을 다시 입력하십시오. - -참고: 커서키 또한 작동할 것입니다. 하지만 hjkl에 익숙해지면, 커서키보다 - 훨씬 빠르게 이동할 수 있을 것입니다. 정말요! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.2: 빔을 시작하고 끝내기 - - - !! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!! - - 1. 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다. - - 2. 다음과 같이 입력합니다: :q! - 이렇게 하면, 바뀐 내용을 *저장하지 않고* 편집기를 빠져나갑니다. - - 3. 쉘 프롬프트가 보인다면, 다시 길잡이로 돌아오기 위해 다음과 같이 - 입력합니다. - vimtutor - 또는 다음과 같을 수도 있습니다. - vim tutor.ko - ----> 'vim' 은 빔 편집기로 들어가는 것을 뜻하며, 'tutor.ko'는 편집하려는 - 파일을 뜻합니다. - - 4. 위에서 이야기한 단계를 기억하였으며, 확신이 서면, 1에서 3까지를 - 수행하여 편집기를 나갔다가 다시 들어와 보십시오. - -주의: :q! 는 바뀐 내용을 저장하지 않습니다. 이 후 lesson에서 - 어떻게 편집 내용을 저장하는지 배울 수 있습니다. - - 5. 그 후 커서를 아래로 움직여 Lesson 1.1.3 으로 가십시오. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.3: 텍스트 편집 - 지우기 - - -** 명령 모드에서 x 를 누르면 커서가 위치한 곳의 글자를 지울 수 있습니다. ** - - 1. ----> 로 표시된 곳으로 커서를 옮겨보십시오. - - 2. 오타를 수정하기 위해, 커서를 지울 글자 위로 움직여 보십시오. - - 3. x 키를 눌러서 지워야할 글자를 지우십시오. - - 4. 2에서 4까지를 반복하여 문장이 올바르게 되도록 하여 보십시오. - ----> The ccow jumpedd ovverr thhe mooon. - - 5. 문장이 정확해졌다면, Lesson 1.1.4로 가십시오. - -주의: 이 길잡이를 보면서 외우려고 하지말고, 직접 사용해보면서 익히길 - 바랍니다. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.4: 텍스트 편집 - 삽입 (INSERTION) - - - ** 명령 모드에서 i 를 누르면 텍스트를 입력할 수 있습니다. ** - - 1. 커서를 첫번째 ---> 로 표시된 줄로 움직입니다. - - 2. 첫번째 줄을 두번째 줄과 똑같이 만들것입니다. 텍스트가 들어가야할 - 곳 다음부터 첫번째 글자 위에 커서를 옮겨 놓습니다. - - 3. i 키를 누른 후, 필요한 내용을 입력합니다. - - 4. 수정한 후에는 를 눌러서 명령 모드로 돌아갑니다. - 문장을 올바르게 만들기 위해 2에서 4의 과정을 반복합니다. - ----> There is text misng this . ----> There is some text missing from this line. - - 5. 텍스트를 삽입하는 데에 익숙해졌다면, Lesson 1.1.5로 가십시오. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.5: 택스트 편집 - 추가 (APPENDING) - - - ** A 를 입력해 텍스트를 추가할 수 있습니다. ** - - 1. 커서를 첫번째 ---> 로 표시된 줄로 움직입니다. - 커서가 문장 내 어디에 있던 상관없습니다. - - 2. A 키를 눌러 필요한 내용을 입력합니다. - - 3. 내용을 모두 입력한 후 를 눌러 명령 모드로 돌아갑니다. - - 4. 커서를 두번째 ---> 로 표시된 줄로 움직입니다. - 문장을 올바르게 만들기 위해 2에서 3의 과정을 반복합니다. - ----> There is some text missing from th - There is some text missing from this line. ----> There is also some text miss - There is also some text missing here. - - 5. 텍스트를 추가하는 데 익숙해졌다면, Lesson 1.1.6으로 가십시오. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.6: 파일 편집 - - ** :wq 를 이용하여 파일을 저장하고 빠져나갈 수 있습니다. ** - - !! 주의: 아래 있는 단계를 실행하기 전에, 이 lesson 전체를 읽으십시오!! - - 1. lesson 1.1.2에서 배웠던 것처럼 :q!로 편집기를 나갈 수 있습니다. - 만약, 다른 터미널에 접근 가능하다면, 아래의 단계를 다른 터미널에서 해봅니다. - - 2. 쉘 프롬프트에 다음과 같이 입력합니다: vim tutor - 'vim' 은 빔 에디터 시작을 위한 명령어, 'tutor'는 수정하고자 하는 - 파일의 이름 입니다. - - 3. 앞에서 배웠던 것처럼 텍스트를 삽입하고 지워보세요. - - 4. 다음 명령어를 이용해 파일 수정 부분을 저장하고 빠져나갑니다: :wq - - 5. 만약 1에서 vimtutor를 빠져나갔다가 다시 들어왔다면, 아래로 움직여 요약으로 넘어가도록 합시다. - - 6. 위 모든 단계를 다 읽고 이해한 후에 직접 해보세요. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.1 요약 - - - 1. 커서를 움직일 때에는 화살표 키나 hjkl 키를 이용합니다. - h (왼쪽) j (아래) k (위) l (오른쪽) - - 2. 쉘 프롬프트에서 빔을 시작하려면 vim FILENAME - - 3. 수정한 내용을 무시한 채로 빔에서 빠져나가려면 :q! - 저장한 후 빔에서 빠져나가려면 :wq - - 4. 명령 모드에서 커서가 위치한 곳의 글자를 지우려면 x 를 입력합니다. - - 5. 명령 모드에서 커서가 위치한 곳에 텍스트를 삽입하려면 - i 를 누른 후 텍스트를 입력하고 커서 앞에 삽입합니다. - A 를 누른 후 텍스트를 입력하고 문장 뒤에 추가 합니다. - -참고: 는 명령 모드로 돌아가는 데 쓰며, 원치 않는 명령이나 완전히 입력되지 - 않은 명령을 취소하는 데에도 씁니다. - -그럼 Lesson 1.2를 시작합시다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.1: 삭제(DELETION) 명령 - - - ** 한 단어를 끝까지 지우려면 dw 라고 치면 됩니다. ** - - 1. 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다. - - 2. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다. - - 3. 지워야할 단어의 처음으로 커서를 옮깁니다. - - 4. dw 라고 쳐서 그 단어를 지웁니다. - - 주의: 위에서 말한대로 하면 화면의 마지막 줄에 dw 라는 글자가 표시됩니다. - 잘못 쳤다면, 를 눌러서 다시 시작하십시오. - ----> There are a some words fun that don't belong paper in this sentence. - - 5. 3, 4번 과정을 다시 하여 문장을 정확하게 만든 뒤 Lesson 1.2.2로 가십시오. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.2: 다른 삭제 명령 - - ** d$ 라고 치면 그 줄 끝까지 지워집니다. ** - - 1. 키를 눌러서 확실하게 명령 모드로 빠져 나옵니다. - - 2. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다. - - 3. 올바른 줄의 끝으로 커서를 옮깁니다. (첫번째로 나오는 . 다음입니다.) - - 4. d$ 라고 쳐서 줄 끝까지 지웁니다. - ----> Somebody typed the end of this line twice. end of this line twice. - - - 5. 어떤 일이 일어났는지 이해하기 위해 Lesson 1.2.3 으로 가십시오. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.3: 명령과 적용 대상에 대해 - - - 삭제 명령 d의 형식은 다음과 같습니다. - - d 대상 - - 여기서: - d - 지우는 명령 - 대상 - 아래에 제시된 대상에 대해 명령을 수행 - - 적용 가능한 대상의 종류: - w - 커서에서 그 단어의 끝까지 (공백 포함.) - e - 커서에서 그 단어의 끝까지 (공백을 포함하지 않음.) - $ - 커서에서 그 줄의 끝까지 - - 예를 들어, de 는 커서의 위치부터 해당 단어의 끝까지 지웁니다. - -참고: 호기심이 있다면, 명령 모드에서 명령 없이 대상을 입력해보십시오. - 위에서 이야기한 대상의 목록에 따라 커서가 움직이게 됩니다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.4: 대상에 반복 적용하기 - - - ** 대상 이전에 숫자를 넣어주면 그 만큼 반복 됩니다. ** - - 1. 아래에 ---> 로 표시된 줄 까지 커서를 옮깁니다. - - 2. 2w 입력하여 커서를 단어 두 개 뒤로 옮깁니다. - - 3. 3e 입력하여 커서를 뒤로 세 번째 단어의 끝으로 옮깁니다. - - 4. 0 (zero) 를 입력하여 문장의 시작부분으로 움직입니다. - - 5. 2에서 3까지를 다른 숫자로 반복해 봅니다. - ----> This is just a line with words you can move around in. - - 6. Lesson 1.2.5로 가십시오. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.5: 삭제에 반복 적용하기 - - - ** 명령과 숫자를 함께 사용하면 그만큼 반복 수행 됩니다. ** - - 위에서 삭제 명령과 대상의 조합과 같이, 대상 이전에 횟수를 넣어 더 많이 삭제 할 수 있습니다: - d 횟수 대상 - - 1. 아래 ---> 표시된 줄에서 커서를 첫번째 대문자 단어로 옮깁니다. - - 2. d2w를 입력하여 두 대문자 단어를 지웁니다. - - 3. 이어지는 대문자 단어들을 1에서 2까지의 단계를 이용해 횟수를 바꾸어 삭제해 봅니다. - ----> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.6: 줄 전체 조작하기 - - - - ** dd 라고 치면 줄 전체를 지웁니다. ** - - 줄 전체를 지우는 일이 잦기 때문에, Vi를 디자인 한 사람들은, 간단히 d를 - 두번 연달아 치면 한 줄을 지울 수 있도록 하였습니다. - - 1. 커서를 아래 나온 단락의 두번째 줄로 가져가십시오. - 2. dd 를 입력하여 그 줄을 지우십시오. - 3. 그런 다음 네번째 줄로 가십시오. - 4. 2dd 라고 입력하여 두줄을 지웁니다. ( 횟수-명령-대상을 기억하세요. ) - ----> 1) Roses are red, ----> 2) Mud is fun, ----> 3) Violets are blue, ----> 4) I have a car, ----> 5) Clocks tell time, ----> 6) Sugar is sweet ----> 7) And so are you. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.7: 취소(UNDO) 명령 - - - ** u 를 누르면 마지막 명령이 취소되며, U 는 줄 전체를 수정합니다. ** - - 1. 커서를 ---> 로 표시된 줄로 이동한 후 첫번째 잘못된 부분 위로 옮깁니다. - 2. x 를 입력하여 첫번째 잘못된 글자를 지웁니다. - 3. 그럼 이제 u 를 입력하여 마지막으로 수행된 명령을 취소합니다. - 4. 이번에는 x 명령을 이용하여 그 줄의 모든 에러를 수정해봅시다. - 5. 대문자 U 를 눌러서 그 줄을 원래 상태로 돌려놓아 보십시오. - 6. 이번에는 u 를 몇 번 눌러서 U 와 이전 명령을 취소해봅시다. - 7. CTRL-R (CTRL 키를 누른 상태에서 R을 누르는 것) 을 몇 번 눌러서 - 명령을 다시 실행해봅시다. (취소한 것을 취소함.) - ----> Fiix the errors oon thhis line and reeplace them witth undo. - - 8. 이 명령은 매우 유용합니다. 그럼 Lesson 1.2 요약으로 넘어가도록 합시다. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.2 요약 - - - 1. 커서가 위치한 곳부터 단어의 끝까지 지우려면: dw - 2. 커서가 위치한 곳부터 줄 끝까지 지우려면: d$ - 3. 줄 전체를 지우려면: dd - - 4. 횟수와 함께 대상을 반복 시키려면: 2w - 5. 명령 모드에서 내리는 명령의 형식은 다음과 같습니다: - - [횟수] 명령 대상 또는 명령 [횟수] 대상 - - 여기서: - 횟수 - 그 명령을 몇 번 반복할 것인가 - 명령 - 어떤 명령을 내릴 것인가 ( 예를 들어, 삭제인 경우는 d ) - 대상 - 명령이 동작할 대상, 예를 들어 w (단어), $ (줄의 끝) 등. - - 6. 커서를 문장 맨 앞으로 옮기려면: 0 - - 7. 이전 행동을 취소하려면: u (소문자 u) - 한 줄에서 수정한 것을 모두 취소하려면: U (대문자 U) - 취소한 것을 다시 실행하려면: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.1: 붙이기(PUT) 명령 - - - ** p 를 입력하여 마지막으로 지운 내용을 커서 뒤에 붙입니다. ** - - 1. 아래에 있는 문단의 첫 줄로 커서를 움직이십시오. - - 2. dd 를 입력하여 그 줄을 지워서 빔의 버퍼에 저장합니다. - - 3. 아까 지운 줄이 가야할 위치의 *윗줄로* 커서를 옮깁니다. - - 4. 명령 모드에서, p 를 입력하여 그 줄을 제대로 된 자리로 옮깁니다. - - 5. 2에서 4를 반복하여 모든 줄의 순서를 바로 잡으십시오. - - d) Can you learn too? - b) Violets are blue, - c) Intelligence is learned, - a) Roses are red, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.2: 치환(REPLACE) 명령 - - - ** 커서 아래의 글자 하나를 바꾸려면, r 을 누른 후 바꿀 글자를 입력합니다. ** - - 1. 커서를 ---> 로 표시된 첫 줄로 옮깁니다. - - 2. 커서를 잘못된 첫 부분으로 옮깁니다. - - 3. r 을 누른 후, 잘못된 부분을 고쳐 쓸 글자를 입력합니다. - - 4. 2에서 3의 과정을 반복하여, 첫 줄의 오류를 수정하십시오. - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. Lesson 1.3.2 로 이동합시다. - -주의: 외우지 말고, 직접 해보면서 익혀야 한다는 것을 잊지 마십시오. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.3: 변환(CHANGE) 명령 - - - ** 한 단어의 전체를 바꾸려면, ce 를 치십시오. ** - - 1. 커서를 ---> 로 표시된 첫줄로 옮깁니다. - - 2. 커서를 lubw 에서 u 위에 올려놓습니다. - - 3. ce 라고 명령한 후 단어를 정확하게 수정합니다. (이 경우, 'ine' 를 칩니다.) - - 4. 를 누른 후 다음 에러로 갑니다 (수정되어야할 첫 글자로 갑니다.) - - 5. 3에서 4의 과정을 반복하여 첫번째 문장을 두번째 문장과 같도록 만듭니다. - ----> This lubw has a few wptfd that mrrf changing usf the change command. ----> This line has a few words that need changing using the change command. - -ce 는 단어를 치환하는 것 뿐만 아니라, 내용을 삽입할 수 있도록 한다는 것에 -유의합시다. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.4: c 를 이용한 다른 변환 명령 - - - ** 변환 명령은 삭제할 때 이용한 대상에 대해 적용할 수 있습니다. ** - - 1. 변환 명령은 삭제와 동일한 방식으로 동작합니다. 형식은 다음과 같습니다: - - [횟수] c 대상 또는 c [횟수] 대상 - - 2. 적용 가능한 대상 역시 같습니다. w (단어), $ (줄의 끝) 등이 있습니다. - - 3. ---> 로 표시된 첫줄로 이동합니다. - - 4. 첫 에러 위로 커서를 옮깁니다. - - 5. c$ 를 입력하여, 그 줄의 나머지가 두번째 줄처럼 되도록 수정한 후 를 - 누르십시오. - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - -참고: 입력하는 동안은 백스페이스를 이용할 수 있습니다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.3 요약 - - - 1. 이미 지운 내용을 되돌리려면, p 를 누르십시오. 이 명령은 커서 *다음에* - 지워진 내용을 붙입니다(PUT). (한 줄을 지운 경우에는 커서 다음 줄에 - 지워진 내용이 붙습니다.) - - 2. 커서 아래의 글자를 치환하려면(REPLACE), r 을 누른 후 원래 글자 대신 - 바꾸어 넣을 글자를 입력합니다. - - 3. 변환 명령(CHANGE)은 커서에서 부터 지정한 대상의 끝까지 바꿀 수 있는 - 명령입니다. 예를 들어, 커서 위치에서 단어의 끝까지 바꾸려면 ce 를 - 입력하면 되며, c$ 는 줄 끝까지 바꾸는 데 쓰입니다. - - 4. 변환 명령의 형식은 다음과 같습니다: - - [횟수] c 대상 또는 c [횟수] 대상 - -계속해서 다음 Lesson 을 진행합시다. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.1: 위치와 파일의 상태 - - - ** CTRL-G 를 누르면 파일 내에서의 현재 위치와 파일의 상태를 볼 수 있습니다. - G 를 누르면 파일 내의 마지막 줄로 이동합니다. ** - - 주의: 아래의 단계를 따라하기 전에, 이 Lesson 전체를 먼저 읽으십시오. - - 1. CTRL 키를 누른 상태에서 g 를 누릅니다. 파일 이름과 현재 위치한 줄이 - 표시된 상태줄이 화면 아래에 표시될 것입니다. 3번째 단계를 위해 그 - 줄 번호를 기억하고 계십시오. - -참고: 커서가 화면 오른쪽 하단으로 옮겨진 것을 보인다면, - 이는 'ruler' 옵션을 세팅된 경우 입니다. (:help 'ruler' 를 참고 하세요.) - - 2. G 를 누르면 파일의 마지막으로 이동합니다. - gg 를 누르면 파일의 시작 부분으로 이동합니다. - - 3. 아까 기억했던 줄 번호를 입력한 후 G 를 누르십시오. 이렇게 하면 - 처음에 CTRL-G 를 눌렀던 장소로 되돌아가게 될 것입니다. - (번호를 입력할 때, 이것은 화면에 표시되지 않습니다.) - - 4. 자신이 생겼다면, 1에서 3까지를 실행해보십시오. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.2: 찾기 명령 - - - ** / 를 누른 후 검색할 문구를 입력하십시오. ** - - 1. 명령 모드에서 / 를 입력하십시오. : 명령에서와 마찬가지로, 화면 아래에 - / 와 커서가 표시될 것입니다. - - 2. 'errroor' 라고 친 후 를 치십시오. 이 단어를 찾으려고 합니다. - - 3. 같은 문구를 다시 찾으려면, 간단히 n 을 입력하십시오. - 같은 문구를 반대 방향으로 찾으려면, Shift-N 을 입력하십시오. - - 4. 문구를 역방향으로 찾으려면, / 대신 ? 를 이용하면 됩니다. - - 5. 원래 있던 곳으로 돌아가기 위해서는 CTRL-O 를 이용하면 됩니다. 반복하면 더 이전으로도 - 갈 수 있습니다. CTRL-I 로 다시 뒤로 갈 수도 있습니다. - ----> "errroor" is not the way to spell error; errroor is an error. - -참고: 찾는 중에 파일의 끝에 다다르게 되면, 파일의 처음부터 다시 찾게 됩니다. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.3: 괄호의 짝 찾기 - - - ** % 를 눌러서 ), ], } 의 짝을 찾습니다. ** - - 1. 커서를 ---> 로 표시된 줄의 (, [, { 중 하나에 가져다 놓습니다. - - 2. % 를 입력해 봅시다. - - 3. 커서가 짝이 맞는 괄호로 이동할 것입니다. - - 4. % 를 입력하여, 이전 괄호로 되돌아 옵시다. - - 5. 커서를 다른 (,),[,],{ 혹은 } 로 움직여 % 를 입력해 봅니다. - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - -참고: 짝이 맞지 않는 괄호가 있는 프로그램을 디버깅할 때에 매우 유용합니다! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.4: 치환(SUBTITUTE) 명령 - - - ** :s/old/new/g 하면 'old' 를 'new' 로 치환(SUBTITUTE)합니다. ** - - 1. 커서를 ---> 로 표시된 줄에 가져다 놓습니다. - - 2. :s/thee/the 를 입력한 후 를 칩니다. 이 명령은 그 줄에서 - 처음으로 발견된 것만 바꾼다는 것에 주의하십시오. - - 3. 이번에는 :s/thee/the/g 를 입력합니다. 이는 그 줄 전체(globally)를 - 치환한다는 것을 의미합니다. - ----> thee best time to see thee flowers is in thee spring. - - 4. 두 줄 사이의 모든 문자열에 대해 치환하려면 다음과 같이 합니다, - :#,#s/old/new/g #,# 는 두 줄의 줄번호를 뜻합니다. - :%s/old/new/g 파일 전체에서 발견된 모든 것을 치환하는 경우입니다. - :%s/old/new/gc 파일 전체에서 발견된 모든 것을 찾고, 치환할지 안 - 할지 프롬프트로 명령합니다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.4 요약 - - 1. CTRL-G 파일의 상태와 파일 내에서의 현재 위치를 표시합니다. - G 파일의 끝으로 이동합니다. - 숫자 G 해당 줄로 이동합니다. - gg 첫 번째 라인으로 이동합니다. - - 2. / 를 입력한 후 문구를 입력하면 그 문구를 아랫방향으로 찾습니다. - ? 를 입력한 후 문구를 입력하면 윗방향으로 찾습니다. - 검색 후, n 을 입력하면 같은 방향으로 다음 문구를 찾으며, - Shift-N 을 입력하면 반대 방향으로 찾습니다. - CTRL-O 는 과거의 위치로, CTRL-I는 새로운 위치로 옮겨줍니다. - - 3. 커서가 (,),[,],{,} 위에 있을 때에 % 를 입력하면 상응하는 짝을 - 찾아갑니다. - - 4. 어떤 줄에 처음 등장하는 old를 new로 바꾸려면 :s/old/new - 한 줄에 등장하는 모든 old를 new로 바꾸려면 :s/old/new/g - 두 줄 #,# 사이에서 치환을 하려면 :#,#s/old/new/g - 파일 내의 모든 문구를 치환하려면 :%s/old/new/g - 바꿀 때마다 확인을 거치려면 'c'를 붙여서 :%s/old/new/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.1: 외부 명령 실행하는 방법 - - - ** :! 을 입력한 후 실행하려는 명령을 입력하십시오. ** - - 1. 친숙한 명령인 : 를 입력하면 커서가 화면 아래로 이동합니다. 명령을 - 입력할 수 있게 됩니다. - - 2. 이제 ! (느낌표) 를 입력하십시오. 이렇게 하면 외부 쉘 명령을 실행할 - 수 있습니다. - - 3. 시험삼아 ! 다음에 ls 를 입력한 후 를 쳐보십시오. 쉘 프롬프트 - 에서처럼 디렉토리의 목록이 출력될 것입니다. ls 가 동작하지 않는다면 - :!dir 을 시도해 보십시오. - -참고: 어떤 외부 명령도 이 방법으로 실행할 수 있습니다. - -참고: 모든 : 명령은 를 쳐야 마무리 됩니다. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.2: 보다 자세한 파일 저장 - - - ** 수정된 내용을 파일로 저장하려면, :w FILENAME 하십시오. ** - - 1. :!dir 또는 :!ls 를 입력하여 디렉토리의 리스트를 얻어옵니다. - 위의 명령 후 를 쳐야한다는 것은 이미 알고 있을 것입니다. - - 2. TEST 처럼 존재하지 않는 파일 이름을 하나 고르십시오. - - 3. 이제 :w TEST 라고 입력하십시오. (TEST는 당신이 선택한 파일 이름입니다.) - - 4. 이렇게 하면 빔 길잡이 파일 전체를 TEST라는 이름으로 저장합니다. - 확인하려면, :!dir 을 다시 입력하여, 디렉토리를 살펴보십시오. - -참고: 빔을 종료한 후, 빔을 다시 실행하여 TEST라는 파일을 열면, 그 파일은 - 저장했을 때와 완벽히 같은 복사본일 것입니다. - - 5. 이제 그 파일을 지웁시다. - (MS-DOS에서): !del TEST - (Unix에서): !rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.3: 선택적으로 저장하는 명령 - - ** 파일의 일부를 저장하려면, v 대상 :w FILENAME 을 입력합니다. ** - - 1. 이 줄로 커서를 가져옵니다. - - 2. v 를 누르고 커서를 아래 다섯번째로 옮깁니다. 이 때, 문자열들이 하이라이트 됨을 주목합니다. - - 3. : 를 누릅니다. 화면 하단에 :'<,'> 가 나타납니다. - - 4. w TEST 를 입력합니다. 여기서 TEST는 파일 이름이며 아직 생성되어 있지 않습니다. 를 - 누르기 전, :'<,'>w TEST 로 입력되었는지 확인 합니다. - - 5. 빔은 선택된 문장들을 TEST 파일에 입력합니다. :!dir 혹은 :!ls를 이용하여 파일이 만들어졌는지 - 확인하십시오. 아직 삭제하지 마십시오! 다음 레슨에서 이 파일을 사용합니다. - -참고 : v 를 눌러 비주얼(Visual) 선택을 시작합니다. 커서를 주변으로 움직여 선택 부분을 조절할 수 - 있습니다. 그리고 명령어를 이용해 해당 문자열을 조작할 수 있습니다. 예를 들어, d 를 이용해 - 삭제할 수도 있습니다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.4: 파일 읽어들이기, 합치기 - - - ** 어떤 파일의 내용을 삽입하려면, :r FILENAME 하십시오 ** - - 1. 커서를 이 라인 바로 위로 옮기십시오. - -주의: 3번째 단계를 실행하면, Lesson 1.5.3 을 보게 될 것입니다. 그렇게 되면 - 이 lesson으로 다시 내려오십시오. - - 2. 이제 TEST 파일을 읽어들입시다. :r TEST 명령을 사용하십시오. TEST 는 - 파일의 이름입니다. 읽어들인 파일은 커서가 위치한 문장 아래부터 놓이게 됩니다. - - 3. 파일이 읽어들여진 것을 확인하기 위해, 뒤로 이동해서 기존 버전과 파일에서 - 읽어들인 버전, 이렇게 Lesson 1.5.3 이 두번 반복되었음을 확인하십시오. - -참고: 외부 명령어의 결과값도 읽을 수 있습니다. 예를 들어, :r !ls 는 ls 명령어에 대한 결과값을 - 읽어 커서 바로 아래에 합칩니다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.5 요약 - - - 1. :!command 를 이용하여 외부 명령을 실행합니다. - - 유용한 예: - (MS-DOS) (Unix) - :!dir :!ls - 디렉토리의 목록을 보여준다. - :!del FILENAME :!rm FILENAME - FILENAME이라는 파일을 지운다. - - 2. :w FILENAME 하면 현재 빔에서 사용하는 파일을 FILENAME이라는 이름으로 - 디스크에 저장합니다. - - 3. v 명령 :w FILENAME 은 비주얼 모드에서 선택된 문장들을 파일 FILENAME에 저장합니다. - - 4. :r FILENAME 은 디스크에서 FILENAME이라는 파일을 불러들여서 커서 위치 - 뒤에 현재 파일을 집어넣습니다. - - 5. :r !dir 는 dir 명령어의 결과값을 현재 커서의 위치 아래에 붙힙니다. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.1: 새 줄 열기(OPEN) 명령 - - - ** o 를 누르면 커서 아래에 줄을 만들고 편집 모드가 됩니다. ** - - 1. 아래에 ---> 로 표시된 줄로 커서를 옮기십시오. - - 2. o (소문자)를 쳐서 커서 *아래에* 줄을 하나 여십시오. 편집 모드가 됩니다. - - 3. ---> 로 표시된 줄을 복사한 후 를 눌러서 편집 모드에서 나오십시오. - ----> After typing o the cursor is placed on the open line in Insert mode. - - 4. 커서 *위에* 줄을 하나 만드려면, 소문자 o 대신 대문자 O 를 치면 됩니다. - 아래 있는 줄에 대해 이 명령을 내려보십시오. - ----> Open up a line above this by typing O while the cursor is on this line. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.2: 추가(APPEND) 명령 - - - ** a 를 누르면 커서 *다음에* 글을 입력할 수 있습니다. ** - - 1. 커서를 ---> 로 표시된 첫번째 줄의 끝으로 옮깁니다. - - 2. e 를 눌러 li 의 끝으로 커서를 옮깁니다. - - 3. 소문자 a 를 커서 아래 글자 *다음*에 글을 추가할 수 있습니다. - - 4. 아랫줄과 같이 문장을 완성해 봅니다. 를 이용해 편집(Insert) 모드를 나갑니다. - - 5. e 를 이용해 다음 고칠 단어로 움직여 3에서 4까지를 반복합니다. - -참고: 그렇게 하시면 고작 줄의 끝에 추가를 하기 위해 i를 누르고, 커서 아래에 - 있던 글자를 반복하고, 글을 끼워넣고, 를 눌러 명령 모드로 돌아와서, - 커서를 오른쪽으로 옮기고 마지막으로 x까지 눌러야 하는 번거로움을 피하실 - 수 있습니다. - - 3. 이제 첫 줄을 완성하십시오. 추가 명령은 텍스트가 입력되는 위치 외에는 - 편집 모드와 완전히 같다는 것을 유념하십시오. - ----> This li will allow you to pract appendi text to a line. ----> This line will allow you to practice appending text to a line. - -참고: a, i 그리고 A 는 텍스트가 입력되는 위치 외에는 편집 모드와 완전히 같다는 것을 유념하십시오. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.3: 치환(REPLACE) 의 다른 버전 - - - ** 대문자 R 을 입력하면 하나 이상의 글자를 바꿀 수 있습니다. ** - - 1. ---> 로 표시된 첫번째 줄로 움직여 커서를 xxx의 앞으로 옮깁니다. - - 2. R 을 입력한 후, 두번째 줄과 같은 숫자를 입력해 xxx를 치환합니다. - - 3. 를 눌러 치환 모드를 빠져나갑니다. 나머지 문장은 그대로 남아 있는지 확인합니다. - - 4. 위 단계들 반복하여 남은 모든 xxx를 치환합니다. - ----> Adding 123 to xxx gives you xxx. ----> Adding 123 to 456 gives you 579. - -주의: 치환 모드는 편집 모드와 비슷합니다. 하지만 입력된 문자들이 원래 문자들을 삭제하는 점이 다릅니다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.4: 문자 복사 붙여넣기(COPY AND PASTE) - - - ** y 를 이용해 복사하고 p 로 붙여 넣습니다. ** - - 1. ---> 로 표시된 줄로 움직여 커서를 "a)" 뒤로 옮깁니다. - - 2. v 를 눌러 비주얼 모드를 시작하고 "first" 바로 앞까지 커서를 움직입니다. - - 3. y 를 눌러 하이라이트 된 부분을 복사(yank (copy))합니다. - - 4. 커서를 다음 문장의 끝으로 옮깁니다: j$ - - 5. p 를 눌러 문자열을 붙여 넣습니다.(paste) 그리고 second 를 입력합니다. - - 6. 비주얼 모드를 이용해 " item."을 선택, y 로 복사, j$ 으로 다음 문장 끝으로 움직여 - p 로 단어를 붙여 넣습니다. - ----> a) this is the first item. - b) - - 참고: y 역시 명령어로 사용 가능합니다. 예를 들어, yw 는 한 단어를 복사합니다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.5: 옵션 설정(SET) - - ** 찾기나 바꾸기에서 대소문자 구분을 없애기 위해 옵션을 설정합니다 ** - - 1. 다음을 입력하여 'ignore' 를 찾으십시오: /ignore - n 키를 이용하여 여러번 반복하십시오. - - 2. 'ic' (대소문자 구별 안함, Ignore case) 옵션을 설정하십시오: - :set ic - - 3. n 키를 눌러서 'ignore' 를 다시 찾아보십시오. - 이제 ignore과 IGNORE 모두 검색되는 점을 주목합니다. - - 4. 'hlsearch' 와 'incsearch' 옵션을 설정합시다. - :set hls is - - 5. 찾기 명령을 다시 입력하여, 어떤 일이 일어나는지 확인해 보십시오: - /ignore - - 6. 대소문자 구별을 끄기 위해서는, 다음과 같이 입력합니다: - :set noic - -참고: 찾은 내용이 강조(HIGHLIGHT)된 것을 없애려면: :nohlsearch -참고: 만약, 검색 한번에 대해서만 대소문자 구별 세팅을 끄고 싶다면 \c 를 이용할 수 있습니다. - : /ignore\c - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.6 요약 - - - 1. o 를 입력하면 커서 *아래에* 한 줄이 열리며, 커서는 편집 모드로 - 열린 줄 위에 위치하게 됩니다. - 대문자 O 를 입력하면 커서가 있는 줄의 *위로* 새 줄을 열게 됩니다. - - 2. a 를 입력하면 커서 *다음에* 글을 입력할 수 있습니다. - 대문자 A 를 입력하면 자동으로 그 줄의 끝에 글자를 추가하게 됩니다. - - 3. e 를 입력하면 단어의 끝으로 움직입니다. - - 4. y 를 입력하면 복사(yank (copy))를, p 를 입력하면 붙여 넣기가 됩니다. - - 5. 대문자 R 을 입력하면 를 눌러서 나가기 전까지 바꾸기 모드가 됩니다. - - 6. ":set xxx" 를 하면 "xxx" 옵션이 설정됩니다.: - 'ic' 'ignorecase' 검색시 대소문자 구별을 하지 않습니다. - 'is' 'incsearch' 검색어에서 부분 검색 결과를 보여줍니다. - 'hls' 'hlsearch' 검색 결과값을 하이라이트해줍니다. - 옵션은 전체 이름 혹은 줄인 이름 모두 사용 가능합니다. - - 7. 앞에 "no"를 붙여 옵션을 끌 수 있습니다: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.7.1: 온라인 도움말 명령 - - - ** 온라인 도움말 시스템 사용하기 ** - - 빔은 폭 넓은 온라인 도움말 시스템을 제공합니다. 도움말을 보려면, - 다음 세가지 중 하나를 시도해보십시오: - - 키를 누른다. (키가 있는 경우) - - 키를 누른다. (키가 있는 경우) - - :help 라고 입력한다. - - 도움말 창을 닫으려면 :q 라고 입력하십시오. - CTRL-W CTRL-W 다른쪽 윈도우로 넘어갑니다. - :q 도움말 윈도우를 닫습니다. - - ":help" 라는 명령에 인자를 주면 어떤 주제에 관한 도움말을 찾을 수 있습니다. - 다음 명령을 내려 보십시오. ( 키를 누르는 것을 잊지 마십시오.) - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LESSON 1.7.2: 시작 스크립트 만들기 - - ** 빔의 기능 켜기 ** - - 빔은 Vi 보다 훨씬 많은 기능을 가지고 있지만, 대부분은 기본적으로 작동하지 - 않습니다. 더 많은 기능을 써보려면, "vimrc" 라는 파일을 만들어야 합니다. - - 1. "vimrc" 파일을 수정합시다. 이 파일은 사용하는 시스템에 따라 다릅니다: - :e ~/.vimrc Unix의 경우 - :e ~/_vimrc MS-Windows의 경우 - - 2. 이제 "vimrc"의 예제를 읽어들입니다: - :r $VIMRUNTIME/vimrc_example.vim - - 3. 다음과 같이 하여 파일을 저장합니다: - :w - - 다음 번에 빔을 시작하면, 구문 강조(syntax highlighting)이 사용될 것입니다. - 모든 원하는 설정을 이 "vimrc" 파일에 넣어둘 수 있습니다. - 더 자세한 내용은 :help vimrc-intro를 참고 하세요. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.7.3: 명령어 완성하기 - - - ** CTRL-D 와 이용하여 명령어를 완성할 수 있습니다.** - - 1. 먼저 vim이 호환 모드가 아닌지를 확인합니다: :set nocp - - 2. 디렉토리에 파일이 존재하는지 먼저 확인 합니다.: :!ls 혹은 :!dir - - 3. 다음과 같이 명령어를 입력합니다: :e - - 4. CTRL-D 를 누르면 "e"로 시작하는 모든 명령어들을 볼 수 있습니다. - - 5. 을 눌러 ":edit" 명령어를 완성해 봅니다. - - 6. 이제 빈칸 하나를 추가한 뒤, 존재하는 파일 이름의 앞 부분을 입력합니다: :edit FIL - - 7. 을 눌러 파일 이름을 완성 시킵니다. - -참고: 완성하기는 많은 명령어에서 사용할 수 있습니다. CTRL-D와 만 누르세요! - 특히, :help 에서 유용할 것입니다. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.7 요약 - - - 1. 도움말을 열기 위해 :help 혹은 혹은 를 누릅니다. - - 2. cmd 에 대한 도움말을 보기 위해서는 :help cmd 를 입력합니다. - - 3. CTRL-W CTRL-W 를 이용해 다른 윈도우로 넘어갑니다. - - 4. :q 로 도움말 윈도우를 빠져나옵니다. - - 5. vimrc 시작 스크립트를 이용해 선호하는 세팅을 유지할 수 있습니다. - - 6. : 명령어를 입력할때, CTRL-D 를 눌러 가능한 명령어들을 볼수 있습니다. - 을 눌러 완성 가능합니다. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - 이것으로 빔 길잡이를 마칩니다. 이 길잡이는 빔 편집기에 대한 간략한 개요를 - 보여주기 위한 의도로 제작되었으며, 이 편집기를 정말 간단히 사용하기에 - 충분할 뿐입니다. 빔에는 이 길잡이와는 비교할 수 없을 만큼 훨씬 많은 명령이 - 있습니다. 다음 사용자 매뉴얼을 읽으십시오: ":help user-manual" - - 보다 자세히 읽고 공부하려면, 다음 책을 추천해 드립니다: - Vim - Vi Improved - by Steve Oualline - 출판사: New Riders - 이 책은 완전히 빔에 대해서만 다루고 있습니다. 특히 초보자들에게 유용합니다. - 많은 예제와 그림이 있습니다. - 다음을 참고하십시오: https://iccf-holland.org/click5.html - - 다음 책은 좀 오래된 책으로 빔보다는 Vi에 대해 다루고 있지만, 역시 추천할 만 - 합니다: - Learning the Vi Editor - by Linda Lamb - 출판사: O'Reilly & Associates Inc. - Vi로 하고 싶은 거의 모든 것에 대해 알 수 있는 좋은 책입니다. - 여섯번째 개정판은 빔에 관한 내용을 포함하고 있습니다. - - 이 길잡이는 Colorado School of Mines의 Michael C. Pierce 와 - Robert K. Ware 가 Colorado State University의 Charles Smith 의 아이디어에 - 착안하여 썼습니다. - . E-mail: bware@mines.colorado.edu. - - Modified for Vim by Bram Moolenaar. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.lt.utf-8 b/runtime/tutor/tutor1.lt similarity index 100% rename from runtime/tutor/tutor1.lt.utf-8 rename to runtime/tutor/tutor1.lt diff --git a/runtime/tutor/tutor1.lv.utf-8 b/runtime/tutor/tutor1.lv similarity index 100% rename from runtime/tutor/tutor1.lv.utf-8 rename to runtime/tutor/tutor1.lv diff --git a/runtime/tutor/tutor1.nb b/runtime/tutor/tutor1.nb index a6be694792..4459f17b66 100644 --- a/runtime/tutor/tutor1.nb +++ b/runtime/tutor/tutor1.nb @@ -1,115 +1,115 @@ =============================================================================== -= V e l k o m m e n t i l i n n f � r i n g e n i V i m -- Ver. 1.7 = += V e l k o m m e n t i l i n n f ø r i n g e n i V i m -- Ver. 1.7 = =============================================================================== - Vim er en meget kraftig editor med mange kommandoer, alt for mange til � - kunne g� gjennom alle i en innf�ring som denne. Den er beregnet p� � - sette deg inn i bruken av nok kommandoer s� du vil v�re i stand til lett - � kunne bruke Vim som en editor til alle form�l. + Vim er en meget kraftig editor med mange kommandoer, alt for mange til å + kunne gå gjennom alle i en innføring som denne. Den er beregnet på å + sette deg inn i bruken av nok kommandoer så du vil være i stand til lett + å kunne bruke Vim som en editor til alle formål. - Tiden som kreves for � g� gjennom denne innf�ringen tar ca. 25-30 + Tiden som kreves for å gå gjennom denne innføringen tar ca. 25-30 minutter, avhengig av hvor mye tid du bruker til eksperimentering. MERK: Kommandoene i leksjonene vil modifisere teksten. Lag en kopi av denne - filen som du kan �ve deg p� (hvis du kj�rte �vimtutor�-kommandoen, er + filen som du kan øve deg på (hvis du kjørte «vimtutor»-kommandoen, er dette allerede en kopi). - Det er viktig � huske at denne innf�ringen er beregnet p� l�ring gjennom - bruk. Det betyr at du m� utf�re kommandoene for � l�re dem skikkelig. + Det er viktig å huske at denne innføringen er beregnet på læring gjennom + bruk. Det betyr at du må utføre kommandoene for å lære dem skikkelig. Hvis du bare leser teksten, vil du glemme kommandoene! - F�rst av alt, sjekk at �Caps Lock� IKKE er aktiv og trykk �j�-tasten for - � flytte mark�ren helt til leksjon 1.1.1 fyller skjermen. + Først av alt, sjekk at «Caps Lock» IKKE er aktiv og trykk «j»-tasten for + å flytte markøren helt til leksjon 1.1.1 fyller skjermen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.1: FLYTTING AV MARK�REN + Leksjon 1.1.1: FLYTTING AV MARKØREN - ** For � flytte mark�ren, trykk tastene h, j, k, l som vist. ** + ** For å flytte markøren, trykk tastene h, j, k, l som vist. ** ^ k Tips: h-tasten er til venstre og flytter til venstre. - < h l > l-tasten er til h�yre og flytter til h�yre. + < h l > l-tasten er til høyre og flytter til høyre. j j-tasten ser ut som en pil som peker nedover. v - 1. Flytt mark�ren rundt p� skjermen til du har f�tt det inn i fingrene. + 1. Flytt markøren rundt på skjermen til du har fått det inn i fingrene. 2. Hold inne nedovertasten (j) til den repeterer. - N� vet du hvordan du beveger deg til neste leksjon. + Nå vet du hvordan du beveger deg til neste leksjon. - 3. G� til leksjon 1.1.2 ved hjelp av nedovertasten. + 3. Gå til leksjon 1.1.2 ved hjelp av nedovertasten. -Merk: Hvis du blir usikker p� noe du har skrevet, trykk for � g� til - normalmodus. Skriv deretter kommandoen du �nsket p� nytt. +Merk: Hvis du blir usikker på noe du har skrevet, trykk for å gå til + normalmodus. Skriv deretter kommandoen du ønsket på nytt. -Merk: Piltastene skal ogs� virke. Men ved � bruke hjkl vil du v�re i stand til - � bevege mark�ren mye raskere n�r du er blitt vant til det. Helt sant! +Merk: Piltastene skal også virke. Men ved å bruke hjkl vil du være i stand til + å bevege markøren mye raskere når du er blitt vant til det. Helt sant! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1.2: AVSLUTTE VIM - !! MERK: F�r du utf�rer noen av punktene nedenfor, les hele leksjonen!! + !! MERK: Før du utfører noen av punktene nedenfor, les hele leksjonen!! - 1. Trykk -tasten (for � forsikre deg om at du er i normalmodus). + 1. Trykk -tasten (for å forsikre deg om at du er i normalmodus). 2. Skriv: :q! . Dette avslutter editoren og FORKASTER alle forandringer som du har gjort. - 3. N�r du ser kommandolinjen i skallet, skriv kommandoen som startet denne - innf�ringen. Den er: vimtutor + 3. Når du ser kommandolinjen i skallet, skriv kommandoen som startet denne + innføringen. Den er: vimtutor - 4. Hvis du er sikker p� at du husker dette, utf�r punktene 1 til 3 for � - avslutte og starte editoren p� nytt. + 4. Hvis du er sikker på at du husker dette, utfør punktene 1 til 3 for å + avslutte og starte editoren på nytt. -MERK: :q! forkaster alle forandringer som du gjorde. I l�pet av noen - f� leksjoner vil du l�re hvordan du lagrer forandringene til en fil. +MERK: :q! forkaster alle forandringer som du gjorde. I løpet av noen + få leksjoner vil du lære hvordan du lagrer forandringene til en fil. - 5. Flytt mark�ren ned til leksjon 1.1.3. + 5. Flytt markøren ned til leksjon 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1.3: REDIGERING AV TEKST -- SLETTING - ** Trykk x for � slette tegnet under mark�ren. ** + ** Trykk x for å slette tegnet under markøren. ** - 1. Flytt mark�ren til den f�rste linjen merket med --->. + 1. Flytt markøren til den første linjen merket med --->. - 2. For � ordne feilene p� linjen, flytt mark�ren til den er opp� tegnet som + 2. For å ordne feilene på linjen, flytt markøren til den er oppå tegnet som skal slettes. - 3. Trykk tasten x for � slette det u�nskede tegnet. + 3. Trykk tasten x for å slette det uønskede tegnet. 4. Repeter punkt 2 til 4 til setningen er lik den som er under. ----> Hessstennnn brrr�snudddde ii gaaata. ----> Hesten br�snudde i gata. +---> Hessstennnn brrråsnudddde ii gaaata. +---> Hesten bråsnudde i gata. - 5. N� som linjen er korrekt, g� til leksjon 1.1.4. + 5. Nå som linjen er korrekt, gå til leksjon 1.1.4. -MERK: N�r du g�r gjennom innf�ringen, ikke bare pr�v � huske kommandoene, men +MERK: Når du går gjennom innføringen, ikke bare prøv å huske kommandoene, men bruk dem helt til de sitter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1.4: REDIGERING AV TEKST -- INNSETTING - ** Trykk i for � sette inn tekst. ** + ** Trykk i for å sette inn tekst. ** - 1. Flytt mark�ren til den f�rste linjen som er merket med --->. + 1. Flytt markøren til den første linjen som er merket med --->. - 2. For � gj�re den f�rste linjen lik den andre, flytt mark�ren til den st�r - p� tegnet ETTER posisjonen der teksten skal settes inn. + 2. For å gjøre den første linjen lik den andre, flytt markøren til den står + på tegnet ETTER posisjonen der teksten skal settes inn. 3. Trykk i og skriv inn teksten som mangler. - 4. Etterhvert som hver feil er fikset, trykk for � returnere til + 4. Etterhvert som hver feil er fikset, trykk for å returnere til normalmodus. Repeter punkt 2 til 4 til setningen er korrekt. ---> Det er tkst som mnglr . ---> Det er ganske mye tekst som mangler her. - 5. N�r du f�ler deg komfortabel med � sette inn tekst, g� til oppsummeringen + 5. Når du føler deg komfortabel med å sette inn tekst, gå til oppsummeringen nedenfor. @@ -117,111 +117,111 @@ MERK: N Leksjon 1.1.5: REDIGERING AV TEKST -- LEGGE TIL - ** Trykk A for � legge til tekst. ** + ** Trykk A for å legge til tekst. ** - 1. Flytt mark�ren til den f�rste linjen nedenfor merket --->. - Det har ikke noe � si hvor mark�ren er plassert p� den linjen. + 1. Flytt markøren til den første linjen nedenfor merket --->. + Det har ikke noe å si hvor markøren er plassert på den linjen. 2. Trykk A og skriv inn det som skal legges til. - 3. N�r teksten er lagt til, trykk for � returnere til normalmodusen. + 3. Når teksten er lagt til, trykk for å returnere til normalmodusen. - 4. Flytt mark�ren til den andre linjen markert med ---> og repeter steg 2 og - 3 for � reparere denne setningen. + 4. Flytt markøren til den andre linjen markert med ---> og repeter steg 2 og + 3 for å reparere denne setningen. ---> Det mangler noe tekst p - Det mangler noe tekst p� denne linjen. ----> Det mangler ogs� litt tek - Det mangler ogs� litt tekst p� denne linjen. + Det mangler noe tekst på denne linjen. +---> Det mangler også litt tek + Det mangler også litt tekst på denne linjen. - 5. N�r du f�ler at du behersker � legge til tekst, g� til leksjon 1.1.6. + 5. Når du føler at du behersker å legge til tekst, gå til leksjon 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1.6: REDIGERE EN FIL - ** Bruk :wq for � lagre en fil og avslutte. ** + ** Bruk :wq for å lagre en fil og avslutte. ** - !! MERK: F�r du utf�rer noen av stegene nedenfor, les hele denne leksjonen!! + !! MERK: Før du utfører noen av stegene nedenfor, les hele denne leksjonen!! - 1. Avslutt denne innf�ringen som du gjorde i leksjon 1.1.2: :q! + 1. Avslutt denne innføringen som du gjorde i leksjon 1.1.2: :q! - 2. Skriv denne kommandoen p� kommandolinja: vim tutor - �vim� er kommandoen for � starte Vim-editoren, �tutor� er navnet p� fila + 2. Skriv denne kommandoen på kommandolinja: vim tutor + «vim» er kommandoen for å starte Vim-editoren, «tutor» er navnet på fila som du vil redigere. Bruk en fil som kan forandres. - 3. Sett inn og slett tekst som du l�rte i de foreg�ende leksjonene. + 3. Sett inn og slett tekst som du lærte i de foregående leksjonene. 4. Lagre filen med forandringene og avslutt Vim med: :wq - 5. Start innf�ringen p� nytt og flytt ned til oppsummeringen som f�lger. + 5. Start innføringen på nytt og flytt ned til oppsummeringen som følger. - 6. Etter � ha lest og forst�tt stegene ovenfor: Sett i gang. + 6. Etter å ha lest og forstått stegene ovenfor: Sett i gang. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.1 - 1. Mark�ren beveges ved hjelp av piltastene eller hjkl-tastene. - h (venstre) j (ned) k (opp) l (h�yre) + 1. Markøren beveges ved hjelp av piltastene eller hjkl-tastene. + h (venstre) j (ned) k (opp) l (høyre) - 2. For � starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN + 2. For å starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN - 3. For � avslutte Vim, skriv: :q! for � forkaste endringer. - ELLER skriv: :wq for � lagre forandringene. + 3. For å avslutte Vim, skriv: :q! for å forkaste endringer. + ELLER skriv: :wq for å lagre forandringene. - 4. For � slette tegnet under mark�ren, trykk: x + 4. For å slette tegnet under markøren, trykk: x - 5. For � sette inn eller legge til tekst, trykk: - i skriv innsatt tekst sett inn f�r mark�ren - A skriv tillagt tekst legg til p� slutten av linjen + 5. For å sette inn eller legge til tekst, trykk: + i skriv innsatt tekst sett inn før markøren + A skriv tillagt tekst legg til på slutten av linjen -MERK: N�r du trykker g�r du til normalmodus eller du avbryter en u�nsket - og delvis fullf�rt kommando. +MERK: Når du trykker går du til normalmodus eller du avbryter en uønsket + og delvis fullført kommando. - N� kan du g� videre til leksjon 1.2. + Nå kan du gå videre til leksjon 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2.1: SLETTEKOMMANDOER - ** Trykk dw for � slette et ord. ** + ** Trykk dw for å slette et ord. ** - 1. Trykk for � v�re sikker p� at du er i normalmodus. + 1. Trykk for å være sikker på at du er i normalmodus. - 2. Flytt mark�ren til den f�rste linjen nedenfor merket --->. + 2. Flytt markøren til den første linjen nedenfor merket --->. - 3. Flytt mark�ren til begynnelsen av ordet som skal slettes. + 3. Flytt markøren til begynnelsen av ordet som skal slettes. 4. Trykk dw og ordet vil forsvinne. -MERK: Bokstaven d vil komme til syne p� den nederste linjen p� skjermen n�r - du skriver den. Vim venter p� at du skal skrive w . Hvis du ser et annet - tegn enn d har du skrevet noe feil; trykk og start p� nytt. +MERK: Bokstaven d vil komme til syne på den nederste linjen på skjermen når + du skriver den. Vim venter på at du skal skrive w . Hvis du ser et annet + tegn enn d har du skrevet noe feil; trykk og start på nytt. ----> Det er agurk tre ord eple som ikke h�rer p�re hjemme i denne setningen. ----> Det er tre ord som ikke h�rer hjemme i denne setningen. +---> Det er agurk tre ord eple som ikke hører pære hjemme i denne setningen. +---> Det er tre ord som ikke hører hjemme i denne setningen. - 5. Repeter punkt 3 og 4 til den f�rste setningen er lik den andre. G� + 5. Repeter punkt 3 og 4 til den første setningen er lik den andre. Gå deretter til leksjon 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2.2: FLERE SLETTEKOMMANDOER - ** Trykk d$ for � slette til slutten av linjen. ** + ** Trykk d$ for å slette til slutten av linjen. ** - 1. Trykk for � v�re sikker p� at du er i normalmodus. + 1. Trykk for å være sikker på at du er i normalmodus. - 2. Flytt mark�ren til linjen nedenfor merket --->. + 2. Flytt markøren til linjen nedenfor merket --->. - 3. Flytt mark�ren til punktet der linjen skal kuttes (ETTER f�rste punktum). + 3. Flytt markøren til punktet der linjen skal kuttes (ETTER første punktum). - 4. Trykk d$ for � slette alt til slutten av linjen. + 4. Trykk d$ for å slette alt til slutten av linjen. ----> Noen skrev slutten p� linjen en gang for mye. linjen en gang for mye. +---> Noen skrev slutten på linjen en gang for mye. linjen en gang for mye. - 5. G� til leksjon 1.2.3 for � forst� hva som skjer. + 5. Gå til leksjon 1.2.3 for å forstå hva som skjer. @@ -239,107 +239,107 @@ MERK: Bokstaven d vil komme til syne p Der: d - er sletteoperatoren. - bevegelse - er hva operatoren vil opere p� (listet nedenfor). + bevegelse - er hva operatoren vil opere på (listet nedenfor). En kort liste med bevegelser: - w - til starten av det neste ordet, UNNTATT det f�rste tegnet. - e - til slutten av det n�v�rende ordet, INKLUDERT det siste tegnet. + w - til starten av det neste ordet, UNNTATT det første tegnet. + e - til slutten av det nåværende ordet, INKLUDERT det siste tegnet. $ - til slutten av linjen, INKLUDERT det siste tegnet. - Ved � skrive de vil alts� alt fra mark�ren til slutten av ordet bli + Ved å skrive de vil altså alt fra markøren til slutten av ordet bli slettet. -MERK: Ved � skrive kun bevegelsen i normalmodusen uten en operator vil - mark�ren flyttes som spesifisert. +MERK: Ved å skrive kun bevegelsen i normalmodusen uten en operator vil + markøren flyttes som spesifisert. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKSJON 1.2.4: BRUK AV TELLER FOR EN BEVEGELSE - ** Ved � skrive et tall foran en bevegelse repeterer den s� mange ganger. ** + ** Ved å skrive et tall foran en bevegelse repeterer den så mange ganger. ** - 1. Flytt mark�ren til starten av linjen markert ---> nedenfor. + 1. Flytt markøren til starten av linjen markert ---> nedenfor. - 2. Skriv 2w for � flytte mark�ren to ord framover. + 2. Skriv 2w for å flytte markøren to ord framover. - 3. Skriv 3e for � flytte mark�ren framover til slutten av det tredje + 3. Skriv 3e for å flytte markøren framover til slutten av det tredje ordet. - 4. Skriv 0 (null) for � flytte til starten av linjen. + 4. Skriv 0 (null) for å flytte til starten av linjen. 5. Repeter steg 2 og 3 med forskjellige tall. ----> Dette er en linje med noen ord som du kan bevege deg rundt p�. +---> Dette er en linje med noen ord som du kan bevege deg rundt på. - 6. G� videre til leksjon 1.2.5. + 6. Gå videre til leksjon 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.5: BRUK AV ANTALL FOR � SLETTE MER + Leksjon 1.2.5: BRUK AV ANTALL FOR Å SLETTE MER - ** Et tall sammen med en operator repeterer den s� mange ganger. ** + ** Et tall sammen med en operator repeterer den så mange ganger. ** I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du - inn antall f�r bevegelsen for � slette mer: + inn antall før bevegelsen for å slette mer: d nummer bevegelse - 1. Flytt mark�ren til det f�rste ordet med STORE BOKSTAVER p� linjen markert + 1. Flytt markøren til det første ordet med STORE BOKSTAVER på linjen markert med --->. - 2. Skriv 2dw for � slette de to ordene med store bokstaver. + 2. Skriv 2dw for å slette de to ordene med store bokstaver. - 3. Repeter steg 1 og 2 med forskjelling antall for � slette de etterf�lgende + 3. Repeter steg 1 og 2 med forskjelling antall for å slette de etterfølgende ordene som har store bokstaver. ----> Denne ABC DE linjen FGHI JK LMN OP er n� Q RS TUV litt mer lesbar. +---> Denne ABC DE linjen FGHI JK LMN OP er nå Q RS TUV litt mer lesbar. -MERK: Et antall mellom operatoren d og bevegelsen virker p� samme m�te som � +MERK: Et antall mellom operatoren d og bevegelsen virker på samme måte som å bruke bevegelsen uten en operator. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.6: OPERERE P� LINJER + Leksjon 1.2.6: OPERERE PÅ LINJER - ** Trykk dd for � slette en hel linje. ** + ** Trykk dd for å slette en hel linje. ** - P� grunn av at sletting av linjer er mye brukt, fant utviklerne av Vi ut at - det vil v�re lettere � rett og slett trykke to d-er for � slette en linje. + På grunn av at sletting av linjer er mye brukt, fant utviklerne av Vi ut at + det vil være lettere å rett og slett trykke to d-er for å slette en linje. - 1. Flytt mark�ren til den andre linjen i verset nedenfor. - 2. Trykk dd � slette linjen. + 1. Flytt markøren til den andre linjen i verset nedenfor. + 2. Trykk dd å slette linjen. 3. Flytt deretter til den fjerde linjen. - 4. Trykk 2dd for � slette to linjer. + 4. Trykk 2dd for å slette to linjer. ----> 1) Roser er r�de, ----> 2) Gj�rme er g�y, ----> 3) Fioler er bl�, +---> 1) Roser er røde, +---> 2) Gjørme er gøy, +---> 3) Fioler er blå, ---> 4) Jeg har en bil, ---> 5) Klokker viser tiden, ----> 6) Druer er s�te ----> 7) Og du er likes�. +---> 6) Druer er søte +---> 7) Og du er likeså. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2.7: ANGRE-KOMMANDOEN - ** Trykk u for � angre siste kommando, U for � fikse en hel linje. ** + ** Trykk u for å angre siste kommando, U for å fikse en hel linje. ** - 1. Flytt mark�ren til linjen nedenfor merket ---> og plasser den p� den - f�rste feilen. - 2. Trykk x for � slette det f�rste u�nskede tegnet. - 3. Trykk s� u for � angre den siste utf�rte kommandoen. - 4. Deretter ordner du alle feilene p� linjene ved � bruke kommandoen x . - 5. Trykk n� en stor U for � sette linjen tilbake til det den var + 1. Flytt markøren til linjen nedenfor merket ---> og plasser den på den + første feilen. + 2. Trykk x for å slette det første uønskede tegnet. + 3. Trykk så u for å angre den siste utførte kommandoen. + 4. Deretter ordner du alle feilene på linjene ved å bruke kommandoen x . + 5. Trykk nå en stor U for å sette linjen tilbake til det den var originalt. - 6. Trykk u noen ganger for � angre U og foreg�ende kommandoer. + 6. Trykk u noen ganger for å angre U og foregående kommandoer. 7. Deretter trykker du CTRL-R (hold CTRL nede mens du trykker R) noen - ganger for � gjenopprette kommandoene (omgj�re angrekommandoene). + ganger for å gjenopprette kommandoene (omgjøre angrekommandoene). ----> RReparer feiilene p�� denne linnnjen oog erssstatt dem meed angre. +---> RReparer feiilene påå denne linnnjen oog erssstatt dem meed angre. - 8. Dette er meget nyttige kommandoer. N� kan du g� til oppsummeringen av + 8. Dette er meget nyttige kommandoer. Nå kan du gå til oppsummeringen av leksjon 1.2. @@ -347,91 +347,91 @@ MERK: Et antall mellom operatoren d og bevegelsen virker p OPPSUMMERING AV LEKSJON 1.2 - 1. For � slette fra mark�ren fram til det neste ordet, trykk: dw - 2. For � slette fra mark�ren til slutten av en linje, trykk: d$ - 3. For � slette en hel linje, trykk: dd + 1. For å slette fra markøren fram til det neste ordet, trykk: dw + 2. For å slette fra markøren til slutten av en linje, trykk: d$ + 3. For å slette en hel linje, trykk: dd - 4. For � repetere en bevegelse, sett et nummer foran: 2w + 4. For å repetere en bevegelse, sett et nummer foran: 2w 5. Formatet for en forandringskommando er: operator [nummer] bevegelse der: - operator - hva som skal gj�res, f.eks. d for � slette - [nummer] - et valgfritt antall for � repetere bevegelsen - bevegelse - hva kommandoen skal operere p�, eksempelvis w (ord), - $ (til slutten av linjen) og s� videre. + operator - hva som skal gjøres, f.eks. d for å slette + [nummer] - et valgfritt antall for å repetere bevegelsen + bevegelse - hva kommandoen skal operere på, eksempelvis w (ord), + $ (til slutten av linjen) og så videre. - 6. For � g� til starten av en linje, bruk en null: 0 + 6. For å gå til starten av en linje, bruk en null: 0 - 7. For � angre tidligere endringer, skriv: u (liten u) - For � angre alle forandringer p� en linje, skriv: U (stor U) - For � omgj�re angringen, trykk: CTRL-R + 7. For å angre tidligere endringer, skriv: u (liten u) + For å angre alle forandringer på en linje, skriv: U (stor U) + For å omgjøre angringen, trykk: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.1: �LIM INN�-KOMMANDOEN + Leksjon 1.3.1: «LIM INN»-KOMMANDOEN - ** Trykk p for � lime inn tidligere slettet tekst etter mark�ren ** + ** Trykk p for å lime inn tidligere slettet tekst etter markøren ** - 1. Flytt mark�ren til den f�rste linjen med ---> nedenfor. + 1. Flytt markøren til den første linjen med ---> nedenfor. - 2. Trykk dd for � slette linjen og lagre den i et Vim-register. + 2. Trykk dd for å slette linjen og lagre den i et Vim-register. - 3. Flytt mark�ren til c)-linjen, OVER posisjonen linjen skal settes inn. + 3. Flytt markøren til c)-linjen, OVER posisjonen linjen skal settes inn. - 4. Trykk p for � legge linjen under mark�ren. + 4. Trykk p for å legge linjen under markøren. - 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkef�lge. + 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkefølge. ----> d) Kan du ogs� l�re? ----> b) Fioler er bl�, ----> c) Intelligens m� l�res, ----> a) Roser er r�de, +---> d) Kan du også lære? +---> b) Fioler er blå, +---> c) Intelligens må læres, +---> a) Roser er røde, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.2: �ERSTATT�-KOMMANDOEN + Leksjon 1.3.2: «ERSTATT»-KOMMANDOEN - ** Trykk rx for � erstatte tegnet under mark�ren med x. ** + ** Trykk rx for å erstatte tegnet under markøren med x. ** - 1. Flytt mark�ren til den f�rste linjen nedenfor merket --->. + 1. Flytt markøren til den første linjen nedenfor merket --->. - 2. Flytt mark�ren s� den st�r opp� den f�rste feilen. + 2. Flytt markøren så den står oppå den første feilen. - 3. Trykk r og deretter tegnet som skal v�re der. + 3. Trykk r og deretter tegnet som skal være der. - 4. Repeter punkt 2 og 3 til den f�rste linjen er lik den andre. + 4. Repeter punkt 2 og 3 til den første linjen er lik den andre. ----> Da dfnne lynjxn ble zkrevet, var det n�en som tjykket feite taster! +---> Da dfnne lynjxn ble zkrevet, var det nøen som tjykket feite taster! ---> Da denne linjen ble skrevet, var det noen som trykket feile taster! - 5. G� videre til leksjon 1.3.2. + 5. Gå videre til leksjon 1.3.2. -MERK: Husk at du b�r l�re ved � BRUKE, ikke pugge. +MERK: Husk at du bør lære ved å BRUKE, ikke pugge. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.3: �FORANDRE�-OPERATOREN + Leksjon 1.3.3: «FORANDRE»-OPERATOREN - ** For � forandre til slutten av et ord, trykk ce . ** + ** For å forandre til slutten av et ord, trykk ce . ** - 1. Flytt mark�ren til den f�rste linjen nedenfor som er merket --->. + 1. Flytt markøren til den første linjen nedenfor som er merket --->. - 2. Plasser mark�ren p� u i �lubjwr�. + 2. Plasser markøren på u i «lubjwr». - 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv �injen�). + 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv «injen»). - 4. Trykk og g� til det neste tegnet som skal forandres. + 4. Trykk og gå til det neste tegnet som skal forandres. - 5. Repeter punkt 3 og 4 helt til den f�rste setningen er lik den andre. + 5. Repeter punkt 3 og 4 helt til den første setningen er lik den andre. ----> Denne lubjwr har noen wgh som m� forkw�p med �for�kzryas�-kommandoen. ----> Denne linjen har noen ord som m� forandres med �forandre�-kommandoen. +---> Denne lubjwr har noen wgh som må forkwåp med «forækzryas»-kommandoen. +---> Denne linjen har noen ord som må forandres med «forandre»-kommandoen. -V�r oppmerksom p� at ce sletter ordet og g�r inn i innsettingsmodus. +Vær oppmerksom på at ce sletter ordet og går inn i innsettingsmodus. @@ -439,113 +439,113 @@ V Leksjon 1.3.4: FLERE FORANDRINGER VED BRUK AV c - ** Forandringskommandoen blir brukt med de samme bevegelser som �slett�. ** + ** Forandringskommandoen blir brukt med de samme bevegelser som «slett». ** - 1. Forandringsoperatoren fungerer p� samme m�te som �slett�. Formatet er: + 1. Forandringsoperatoren fungerer på samme måte som «slett». Formatet er: c [nummer] bevegelse 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en linje). - 3. G� til den f�rste linjen nedenfor som er merket --->. + 3. Gå til den første linjen nedenfor som er merket --->. - 4. Flytt mark�ren til den f�rste feilen. + 4. Flytt markøren til den første feilen. 5. Skriv c$ og skriv resten av linjen lik den andre og trykk . ----> Slutten p� denne linjen trenger litt hjelp for � gj�re den lik den neste. ----> Slutten p� denne linjen trenger � bli rettet ved bruk av c$-kommandoen. +---> Slutten på denne linjen trenger litt hjelp for å gjøre den lik den neste. +---> Slutten på denne linjen trenger å bli rettet ved bruk av c$-kommandoen. -MERK: Du kan bruke slettetasten for � rette feil mens du skriver. +MERK: Du kan bruke slettetasten for å rette feil mens du skriver. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.3 - 1. For � legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette - limer inn den slettede teksten ETTER mark�ren (hvis en linje ble slettet - vil den bli limt inn p� linjen under mark�ren). + 1. For å legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette + limer inn den slettede teksten ETTER markøren (hvis en linje ble slettet + vil den bli limt inn på linjen under markøren). - 2. For � erstatte et tegn under mark�ren, trykk r og deretter tegnet som + 2. For å erstatte et tegn under markøren, trykk r og deretter tegnet som du vil ha der. - 3. Forandringsoperatoren lar deg forandre fra mark�ren til dit bevegelsen - tar deg. Det vil si, skriv ce for � forandre fra mark�ren til slutten - av ordet, c$ for � forandre til slutten av linjen. + 3. Forandringsoperatoren lar deg forandre fra markøren til dit bevegelsen + tar deg. Det vil si, skriv ce for å forandre fra markøren til slutten + av ordet, c$ for å forandre til slutten av linjen. - 4. Formatet for �forandre� er: + 4. Formatet for «forandre» er: c [nummer] bevegelse -N� kan du g� til neste leksjon. +Nå kan du gå til neste leksjon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.1: POSISJONERING AV MARK�REN OG FILSTATUS + Leksjon 1.4.1: POSISJONERING AV MARKØREN OG FILSTATUS - ** Trykk CTRL-G for � vise posisjonen i filen og filstatusen. - Trykk G for � g� til en spesifikk linje i filen. ** + ** Trykk CTRL-G for å vise posisjonen i filen og filstatusen. + Trykk G for å gå til en spesifikk linje i filen. ** - Merk: Les hele leksjonen f�r du utf�rer noen av punktene! + Merk: Les hele leksjonen før du utfører noen av punktene! 1. Hold nede Ctrl-tasten og trykk g . Vi kaller dette CTRL-G. En melding - vil komme til syne p� bunnen av skjermen med filnavnet og posisjonen i + vil komme til syne på bunnen av skjermen med filnavnet og posisjonen i filen. Husk linjenummeret for bruk i steg 3. -Merk: Du kan se mark�rposisjonen i nederste h�yre hj�rne av skjermen. Dette - skjer n�r �ruler�-valget er satt (forklart i leksjon 6). +Merk: Du kan se markørposisjonen i nederste høyre hjørne av skjermen. Dette + skjer når «ruler»-valget er satt (forklart i leksjon 6). - 2. Trykk G for � g� til bunnen av filen. - Skriv gg for � g� til begynnelsen av filen. + 2. Trykk G for å gå til bunnen av filen. + Skriv gg for å gå til begynnelsen av filen. - 3. Skriv inn linjenummeret du var p� og deretter G . Dette vil f�re deg - tilbake til linjen du var p� da du f�rst trykket CTRL-G. + 3. Skriv inn linjenummeret du var på og deretter G . Dette vil føre deg + tilbake til linjen du var på da du først trykket CTRL-G. - 4. Utf�r steg 1 til 3 hvis du f�ler deg sikker p� prosedyren. + 4. Utfør steg 1 til 3 hvis du føler deg sikker på prosedyren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.2: S�KEKOMMANDOEN + Leksjon 1.4.2: SØKEKOMMANDOEN - ** Skriv / etterfulgt av en s�kestreng som du vil lete etter. ** + ** Skriv / etterfulgt av en søkestreng som du vil lete etter. ** - 1. Trykk / n�r du er i normalmodusen. Legg merke til at skr�streken og - mark�ren kommer til syne p� bunnen av skjermen i likhet med - �:�-kommandoene. + 1. Trykk / når du er i normalmodusen. Legg merke til at skråstreken og + markøren kommer til syne på bunnen av skjermen i likhet med + «:»-kommandoene. - 2. Skriv �feeeiil� og trykk . Dette er teksten du vil lete etter. + 2. Skriv «feeeiil» og trykk . Dette er teksten du vil lete etter. - 3. For � finne neste forekomst av s�kestrengen, trykk n . - For � lete etter samme s�keteksten i motsatt retning, trykk N . + 3. For å finne neste forekomst av søkestrengen, trykk n . + For å lete etter samme søketeksten i motsatt retning, trykk N . - 4. For � lete etter en tekst bakover i filen, bruk ? istedenfor / . + 4. For å lete etter en tekst bakover i filen, bruk ? istedenfor / . - 5. For � g� tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens - du trykker bokstaven o ). Repeter for � g� enda lengre tilbake. CTRL-I - g�r framover. + 5. For å gå tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens + du trykker bokstaven o ). Repeter for å gå enda lengre tilbake. CTRL-I + går framover. ----> �feeeiil� er ikke m�ten � skrive �feil� p�, feeeiil er helt feil. -Merk: N�r s�kingen n�r slutten av filen, vil den fortsette fra starten unntatt - hvis �wrapscan�-valget er resatt. +---> «feeeiil» er ikke måten å skrive «feil» på, feeeiil er helt feil. +Merk: Når søkingen når slutten av filen, vil den fortsette fra starten unntatt + hvis «wrapscan»-valget er resatt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.4.3: FINN SAMSVARENDE PARENTESER - ** Trykk % for � finne en samsvarende ), ] eller } . ** + ** Trykk % for å finne en samsvarende ), ] eller } . ** - 1. Plasser mark�ren p� en (, [ eller { p� linjen nedenfor merket --->. + 1. Plasser markøren på en (, [ eller { på linjen nedenfor merket --->. 2. Trykk % . - 3. Mark�ren vil g� til den samsvarende parentesen eller hakeparentesen. + 3. Markøren vil gå til den samsvarende parentesen eller hakeparentesen. - 4. Trykk % for � flytte mark�ren til den andre samsvarende parentesen. + 4. Trykk % for å flytte markøren til den andre samsvarende parentesen. - 5. Flytt mark�ren til en annen (, ), [, ], { eller } og se hva % gj�r. + 5. Flytt markøren til en annen (, ), [, ], { eller } og se hva % gjør. ---> Dette ( er en testlinje med (, [ ] og { } i den )). -Merk: Dette er veldig nyttig til feils�king i programmer som har ubalansert +Merk: Dette er veldig nyttig til feilsøking i programmer som har ubalansert antall parenteser! @@ -554,136 +554,136 @@ Merk: Dette er veldig nyttig til feils Leksjon 1.4.4: ERSTATT-KOMMANDOEN - ** Skriv :s/gammel/ny/g for � erstatte �gammel� med �ny�. ** + ** Skriv :s/gammel/ny/g for å erstatte «gammel» med «ny». ** - 1. Flytt mark�ren til linjen nedenfor som er merket med --->. + 1. Flytt markøren til linjen nedenfor som er merket med --->. 2. Skriv :s/deen/den/ . Legg merke til at denne kommandoen bare - forandrer den f�rste forekomsten av �deen� p� linjen. + forandrer den første forekomsten av «deen» på linjen. - 3. Skriv :s/deen/den/g . N�r g-flagget legges til, betyr dette global - erstatning p� linjen og erstatter alle forekomster av �deen� p� linjen. + 3. Skriv :s/deen/den/g . Når g-flagget legges til, betyr dette global + erstatning på linjen og erstatter alle forekomster av «deen» på linjen. ---> deen som kan kaste deen tyngste steinen lengst er deen beste - 4. For � erstatte alle forekomster av en tekststreng mellom to linjer, - skriv :#,#s/gammel/ny/g der #,# er linjenumrene p� de to linjene for - linjeomr�det erstatningen skal gj�res. - Skriv :%s/gammel/ny/g for � erstatte tekst i hele filen. - Skriv :%s/gammel/ny/gc for � finne alle forekomster i hele filen, og - deretter sp�rre om teksten skal erstattes eller + 4. For å erstatte alle forekomster av en tekststreng mellom to linjer, + skriv :#,#s/gammel/ny/g der #,# er linjenumrene på de to linjene for + linjeområdet erstatningen skal gjøres. + Skriv :%s/gammel/ny/g for å erstatte tekst i hele filen. + Skriv :%s/gammel/ny/gc for å finne alle forekomster i hele filen, og + deretter spørre om teksten skal erstattes eller ikke. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.4 - 1. Ctrl-G viser n�v�rende posisjon i filen og filstatusen. - G g�r til slutten av filen. - nummer G g�r til det linjenummeret. - gg g�r til den f�rste linjen. + 1. Ctrl-G viser nåværende posisjon i filen og filstatusen. + G går til slutten av filen. + nummer G går til det linjenummeret. + gg går til den første linjen. - 2. Skriv / etterfulgt av en s�ketekst for � lete FRAMOVER etter teksten. - Skriv ? etterfulgt av en s�ketekst for � lete BAKOVER etter teksten. - Etter et s�k kan du trykke n for � finne neste forekomst i den samme - retningen eller N for � lete i motsatt retning. + 2. Skriv / etterfulgt av en søketekst for å lete FRAMOVER etter teksten. + Skriv ? etterfulgt av en søketekst for å lete BAKOVER etter teksten. + Etter et søk kan du trykke n for å finne neste forekomst i den samme + retningen eller N for å lete i motsatt retning. CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner. - 3. Skriv % n�r mark�ren st�r p� en (, ), [, ], { eller } for � finne den + 3. Skriv % når markøren står på en (, ), [, ], { eller } for å finne den som samsvarer. - 4. Erstatte �gammel� med f�rste �ny� p� en linje: :s/gammel/ny - Erstatte alle �gammel� med �ny� p� en linje: :s/gammel/ny/g + 4. Erstatte «gammel» med første «ny» på en linje: :s/gammel/ny + Erstatte alle «gammel» med «ny» på en linje: :s/gammel/ny/g Erstatte tekst mellom to linjenumre: :#,#s/gammel/ny/g Erstatte alle forekomster i en fil: :%s/gammel/ny/g - For � godkjenne hver erstatning, legg til �c�: :%s/gammel/ny/gc + For å godkjenne hver erstatning, legg til «c»: :%s/gammel/ny/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.1: HVORDAN UTF�RE EN EKSTERN KOMMANDO + Leksjon 1.5.1: HVORDAN UTFØRE EN EKSTERN KOMMANDO - ** Skriv :! etterfulgt av en ekstern kommando for � utf�re denne. ** + ** Skriv :! etterfulgt av en ekstern kommando for å utføre denne. ** - 1. Skriv den velkjente kommandoen : for � plassere mark�ren p� bunnen av + 1. Skriv den velkjente kommandoen : for å plassere markøren på bunnen av skjermen. Dette lar deg skrive en kommandolinjekommando. - 2. N� kan du skrive tegnet ! . Dette lar deg utf�re en hvilken som helst + 2. Nå kan du skrive tegnet ! . Dette lar deg utføre en hvilken som helst ekstern kommando. 3. Som et eksempel, skriv ls etter utropstegnet og trykk . Du vil - n� f� en liste over filene i katalogen, akkurat som om du hadde kj�rt + nå få en liste over filene i katalogen, akkurat som om du hadde kjørt kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis - �ls� ikke virker. + «ls» ikke virker. -MERK: Det er mulig � kj�re alle eksterne kommandoer p� denne m�ten, ogs� med +MERK: Det er mulig å kjøre alle eksterne kommandoer på denne måten, også med parametere. -MERK: Alle �:�-kommandoer m� avsluttes med . Fra dette punktet er det +MERK: Alle «:»-kommandoer må avsluttes med . Fra dette punktet er det ikke alltid vi nevner det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.5.2: MER OM LAGRING AV FILER - ** For � lagre endringene gjort i en tekst, skriv :w FILNAVN. ** + ** For å lagre endringene gjort i en tekst, skriv :w FILNAVN. ** - 1. Skriv :!dir eller :!ls for � f� en liste over filene i katalogen. Du - vet allerede at du m� trykke etter dette. + 1. Skriv :!dir eller :!ls for å få en liste over filene i katalogen. Du + vet allerede at du må trykke etter dette. - 2. Velg et filnavn p� en fil som ikke finnes, som for eksempel TEST . + 2. Velg et filnavn på en fil som ikke finnes, som for eksempel TEST . 3. Skriv :w TEST (der TEST er filnavnet du velger). - 4. Dette lagrer hele filen (denne innf�ringen) under navnet TEST . For � - sjekke dette, skriv :!dir eller :!ls igjen for � se innholdet av + 4. Dette lagrer hele filen (denne innføringen) under navnet TEST . For å + sjekke dette, skriv :!dir eller :!ls igjen for å se innholdet av katalogen. -Merk: Hvis du n� hadde avsluttet Vim og startet p� nytt igjen med �vim TEST�, - ville filen v�rt en eksakt kopi av innf�ringen da du lagret den. +Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim TEST», + ville filen vært en eksakt kopi av innføringen da du lagret den. - 5. Fjern filen ved � skrive :!rm TEST hvis du er p� et Unix-lignende + 5. Fjern filen ved å skrive :!rm TEST hvis du er på et Unix-lignende operativsystem, eller :!del TEST hvis du bruker MS-DOS. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.5.3: VELGE TEKST SOM SKAL LAGRES - ** For � lagre en del av en fil, skriv v bevegelse :w FILNAVN ** + ** For å lagre en del av en fil, skriv v bevegelse :w FILNAVN ** - 1. Flytt mark�ren til denne linjen. + 1. Flytt markøren til denne linjen. - 2. Trykk v og flytt mark�ren til det femte elementet nedenfor. Legg merke + 2. Trykk v og flytt markøren til det femte elementet nedenfor. Legg merke til at teksten blir markert. - 3. Trykk : (kolon). P� bunnen av skjermen vil :'<,'> komme til syne. + 3. Trykk : (kolon). På bunnen av skjermen vil :'<,'> komme til syne. 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller - at du ser :'<,'>w TEST f�r du trykker Enter. + at du ser :'<,'>w TEST før du trykker Enter. 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls - for � se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. + for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. -MERK: Ved � trykke v startes visuelt valg. Du kan flytte mark�ren rundt for - � gj�re det valgte omr�det st�rre eller mindre. Deretter kan du bruke en - operator for � gj�re noe med teksten. For eksempel sletter d teksten. +MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for + å gjøre det valgte området større eller mindre. Deretter kan du bruke en + operator for å gjøre noe med teksten. For eksempel sletter d teksten. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.4: HENTING OG SAMMENSL�ING AV FILER + Leksjon 1.5.4: HENTING OG SAMMENSLÅING AV FILER - ** For � lese inn en annen fil inn i n�v�rende buffer, skriv :r FILNAVN ** + ** For å lese inn en annen fil inn i nåværende buffer, skriv :r FILNAVN ** - 1. Plasser mark�ren like over denne linjen. + 1. Plasser markøren like over denne linjen. -MERK: Etter � ha utf�rt steg 2 vil du se teksten fra leksjon 1.5.3. G� deretter - NED for � se denne leksjonen igjen. +MERK: Etter å ha utført steg 2 vil du se teksten fra leksjon 1.5.3. Gå deretter + NED for å se denne leksjonen igjen. - 2. Hent TEST-filen ved � bruke kommandoen :r TEST der TEST er navnet p� - filen du brukte. Filen du henter blir plassert nedenfor mark�rlinjen. + 2. Hent TEST-filen ved å bruke kommandoen :r TEST der TEST er navnet på + filen du brukte. Filen du henter blir plassert nedenfor markørlinjen. - 3. For � sjekke at filen ble hentet, g� tilbake og se at det er to kopier av + 3. For å sjekke at filen ble hentet, gå tilbake og se at det er to kopier av leksjon 1.5.3, originalen og denne versjonen. -MERK: Du kan ogs� lese utdataene av en ekstern kommando. For eksempel, :r !ls - leser utdataene av ls-kommandoen og legger dem nedenfor mark�ren. +MERK: Du kan også lese utdataene av en ekstern kommando. For eksempel, :r !ls + leser utdataene av ls-kommandoen og legger dem nedenfor markøren. @@ -692,90 +692,90 @@ MERK: Du kan ogs OPPSUMMERING AV LEKSJON 1.5 - 1. :!kommando utf�rer en ekstern kommandio. + 1. :!kommando utfører en ekstern kommandio. Noen nyttige eksempler er: (MS-DOS) (Unix) :!dir :!ls - List filene i katalogen. :!del FILNAVN :!rm FILNAVN - Slett filen FILNAVN. - 2. :w FILNAVN skriver den n�v�rende Vim-filen disken med navnet FILNAVN . + 2. :w FILNAVN skriver den nåværende Vim-filen disken med navnet FILNAVN . 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen FILNAVN. - 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor mark�ren. + 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markøren. - 5. :r !dir leser utdataene fra �dir�-kommandoen og legger dem nedenfor - mark�rposisjonen. + 5. :r !dir leser utdataene fra «dir»-kommandoen og legger dem nedenfor + markørposisjonen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.1: ��PNE LINJE�-KOMMANDOEN + Leksjon 1.6.1: «ÅPNE LINJE»-KOMMANDOEN - ** Skriv o for � ��pne opp� for en ny linje etter mark�ren og g� til + ** Skriv o for å «åpne opp» for en ny linje etter markøren og gå til innsettingsmodus ** - 1. Flytt mark�ren til linjen nedenfor merket --->. + 1. Flytt markøren til linjen nedenfor merket --->. - 2. Skriv o (liten o) for � �pne opp en linje NEDENFOR mark�ren og g� inn i + 2. Skriv o (liten o) for å åpne opp en linje NEDENFOR markøren og gå inn i innsettingsmodus. - 3. Skriv litt tekst og trykk for � g� ut av innsettingsmodusen. + 3. Skriv litt tekst og trykk for å gå ut av innsettingsmodusen. ----> Etter at o er skrevet blir mark�ren plassert p� den tomme linjen. +---> Etter at o er skrevet blir markøren plassert på den tomme linjen. - 4. For � �pne en ny linje OVER mark�ren, trykk rett og slett en stor O - istedenfor en liten o . Pr�v dette p� linjen nedenfor. + 4. For å åpne en ny linje OVER markøren, trykk rett og slett en stor O + istedenfor en liten o . Prøv dette på linjen nedenfor. ----> Lag ny linje over denne ved � trykke O mens mark�ren er p� denne linjen. +---> Lag ny linje over denne ved å trykke O mens markøren er på denne linjen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.2: �LEGG TIL�-KOMMANDOEN + Leksjon 1.6.2: «LEGG TIL»-KOMMANDOEN - ** Skriv a for � legge til tekst ETTER mark�ren. ** + ** Skriv a for å legge til tekst ETTER markøren. ** - 1. Flytt mark�ren til starten av linjen merket ---> nedenfor. + 1. Flytt markøren til starten av linjen merket ---> nedenfor. - 2. Trykk e til mark�ren er p� slutten av �li�. + 2. Trykk e til markøren er på slutten av «li». - 3. Trykk a (liten a) for � legge til tekst ETTER mark�ren. + 3. Trykk a (liten a) for å legge til tekst ETTER markøren. - 4. Fullf�r ordet s�nn som p� linjen nedenfor. Trykk for � g� ut av + 4. Fullfør ordet sånn som på linjen nedenfor. Trykk for å gå ut av innsettingsmodusen. - 5. Bruk e for � g� til det neste ufullstendige ordet og repeter steg 3 og + 5. Bruk e for å gå til det neste ufullstendige ordet og repeter steg 3 og 4. ----> Denne li lar deg �ve p� � leg til tek p� en linje. ----> Denne linjen lar deg �ve p� � legge til tekst p� en linje. +---> Denne li lar deg øve på å leg til tek på en linje. +---> Denne linjen lar deg øve på å legge til tekst på en linje. -Merk: a, i og A g�r alle til den samme innsettingsmodusen, den eneste +Merk: a, i og A går alle til den samme innsettingsmodusen, den eneste forskjellen er hvor tegnene blir satt inn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.3: EN ANNEN M�TE � ERSTATTE P� + Leksjon 1.6.3: EN ANNEN MÅTE Å ERSTATTE PÅ - ** Skriv en stor R for � erstatte mer enn ett tegn. ** + ** Skriv en stor R for å erstatte mer enn ett tegn. ** - 1. Flytt mark�ren til den f�rste linjen nedenfor merket --->. Flytt mark�ren - til begynnelsen av den f�rste �xxx�-en. + 1. Flytt markøren til den første linjen nedenfor merket --->. Flytt markøren + til begynnelsen av den første «xxx»-en. - 2. Trykk R og skriv inn tallet som st�r nedenfor p� den andre linjen s� + 2. Trykk R og skriv inn tallet som står nedenfor på den andre linjen så det erstatter xxx. - 3. Trykk for � g� ut av erstatningsmodusen. Legg merke til at resten + 3. Trykk for å gå ut av erstatningsmodusen. Legg merke til at resten av linjen forblir uforandret. - 4. Repeter stegene for � erstatte den gjenv�rende xxx. + 4. Repeter stegene for å erstatte den gjenværende xxx. ----> Ved � legge 123 til xxx f�r vi xxx. ----> Ved � legge 123 til 456 f�r vi 579. +---> Ved å legge 123 til xxx får vi xxx. +---> Ved å legge 123 til 456 får vi 579. MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives erstatter et eksisterende tegn. @@ -784,89 +784,89 @@ MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives Leksjon 1.6.4: KOPIERE OG LIME INN TEKST - ** Bruk y-operatoren for � kopiere tekst og p for � lime den inn ** + ** Bruk y-operatoren for å kopiere tekst og p for å lime den inn ** - 1. G� til linjen merket ---> nedenfor og plasser mark�ren etter �a)�. + 1. Gå til linjen merket ---> nedenfor og plasser markøren etter «a)». - 2. G� inn i visuell modus med v og flytt mark�ren til like f�r �f�rste�. + 2. Gå inn i visuell modus med v og flytt markøren til like før «første». - 3. Trykk y for � kopiere (engelsk: �yank�) den uthevede teksten. + 3. Trykk y for å kopiere (engelsk: «yank») den uthevede teksten. - 4. Flytt mark�ren til slutten av den neste linjen: j$ + 4. Flytt markøren til slutten av den neste linjen: j$ - 5. Trykk p for � lime inn teksten. Trykk deretter: a andre . + 5. Trykk p for å lime inn teksten. Trykk deretter: a andre . - 6. Bruk visuell modus for � velge � valget.�, kopier det med y , g� til + 6. Bruk visuell modus for å velge « valget.», kopier det med y , gå til slutten av den neste linjen med j$ og legg inn teksten der med p . ----> a) Dette er det f�rste valget. +---> a) Dette er det første valget. b) -Merk: Du kan ogs� bruke y som en operator; yw kopierer ett ord. +Merk: Du kan også bruke y som en operator; yw kopierer ett ord. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.6.5: SETT VALG - ** Sett et valg s� s�k eller erstatning ignorerer store/sm� bokstaver. ** + ** Sett et valg så søk eller erstatning ignorerer store/små bokstaver. ** - 1. Let etter �ignore� ved � skrive: /ignore - Repeter flere ganger ved � trykke n . + 1. Let etter «ignore» ved å skrive: /ignore + Repeter flere ganger ved å trykke n . - 2. Sett �ic�-valget (Ignore Case) ved � skrive: :set ic + 2. Sett «ic»-valget (Ignore Case) ved å skrive: :set ic - 3. S�k etter �ignore� igjen ved � trykke n . - Legg merke til at b�de �Ignore� og �IGNORE� blir funnet. + 3. Søk etter «ignore» igjen ved å trykke n . + Legg merke til at både «Ignore» og «IGNORE» blir funnet. - 4. Sett �hlsearch�- og �incsearch�-valgene: :set hls is + 4. Sett «hlsearch»- og «incsearch»-valgene: :set hls is - 5. Skriv s�kekommandoen igjen og se hva som skjer: /ignore + 5. Skriv søkekommandoen igjen og se hva som skjer: /ignore - 6. For � sl� av ignorering av store/sm� bokstaver, skriv: :set noic + 6. For å slå av ignorering av store/små bokstaver, skriv: :set noic -Merk: For � fjerne uthevingen av treff, skriv: :nohlsearch -Merk: Hvis du vil ignorere store/sm� bokstaver for kun en s�kekommando, bruk +Merk: For å fjerne uthevingen av treff, skriv: :nohlsearch +Merk: Hvis du vil ignorere store/små bokstaver for kun en søkekommando, bruk \c i uttrykket: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.6 - 1. Trykk o for � legge til en linje NEDENFOR mark�ren og g� inn i + 1. Trykk o for å legge til en linje NEDENFOR markøren og gå inn i innsettingsmodus. - Trykk O for � �pne en linje OVER mark�ren. + Trykk O for å åpne en linje OVER markøren. - 2. Skriv a for � sette inn tekst ETTER mark�ren. - Skriv A for � sette inn tekst etter slutten av linjen. + 2. Skriv a for å sette inn tekst ETTER markøren. + Skriv A for å sette inn tekst etter slutten av linjen. - 3. Kommandoen e g�r til slutten av et ord. + 3. Kommandoen e går til slutten av et ord. - 4. Operatoren y (�yank�) kopierer tekst, p (�paste�) limer den inn. + 4. Operatoren y («yank») kopierer tekst, p («paste») limer den inn. - 5. Ved � trykke R g�r du inn i erstatningsmodus helt til trykkes. + 5. Ved å trykke R går du inn i erstatningsmodus helt til trykkes. - 6. Skriv �:set xxx� for � sette valget �xxx�. Noen valg er: - �ic� �ignorecase� ignorer store/sm� bokstaver under s�k - �is� �incsearch� vis delvise treff for en s�ketekst - �hls� �hlsearch� uthev alle s�ketreff + 6. Skriv «:set xxx» for å sette valget «xxx». Noen valg er: + «ic» «ignorecase» ignorer store/små bokstaver under søk + «is» «incsearch» vis delvise treff for en søketekst + «hls» «hlsearch» uthev alle søketreff - 7. Legg til �no� foran valget for � sl� det av: :set noic + 7. Legg til «no» foran valget for å slå det av: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.1: F� HJELP + Leksjon 1.7.1: FÅ HJELP ** Bruk det innebygde hjelpesystemet. ** - Vim har et omfattende innebygget hjelpesystem. For � starte det, pr�v en av - disse m�tene: + Vim har et omfattende innebygget hjelpesystem. For å starte det, prøv en av + disse måtene: - Trykk Hjelp-tasten (hvis du har en) - Trykk F1-tasten (hvis du har en) - Skriv :help - Les teksten i hjelpevinduet for � finne ut hvordan hjelpen virker. - Skriv CTRL-W CTRL-W for � hoppe fra et vindu til et annet - Skriv :q for � lukke hjelpevinduet. + Les teksten i hjelpevinduet for å finne ut hvordan hjelpen virker. + Skriv CTRL-W CTRL-W for å hoppe fra et vindu til et annet + Skriv :q for å lukke hjelpevinduet. - Du kan f� hjelp for omtrent alle temaer om Vim ved � skrive et parameter til - �:help�-kommandoen. Pr�v disse (ikke glem � trykke ): + Du kan få hjelp for omtrent alle temaer om Vim ved å skrive et parameter til + «:help»-kommandoen. Prøv disse (ikke glem å trykke ): :help w :help c_CTRL-D @@ -876,64 +876,64 @@ Merk: Hvis du vil ignorere store/sm Leksjon 1.7.2: LAG ET OPPSTARTSSKRIPT - ** Sl� p� funksjoner i Vim ** + ** Slå på funksjoner i Vim ** - Vim har mange flere funksjoner enn Vi, men flesteparten av dem er sl�tt av - som standard. For � begynne � bruke flere funksjoner m� du lage en - �vimrc�-fil. + Vim har mange flere funksjoner enn Vi, men flesteparten av dem er slått av + som standard. For å begynne å bruke flere funksjoner må du lage en + «vimrc»-fil. - 1. Start redigeringen av �vimrc�-filen. Dette avhenger av systemet ditt: + 1. Start redigeringen av «vimrc»-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix :e ~/_vimrc for MS Windows - 2. Les inn eksempelfilen for �vimrc�: + 2. Les inn eksempelfilen for «vimrc»: :r $VIMRUNTIME/vimrc_example.vim 3. Lagre filen med: :w Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til - alle dine foretrukne oppsett i denne �vimrc�-filen. + alle dine foretrukne oppsett i denne «vimrc»-filen. For mer informasjon, skriv :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.3: FULLF�RING + Leksjon 1.7.3: FULLFØRING - ** Kommandolinjefullf�ring med CTRL-D og ** + ** Kommandolinjefullføring med CTRL-D og ** - 1. V�r sikker p� at Vim ikke er i Vi-kompatibel modus: :set nocp + 1. Vær sikker på at Vim ikke er i Vi-kompatibel modus: :set nocp 2. Se hvilke filer som er i katalogen: :!ls eller :!dir - 3. Skriv starten p� en kommando: :e + 3. Skriv starten på en kommando: :e 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med - �e�. + «e». - 5. Trykk og Vim vil fullf�re kommandonavnet til �:edit�. + 5. Trykk og Vim vil fullføre kommandonavnet til «:edit». - 6. Legg til et mellomrom og starten p� et eksisterende filnavn: :edit FIL + 6. Legg til et mellomrom og starten på et eksisterende filnavn: :edit FIL - 7. Trykk . Vim vil fullf�re navnet (hvis det er unikt). + 7. Trykk . Vim vil fullføre navnet (hvis det er unikt). -MERK: Fullf�ring fungerer for mange kommandoer. Pr�v ved � trykke CTRL-D og +MERK: Fullføring fungerer for mange kommandoer. Prøv ved å trykke CTRL-D og . Det er spesielt nyttig for bruk sammen med :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.7 - 1. Skriv :help eller trykk eller for � �pne et hjelpevindu. + 1. Skriv :help eller trykk eller for å åpne et hjelpevindu. - 2. Skriv :help kommando for � f� hjelp om kommando . + 2. Skriv :help kommando for å få hjelp om kommando . - 3. Trykk CTRL-W CTRL-W for � hoppe til et annet vindu. + 3. Trykk CTRL-W CTRL-W for å hoppe til et annet vindu. - 4. Trykk :q for � lukke hjelpevinduet. + 4. Trykk :q for å lukke hjelpevinduet. - 5. Opprett et vimrc-oppstartsskript for � lagre favorittvalgene dine. + 5. Opprett et vimrc-oppstartsskript for å lagre favorittvalgene dine. - 6. N�r du skriver en �:�-kommando, trykk CTRL-D for � se mulige - fullf�ringer. Trykk for � bruke en fullf�ring. + 6. Når du skriver en «:»-kommando, trykk CTRL-D for å se mulige + fullføringer. Trykk for å bruke en fullføring. @@ -943,30 +943,30 @@ MERK: Fullf ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Her slutter innf�ringen i Vim. Den var ment som en rask oversikt over - editoren, akkurat nok til � la deg sette i gang med enkel bruk. Den er p� - langt n�r komplett, da Vim har mange flere kommandoer. Les bruksanvisningen - ved � skrive :help user-manual . + Her slutter innføringen i Vim. Den var ment som en rask oversikt over + editoren, akkurat nok til å la deg sette i gang med enkel bruk. Den er på + langt nær komplett, da Vim har mange flere kommandoer. Les bruksanvisningen + ved å skrive :help user-manual . For videre lesing og studier, kan denne boken anbefales: - �Vim - Vi Improved� av Steve Oualline + «Vim - Vi Improved» av Steve Oualline Utgiver: New Riders - Den f�rste boken som er fullt og helt dedisert til Vim. Spesielt nyttig for + Den første boken som er fullt og helt dedisert til Vim. Spesielt nyttig for nybegynnere. Inneholder mange eksempler og illustrasjoner. Se https://iccf-holland.org/click5.html - Denne boken er eldre og handler mer om Vi enn Vim, men anbefales ogs�: - �Learning the Vi Editor� av Linda Lamb + Denne boken er eldre og handler mer om Vi enn Vim, men anbefales også: + «Learning the Vi Editor» av Linda Lamb Utgiver: O'Reilly & Associates Inc. - Det er en god bok for � f� vite omtrent hva som helst om Vi. - Den sjette utgaven inneholder ogs� informasjon om Vim. + Det er en god bok for å få vite omtrent hva som helst om Vi. + Den sjette utgaven inneholder også informasjon om Vim. - Denne innf�ringen er skrevet av Michael C. Pierce og Robert K. Ware, - Colorado School of Mines med id�er av Charles Smith, Colorado State + Denne innføringen er skrevet av Michael C. Pierce og Robert K. Ware, + Colorado School of Mines med idéer av Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu . Modifisert for Vim av Bram Moolenaar. - Oversatt av �yvind A. Holm. E-mail: vimtutor _AT_ sunbase.org + Oversatt av Øyvind A. Holm. E-mail: vimtutor _AT_ sunbase.org Id: tutor.no 406 2007-03-18 22:48:36Z sunny ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.nb.utf-8 b/runtime/tutor/tutor1.nb.utf-8 deleted file mode 100644 index 4459f17b66..0000000000 --- a/runtime/tutor/tutor1.nb.utf-8 +++ /dev/null @@ -1,973 +0,0 @@ -=============================================================================== -= V e l k o m m e n t i l i n n f ø r i n g e n i V i m -- Ver. 1.7 = -=============================================================================== - - Vim er en meget kraftig editor med mange kommandoer, alt for mange til å - kunne gå gjennom alle i en innføring som denne. Den er beregnet på å - sette deg inn i bruken av nok kommandoer så du vil være i stand til lett - å kunne bruke Vim som en editor til alle formål. - - Tiden som kreves for å gå gjennom denne innføringen tar ca. 25-30 - minutter, avhengig av hvor mye tid du bruker til eksperimentering. - - MERK: - Kommandoene i leksjonene vil modifisere teksten. Lag en kopi av denne - filen som du kan øve deg på (hvis du kjørte «vimtutor»-kommandoen, er - dette allerede en kopi). - - Det er viktig å huske at denne innføringen er beregnet på læring gjennom - bruk. Det betyr at du må utføre kommandoene for å lære dem skikkelig. - Hvis du bare leser teksten, vil du glemme kommandoene! - - Først av alt, sjekk at «Caps Lock» IKKE er aktiv og trykk «j»-tasten for - å flytte markøren helt til leksjon 1.1.1 fyller skjermen. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.1: FLYTTING AV MARKØREN - - - ** For å flytte markøren, trykk tastene h, j, k, l som vist. ** - ^ - k Tips: h-tasten er til venstre og flytter til venstre. - < h l > l-tasten er til høyre og flytter til høyre. - j j-tasten ser ut som en pil som peker nedover. - v - 1. Flytt markøren rundt på skjermen til du har fått det inn i fingrene. - - 2. Hold inne nedovertasten (j) til den repeterer. - Nå vet du hvordan du beveger deg til neste leksjon. - - 3. Gå til leksjon 1.1.2 ved hjelp av nedovertasten. - -Merk: Hvis du blir usikker på noe du har skrevet, trykk for å gå til - normalmodus. Skriv deretter kommandoen du ønsket på nytt. - -Merk: Piltastene skal også virke. Men ved å bruke hjkl vil du være i stand til - å bevege markøren mye raskere når du er blitt vant til det. Helt sant! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.2: AVSLUTTE VIM - - - !! MERK: Før du utfører noen av punktene nedenfor, les hele leksjonen!! - - 1. Trykk -tasten (for å forsikre deg om at du er i normalmodus). - - 2. Skriv: :q! . - Dette avslutter editoren og FORKASTER alle forandringer som du har gjort. - - 3. Når du ser kommandolinjen i skallet, skriv kommandoen som startet denne - innføringen. Den er: vimtutor - - 4. Hvis du er sikker på at du husker dette, utfør punktene 1 til 3 for å - avslutte og starte editoren på nytt. - -MERK: :q! forkaster alle forandringer som du gjorde. I løpet av noen - få leksjoner vil du lære hvordan du lagrer forandringene til en fil. - - 5. Flytt markøren ned til leksjon 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.3: REDIGERING AV TEKST -- SLETTING - - - ** Trykk x for å slette tegnet under markøren. ** - - 1. Flytt markøren til den første linjen merket med --->. - - 2. For å ordne feilene på linjen, flytt markøren til den er oppå tegnet som - skal slettes. - - 3. Trykk tasten x for å slette det uønskede tegnet. - - 4. Repeter punkt 2 til 4 til setningen er lik den som er under. - ----> Hessstennnn brrråsnudddde ii gaaata. ----> Hesten bråsnudde i gata. - - 5. Nå som linjen er korrekt, gå til leksjon 1.1.4. - -MERK: Når du går gjennom innføringen, ikke bare prøv å huske kommandoene, men - bruk dem helt til de sitter. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.4: REDIGERING AV TEKST -- INNSETTING - - - ** Trykk i for å sette inn tekst. ** - - 1. Flytt markøren til den første linjen som er merket med --->. - - 2. For å gjøre den første linjen lik den andre, flytt markøren til den står - på tegnet ETTER posisjonen der teksten skal settes inn. - - 3. Trykk i og skriv inn teksten som mangler. - - 4. Etterhvert som hver feil er fikset, trykk for å returnere til - normalmodus. Repeter punkt 2 til 4 til setningen er korrekt. - ----> Det er tkst som mnglr . ----> Det er ganske mye tekst som mangler her. - - 5. Når du føler deg komfortabel med å sette inn tekst, gå til oppsummeringen - nedenfor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.5: REDIGERING AV TEKST -- LEGGE TIL - - - ** Trykk A for å legge til tekst. ** - - 1. Flytt markøren til den første linjen nedenfor merket --->. - Det har ikke noe å si hvor markøren er plassert på den linjen. - - 2. Trykk A og skriv inn det som skal legges til. - - 3. Når teksten er lagt til, trykk for å returnere til normalmodusen. - - 4. Flytt markøren til den andre linjen markert med ---> og repeter steg 2 og - 3 for å reparere denne setningen. - ----> Det mangler noe tekst p - Det mangler noe tekst på denne linjen. ----> Det mangler også litt tek - Det mangler også litt tekst på denne linjen. - - 5. Når du føler at du behersker å legge til tekst, gå til leksjon 1.1.6. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.6: REDIGERE EN FIL - - - ** Bruk :wq for å lagre en fil og avslutte. ** - - !! MERK: Før du utfører noen av stegene nedenfor, les hele denne leksjonen!! - - 1. Avslutt denne innføringen som du gjorde i leksjon 1.1.2: :q! - - 2. Skriv denne kommandoen på kommandolinja: vim tutor - «vim» er kommandoen for å starte Vim-editoren, «tutor» er navnet på fila - som du vil redigere. Bruk en fil som kan forandres. - - 3. Sett inn og slett tekst som du lærte i de foregående leksjonene. - - 4. Lagre filen med forandringene og avslutt Vim med: :wq - - 5. Start innføringen på nytt og flytt ned til oppsummeringen som følger. - - 6. Etter å ha lest og forstått stegene ovenfor: Sett i gang. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.1 - - - 1. Markøren beveges ved hjelp av piltastene eller hjkl-tastene. - h (venstre) j (ned) k (opp) l (høyre) - - 2. For å starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN - - 3. For å avslutte Vim, skriv: :q! for å forkaste endringer. - ELLER skriv: :wq for å lagre forandringene. - - 4. For å slette tegnet under markøren, trykk: x - - 5. For å sette inn eller legge til tekst, trykk: - i skriv innsatt tekst sett inn før markøren - A skriv tillagt tekst legg til på slutten av linjen - -MERK: Når du trykker går du til normalmodus eller du avbryter en uønsket - og delvis fullført kommando. - - Nå kan du gå videre til leksjon 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.1: SLETTEKOMMANDOER - - - ** Trykk dw for å slette et ord. ** - - 1. Trykk for å være sikker på at du er i normalmodus. - - 2. Flytt markøren til den første linjen nedenfor merket --->. - - 3. Flytt markøren til begynnelsen av ordet som skal slettes. - - 4. Trykk dw og ordet vil forsvinne. - -MERK: Bokstaven d vil komme til syne på den nederste linjen på skjermen når - du skriver den. Vim venter på at du skal skrive w . Hvis du ser et annet - tegn enn d har du skrevet noe feil; trykk og start på nytt. - ----> Det er agurk tre ord eple som ikke hører pære hjemme i denne setningen. ----> Det er tre ord som ikke hører hjemme i denne setningen. - - 5. Repeter punkt 3 og 4 til den første setningen er lik den andre. Gå - deretter til leksjon 1.2.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.2: FLERE SLETTEKOMMANDOER - - - ** Trykk d$ for å slette til slutten av linjen. ** - - 1. Trykk for å være sikker på at du er i normalmodus. - - 2. Flytt markøren til linjen nedenfor merket --->. - - 3. Flytt markøren til punktet der linjen skal kuttes (ETTER første punktum). - - 4. Trykk d$ for å slette alt til slutten av linjen. - ----> Noen skrev slutten på linjen en gang for mye. linjen en gang for mye. - - 5. Gå til leksjon 1.2.3 for å forstå hva som skjer. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.3: OM OPERATORER OG BEVEGELSER - - - Mange kommandoer som forandrer teksten er laget ut i fra en operator og en - bevegelse. Formatet for en slettekommando med sletteoperatoren d er: - - d bevegelse - - Der: - d - er sletteoperatoren. - bevegelse - er hva operatoren vil opere på (listet nedenfor). - - En kort liste med bevegelser: - w - til starten av det neste ordet, UNNTATT det første tegnet. - e - til slutten av det nåværende ordet, INKLUDERT det siste tegnet. - $ - til slutten av linjen, INKLUDERT det siste tegnet. - - Ved å skrive de vil altså alt fra markøren til slutten av ordet bli - slettet. - -MERK: Ved å skrive kun bevegelsen i normalmodusen uten en operator vil - markøren flyttes som spesifisert. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKSJON 1.2.4: BRUK AV TELLER FOR EN BEVEGELSE - - - ** Ved å skrive et tall foran en bevegelse repeterer den så mange ganger. ** - - 1. Flytt markøren til starten av linjen markert ---> nedenfor. - - 2. Skriv 2w for å flytte markøren to ord framover. - - 3. Skriv 3e for å flytte markøren framover til slutten av det tredje - ordet. - - 4. Skriv 0 (null) for å flytte til starten av linjen. - - 5. Repeter steg 2 og 3 med forskjellige tall. - ----> Dette er en linje med noen ord som du kan bevege deg rundt på. - - 6. Gå videre til leksjon 1.2.5. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.5: BRUK AV ANTALL FOR Å SLETTE MER - - - ** Et tall sammen med en operator repeterer den så mange ganger. ** - - I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du - inn antall før bevegelsen for å slette mer: - d nummer bevegelse - - 1. Flytt markøren til det første ordet med STORE BOKSTAVER på linjen markert - med --->. - - 2. Skriv 2dw for å slette de to ordene med store bokstaver. - - 3. Repeter steg 1 og 2 med forskjelling antall for å slette de etterfølgende - ordene som har store bokstaver. - ----> Denne ABC DE linjen FGHI JK LMN OP er nå Q RS TUV litt mer lesbar. - -MERK: Et antall mellom operatoren d og bevegelsen virker på samme måte som å - bruke bevegelsen uten en operator. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.6: OPERERE PÅ LINJER - - - ** Trykk dd for å slette en hel linje. ** - - På grunn av at sletting av linjer er mye brukt, fant utviklerne av Vi ut at - det vil være lettere å rett og slett trykke to d-er for å slette en linje. - - 1. Flytt markøren til den andre linjen i verset nedenfor. - 2. Trykk dd å slette linjen. - 3. Flytt deretter til den fjerde linjen. - 4. Trykk 2dd for å slette to linjer. - ----> 1) Roser er røde, ----> 2) Gjørme er gøy, ----> 3) Fioler er blå, ----> 4) Jeg har en bil, ----> 5) Klokker viser tiden, ----> 6) Druer er søte ----> 7) Og du er likeså. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.7: ANGRE-KOMMANDOEN - - - ** Trykk u for å angre siste kommando, U for å fikse en hel linje. ** - - 1. Flytt markøren til linjen nedenfor merket ---> og plasser den på den - første feilen. - 2. Trykk x for å slette det første uønskede tegnet. - 3. Trykk så u for å angre den siste utførte kommandoen. - 4. Deretter ordner du alle feilene på linjene ved å bruke kommandoen x . - 5. Trykk nå en stor U for å sette linjen tilbake til det den var - originalt. - 6. Trykk u noen ganger for å angre U og foregående kommandoer. - 7. Deretter trykker du CTRL-R (hold CTRL nede mens du trykker R) noen - ganger for å gjenopprette kommandoene (omgjøre angrekommandoene). - ----> RReparer feiilene påå denne linnnjen oog erssstatt dem meed angre. - - 8. Dette er meget nyttige kommandoer. Nå kan du gå til oppsummeringen av - leksjon 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.2 - - - 1. For å slette fra markøren fram til det neste ordet, trykk: dw - 2. For å slette fra markøren til slutten av en linje, trykk: d$ - 3. For å slette en hel linje, trykk: dd - - 4. For å repetere en bevegelse, sett et nummer foran: 2w - 5. Formatet for en forandringskommando er: - operator [nummer] bevegelse - der: - operator - hva som skal gjøres, f.eks. d for å slette - [nummer] - et valgfritt antall for å repetere bevegelsen - bevegelse - hva kommandoen skal operere på, eksempelvis w (ord), - $ (til slutten av linjen) og så videre. - - 6. For å gå til starten av en linje, bruk en null: 0 - - 7. For å angre tidligere endringer, skriv: u (liten u) - For å angre alle forandringer på en linje, skriv: U (stor U) - For å omgjøre angringen, trykk: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.1: «LIM INN»-KOMMANDOEN - - - ** Trykk p for å lime inn tidligere slettet tekst etter markøren ** - - 1. Flytt markøren til den første linjen med ---> nedenfor. - - 2. Trykk dd for å slette linjen og lagre den i et Vim-register. - - 3. Flytt markøren til c)-linjen, OVER posisjonen linjen skal settes inn. - - 4. Trykk p for å legge linjen under markøren. - - 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkefølge. - ----> d) Kan du også lære? ----> b) Fioler er blå, ----> c) Intelligens må læres, ----> a) Roser er røde, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.2: «ERSTATT»-KOMMANDOEN - - - ** Trykk rx for å erstatte tegnet under markøren med x. ** - - 1. Flytt markøren til den første linjen nedenfor merket --->. - - 2. Flytt markøren så den står oppå den første feilen. - - 3. Trykk r og deretter tegnet som skal være der. - - 4. Repeter punkt 2 og 3 til den første linjen er lik den andre. - ----> Da dfnne lynjxn ble zkrevet, var det nøen som tjykket feite taster! ----> Da denne linjen ble skrevet, var det noen som trykket feile taster! - - 5. Gå videre til leksjon 1.3.2. - -MERK: Husk at du bør lære ved å BRUKE, ikke pugge. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.3: «FORANDRE»-OPERATOREN - - - ** For å forandre til slutten av et ord, trykk ce . ** - - 1. Flytt markøren til den første linjen nedenfor som er merket --->. - - 2. Plasser markøren på u i «lubjwr». - - 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv «injen»). - - 4. Trykk og gå til det neste tegnet som skal forandres. - - 5. Repeter punkt 3 og 4 helt til den første setningen er lik den andre. - ----> Denne lubjwr har noen wgh som må forkwåp med «forækzryas»-kommandoen. ----> Denne linjen har noen ord som må forandres med «forandre»-kommandoen. - -Vær oppmerksom på at ce sletter ordet og går inn i innsettingsmodus. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.4: FLERE FORANDRINGER VED BRUK AV c - - - ** Forandringskommandoen blir brukt med de samme bevegelser som «slett». ** - - 1. Forandringsoperatoren fungerer på samme måte som «slett». Formatet er: - - c [nummer] bevegelse - - 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en - linje). - - 3. Gå til den første linjen nedenfor som er merket --->. - - 4. Flytt markøren til den første feilen. - - 5. Skriv c$ og skriv resten av linjen lik den andre og trykk . - ----> Slutten på denne linjen trenger litt hjelp for å gjøre den lik den neste. ----> Slutten på denne linjen trenger å bli rettet ved bruk av c$-kommandoen. - -MERK: Du kan bruke slettetasten for å rette feil mens du skriver. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.3 - - - 1. For å legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette - limer inn den slettede teksten ETTER markøren (hvis en linje ble slettet - vil den bli limt inn på linjen under markøren). - - 2. For å erstatte et tegn under markøren, trykk r og deretter tegnet som - du vil ha der. - - 3. Forandringsoperatoren lar deg forandre fra markøren til dit bevegelsen - tar deg. Det vil si, skriv ce for å forandre fra markøren til slutten - av ordet, c$ for å forandre til slutten av linjen. - - 4. Formatet for «forandre» er: - - c [nummer] bevegelse - -Nå kan du gå til neste leksjon. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.1: POSISJONERING AV MARKØREN OG FILSTATUS - - ** Trykk CTRL-G for å vise posisjonen i filen og filstatusen. - Trykk G for å gå til en spesifikk linje i filen. ** - - Merk: Les hele leksjonen før du utfører noen av punktene! - - 1. Hold nede Ctrl-tasten og trykk g . Vi kaller dette CTRL-G. En melding - vil komme til syne på bunnen av skjermen med filnavnet og posisjonen i - filen. Husk linjenummeret for bruk i steg 3. - -Merk: Du kan se markørposisjonen i nederste høyre hjørne av skjermen. Dette - skjer når «ruler»-valget er satt (forklart i leksjon 6). - - 2. Trykk G for å gå til bunnen av filen. - Skriv gg for å gå til begynnelsen av filen. - - 3. Skriv inn linjenummeret du var på og deretter G . Dette vil føre deg - tilbake til linjen du var på da du først trykket CTRL-G. - - 4. Utfør steg 1 til 3 hvis du føler deg sikker på prosedyren. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.2: SØKEKOMMANDOEN - - ** Skriv / etterfulgt av en søkestreng som du vil lete etter. ** - - 1. Trykk / når du er i normalmodusen. Legg merke til at skråstreken og - markøren kommer til syne på bunnen av skjermen i likhet med - «:»-kommandoene. - - 2. Skriv «feeeiil» og trykk . Dette er teksten du vil lete etter. - - 3. For å finne neste forekomst av søkestrengen, trykk n . - For å lete etter samme søketeksten i motsatt retning, trykk N . - - 4. For å lete etter en tekst bakover i filen, bruk ? istedenfor / . - - 5. For å gå tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens - du trykker bokstaven o ). Repeter for å gå enda lengre tilbake. CTRL-I - går framover. - ----> «feeeiil» er ikke måten å skrive «feil» på, feeeiil er helt feil. -Merk: Når søkingen når slutten av filen, vil den fortsette fra starten unntatt - hvis «wrapscan»-valget er resatt. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.3: FINN SAMSVARENDE PARENTESER - - - ** Trykk % for å finne en samsvarende ), ] eller } . ** - - 1. Plasser markøren på en (, [ eller { på linjen nedenfor merket --->. - - 2. Trykk % . - - 3. Markøren vil gå til den samsvarende parentesen eller hakeparentesen. - - 4. Trykk % for å flytte markøren til den andre samsvarende parentesen. - - 5. Flytt markøren til en annen (, ), [, ], { eller } og se hva % gjør. - ----> Dette ( er en testlinje med (, [ ] og { } i den )). - -Merk: Dette er veldig nyttig til feilsøking i programmer som har ubalansert - antall parenteser! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.4: ERSTATT-KOMMANDOEN - - - ** Skriv :s/gammel/ny/g for å erstatte «gammel» med «ny». ** - - 1. Flytt markøren til linjen nedenfor som er merket med --->. - - 2. Skriv :s/deen/den/ . Legg merke til at denne kommandoen bare - forandrer den første forekomsten av «deen» på linjen. - - 3. Skriv :s/deen/den/g . Når g-flagget legges til, betyr dette global - erstatning på linjen og erstatter alle forekomster av «deen» på linjen. - ----> deen som kan kaste deen tyngste steinen lengst er deen beste - - 4. For å erstatte alle forekomster av en tekststreng mellom to linjer, - skriv :#,#s/gammel/ny/g der #,# er linjenumrene på de to linjene for - linjeområdet erstatningen skal gjøres. - Skriv :%s/gammel/ny/g for å erstatte tekst i hele filen. - Skriv :%s/gammel/ny/gc for å finne alle forekomster i hele filen, og - deretter spørre om teksten skal erstattes eller - ikke. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.4 - - - 1. Ctrl-G viser nåværende posisjon i filen og filstatusen. - G går til slutten av filen. - nummer G går til det linjenummeret. - gg går til den første linjen. - - 2. Skriv / etterfulgt av en søketekst for å lete FRAMOVER etter teksten. - Skriv ? etterfulgt av en søketekst for å lete BAKOVER etter teksten. - Etter et søk kan du trykke n for å finne neste forekomst i den samme - retningen eller N for å lete i motsatt retning. - CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner. - - 3. Skriv % når markøren står på en (, ), [, ], { eller } for å finne den - som samsvarer. - - 4. Erstatte «gammel» med første «ny» på en linje: :s/gammel/ny - Erstatte alle «gammel» med «ny» på en linje: :s/gammel/ny/g - Erstatte tekst mellom to linjenumre: :#,#s/gammel/ny/g - Erstatte alle forekomster i en fil: :%s/gammel/ny/g - For å godkjenne hver erstatning, legg til «c»: :%s/gammel/ny/gc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.1: HVORDAN UTFØRE EN EKSTERN KOMMANDO - - - ** Skriv :! etterfulgt av en ekstern kommando for å utføre denne. ** - - 1. Skriv den velkjente kommandoen : for å plassere markøren på bunnen av - skjermen. Dette lar deg skrive en kommandolinjekommando. - - 2. Nå kan du skrive tegnet ! . Dette lar deg utføre en hvilken som helst - ekstern kommando. - - 3. Som et eksempel, skriv ls etter utropstegnet og trykk . Du vil - nå få en liste over filene i katalogen, akkurat som om du hadde kjørt - kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis - «ls» ikke virker. - -MERK: Det er mulig å kjøre alle eksterne kommandoer på denne måten, også med - parametere. - -MERK: Alle «:»-kommandoer må avsluttes med . Fra dette punktet er det - ikke alltid vi nevner det. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.2: MER OM LAGRING AV FILER - - - ** For å lagre endringene gjort i en tekst, skriv :w FILNAVN. ** - - 1. Skriv :!dir eller :!ls for å få en liste over filene i katalogen. Du - vet allerede at du må trykke etter dette. - - 2. Velg et filnavn på en fil som ikke finnes, som for eksempel TEST . - - 3. Skriv :w TEST (der TEST er filnavnet du velger). - - 4. Dette lagrer hele filen (denne innføringen) under navnet TEST . For å - sjekke dette, skriv :!dir eller :!ls igjen for å se innholdet av - katalogen. - -Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim TEST», - ville filen vært en eksakt kopi av innføringen da du lagret den. - - 5. Fjern filen ved å skrive :!rm TEST hvis du er på et Unix-lignende - operativsystem, eller :!del TEST hvis du bruker MS-DOS. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.3: VELGE TEKST SOM SKAL LAGRES - - - ** For å lagre en del av en fil, skriv v bevegelse :w FILNAVN ** - - 1. Flytt markøren til denne linjen. - - 2. Trykk v og flytt markøren til det femte elementet nedenfor. Legg merke - til at teksten blir markert. - - 3. Trykk : (kolon). På bunnen av skjermen vil :'<,'> komme til syne. - - 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller - at du ser :'<,'>w TEST før du trykker Enter. - - 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls - for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. - -MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for - å gjøre det valgte området større eller mindre. Deretter kan du bruke en - operator for å gjøre noe med teksten. For eksempel sletter d teksten. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.4: HENTING OG SAMMENSLÅING AV FILER - - - ** For å lese inn en annen fil inn i nåværende buffer, skriv :r FILNAVN ** - - 1. Plasser markøren like over denne linjen. - -MERK: Etter å ha utført steg 2 vil du se teksten fra leksjon 1.5.3. Gå deretter - NED for å se denne leksjonen igjen. - - 2. Hent TEST-filen ved å bruke kommandoen :r TEST der TEST er navnet på - filen du brukte. Filen du henter blir plassert nedenfor markørlinjen. - - 3. For å sjekke at filen ble hentet, gå tilbake og se at det er to kopier av - leksjon 1.5.3, originalen og denne versjonen. - -MERK: Du kan også lese utdataene av en ekstern kommando. For eksempel, :r !ls - leser utdataene av ls-kommandoen og legger dem nedenfor markøren. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.5 - - - 1. :!kommando utfører en ekstern kommandio. - - Noen nyttige eksempler er: - (MS-DOS) (Unix) - :!dir :!ls - List filene i katalogen. - :!del FILNAVN :!rm FILNAVN - Slett filen FILNAVN. - - 2. :w FILNAVN skriver den nåværende Vim-filen disken med navnet FILNAVN . - - 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen - FILNAVN. - - 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markøren. - - 5. :r !dir leser utdataene fra «dir»-kommandoen og legger dem nedenfor - markørposisjonen. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.1: «ÅPNE LINJE»-KOMMANDOEN - - - ** Skriv o for å «åpne opp» for en ny linje etter markøren og gå til - innsettingsmodus ** - - 1. Flytt markøren til linjen nedenfor merket --->. - - 2. Skriv o (liten o) for å åpne opp en linje NEDENFOR markøren og gå inn i - innsettingsmodus. - - 3. Skriv litt tekst og trykk for å gå ut av innsettingsmodusen. - ----> Etter at o er skrevet blir markøren plassert på den tomme linjen. - - 4. For å åpne en ny linje OVER markøren, trykk rett og slett en stor O - istedenfor en liten o . Prøv dette på linjen nedenfor. - ----> Lag ny linje over denne ved å trykke O mens markøren er på denne linjen. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.2: «LEGG TIL»-KOMMANDOEN - - - ** Skriv a for å legge til tekst ETTER markøren. ** - - 1. Flytt markøren til starten av linjen merket ---> nedenfor. - - 2. Trykk e til markøren er på slutten av «li». - - 3. Trykk a (liten a) for å legge til tekst ETTER markøren. - - 4. Fullfør ordet sånn som på linjen nedenfor. Trykk for å gå ut av - innsettingsmodusen. - - 5. Bruk e for å gå til det neste ufullstendige ordet og repeter steg 3 og - 4. - ----> Denne li lar deg øve på å leg til tek på en linje. ----> Denne linjen lar deg øve på å legge til tekst på en linje. - -Merk: a, i og A går alle til den samme innsettingsmodusen, den eneste - forskjellen er hvor tegnene blir satt inn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.3: EN ANNEN MÅTE Å ERSTATTE PÅ - - - ** Skriv en stor R for å erstatte mer enn ett tegn. ** - - 1. Flytt markøren til den første linjen nedenfor merket --->. Flytt markøren - til begynnelsen av den første «xxx»-en. - - 2. Trykk R og skriv inn tallet som står nedenfor på den andre linjen så - det erstatter xxx. - - 3. Trykk for å gå ut av erstatningsmodusen. Legg merke til at resten - av linjen forblir uforandret. - - 4. Repeter stegene for å erstatte den gjenværende xxx. - ----> Ved å legge 123 til xxx får vi xxx. ----> Ved å legge 123 til 456 får vi 579. - -MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives - erstatter et eksisterende tegn. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.4: KOPIERE OG LIME INN TEKST - - - ** Bruk y-operatoren for å kopiere tekst og p for å lime den inn ** - - 1. Gå til linjen merket ---> nedenfor og plasser markøren etter «a)». - - 2. Gå inn i visuell modus med v og flytt markøren til like før «første». - - 3. Trykk y for å kopiere (engelsk: «yank») den uthevede teksten. - - 4. Flytt markøren til slutten av den neste linjen: j$ - - 5. Trykk p for å lime inn teksten. Trykk deretter: a andre . - - 6. Bruk visuell modus for å velge « valget.», kopier det med y , gå til - slutten av den neste linjen med j$ og legg inn teksten der med p . - ----> a) Dette er det første valget. - b) - -Merk: Du kan også bruke y som en operator; yw kopierer ett ord. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.5: SETT VALG - - - ** Sett et valg så søk eller erstatning ignorerer store/små bokstaver. ** - - 1. Let etter «ignore» ved å skrive: /ignore - Repeter flere ganger ved å trykke n . - - 2. Sett «ic»-valget (Ignore Case) ved å skrive: :set ic - - 3. Søk etter «ignore» igjen ved å trykke n . - Legg merke til at både «Ignore» og «IGNORE» blir funnet. - - 4. Sett «hlsearch»- og «incsearch»-valgene: :set hls is - - 5. Skriv søkekommandoen igjen og se hva som skjer: /ignore - - 6. For å slå av ignorering av store/små bokstaver, skriv: :set noic - -Merk: For å fjerne uthevingen av treff, skriv: :nohlsearch -Merk: Hvis du vil ignorere store/små bokstaver for kun en søkekommando, bruk - \c i uttrykket: /ignore\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.6 - - 1. Trykk o for å legge til en linje NEDENFOR markøren og gå inn i - innsettingsmodus. - Trykk O for å åpne en linje OVER markøren. - - 2. Skriv a for å sette inn tekst ETTER markøren. - Skriv A for å sette inn tekst etter slutten av linjen. - - 3. Kommandoen e går til slutten av et ord. - - 4. Operatoren y («yank») kopierer tekst, p («paste») limer den inn. - - 5. Ved å trykke R går du inn i erstatningsmodus helt til trykkes. - - 6. Skriv «:set xxx» for å sette valget «xxx». Noen valg er: - «ic» «ignorecase» ignorer store/små bokstaver under søk - «is» «incsearch» vis delvise treff for en søketekst - «hls» «hlsearch» uthev alle søketreff - - 7. Legg til «no» foran valget for å slå det av: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.1: FÅ HJELP - - - ** Bruk det innebygde hjelpesystemet. ** - - Vim har et omfattende innebygget hjelpesystem. For å starte det, prøv en av - disse måtene: - - Trykk Hjelp-tasten (hvis du har en) - - Trykk F1-tasten (hvis du har en) - - Skriv :help - - Les teksten i hjelpevinduet for å finne ut hvordan hjelpen virker. - Skriv CTRL-W CTRL-W for å hoppe fra et vindu til et annet - Skriv :q for å lukke hjelpevinduet. - - Du kan få hjelp for omtrent alle temaer om Vim ved å skrive et parameter til - «:help»-kommandoen. Prøv disse (ikke glem å trykke ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.2: LAG ET OPPSTARTSSKRIPT - - - ** Slå på funksjoner i Vim ** - - Vim har mange flere funksjoner enn Vi, men flesteparten av dem er slått av - som standard. For å begynne å bruke flere funksjoner må du lage en - «vimrc»-fil. - - 1. Start redigeringen av «vimrc»-filen. Dette avhenger av systemet ditt: - :e ~/.vimrc for Unix - :e ~/_vimrc for MS Windows - - 2. Les inn eksempelfilen for «vimrc»: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Lagre filen med: - :w - - Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til - alle dine foretrukne oppsett i denne «vimrc»-filen. - For mer informasjon, skriv :help vimrc-intro -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.3: FULLFØRING - - - ** Kommandolinjefullføring med CTRL-D og ** - - 1. Vær sikker på at Vim ikke er i Vi-kompatibel modus: :set nocp - - 2. Se hvilke filer som er i katalogen: :!ls eller :!dir - - 3. Skriv starten på en kommando: :e - - 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med - «e». - - 5. Trykk og Vim vil fullføre kommandonavnet til «:edit». - - 6. Legg til et mellomrom og starten på et eksisterende filnavn: :edit FIL - - 7. Trykk . Vim vil fullføre navnet (hvis det er unikt). - -MERK: Fullføring fungerer for mange kommandoer. Prøv ved å trykke CTRL-D og - . Det er spesielt nyttig for bruk sammen med :help . -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.7 - - - 1. Skriv :help eller trykk eller for å åpne et hjelpevindu. - - 2. Skriv :help kommando for å få hjelp om kommando . - - 3. Trykk CTRL-W CTRL-W for å hoppe til et annet vindu. - - 4. Trykk :q for å lukke hjelpevinduet. - - 5. Opprett et vimrc-oppstartsskript for å lagre favorittvalgene dine. - - 6. Når du skriver en «:»-kommando, trykk CTRL-D for å se mulige - fullføringer. Trykk for å bruke en fullføring. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Her slutter innføringen i Vim. Den var ment som en rask oversikt over - editoren, akkurat nok til å la deg sette i gang med enkel bruk. Den er på - langt nær komplett, da Vim har mange flere kommandoer. Les bruksanvisningen - ved å skrive :help user-manual . - - For videre lesing og studier, kan denne boken anbefales: - «Vim - Vi Improved» av Steve Oualline - Utgiver: New Riders - Den første boken som er fullt og helt dedisert til Vim. Spesielt nyttig for - nybegynnere. Inneholder mange eksempler og illustrasjoner. - Se https://iccf-holland.org/click5.html - - Denne boken er eldre og handler mer om Vi enn Vim, men anbefales også: - «Learning the Vi Editor» av Linda Lamb - Utgiver: O'Reilly & Associates Inc. - Det er en god bok for å få vite omtrent hva som helst om Vi. - Den sjette utgaven inneholder også informasjon om Vim. - - Denne innføringen er skrevet av Michael C. Pierce og Robert K. Ware, - Colorado School of Mines med idéer av Charles Smith, Colorado State - University. E-mail: bware@mines.colorado.edu . - - Modifisert for Vim av Bram Moolenaar. - Oversatt av Øyvind A. Holm. E-mail: vimtutor _AT_ sunbase.org - Id: tutor.no 406 2007-03-18 22:48:36Z sunny - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -vim: set ts=8 : diff --git a/runtime/tutor/tutor1.nl b/runtime/tutor/tutor1.nl index a4c8a12775..a5893241e7 100644 --- a/runtime/tutor/tutor1.nl +++ b/runtime/tutor/tutor1.nl @@ -282,7 +282,7 @@ 2. Met d2w worden twee woorden (in dit voorbeeld in hoofdletters) gewist. 3. Herhaal de stappen 1 en 2 met verschillende tellers om de verschillende - woorden in hoofdletters met ��n commando te wissen. + woorden in hoofdletters met één commando te wissen. ---> deze ABC DE regel FGHI JK LMN OP is QZ RS ontdaan van rommel. @@ -494,7 +494,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.4.2: HET COMMANDO ZOEKEN - ** Met /ZOEK wordt naar de zoekterm (��n of meer woorden) gezocht. ** + ** Met /ZOEK wordt naar de zoekterm (één of meer woorden) gezocht. ** 1. Tik in de opdrachtmodus het teken / . Je ziet dat het met de cursor aan de onderkant van het scherm verschijnt, zoals bij het :-commando. @@ -606,7 +606,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.5.2: MEER OVER HET OPSLAAN VAN BESTANDEN - ** Tik :w BESTANDSNAAM om de tekst m�t veranderingen op te slaan. ** + ** Tik :w BESTANDSNAAM om de tekst mèt veranderingen op te slaan. ** 1. Tik :!dir of :!ls om de inhoud van je map te tonen. Je weet inmiddels dat je daarna een moet tikken. @@ -736,7 +736,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Les 1.6.3: VERVANGEN OP EEN ANDERE MANIER - ** Tik een hoofdletter R om meer dan ��n teken te vervangen. ** + ** Tik een hoofdletter R om meer dan één teken te vervangen. ** 1. Ga naar de eerste regel beneden met --->. Ga met de cursor naar het begin van de eerste "xxx" . @@ -756,15 +756,15 @@ vervangt een bestaand teken. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.6.4: TEKST KOPI�REN EN PLAKKEN + Les 1.6.4: TEKST KOPIËREN EN PLAKKEN - ** Gebruik y om tekst te kopi�ren en p om te plakken. ** + ** Gebruik y om tekst te kopiëren en p om te plakken. ** 1. Ga naar de regel beneden met ---> en zet de cursor achter "a)". 2. Zet zichtbare modus aan met v en zet de cursor juist voor "eerste". - 3. Tik y ('yank') om de opgelichte tekst ("dit is het") te kopi�ren. + 3. Tik y ('yank') om de opgelichte tekst ("dit is het") te kopiëren. 4. Ga met j$ met de cursor naar het einde van de volgende regel. @@ -837,7 +837,7 @@ ** Het gebruik van ingebouwde hulp. ** Vim heeft een uitgebreid ingebouwd hulpsysteem. Probeer, om te beginnen, - ��n van deze drie: + één van deze drie: - druk de toets (als je die hebt) - druk de toets (als je die hebt) - tik :help @@ -939,7 +939,7 @@ & Linda Lamb) bevat ook informatie over Vim. Deze lessen zijn geschreven door Michael C. Pierce en Robert K. Ware, - Colorado School of Mines met gebruikmaking van idee�n van Charles Smith + Colorado School of Mines met gebruikmaking van ideeën van Charles Smith van de Colorado State University. E-mail: bware@mines.colorado.edu. Aangepast voor Vim door Bram Moolenaar. diff --git a/runtime/tutor/tutor1.nl.utf-8 b/runtime/tutor/tutor1.nl.utf-8 deleted file mode 100644 index a5893241e7..0000000000 --- a/runtime/tutor/tutor1.nl.utf-8 +++ /dev/null @@ -1,950 +0,0 @@ - ========================================================================== - = W e l k o m b i j d e V I M l e s s e n - Versie 1.7 = - ========================================================================== - - Vim is een krachtige editor met veel commando's, te veel om uit te leggen - in lessen zoals deze. Deze lessen zijn bedoeld om voldoende commando's te - behandelen om je in staat te stellen met Vim te werken als een editor voor - algemeen gebruik. - - Deze lessen zullen 25 tot 30 minuten in beslag nemen, afhankelijk van de - tijd die wordt besteed aan het uitproberen van de commando's. - - LET OP: - Door de commando's in deze lessen verandert de tekst. Maak een kopie van - dit bestand om mee te oefenen (als je "vimtutor" uitvoerde, is dit al een - kopie). - - Deze lessen zijn bedoeld om al doende te leren. Dat betekent dat je de - commando's moet uitvoeren om ze goed te leren kennen. Als je de tekst - alleen maar doorleest, zal je de commando's niet leren! - - Zorg ervoor dat de toets NIET is ingedrukt en druk vaak genoeg - op de j-toets om de cursor zo te bewegen dat les 1.1.1 volledig op het - scherm staat. - - LET OP: In deze lessen worden omwille van de duidelijkheid vaak spaties - gebruikt binnen een commando (bv. "40 G" of "operator [getal] beweging"). - Tik deze spaties echter NIET. Ze verstoren de werking. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.1.1: VERPLAATS DE CURSOR - - ** De cursor wordt verplaatst met de toetsen h, j, k, l zoals aangegeven. ** - ^ - k Hint: De h is de meest linkse en beweegt naar links. - < h l > De l is de meest rechtse en beweegt naar rechts. - j De j lijkt op een pijl naar beneden. - v - - 1. Beweeg de cursor over het scherm om er vertrouwd mee te raken. - - 2. Druk de omlaag-toets (j) tot hij repeteert. - Nu weet je hoe je de volgende les bereikt. - - 3. Gebruik de omlaag-toets om naar les 1.1.2 te gaan. - - OPMERKING: Als je twijfelt aan wat je tikte, druk om in de opdracht- - modus te komen. Tik daarna het commando dat bedoeld wordt. - - OPMERKING: Pijltjes-toetsen werken ook. Met de hjkl-toetsen kan je sneller - rondbewegen, als je er eenmaal aan gewend bent. Echt waar! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.1.2: VIM AFSLUITEN - - !! LET OP: Lees deze les goed door voordat je iets uitvoert!! - - 1. Druk de toets (om zeker in de opdrachtmodus te zitten). - - 2. Tik :q! - Hiermee wordt de editor afgesloten. Alle veranderingen gaan VERLOREN. - - 3. Nu zie je de shell-prompt. Tik het commando waarmee je deze lessen - hebt opgeroepen. Dat is normaal gesproken: vimtutor - - 4. Als je deze stappen goed hebt doorgelezen, voer dan de stappen 1 tot 3 - uit om de editor te verlaten en weer op te starten. - - LET OP: :q! verwerpt alle veranderingen die je aanbracht. Een paar - lessen verder zal je leren hoe veranderingen worden opgeslagen in - een bestand. - - 5. Beweeg de cursor omlaag naar les 1.1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.1.3: TEKST BEWERKEN - WISSEN - - ** Tik x om het teken onder de cursor te wissen. ** - - 1. Ga met de cursor naar de regel verderop met --->. - - 2. Zet de cursor op een teken dat moet worden gewist om een fout te - herstellen. - - 3. Tik x om het ongewenste teken te wissen. - - 4. Herhaal deze stappen tot de regel goed is. - - ---> Vi kkent eenn opdracccchtmodus en een invooegmmmmodus. - - 5. Nu de regel gecorrigeerd is kan je naar les 1.1.4 gaan. - - LET OP: Probeer de lessen niet uit je hoofd te leren. Leer al doende. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.1.4: TEKST BEWERKEN - INVOEGEN - - ** Tik i ('insert') om tekst in te voegen. ** - - 1. Ga met de cursor naar de eerste regel verderop met --->. - - 2. Maak de eerste regel gelijk aan de tweede. Zet daarvoor de cursor op - het karakter waarvoor tekst moet worden ingevoegd. - - 3. Tik i en daarna de nodige aanvullingen. - - 4. Tik na elke herstelde fout om terug te keren in de opdrachtmodus. - Herhaal de stappen 2 tot 4 om de zin te verbeteren. - - ---> Aan regel ontekt wat . - ---> Aan deze regel ontbreekt wat tekst. - - 5. Ga naar les 1.1.5 als je gewend bent aan het invoegen van tekst. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.1.5: TEKST BEWERKEN - TOEVOEGEN - - ** Tik A ('append') om tekst toe te voegen. ** - - 1. Ga met de cursor naar de eerste regel verderop met --->. - Het maakt niet uit waar de cursor in deze regel staat. - - 2. Tik hoofdletter A en tik de nodige aanvullingen. - - 3. Tik nadat de tekst is aangevuld. Zo keer je terug in de - opdrachtmodus. - - 4. Ga naar de tweede regel verderop met ---> en herhaal stap 2 en 3 - om deze zin te corrigeren. - - ---> Er ontbreekt wat tekst aan de - Er ontbreekt wat tekst aan deze regel. - ---> Hier ontbreekt ook w - Hier ontbreekt ook wat tekst. - - 5. Ga naar les 1.1.6 als je vertrouwd bent geraakt aan het toevoegen - van tekst. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.1.6: EEN BESTAND EDITTEN - - ** Gebruik :wq om een bestand op te slaan en de editor te verlaten. ** - - !! LET OP: Lees deze les helemaal door voordat je een van de volgende - stappen uitvoert!! - - 1. Verlaat deze les zoals je in les 1.1.2 deed: :q! - Of gebruik een andere terminal als je daar de beschikking over hebt. Doe - daar het volgende. - - 2. Tik het volgende commando na de shell-prompt: vim les - 'vim' (vaak ook 'vi') is het commando om de Vim-editor te starten, - 'les' is de naam van het bestand, dat je gaat bewerken. Kies een andere - naam als er al een bestand 'les' bestaat, dat niet veranderd mag worden. - - 3. Voeg naar eigen keus tekst toe, zoals je geleerd hebt in eerdere lessen. - - 4. Sla het bestand met de wijzigingen op en verlaat Vim met :wq - - 5. Herstart vimtutor als je deze bij stap 1 hebt verlaten en ga verder met - de volgende samenvatting. - - 6. Voer deze stappen uit nadat je ze hebt gelezen en begrepen. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SAMENVATTING Les 1.1 - - 1. De cursor wordt bewogen met de pijltjestoetsen of de hjkl-toetsen. - h (links) j (omlaag) k (omhoog) l (rechts) - - 2. Start Vim van de shell-prompt. Tik: vim BESTANDSNAAM - - 3. Sluit Vim af met :q! om de veranderingen weg te gooien. - OF tik :wq om de veranderingen te bewaren. - - 4. Wis het teken onder de cursor met: x - - 5. Invoegen of toevoegen van tekst, tik: - i en daarna de in te voegen tekst voeg in vanaf de cursor - A en daarna de toe te voegen tekst voeg toe achter de regel - - OPMERKING: Met kom je terug in opdrachtmodus en wordt een ongewenst - of gedeeltelijk uitgevoerd commando afgebroken. - - Ga nu verder met les 1.2.1. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.2.1: WIS-COMMANDO'S - - ** Tik dw ('delete word') om een woord te wissen. ** - - 1. Druk op om zeker in de opdrachtmodus te zijn. - - 2. Ga naar de regel hieronder, die met ---> begint. - - 3. Ga met de cursor naar het begin van een woord dat moet worden gewist. - - 4. Met het tikken van dw verdwijnt het woord. - - OPMERKING: De letter d verschijnt op de laatste regel van het scherm - zodra je hem tikt. Vim is aan het wachten tot je de w tikt. - Als je een ander teken dan d ziet, heb je iets verkeerds - getikt. Druk op en begin opnieuw. - - NOG EEN OPMERKING: Dit werkt alleen als de optie 'showcmd' is ingeschakeld. - Dat gebeurt met :set showcmd - - ---> Er zijn een het paar ggg woorden, die niet in deze len zin thuishoren. - - 5. Herhaal de stappen 3 en 4 tot de zin goed is en ga naar les 1.2.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.2.2: MEER WIS-COMMANDO'S - - ** Tik d$ om te wissen tot het einde van de regel. ** - - 1. Druk op om zeker in de opdrachtmodus te zijn. - - 2. Ga naar de regel hieronder, die met ---> begint. - - 3. Ga met de cursor naar het einde van de correcte regel (NA de eerste . ). - - 4. Tik d$ om te wissen tot het einde van de regel. - - ---> Iemand heeft het einde van deze regel dubbel getikt. dubbel getikt. - - 5. Ga naar les 1.2.3 voor uitleg. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.2.3: OVER OPERATOREN EN BEWEGINGEN - - Veel commando's die de tekst veranderen, bestaan uit een operator en een - beweging. De samenstelling van een wis-commando met de operator d is: - d beweging - - Daarbij is: - d - de wis-operator - beweging - het bereik waarop de operator werkt (zie het lijstje hieronder) - - Een korte lijst van bewegingen vanaf de cursor: - w - tot het begin van het volgende woord, ZONDER het eerste teken daarvan. - e - tot het einde van het huidige woord, INCLUSIEF het laatste teken. - $ - tot het einde van de regel, INCLUSIEF het laatste teken. - - Het tikken van de wist tekst vanaf de cursor tot het eind van het woord. - - OPMERKING: Het intikken van alleen maar de beweging, zonder een operator, - in de opdrachtmodus beweegt de cursor (respectievelijk naar het - volgende woord, naar het eind van het huidige woord en naar het - eind van de regel). - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.2.4: GEBRUIK VAN EEN TELLER BIJ EEN BEWEGING - - ** Een getal voor een beweging herhaalt het zoveel keer. ** - - 1. Ga naar de regel hieronder, die met ---> begint. - - 2. Tik 2w zodat de cursor twee woorden vooruit gaat. - - 3. Tik 3e zodat de cursor naar het einde van het derde woord gaat. - - 4. Tik 0 (nul) om naar het begin van de regel te gaan. - - 5. Herhaal de stappen 2 en 3 met andere getallen. - - ---> Dit is een regel met woorden waarin je heen en weer kan bewegen. - - 6. Ga verder met les 1.2.5. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.2.5: GEBRUIK EEN TELLER OM MEER TE WISSEN - - ** Een getal met een operator zorgt dat deze zoveel keer wordt herhaald. ** - - Bij de combinatie van wis-operator en beweging kan je voor de beweging een - teller zetten om meer te wissen: - d [teller] beweging - - 1. Ga naar het eerste woord in HOOFDLETTERS in de regel na --->. - - 2. Met d2w worden twee woorden (in dit voorbeeld in hoofdletters) gewist. - - 3. Herhaal de stappen 1 en 2 met verschillende tellers om de verschillende - woorden in hoofdletters met één commando te wissen. - - ---> deze ABC DE regel FGHI JK LMN OP is QZ RS ontdaan van rommel. - - OPMERKING: De teller kan ook aan het begin staan: d2w en 2dw werken allebei. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.2.6: BEWERKING VAN HELE REGELS - - ** Tik dd om een hele regel te wissen. ** - - Omdat het wissen van een hele regel vaak voorkomt, besloten de ontwerpers - van Vi dat met het tikken van dd simpelweg een hele regel gewist wordt. - - 1. Ga met de cursor naar de tweede regel van de zinnetjes hieronder. - - 2. Tik dd om de regel te wissen. - - 3. Ga nu naar de vierde regel. - - 4. Tik 2dd om twee regels te wissen. - - ---> 1) Rozen zijn rood. - ---> 2) Modder is leuk. - ---> 3) Viooltjes zijn blauw. - ---> 4) Ik heb een auto. - ---> 5) De klok slaat de tijd. - ---> 6) Suiker is zoet. - ---> 7) En dat ben jij ook. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.2.7: HET COMMANDO HERSTEL - - ** u maakt het laatste commando ongedaan, U herstelt een hele regel. ** - - 1. Ga met de cursor naar de regel hieronder met ---> en zet hem - op de eerste fout. - - 2. Tik x om het eerste ongewenste teken te wissen. - - 3. Tik nu u en maak daarmee het vorige commando ongedaan. - - 4. Herstel nu alle fouten in de regel met het x commando. - - 5. Tik een hoofdletter U om de regel in z'n oorspronkelijke staat terug - te brengen. - - 6. Tik nu een paar keer u en herstel daarmee de U en eerdere commando's. - - 7. Tik nu een paar keer CTRL-R (Ctrl-toets ingedrukt houden en R tikken) en - voer daarmee de commando's opnieuw uit: 'redo' oftewel 'undo de undo's'. - - ---> Heerstel de fouten inn deeze regel en brenng ze weer terugg met undo. - - 8. Dit zijn heel nuttige commando's. Ga verder met samenvatting van les 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SAMENVATTING Les 1.2 - - 1. Wis van de cursor tot het volgende woord met dw - - 2. Wis van de cursor tot het eind van de regel met d$ - - 3. Wis de hele regel met dd - - 4. Herhaal een beweging door er een getal voor te zetten: 2w - - 5. De opbouw van een wijzigingscommando is: - operator [getal] beweging - daarbij is: - operator - wat er moet gebeuren, bijvoorbeeld d om te wissen - [getal] - een (niet-verplichte) teller om 'beweging' te herhalen - beweging - een beweging door de te wijzigen tekst zoals w (woord) - of $ (tot het einde van de regel) enz. - - 6. Ga naar het begin van de regel met nul: 0 - - 7. Undo de voorgaande actie met u (kleine letter) - Undo alle veranderingen in een regel met U (hoofdletter) - Undo de undo's met CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.3.1: HET COMMANDO PLAK - - ** Tik p ('put') en plak daarmee zojuist gewiste tekst na de cursor. ** - - 1. Ga met de cursor naar de eerste regel met ---> hierna. - - 2. Wis de regel met dd en bewaar hem zodoende in een Vim-register. - - 3. Ga naar de c-regel, waar de gewiste regel ONDER moet komen. - - 4. Tik p om de regel terug te zetten onder de regel met de cursor. - - 5. Herhaal de stappen 2 tot 4 om de regels in de goede volgorde te zetten. - ----> d) Krijg je het ook onder de knie? ----> b) Viooltjes zijn blauw, ----> c) Begrip is te leren, ----> a) Rozen zijn rood, - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.3.2: HET COMMANDO VERVANG - - ** Tik rx ('replace') om het teken onder de cursor te vervangen door x. ** - - 1. Ga naar de eerste regel hieronder met --->. - - 2. Zet de cursor op de eerste fout. - - 3. Tik r en dan het teken dat er hoort te staan. - - 4. Herhaal de stappen 2 en 3 tot de eerste regel gelijk is aan de tweede. - - ---> Bij het tokken van dezf hegel heeft iemamd verklerde letters getikt. - ---> Bij het tikken van deze regel heeft iemand verkeerde letters getikt. - - 5. Ga nu naar les 1.3.3. - - LET OP: Door het te doen, leer je beter dan door het uit je hoofd te leren. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.3.3: HET COMMANDO VERANDER - - ** Tik ce om te veranderen tot het einde van een woord. ** - - 1. Ga met de cursor naar de eerste regel hieronder met --->. - - 2. Zet de cursor op de u van ruch. - - 3. Tik ce en de juiste letters (in dit geval "egel"). - - 4. Druk en ga naar het volgende teken dat moet worden veranderd. - - 5. Herhaal de stappen 3 en 4 tot de eerste regel gelijk is aan de tweede. - - ---> In deze ruch staan een paar weedrim die veranderd moud worden. - ---> In deze regel staan een paar woorden die veranderd moeten worden. - - LET OP: Met ce wordt (het laatste deel van) een woord gewist en kom je - in de invoegmodus. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.3.4: MEER VERANDERINGEN MET c - - 1. Het commando verander ('change') werkt op dezelfde manier als wis. De - opbouw is: - c [teller] beweging - - 2. De bewegingen zijn hetzelfde, zoals w (woord) en $ (einde regel). - - 3. Ga naar de eerste regel hieronder met --->. - - 4. Zet de cursor op de eerste fout. - - 5. Tik c$ en tik de rest van de regel zodat hij gelijk wordt aan de - tweede en sluit af met . - - ---> Het einde van deze regel moet precies zo worden als de tweede regel. - ---> Het einde van deze regel moet gecorrigeerd worden met het commando c$. - - OPMERKING: Je kan de toets gebruiken om tikfouten te herstellen. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SAMENVATTING Les 1.3 - - 1. Tik p om tekst terug te plakken, die zojuist is gewist. Dit zet de - gewiste tekst ACHTER de cursor (als een hele regel is gewist komt deze - op de regel ONDER de cursor. - - 2. Het teken waarop de cursor staat wordt vervangen met r gevolgd door - het teken dat je daar wilt hebben. - - 3. Het commando 'verander' stelt je in staat om tekst te veranderen vanaf - de cursor tot waar de 'beweging' je brengt. Dat wil zeggen: tik ce om - te veranderen vanaf de cursor tot het einde van het woord, c$ om te - veranderen tot het einde van de regel. - - 4. De opbouw van het commando verander is: - c [teller] beweging - - Ga nu naar de volgende les. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.4.1: PLAATS VAN DE CURSOR EN STATUS VAN HET BESTAND - - ** CTRL-G laat zien waar (regelnummer) je je bevindt en wat de status van - het bestand is. Met [nummer] G ga je naar een bepaalde regel. ** - - LET OP: Lees de hele les voordat je een stap uitvoert!! - - 1. Hou de Ctrl-toets ingedrukt en tik g . Dit noemen we CTRL-G. - Onderaan de pagina verschijnt een boodschap met de bestandsnaam en de - positie in het bestand. Onthou het regelnummer voor stap 3. - - OPMERKING: Als de optie 'ruler' aan staat, wordt de positie van de cursor - (regelnummer, kolom) steeds in de rechter-onderhoek van het - scherm vermeld. In dit geval vermeldt CTRL-G geen regelnummer. - CTRL-G geeft ook de status aan, namelijk of de tekst veranderd - is ('modified') sinds het de laatste keer is opgeslagen. - - 2. Tik hoofdletter G om naar het einde van het bestand te gaan. - Tik gg om naar het begin van het bestand te gaan. - - 3. Tik het regelnummer waar je bij stap 1 was en daarna G . Dit brengt je - terug naar de regel waar je was toen je de eerste keer CTRL-G tikte. - - 4. Voer de stappen 1 tot 3 uit als je dit goed hebt gelezen. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.4.2: HET COMMANDO ZOEKEN - - ** Met /ZOEK wordt naar de zoekterm (één of meer woorden) gezocht. ** - - 1. Tik in de opdrachtmodus het teken / . Je ziet dat het met de cursor - aan de onderkant van het scherm verschijnt, zoals bij het :-commando. - - 2. Tik nu 'ffouut' . Dit is het woord waarnaar gezocht wordt. - - 3. Tik n om verder te zoeken met dezelfde zoekterm. - Zoek met N met dezelfde zoekterm in de tegenovergestelde richting. - - 4. Zoek in achterwaartse richting met ?zoekterm in plaats van / . - - 5. Keer terug naar de vorige hit met CTRL-O (hou Ctrl-toets ingedrukt en - tik letter o). Herhaal om verder terug te gaan. CTRL-I gaat vooruit. - - ---> "ffouut" is niet de juiste spelling van fout, ffouut is een fout. - - OPMERKING: Als zoeken het einde van het bestand bereikt, wordt vanaf het - begin doorgezocht, tenzij de optie 'wrapscan' is uitgeschakeld. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.4.3: GA NAAR CORRESPONDERENDE HAAKJES - - ** Tik % om naar corresponderende ), ] of } te gaan. ** - - 1. Zet de cursor op een (, [ of { in de regel hieronder met --->. - - 2. Tik dan het teken % . - - 3. De cursor gaan naar het overeenkomstige haakje. - - 4. Met opnieuw % gaat de cursor terug naar het eerste haakje. - - 5. Plaats de cursor op een ander haakje en bekijk wat % doet. - - ---> Dit ( is een testregel met ('s, ['s ] en {'s } erin. )) - - OPMERKING: Dit is nuttig bij het debuggen van een programma waarin haakjes - niet corresponderen. Met de optie 'showmatch' wordt ook - aangegeven of haakjes corresponderen, maar de cursor wordt niet - (blijvend) verplaatst. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.4.4: HET VERVANG COMMANDO - - ** Tik :s/oud/nieuw/g om 'oud' door 'nieuw' te vervangen. ** - - 1. Ga met de cursor naar de regel hieronder met --->. - - 2. Tik :s/dee/de . Zoals je ziet, vervangt ('substitute') dit - commando alleen de eerste "dee" in de regel. - - 3. Tik nu :s/dee/de/g . Met de g-vlag ('global') wordt elke "dee" in de - regel vervangen. - - ---> dee beste tijd om dee bloemen te zien is in dee lente. - - 4. Om in (een deel van) een tekst elk 'oud' te vervangen door 'nieuw': - tik :#,#s/oud/nieuw/g waar #,# de regelnummers zijn die het gebied - begrenzen waarin wordt vervangen. - tik :%s/oud/nieuw/g om alles te vervangen in het hele bestand. - tik :%s/oud/nieuw/gc om elke 'oud' in het hele bestand te vinden - en te vragen of er vervangen moet worden. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SAMENVATTING Les 1.4 - - 1. CTRL-G laat positie in het bestand zien en de status van het bestand. - G verplaatst je naar het einde van het bestand. - nummer G verplaatst je naar regelnummer. - gg verplaatst je naar de eerste regel. - - 2. Met / en een zoekterm wordt VOORWAARTS gezocht naar de term. - Met ? en een zoekterm wordt ACHTERWAARTS gezocht naar de term. - Tik n na een zoekopdracht om de volgende hit te vinden, - of tik N om in de andere richting te zoeken. - CTRL-O brengt je naar eerdere hit, CTRL-I naar nieuwere. - - 3. Tik % terwijl de cursor op een haakje ([{}]) staat, om naar het - corresponderende haakje te gaan. - - 4. :s/oud/nieuw vervangt het eerste 'oud' in een regel door 'nieuw'. - :s/oud/nieuw/g vervangt elk 'oud' in een regel door 'nieuw'. - :#,#s/oud/nieuw/g vervangt elk 'oud' door 'nieuw' tussen de regelnummers. - :%s/oud/nieuw/g vervangt elk 'oud' door 'nieuw' in het hele bestand. - Voeg c toe (:%s/oud/nieuw/gc) om elke keer om bevestiging - ('confirmation') te vragen. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.5.1: HOE EEN EXTERN COMMANDO WORDT UITGEVOERD - - ** Tik :! gevolgd door een extern commando om dat uit te voeren. ** - - 1. Tik het commando : waarmee de cursor op de onderste regel van het - scherm komt te staan. Nu kan je een opdracht geven via de commando-regel. - - 2. Tik een ! (uitroepteken). Dit stelt je in staat om elk shell-commando - uit te voeren. - - 3. Tik bijvoorbeeld ls na het uitroepteken en daarna . Hiermee - krijg je de inhoud van je map te zien, net alsof je de opdracht gaf - vanaf de shell-prompt. Probeer :!dir als het niet werkt. - - OPMERKING: Elk extern commando kan op deze manier uitgevoerd worden, ook - met argumenten. - - OPMERKING: Alle commando's na : moeten worden afgesloten met . - Vanaf nu zullen we dat niet meer altijd vermelden. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.5.2: MEER OVER HET OPSLAAN VAN BESTANDEN - - ** Tik :w BESTANDSNAAM om de tekst mèt veranderingen op te slaan. ** - - 1. Tik :!dir of :!ls om de inhoud van je map te tonen. Je weet - inmiddels dat je daarna een moet tikken. - - 2. Kies een bestandsnaam die nog niet bestaat, bijvoorbeeld TEST. - - 3. Tik nu: :w TEST (als je de naam TEST hebt gekozen). - - 4. Hierdoor wordt het hele bestand (de VIM lessen) opgeslagen onder de - naam TEST. Tik weer :!dir of :!ls om dit te controleren. - - OPMERKING: Als je Vim zou verlaten en opnieuw zou starten met vim TEST is - het bestand een exacte kopie van de lessen, zoals je ze opsloeg. - - 5. Wis het bestand nu met de opdracht (MS-DOS) :!del TEST - of (Unix) :!rm TEST - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.5.3: EEN DEEL VAN DE TEKST OPSLAAN - - ** Sla een deel van het bestand op met v beweging :w BESTANDSNAAM ** - - 1. Ga naar deze regel. - - 2. Tik v en ga met de cursor naar stap 5 hieronder. Je ziet dat de - tekst oplicht. - - 3. Tik : . Onderaan het scherm zal :'<,'> verschijnen. - - 4. Tik w TEST , waar TEST een bestandsnaam is, die nog niet bestaat. - Controleer dat je :'<,'>w TEST ziet staan voordat je tikt. - - 5. Vim slaat nu de geselecteerde regels op in het bestand TEST. Met - :!dir of !ls kan je dat zien. Wis het nog niet! We zullen het in - de volgende les gebruiken. - - OPMERKING: Het tikken van v zet zichtbare modus ('visual selection') aan. - Je kan de cursor rondbewegen om de selectie groter of kleiner - te maken. Vervolgens kan je een commando gebruiken om iets met - de tekst te doen. Met d bijvoorbeeld wis je de tekst. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.5.4: OPHALEN EN SAMENVOEGEN VAN BESTANDEN - - ** Tik :r BESTANDSNAAM om de inhoud van een bestand in te voegen. ** - - 1. Zet de cursor precies boven deze regel. - - OPMERKING: Na het uitvoeren van stap 2 zie je tekst van les 1.5.3. Scrol - daarna naar beneden om deze les weer te zien. - - 2. Haal nu het bestand TEST op met het commando :r TEST . - Het bestand dat je ophaalt komt onder de regel waarin de cursor staat. - - 3. Controleer dat er een bestand is opgehaald. Ga met de cursor omhoog. - Dan zie je de tekst van les 1.5.3 dubbel, het origineel en de versie uit - het bestand. - - OPMERKING: Je kan ook de uitvoer van een extern commando inlezen. Om een - voorbeeld te geven: :r !ls leest de uitvoer van het commando - ls en zet dat onder de regel waarin de cursor staat. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SAMENVATTING Les 1.5 - - 1. :!COMMANDO voert een extern commando uit. - Enkele bruikbare voorbeelden zijn: - (MS-DOS) (Unix) - :!dir :!ls - laat de inhoud van een map zien - :!del BESTAND :!rm BESTAND - wist bestand BESTAND - - 2. :w BESTANDSNAAM schrijft het huidige Vim-bestand naar disk met de - naam BESTANDSNAAM. - - 3. v beweging :w BESTANDSNAAM laat je in zichtbare modus een fragment - selecteren, dat wordt opgeslagen in het bestand BESTANDSNAAM. - - 4. :r BESTANDSNAAM haalt het bestand BESTANDSNAAM op en voegt het onder - de cursor-positie in de tekst in. - - 5. :r !dir leest de uitvoer van het externe commando dir en zet het onder - de cursor-positie. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.6.1: HET COMMANDO OPEN - - ** Tik o om een regel onder de cursor te openen in invoegmodus. ** - - 1. Ga naar de eerste regel beneden met --->. - - 2. Tik de kleine letter o en open daarmee een regel ONDER de cursor en - ga naar de invoegmodus. - - 3. Tik wat tekst in en sluit af met om de invoegmodus te verlaten. - - ---> Als je o tikt, komt de cursor in een nieuwe regel in invoegmodus. - - 4. Om een regel BOVEN de cursor te openen, moet je gewoon een hoofdletter - O tikken in plaats van een kleine letter. Probeer dat vanaf de volgende - regel. - - ---> Open een regel hierboven. Tik een O terwijl de cursor hier staat. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.6.2: HET COMMANDO TOEVOEGEN - - ** Tik a om tekst toe te voegen ACHTER de cursor. ** - - 1. Ga naar het begin van de regel beneden met --->. - - 2. Tik e tot de cursor op het einde van "ste" staat. - - 3. Tik een (kleine letter) a ('append') om toe te voegen ACHTER de cursor. - - 4. Vul het woord aan zoals in de volgende regel. Druk om de - invoegmodus te verlaten. - - 5. Ga met e naar het einde van het volgende onvolledige woord en herhaal - de stappen 3 en 4. - - ---> Deze regel ste je in staat om te oef in het toevo van tekst. - Deze regel stelt je in staat om te oefenen in het toevoegen van tekst. - - OPMERKING: a, i en A openen allemaal dezelfde invoegmodus, het enige - verschil is waar tekens worden ingevoegd. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.6.3: VERVANGEN OP EEN ANDERE MANIER - - ** Tik een hoofdletter R om meer dan één teken te vervangen. ** - - 1. Ga naar de eerste regel beneden met --->. Ga met de cursor naar het - begin van de eerste "xxx" . - - 2. Tik nu R en daarna het getal eronder in de tweede regel, zodat xxx - wordt vervangen. - - 3. Druk om de vervangmodus te verlaten. Je ziet dat de rest van de - regel ongewijzigd blijft. - - 4. Herhaal de stappen om de overgebleven xxx te vervangen. - - ---> Optellen van 123 en xxx geeft je xxx. - ---> Optellen van 123 en 456 geeft je 579. - - OPMERKING: Vervangmodus lijkt op invoegmodus, maar elk teken dat je tikt, - vervangt een bestaand teken. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.6.4: TEKST KOPIËREN EN PLAKKEN - - ** Gebruik y om tekst te kopiëren en p om te plakken. ** - - 1. Ga naar de regel beneden met ---> en zet de cursor achter "a)". - - 2. Zet zichtbare modus aan met v en zet de cursor juist voor "eerste". - - 3. Tik y ('yank') om de opgelichte tekst ("dit is het") te kopiëren. - - 4. Ga met j$ met de cursor naar het einde van de volgende regel. - - 5. Plak de gekopieerde tekst met p en tik a tweede . - - 6. Selecteer in zichtbare modus "onderdeel", kopieer het met y en - ga met j$ naar het einde van de tweede regel. Plak de tekst daar - met p . - - ---> a) dit is het eerste onderdeel - b) - - OPMERKING: Je kan y ook als operator gebruiken; yw kopieert een woord, - yy een hele regel. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.6.5: OPTIES GEBRUIKEN - - ** Gebruik een optie voor al dan niet hoofdlettergevoelig zoeken. ** - - 1. Zoek naar 'hoofdlettergevoelig' met /hoofdlettergevoelig - Herhaal het zoeken enkele keren door n te tikken. - - 2. Schakel de optie 'ic' ('ignore case', niet-hoofdlettergevoelig) in - met :set ic - - 3. Zoek met n opnieuw naar 'hoofdlettergevoelig'. Je ziet dat - Hoofdlettergevoelig en HOOFDLETTERGEVOELIG nu ook gevonden worden. - - 4. Schakel de opties 'hlsearch' (treffers oplichten) en 'incsearch' (toon - gedeeltelijke treffers bij intikken) in met :set hls is - - 5. Tik weer /hoofdlettergevoelig en kijk wat er gebeurt. - - 6. Schakel 'hoofdlettergevoelig' weer in met :set noic - - OPMERKING: Schakel het oplichten van treffers uit met :nohlsearch - - OPMERKING: Om bij een enkel zoek-commando de hoofdlettergevoeligheid om - te draaien kan \c worden gebruikt na de zoekterm: - /hoofdlettergevoelig\c . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SAMENVATTING Les 1.6 - - 1. Tik o om een regel te openen ONDER de cursor en invoegmodus te starten. - Tik O om een regel te openen BOVEN de cursor. - - 2. Tik a om tekst toe te voegen NA de cursor. - Tik A om tekst toe te voegen aan het einde van de regel. - - 3. Het commando e beweegt de cursor naar het einde van een woord. - - 4. De operator y yankt (kopieert) tekst, p zet het terug (plakt). - - 5. Met hoofdletter R wordt de vervangmodus geopend, met afgesloten. - - 6. Met :set xxx wordt optie 'xxx' ingeschakeld. Opties zijn bijvoorbeeld: - ic ignorecase geen verschil hoofdletters/kleine letters bij zoeken - is incsearch toon gedeeltelijke treffers tijdens intikken zoekterm - hls hlsearch laat alle treffers oplichten - Je kan zowel de lange als de korte naam van een optie gebruiken. - - 7. Zet 'no' voor de naam om een optie uit te schakelen: :set noic - schakelt 'ic' uit. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.7.1: HULP INROEPEN - - ** Het gebruik van ingebouwde hulp. ** - - Vim heeft een uitgebreid ingebouwd hulpsysteem. Probeer, om te beginnen, - één van deze drie: - - druk de toets (als je die hebt) - - druk de toets (als je die hebt) - - tik :help - - Lees de tekst in het help-venster om te leren hoe 'help' werkt. - Tik CTRL-W CTRL-W om van het ene venster naar het andere te gaan. - Met :q wordt het help-venster gesloten. - - Je kan hulp vinden over nagenoeg elk onderwerp door een argument aan het - commando :help toe te voegen. Probeer deze (en vergeet niet): - :help w - :help c_CTRL-D - :help insert-index - :help user-manual - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.7.2: SCHRIJF EEN CONFIGURATIEBESTAND - - ** Mogelijkheden van Vim uitbreiden. ** - - Vim kent veel meer mogelijkheden dan Vi, maar de meeste zijn standaard - uitgeschakeld. Om meer functies te gebruiken moet je een 'vimrc'-bestand - schrijven. - - 1. Bewerk het bestand 'vimrc'. Hoe dat moet hangt af van je systeem: - :e ~/.vimrc voor Unix - :e ~/_vimrc voor MS-Windows - - 2. Lees de inhoud van het voorbeeld-bestand: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Sla het bestand op met :w - - De volgende keer dat je Vim start wordt 'syntaxiskleuring' gebruiken. - Je kan al je voorkeursinstellingen toevoegen aan dit 'vimrc'-bestand. - Tik :help vimrc-intro voor meer informatie. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Les 1.7.3: AANVULLEN - - ** Aanvullen van de 'command line' met CTRL-D en . ** - - 1. Zorg dat Vim niet in 'compatible mode' is met :set nocp - - 2. Kijk welke bestanden zich in de map bevinden met :!ls of :!dir - - 3. Tik het begin van een commando: :e - - 4. Met CTRL-D toont Vim een lijst commando's, die met "e" beginnen. - - 5. Druk enkele keren . Vim laat aanvullingen zien, zoals ":edit", - dat we hier gebruiken. - - 6. Voeg een spatie toe en de eerste letter(s) van een bestaande - bestandsnaam: :edit BESTAND - - 7. Druk . Vim vult de naam aan (als hij uniek is). - - OPMERKING: Aanvullen werkt bij tal van commando's. Probeer gewoon CTRL-D - en . Het is bijzonder nuttig bij :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - SAMENVATTING Les 1.7 - - 1. Tik :help of druk of om een help-venster te openen. - - 2. Tik :help CMD voor hulp over CMD . - - 3. Tik CTRL-W CTRL-W om naar een ander venster te gaan. - - 4. Tik :q om het help-venster te sluiten. - - 5. Maak een bestand met de naam 'vimrc' voor je voorkeursinstellingen. - - 6. Druk CTRL-D tijdens het intikken van een :-commando om mogelijke - aanvullingen te zien. Druk om aanvullen te gebruiken. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Hiermee komen de Vim-lessen tot een einde. Ze waren bedoeld om een kort - overzicht te geven van de Vim-editor, juist voldoende om de editor - redelijk makkelijk te gebruiken. Deze lessen zijn verre van volledig. Vim - kent veel meer commando's. Lees hierna de handleiding voor gebruikers: - ":help user-manual". - - Voor verdere studie wordt aanbevolen: - Vim - Vi Improved - door Steve Oualline - Uitgever: New Riders - Dit is het eerste boek dat geheel aan Vim is gewijd. Speciaal geschikt - voor beginners. Met veel voorbeelden en afbeeldingen. - Zie https://iccf-holland.org/click5.html - - Het volgende boek is ouder en gaat meer over Vi dan Vim, maar het wordt - toch aanbevolen: - Learning the Vi Editor - door Linda Lamb - Uitgever: O'Reilly & Associates Inc. - Het is een goed boek om nagenoeg alles te weten te komen dat je met Vi - zou willen doen. De zesde en vooral de nieuwe zevende druk (onder de - titel Learning the Vi and Vim Editors door Arnold Robbins, Elbert Hannah - & Linda Lamb) bevat ook informatie over Vim. - - Deze lessen zijn geschreven door Michael C. Pierce en Robert K. Ware, - Colorado School of Mines met gebruikmaking van ideeën van Charles Smith - van de Colorado State University. E-mail: bware@mines.colorado.edu. - - Aangepast voor Vim door Bram Moolenaar. - - Nederlandse vertaling door Rob Bishoff, april 2012 - e-mail: rob.bishoff@hccnet.nl) - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.no b/runtime/tutor/tutor1.no index a6be694792..4459f17b66 100644 --- a/runtime/tutor/tutor1.no +++ b/runtime/tutor/tutor1.no @@ -1,115 +1,115 @@ =============================================================================== -= V e l k o m m e n t i l i n n f � r i n g e n i V i m -- Ver. 1.7 = += V e l k o m m e n t i l i n n f ø r i n g e n i V i m -- Ver. 1.7 = =============================================================================== - Vim er en meget kraftig editor med mange kommandoer, alt for mange til � - kunne g� gjennom alle i en innf�ring som denne. Den er beregnet p� � - sette deg inn i bruken av nok kommandoer s� du vil v�re i stand til lett - � kunne bruke Vim som en editor til alle form�l. + Vim er en meget kraftig editor med mange kommandoer, alt for mange til å + kunne gå gjennom alle i en innføring som denne. Den er beregnet på å + sette deg inn i bruken av nok kommandoer så du vil være i stand til lett + å kunne bruke Vim som en editor til alle formål. - Tiden som kreves for � g� gjennom denne innf�ringen tar ca. 25-30 + Tiden som kreves for å gå gjennom denne innføringen tar ca. 25-30 minutter, avhengig av hvor mye tid du bruker til eksperimentering. MERK: Kommandoene i leksjonene vil modifisere teksten. Lag en kopi av denne - filen som du kan �ve deg p� (hvis du kj�rte �vimtutor�-kommandoen, er + filen som du kan øve deg på (hvis du kjørte «vimtutor»-kommandoen, er dette allerede en kopi). - Det er viktig � huske at denne innf�ringen er beregnet p� l�ring gjennom - bruk. Det betyr at du m� utf�re kommandoene for � l�re dem skikkelig. + Det er viktig å huske at denne innføringen er beregnet på læring gjennom + bruk. Det betyr at du må utføre kommandoene for å lære dem skikkelig. Hvis du bare leser teksten, vil du glemme kommandoene! - F�rst av alt, sjekk at �Caps Lock� IKKE er aktiv og trykk �j�-tasten for - � flytte mark�ren helt til leksjon 1.1.1 fyller skjermen. + Først av alt, sjekk at «Caps Lock» IKKE er aktiv og trykk «j»-tasten for + å flytte markøren helt til leksjon 1.1.1 fyller skjermen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.1: FLYTTING AV MARK�REN + Leksjon 1.1.1: FLYTTING AV MARKØREN - ** For � flytte mark�ren, trykk tastene h, j, k, l som vist. ** + ** For å flytte markøren, trykk tastene h, j, k, l som vist. ** ^ k Tips: h-tasten er til venstre og flytter til venstre. - < h l > l-tasten er til h�yre og flytter til h�yre. + < h l > l-tasten er til høyre og flytter til høyre. j j-tasten ser ut som en pil som peker nedover. v - 1. Flytt mark�ren rundt p� skjermen til du har f�tt det inn i fingrene. + 1. Flytt markøren rundt på skjermen til du har fått det inn i fingrene. 2. Hold inne nedovertasten (j) til den repeterer. - N� vet du hvordan du beveger deg til neste leksjon. + Nå vet du hvordan du beveger deg til neste leksjon. - 3. G� til leksjon 1.1.2 ved hjelp av nedovertasten. + 3. Gå til leksjon 1.1.2 ved hjelp av nedovertasten. -Merk: Hvis du blir usikker p� noe du har skrevet, trykk for � g� til - normalmodus. Skriv deretter kommandoen du �nsket p� nytt. +Merk: Hvis du blir usikker på noe du har skrevet, trykk for å gå til + normalmodus. Skriv deretter kommandoen du ønsket på nytt. -Merk: Piltastene skal ogs� virke. Men ved � bruke hjkl vil du v�re i stand til - � bevege mark�ren mye raskere n�r du er blitt vant til det. Helt sant! +Merk: Piltastene skal også virke. Men ved å bruke hjkl vil du være i stand til + å bevege markøren mye raskere når du er blitt vant til det. Helt sant! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1.2: AVSLUTTE VIM - !! MERK: F�r du utf�rer noen av punktene nedenfor, les hele leksjonen!! + !! MERK: Før du utfører noen av punktene nedenfor, les hele leksjonen!! - 1. Trykk -tasten (for � forsikre deg om at du er i normalmodus). + 1. Trykk -tasten (for å forsikre deg om at du er i normalmodus). 2. Skriv: :q! . Dette avslutter editoren og FORKASTER alle forandringer som du har gjort. - 3. N�r du ser kommandolinjen i skallet, skriv kommandoen som startet denne - innf�ringen. Den er: vimtutor + 3. Når du ser kommandolinjen i skallet, skriv kommandoen som startet denne + innføringen. Den er: vimtutor - 4. Hvis du er sikker p� at du husker dette, utf�r punktene 1 til 3 for � - avslutte og starte editoren p� nytt. + 4. Hvis du er sikker på at du husker dette, utfør punktene 1 til 3 for å + avslutte og starte editoren på nytt. -MERK: :q! forkaster alle forandringer som du gjorde. I l�pet av noen - f� leksjoner vil du l�re hvordan du lagrer forandringene til en fil. +MERK: :q! forkaster alle forandringer som du gjorde. I løpet av noen + få leksjoner vil du lære hvordan du lagrer forandringene til en fil. - 5. Flytt mark�ren ned til leksjon 1.1.3. + 5. Flytt markøren ned til leksjon 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1.3: REDIGERING AV TEKST -- SLETTING - ** Trykk x for � slette tegnet under mark�ren. ** + ** Trykk x for å slette tegnet under markøren. ** - 1. Flytt mark�ren til den f�rste linjen merket med --->. + 1. Flytt markøren til den første linjen merket med --->. - 2. For � ordne feilene p� linjen, flytt mark�ren til den er opp� tegnet som + 2. For å ordne feilene på linjen, flytt markøren til den er oppå tegnet som skal slettes. - 3. Trykk tasten x for � slette det u�nskede tegnet. + 3. Trykk tasten x for å slette det uønskede tegnet. 4. Repeter punkt 2 til 4 til setningen er lik den som er under. ----> Hessstennnn brrr�snudddde ii gaaata. ----> Hesten br�snudde i gata. +---> Hessstennnn brrråsnudddde ii gaaata. +---> Hesten bråsnudde i gata. - 5. N� som linjen er korrekt, g� til leksjon 1.1.4. + 5. Nå som linjen er korrekt, gå til leksjon 1.1.4. -MERK: N�r du g�r gjennom innf�ringen, ikke bare pr�v � huske kommandoene, men +MERK: Når du går gjennom innføringen, ikke bare prøv å huske kommandoene, men bruk dem helt til de sitter. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1.4: REDIGERING AV TEKST -- INNSETTING - ** Trykk i for � sette inn tekst. ** + ** Trykk i for å sette inn tekst. ** - 1. Flytt mark�ren til den f�rste linjen som er merket med --->. + 1. Flytt markøren til den første linjen som er merket med --->. - 2. For � gj�re den f�rste linjen lik den andre, flytt mark�ren til den st�r - p� tegnet ETTER posisjonen der teksten skal settes inn. + 2. For å gjøre den første linjen lik den andre, flytt markøren til den står + på tegnet ETTER posisjonen der teksten skal settes inn. 3. Trykk i og skriv inn teksten som mangler. - 4. Etterhvert som hver feil er fikset, trykk for � returnere til + 4. Etterhvert som hver feil er fikset, trykk for å returnere til normalmodus. Repeter punkt 2 til 4 til setningen er korrekt. ---> Det er tkst som mnglr . ---> Det er ganske mye tekst som mangler her. - 5. N�r du f�ler deg komfortabel med � sette inn tekst, g� til oppsummeringen + 5. Når du føler deg komfortabel med å sette inn tekst, gå til oppsummeringen nedenfor. @@ -117,111 +117,111 @@ MERK: N Leksjon 1.1.5: REDIGERING AV TEKST -- LEGGE TIL - ** Trykk A for � legge til tekst. ** + ** Trykk A for å legge til tekst. ** - 1. Flytt mark�ren til den f�rste linjen nedenfor merket --->. - Det har ikke noe � si hvor mark�ren er plassert p� den linjen. + 1. Flytt markøren til den første linjen nedenfor merket --->. + Det har ikke noe å si hvor markøren er plassert på den linjen. 2. Trykk A og skriv inn det som skal legges til. - 3. N�r teksten er lagt til, trykk for � returnere til normalmodusen. + 3. Når teksten er lagt til, trykk for å returnere til normalmodusen. - 4. Flytt mark�ren til den andre linjen markert med ---> og repeter steg 2 og - 3 for � reparere denne setningen. + 4. Flytt markøren til den andre linjen markert med ---> og repeter steg 2 og + 3 for å reparere denne setningen. ---> Det mangler noe tekst p - Det mangler noe tekst p� denne linjen. ----> Det mangler ogs� litt tek - Det mangler ogs� litt tekst p� denne linjen. + Det mangler noe tekst på denne linjen. +---> Det mangler også litt tek + Det mangler også litt tekst på denne linjen. - 5. N�r du f�ler at du behersker � legge til tekst, g� til leksjon 1.1.6. + 5. Når du føler at du behersker å legge til tekst, gå til leksjon 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.1.6: REDIGERE EN FIL - ** Bruk :wq for � lagre en fil og avslutte. ** + ** Bruk :wq for å lagre en fil og avslutte. ** - !! MERK: F�r du utf�rer noen av stegene nedenfor, les hele denne leksjonen!! + !! MERK: Før du utfører noen av stegene nedenfor, les hele denne leksjonen!! - 1. Avslutt denne innf�ringen som du gjorde i leksjon 1.1.2: :q! + 1. Avslutt denne innføringen som du gjorde i leksjon 1.1.2: :q! - 2. Skriv denne kommandoen p� kommandolinja: vim tutor - �vim� er kommandoen for � starte Vim-editoren, �tutor� er navnet p� fila + 2. Skriv denne kommandoen på kommandolinja: vim tutor + «vim» er kommandoen for å starte Vim-editoren, «tutor» er navnet på fila som du vil redigere. Bruk en fil som kan forandres. - 3. Sett inn og slett tekst som du l�rte i de foreg�ende leksjonene. + 3. Sett inn og slett tekst som du lærte i de foregående leksjonene. 4. Lagre filen med forandringene og avslutt Vim med: :wq - 5. Start innf�ringen p� nytt og flytt ned til oppsummeringen som f�lger. + 5. Start innføringen på nytt og flytt ned til oppsummeringen som følger. - 6. Etter � ha lest og forst�tt stegene ovenfor: Sett i gang. + 6. Etter å ha lest og forstått stegene ovenfor: Sett i gang. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.1 - 1. Mark�ren beveges ved hjelp av piltastene eller hjkl-tastene. - h (venstre) j (ned) k (opp) l (h�yre) + 1. Markøren beveges ved hjelp av piltastene eller hjkl-tastene. + h (venstre) j (ned) k (opp) l (høyre) - 2. For � starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN + 2. For å starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN - 3. For � avslutte Vim, skriv: :q! for � forkaste endringer. - ELLER skriv: :wq for � lagre forandringene. + 3. For å avslutte Vim, skriv: :q! for å forkaste endringer. + ELLER skriv: :wq for å lagre forandringene. - 4. For � slette tegnet under mark�ren, trykk: x + 4. For å slette tegnet under markøren, trykk: x - 5. For � sette inn eller legge til tekst, trykk: - i skriv innsatt tekst sett inn f�r mark�ren - A skriv tillagt tekst legg til p� slutten av linjen + 5. For å sette inn eller legge til tekst, trykk: + i skriv innsatt tekst sett inn før markøren + A skriv tillagt tekst legg til på slutten av linjen -MERK: N�r du trykker g�r du til normalmodus eller du avbryter en u�nsket - og delvis fullf�rt kommando. +MERK: Når du trykker går du til normalmodus eller du avbryter en uønsket + og delvis fullført kommando. - N� kan du g� videre til leksjon 1.2. + Nå kan du gå videre til leksjon 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2.1: SLETTEKOMMANDOER - ** Trykk dw for � slette et ord. ** + ** Trykk dw for å slette et ord. ** - 1. Trykk for � v�re sikker p� at du er i normalmodus. + 1. Trykk for å være sikker på at du er i normalmodus. - 2. Flytt mark�ren til den f�rste linjen nedenfor merket --->. + 2. Flytt markøren til den første linjen nedenfor merket --->. - 3. Flytt mark�ren til begynnelsen av ordet som skal slettes. + 3. Flytt markøren til begynnelsen av ordet som skal slettes. 4. Trykk dw og ordet vil forsvinne. -MERK: Bokstaven d vil komme til syne p� den nederste linjen p� skjermen n�r - du skriver den. Vim venter p� at du skal skrive w . Hvis du ser et annet - tegn enn d har du skrevet noe feil; trykk og start p� nytt. +MERK: Bokstaven d vil komme til syne på den nederste linjen på skjermen når + du skriver den. Vim venter på at du skal skrive w . Hvis du ser et annet + tegn enn d har du skrevet noe feil; trykk og start på nytt. ----> Det er agurk tre ord eple som ikke h�rer p�re hjemme i denne setningen. ----> Det er tre ord som ikke h�rer hjemme i denne setningen. +---> Det er agurk tre ord eple som ikke hører pære hjemme i denne setningen. +---> Det er tre ord som ikke hører hjemme i denne setningen. - 5. Repeter punkt 3 og 4 til den f�rste setningen er lik den andre. G� + 5. Repeter punkt 3 og 4 til den første setningen er lik den andre. Gå deretter til leksjon 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2.2: FLERE SLETTEKOMMANDOER - ** Trykk d$ for � slette til slutten av linjen. ** + ** Trykk d$ for å slette til slutten av linjen. ** - 1. Trykk for � v�re sikker p� at du er i normalmodus. + 1. Trykk for å være sikker på at du er i normalmodus. - 2. Flytt mark�ren til linjen nedenfor merket --->. + 2. Flytt markøren til linjen nedenfor merket --->. - 3. Flytt mark�ren til punktet der linjen skal kuttes (ETTER f�rste punktum). + 3. Flytt markøren til punktet der linjen skal kuttes (ETTER første punktum). - 4. Trykk d$ for � slette alt til slutten av linjen. + 4. Trykk d$ for å slette alt til slutten av linjen. ----> Noen skrev slutten p� linjen en gang for mye. linjen en gang for mye. +---> Noen skrev slutten på linjen en gang for mye. linjen en gang for mye. - 5. G� til leksjon 1.2.3 for � forst� hva som skjer. + 5. Gå til leksjon 1.2.3 for å forstå hva som skjer. @@ -239,107 +239,107 @@ MERK: Bokstaven d vil komme til syne p Der: d - er sletteoperatoren. - bevegelse - er hva operatoren vil opere p� (listet nedenfor). + bevegelse - er hva operatoren vil opere på (listet nedenfor). En kort liste med bevegelser: - w - til starten av det neste ordet, UNNTATT det f�rste tegnet. - e - til slutten av det n�v�rende ordet, INKLUDERT det siste tegnet. + w - til starten av det neste ordet, UNNTATT det første tegnet. + e - til slutten av det nåværende ordet, INKLUDERT det siste tegnet. $ - til slutten av linjen, INKLUDERT det siste tegnet. - Ved � skrive de vil alts� alt fra mark�ren til slutten av ordet bli + Ved å skrive de vil altså alt fra markøren til slutten av ordet bli slettet. -MERK: Ved � skrive kun bevegelsen i normalmodusen uten en operator vil - mark�ren flyttes som spesifisert. +MERK: Ved å skrive kun bevegelsen i normalmodusen uten en operator vil + markøren flyttes som spesifisert. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKSJON 1.2.4: BRUK AV TELLER FOR EN BEVEGELSE - ** Ved � skrive et tall foran en bevegelse repeterer den s� mange ganger. ** + ** Ved å skrive et tall foran en bevegelse repeterer den så mange ganger. ** - 1. Flytt mark�ren til starten av linjen markert ---> nedenfor. + 1. Flytt markøren til starten av linjen markert ---> nedenfor. - 2. Skriv 2w for � flytte mark�ren to ord framover. + 2. Skriv 2w for å flytte markøren to ord framover. - 3. Skriv 3e for � flytte mark�ren framover til slutten av det tredje + 3. Skriv 3e for å flytte markøren framover til slutten av det tredje ordet. - 4. Skriv 0 (null) for � flytte til starten av linjen. + 4. Skriv 0 (null) for å flytte til starten av linjen. 5. Repeter steg 2 og 3 med forskjellige tall. ----> Dette er en linje med noen ord som du kan bevege deg rundt p�. +---> Dette er en linje med noen ord som du kan bevege deg rundt på. - 6. G� videre til leksjon 1.2.5. + 6. Gå videre til leksjon 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.5: BRUK AV ANTALL FOR � SLETTE MER + Leksjon 1.2.5: BRUK AV ANTALL FOR Å SLETTE MER - ** Et tall sammen med en operator repeterer den s� mange ganger. ** + ** Et tall sammen med en operator repeterer den så mange ganger. ** I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du - inn antall f�r bevegelsen for � slette mer: + inn antall før bevegelsen for å slette mer: d nummer bevegelse - 1. Flytt mark�ren til det f�rste ordet med STORE BOKSTAVER p� linjen markert + 1. Flytt markøren til det første ordet med STORE BOKSTAVER på linjen markert med --->. - 2. Skriv 2dw for � slette de to ordene med store bokstaver. + 2. Skriv 2dw for å slette de to ordene med store bokstaver. - 3. Repeter steg 1 og 2 med forskjelling antall for � slette de etterf�lgende + 3. Repeter steg 1 og 2 med forskjelling antall for å slette de etterfølgende ordene som har store bokstaver. ----> Denne ABC DE linjen FGHI JK LMN OP er n� Q RS TUV litt mer lesbar. +---> Denne ABC DE linjen FGHI JK LMN OP er nå Q RS TUV litt mer lesbar. -MERK: Et antall mellom operatoren d og bevegelsen virker p� samme m�te som � +MERK: Et antall mellom operatoren d og bevegelsen virker på samme måte som å bruke bevegelsen uten en operator. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.6: OPERERE P� LINJER + Leksjon 1.2.6: OPERERE PÅ LINJER - ** Trykk dd for � slette en hel linje. ** + ** Trykk dd for å slette en hel linje. ** - P� grunn av at sletting av linjer er mye brukt, fant utviklerne av Vi ut at - det vil v�re lettere � rett og slett trykke to d-er for � slette en linje. + På grunn av at sletting av linjer er mye brukt, fant utviklerne av Vi ut at + det vil være lettere å rett og slett trykke to d-er for å slette en linje. - 1. Flytt mark�ren til den andre linjen i verset nedenfor. - 2. Trykk dd � slette linjen. + 1. Flytt markøren til den andre linjen i verset nedenfor. + 2. Trykk dd å slette linjen. 3. Flytt deretter til den fjerde linjen. - 4. Trykk 2dd for � slette to linjer. + 4. Trykk 2dd for å slette to linjer. ----> 1) Roser er r�de, ----> 2) Gj�rme er g�y, ----> 3) Fioler er bl�, +---> 1) Roser er røde, +---> 2) Gjørme er gøy, +---> 3) Fioler er blå, ---> 4) Jeg har en bil, ---> 5) Klokker viser tiden, ----> 6) Druer er s�te ----> 7) Og du er likes�. +---> 6) Druer er søte +---> 7) Og du er likeså. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.2.7: ANGRE-KOMMANDOEN - ** Trykk u for � angre siste kommando, U for � fikse en hel linje. ** + ** Trykk u for å angre siste kommando, U for å fikse en hel linje. ** - 1. Flytt mark�ren til linjen nedenfor merket ---> og plasser den p� den - f�rste feilen. - 2. Trykk x for � slette det f�rste u�nskede tegnet. - 3. Trykk s� u for � angre den siste utf�rte kommandoen. - 4. Deretter ordner du alle feilene p� linjene ved � bruke kommandoen x . - 5. Trykk n� en stor U for � sette linjen tilbake til det den var + 1. Flytt markøren til linjen nedenfor merket ---> og plasser den på den + første feilen. + 2. Trykk x for å slette det første uønskede tegnet. + 3. Trykk så u for å angre den siste utførte kommandoen. + 4. Deretter ordner du alle feilene på linjene ved å bruke kommandoen x . + 5. Trykk nå en stor U for å sette linjen tilbake til det den var originalt. - 6. Trykk u noen ganger for � angre U og foreg�ende kommandoer. + 6. Trykk u noen ganger for å angre U og foregående kommandoer. 7. Deretter trykker du CTRL-R (hold CTRL nede mens du trykker R) noen - ganger for � gjenopprette kommandoene (omgj�re angrekommandoene). + ganger for å gjenopprette kommandoene (omgjøre angrekommandoene). ----> RReparer feiilene p�� denne linnnjen oog erssstatt dem meed angre. +---> RReparer feiilene påå denne linnnjen oog erssstatt dem meed angre. - 8. Dette er meget nyttige kommandoer. N� kan du g� til oppsummeringen av + 8. Dette er meget nyttige kommandoer. Nå kan du gå til oppsummeringen av leksjon 1.2. @@ -347,91 +347,91 @@ MERK: Et antall mellom operatoren d og bevegelsen virker p OPPSUMMERING AV LEKSJON 1.2 - 1. For � slette fra mark�ren fram til det neste ordet, trykk: dw - 2. For � slette fra mark�ren til slutten av en linje, trykk: d$ - 3. For � slette en hel linje, trykk: dd + 1. For å slette fra markøren fram til det neste ordet, trykk: dw + 2. For å slette fra markøren til slutten av en linje, trykk: d$ + 3. For å slette en hel linje, trykk: dd - 4. For � repetere en bevegelse, sett et nummer foran: 2w + 4. For å repetere en bevegelse, sett et nummer foran: 2w 5. Formatet for en forandringskommando er: operator [nummer] bevegelse der: - operator - hva som skal gj�res, f.eks. d for � slette - [nummer] - et valgfritt antall for � repetere bevegelsen - bevegelse - hva kommandoen skal operere p�, eksempelvis w (ord), - $ (til slutten av linjen) og s� videre. + operator - hva som skal gjøres, f.eks. d for å slette + [nummer] - et valgfritt antall for å repetere bevegelsen + bevegelse - hva kommandoen skal operere på, eksempelvis w (ord), + $ (til slutten av linjen) og så videre. - 6. For � g� til starten av en linje, bruk en null: 0 + 6. For å gå til starten av en linje, bruk en null: 0 - 7. For � angre tidligere endringer, skriv: u (liten u) - For � angre alle forandringer p� en linje, skriv: U (stor U) - For � omgj�re angringen, trykk: CTRL-R + 7. For å angre tidligere endringer, skriv: u (liten u) + For å angre alle forandringer på en linje, skriv: U (stor U) + For å omgjøre angringen, trykk: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.1: �LIM INN�-KOMMANDOEN + Leksjon 1.3.1: «LIM INN»-KOMMANDOEN - ** Trykk p for � lime inn tidligere slettet tekst etter mark�ren ** + ** Trykk p for å lime inn tidligere slettet tekst etter markøren ** - 1. Flytt mark�ren til den f�rste linjen med ---> nedenfor. + 1. Flytt markøren til den første linjen med ---> nedenfor. - 2. Trykk dd for � slette linjen og lagre den i et Vim-register. + 2. Trykk dd for å slette linjen og lagre den i et Vim-register. - 3. Flytt mark�ren til c)-linjen, OVER posisjonen linjen skal settes inn. + 3. Flytt markøren til c)-linjen, OVER posisjonen linjen skal settes inn. - 4. Trykk p for � legge linjen under mark�ren. + 4. Trykk p for å legge linjen under markøren. - 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkef�lge. + 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkefølge. ----> d) Kan du ogs� l�re? ----> b) Fioler er bl�, ----> c) Intelligens m� l�res, ----> a) Roser er r�de, +---> d) Kan du også lære? +---> b) Fioler er blå, +---> c) Intelligens må læres, +---> a) Roser er røde, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.2: �ERSTATT�-KOMMANDOEN + Leksjon 1.3.2: «ERSTATT»-KOMMANDOEN - ** Trykk rx for � erstatte tegnet under mark�ren med x. ** + ** Trykk rx for å erstatte tegnet under markøren med x. ** - 1. Flytt mark�ren til den f�rste linjen nedenfor merket --->. + 1. Flytt markøren til den første linjen nedenfor merket --->. - 2. Flytt mark�ren s� den st�r opp� den f�rste feilen. + 2. Flytt markøren så den står oppå den første feilen. - 3. Trykk r og deretter tegnet som skal v�re der. + 3. Trykk r og deretter tegnet som skal være der. - 4. Repeter punkt 2 og 3 til den f�rste linjen er lik den andre. + 4. Repeter punkt 2 og 3 til den første linjen er lik den andre. ----> Da dfnne lynjxn ble zkrevet, var det n�en som tjykket feite taster! +---> Da dfnne lynjxn ble zkrevet, var det nøen som tjykket feite taster! ---> Da denne linjen ble skrevet, var det noen som trykket feile taster! - 5. G� videre til leksjon 1.3.2. + 5. Gå videre til leksjon 1.3.2. -MERK: Husk at du b�r l�re ved � BRUKE, ikke pugge. +MERK: Husk at du bør lære ved å BRUKE, ikke pugge. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.3: �FORANDRE�-OPERATOREN + Leksjon 1.3.3: «FORANDRE»-OPERATOREN - ** For � forandre til slutten av et ord, trykk ce . ** + ** For å forandre til slutten av et ord, trykk ce . ** - 1. Flytt mark�ren til den f�rste linjen nedenfor som er merket --->. + 1. Flytt markøren til den første linjen nedenfor som er merket --->. - 2. Plasser mark�ren p� u i �lubjwr�. + 2. Plasser markøren på u i «lubjwr». - 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv �injen�). + 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv «injen»). - 4. Trykk og g� til det neste tegnet som skal forandres. + 4. Trykk og gå til det neste tegnet som skal forandres. - 5. Repeter punkt 3 og 4 helt til den f�rste setningen er lik den andre. + 5. Repeter punkt 3 og 4 helt til den første setningen er lik den andre. ----> Denne lubjwr har noen wgh som m� forkw�p med �for�kzryas�-kommandoen. ----> Denne linjen har noen ord som m� forandres med �forandre�-kommandoen. +---> Denne lubjwr har noen wgh som må forkwåp med «forækzryas»-kommandoen. +---> Denne linjen har noen ord som må forandres med «forandre»-kommandoen. -V�r oppmerksom p� at ce sletter ordet og g�r inn i innsettingsmodus. +Vær oppmerksom på at ce sletter ordet og går inn i innsettingsmodus. @@ -439,113 +439,113 @@ V Leksjon 1.3.4: FLERE FORANDRINGER VED BRUK AV c - ** Forandringskommandoen blir brukt med de samme bevegelser som �slett�. ** + ** Forandringskommandoen blir brukt med de samme bevegelser som «slett». ** - 1. Forandringsoperatoren fungerer p� samme m�te som �slett�. Formatet er: + 1. Forandringsoperatoren fungerer på samme måte som «slett». Formatet er: c [nummer] bevegelse 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en linje). - 3. G� til den f�rste linjen nedenfor som er merket --->. + 3. Gå til den første linjen nedenfor som er merket --->. - 4. Flytt mark�ren til den f�rste feilen. + 4. Flytt markøren til den første feilen. 5. Skriv c$ og skriv resten av linjen lik den andre og trykk . ----> Slutten p� denne linjen trenger litt hjelp for � gj�re den lik den neste. ----> Slutten p� denne linjen trenger � bli rettet ved bruk av c$-kommandoen. +---> Slutten på denne linjen trenger litt hjelp for å gjøre den lik den neste. +---> Slutten på denne linjen trenger å bli rettet ved bruk av c$-kommandoen. -MERK: Du kan bruke slettetasten for � rette feil mens du skriver. +MERK: Du kan bruke slettetasten for å rette feil mens du skriver. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.3 - 1. For � legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette - limer inn den slettede teksten ETTER mark�ren (hvis en linje ble slettet - vil den bli limt inn p� linjen under mark�ren). + 1. For å legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette + limer inn den slettede teksten ETTER markøren (hvis en linje ble slettet + vil den bli limt inn på linjen under markøren). - 2. For � erstatte et tegn under mark�ren, trykk r og deretter tegnet som + 2. For å erstatte et tegn under markøren, trykk r og deretter tegnet som du vil ha der. - 3. Forandringsoperatoren lar deg forandre fra mark�ren til dit bevegelsen - tar deg. Det vil si, skriv ce for � forandre fra mark�ren til slutten - av ordet, c$ for � forandre til slutten av linjen. + 3. Forandringsoperatoren lar deg forandre fra markøren til dit bevegelsen + tar deg. Det vil si, skriv ce for å forandre fra markøren til slutten + av ordet, c$ for å forandre til slutten av linjen. - 4. Formatet for �forandre� er: + 4. Formatet for «forandre» er: c [nummer] bevegelse -N� kan du g� til neste leksjon. +Nå kan du gå til neste leksjon. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.1: POSISJONERING AV MARK�REN OG FILSTATUS + Leksjon 1.4.1: POSISJONERING AV MARKØREN OG FILSTATUS - ** Trykk CTRL-G for � vise posisjonen i filen og filstatusen. - Trykk G for � g� til en spesifikk linje i filen. ** + ** Trykk CTRL-G for å vise posisjonen i filen og filstatusen. + Trykk G for å gå til en spesifikk linje i filen. ** - Merk: Les hele leksjonen f�r du utf�rer noen av punktene! + Merk: Les hele leksjonen før du utfører noen av punktene! 1. Hold nede Ctrl-tasten og trykk g . Vi kaller dette CTRL-G. En melding - vil komme til syne p� bunnen av skjermen med filnavnet og posisjonen i + vil komme til syne på bunnen av skjermen med filnavnet og posisjonen i filen. Husk linjenummeret for bruk i steg 3. -Merk: Du kan se mark�rposisjonen i nederste h�yre hj�rne av skjermen. Dette - skjer n�r �ruler�-valget er satt (forklart i leksjon 6). +Merk: Du kan se markørposisjonen i nederste høyre hjørne av skjermen. Dette + skjer når «ruler»-valget er satt (forklart i leksjon 6). - 2. Trykk G for � g� til bunnen av filen. - Skriv gg for � g� til begynnelsen av filen. + 2. Trykk G for å gå til bunnen av filen. + Skriv gg for å gå til begynnelsen av filen. - 3. Skriv inn linjenummeret du var p� og deretter G . Dette vil f�re deg - tilbake til linjen du var p� da du f�rst trykket CTRL-G. + 3. Skriv inn linjenummeret du var på og deretter G . Dette vil føre deg + tilbake til linjen du var på da du først trykket CTRL-G. - 4. Utf�r steg 1 til 3 hvis du f�ler deg sikker p� prosedyren. + 4. Utfør steg 1 til 3 hvis du føler deg sikker på prosedyren. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.2: S�KEKOMMANDOEN + Leksjon 1.4.2: SØKEKOMMANDOEN - ** Skriv / etterfulgt av en s�kestreng som du vil lete etter. ** + ** Skriv / etterfulgt av en søkestreng som du vil lete etter. ** - 1. Trykk / n�r du er i normalmodusen. Legg merke til at skr�streken og - mark�ren kommer til syne p� bunnen av skjermen i likhet med - �:�-kommandoene. + 1. Trykk / når du er i normalmodusen. Legg merke til at skråstreken og + markøren kommer til syne på bunnen av skjermen i likhet med + «:»-kommandoene. - 2. Skriv �feeeiil� og trykk . Dette er teksten du vil lete etter. + 2. Skriv «feeeiil» og trykk . Dette er teksten du vil lete etter. - 3. For � finne neste forekomst av s�kestrengen, trykk n . - For � lete etter samme s�keteksten i motsatt retning, trykk N . + 3. For å finne neste forekomst av søkestrengen, trykk n . + For å lete etter samme søketeksten i motsatt retning, trykk N . - 4. For � lete etter en tekst bakover i filen, bruk ? istedenfor / . + 4. For å lete etter en tekst bakover i filen, bruk ? istedenfor / . - 5. For � g� tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens - du trykker bokstaven o ). Repeter for � g� enda lengre tilbake. CTRL-I - g�r framover. + 5. For å gå tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens + du trykker bokstaven o ). Repeter for å gå enda lengre tilbake. CTRL-I + går framover. ----> �feeeiil� er ikke m�ten � skrive �feil� p�, feeeiil er helt feil. -Merk: N�r s�kingen n�r slutten av filen, vil den fortsette fra starten unntatt - hvis �wrapscan�-valget er resatt. +---> «feeeiil» er ikke måten å skrive «feil» på, feeeiil er helt feil. +Merk: Når søkingen når slutten av filen, vil den fortsette fra starten unntatt + hvis «wrapscan»-valget er resatt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.4.3: FINN SAMSVARENDE PARENTESER - ** Trykk % for � finne en samsvarende ), ] eller } . ** + ** Trykk % for å finne en samsvarende ), ] eller } . ** - 1. Plasser mark�ren p� en (, [ eller { p� linjen nedenfor merket --->. + 1. Plasser markøren på en (, [ eller { på linjen nedenfor merket --->. 2. Trykk % . - 3. Mark�ren vil g� til den samsvarende parentesen eller hakeparentesen. + 3. Markøren vil gå til den samsvarende parentesen eller hakeparentesen. - 4. Trykk % for � flytte mark�ren til den andre samsvarende parentesen. + 4. Trykk % for å flytte markøren til den andre samsvarende parentesen. - 5. Flytt mark�ren til en annen (, ), [, ], { eller } og se hva % gj�r. + 5. Flytt markøren til en annen (, ), [, ], { eller } og se hva % gjør. ---> Dette ( er en testlinje med (, [ ] og { } i den )). -Merk: Dette er veldig nyttig til feils�king i programmer som har ubalansert +Merk: Dette er veldig nyttig til feilsøking i programmer som har ubalansert antall parenteser! @@ -554,136 +554,136 @@ Merk: Dette er veldig nyttig til feils Leksjon 1.4.4: ERSTATT-KOMMANDOEN - ** Skriv :s/gammel/ny/g for � erstatte �gammel� med �ny�. ** + ** Skriv :s/gammel/ny/g for å erstatte «gammel» med «ny». ** - 1. Flytt mark�ren til linjen nedenfor som er merket med --->. + 1. Flytt markøren til linjen nedenfor som er merket med --->. 2. Skriv :s/deen/den/ . Legg merke til at denne kommandoen bare - forandrer den f�rste forekomsten av �deen� p� linjen. + forandrer den første forekomsten av «deen» på linjen. - 3. Skriv :s/deen/den/g . N�r g-flagget legges til, betyr dette global - erstatning p� linjen og erstatter alle forekomster av �deen� p� linjen. + 3. Skriv :s/deen/den/g . Når g-flagget legges til, betyr dette global + erstatning på linjen og erstatter alle forekomster av «deen» på linjen. ---> deen som kan kaste deen tyngste steinen lengst er deen beste - 4. For � erstatte alle forekomster av en tekststreng mellom to linjer, - skriv :#,#s/gammel/ny/g der #,# er linjenumrene p� de to linjene for - linjeomr�det erstatningen skal gj�res. - Skriv :%s/gammel/ny/g for � erstatte tekst i hele filen. - Skriv :%s/gammel/ny/gc for � finne alle forekomster i hele filen, og - deretter sp�rre om teksten skal erstattes eller + 4. For å erstatte alle forekomster av en tekststreng mellom to linjer, + skriv :#,#s/gammel/ny/g der #,# er linjenumrene på de to linjene for + linjeområdet erstatningen skal gjøres. + Skriv :%s/gammel/ny/g for å erstatte tekst i hele filen. + Skriv :%s/gammel/ny/gc for å finne alle forekomster i hele filen, og + deretter spørre om teksten skal erstattes eller ikke. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.4 - 1. Ctrl-G viser n�v�rende posisjon i filen og filstatusen. - G g�r til slutten av filen. - nummer G g�r til det linjenummeret. - gg g�r til den f�rste linjen. + 1. Ctrl-G viser nåværende posisjon i filen og filstatusen. + G går til slutten av filen. + nummer G går til det linjenummeret. + gg går til den første linjen. - 2. Skriv / etterfulgt av en s�ketekst for � lete FRAMOVER etter teksten. - Skriv ? etterfulgt av en s�ketekst for � lete BAKOVER etter teksten. - Etter et s�k kan du trykke n for � finne neste forekomst i den samme - retningen eller N for � lete i motsatt retning. + 2. Skriv / etterfulgt av en søketekst for å lete FRAMOVER etter teksten. + Skriv ? etterfulgt av en søketekst for å lete BAKOVER etter teksten. + Etter et søk kan du trykke n for å finne neste forekomst i den samme + retningen eller N for å lete i motsatt retning. CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner. - 3. Skriv % n�r mark�ren st�r p� en (, ), [, ], { eller } for � finne den + 3. Skriv % når markøren står på en (, ), [, ], { eller } for å finne den som samsvarer. - 4. Erstatte �gammel� med f�rste �ny� p� en linje: :s/gammel/ny - Erstatte alle �gammel� med �ny� p� en linje: :s/gammel/ny/g + 4. Erstatte «gammel» med første «ny» på en linje: :s/gammel/ny + Erstatte alle «gammel» med «ny» på en linje: :s/gammel/ny/g Erstatte tekst mellom to linjenumre: :#,#s/gammel/ny/g Erstatte alle forekomster i en fil: :%s/gammel/ny/g - For � godkjenne hver erstatning, legg til �c�: :%s/gammel/ny/gc + For å godkjenne hver erstatning, legg til «c»: :%s/gammel/ny/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.1: HVORDAN UTF�RE EN EKSTERN KOMMANDO + Leksjon 1.5.1: HVORDAN UTFØRE EN EKSTERN KOMMANDO - ** Skriv :! etterfulgt av en ekstern kommando for � utf�re denne. ** + ** Skriv :! etterfulgt av en ekstern kommando for å utføre denne. ** - 1. Skriv den velkjente kommandoen : for � plassere mark�ren p� bunnen av + 1. Skriv den velkjente kommandoen : for å plassere markøren på bunnen av skjermen. Dette lar deg skrive en kommandolinjekommando. - 2. N� kan du skrive tegnet ! . Dette lar deg utf�re en hvilken som helst + 2. Nå kan du skrive tegnet ! . Dette lar deg utføre en hvilken som helst ekstern kommando. 3. Som et eksempel, skriv ls etter utropstegnet og trykk . Du vil - n� f� en liste over filene i katalogen, akkurat som om du hadde kj�rt + nå få en liste over filene i katalogen, akkurat som om du hadde kjørt kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis - �ls� ikke virker. + «ls» ikke virker. -MERK: Det er mulig � kj�re alle eksterne kommandoer p� denne m�ten, ogs� med +MERK: Det er mulig å kjøre alle eksterne kommandoer på denne måten, også med parametere. -MERK: Alle �:�-kommandoer m� avsluttes med . Fra dette punktet er det +MERK: Alle «:»-kommandoer må avsluttes med . Fra dette punktet er det ikke alltid vi nevner det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.5.2: MER OM LAGRING AV FILER - ** For � lagre endringene gjort i en tekst, skriv :w FILNAVN. ** + ** For å lagre endringene gjort i en tekst, skriv :w FILNAVN. ** - 1. Skriv :!dir eller :!ls for � f� en liste over filene i katalogen. Du - vet allerede at du m� trykke etter dette. + 1. Skriv :!dir eller :!ls for å få en liste over filene i katalogen. Du + vet allerede at du må trykke etter dette. - 2. Velg et filnavn p� en fil som ikke finnes, som for eksempel TEST . + 2. Velg et filnavn på en fil som ikke finnes, som for eksempel TEST . 3. Skriv :w TEST (der TEST er filnavnet du velger). - 4. Dette lagrer hele filen (denne innf�ringen) under navnet TEST . For � - sjekke dette, skriv :!dir eller :!ls igjen for � se innholdet av + 4. Dette lagrer hele filen (denne innføringen) under navnet TEST . For å + sjekke dette, skriv :!dir eller :!ls igjen for å se innholdet av katalogen. -Merk: Hvis du n� hadde avsluttet Vim og startet p� nytt igjen med �vim TEST�, - ville filen v�rt en eksakt kopi av innf�ringen da du lagret den. +Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim TEST», + ville filen vært en eksakt kopi av innføringen da du lagret den. - 5. Fjern filen ved � skrive :!rm TEST hvis du er p� et Unix-lignende + 5. Fjern filen ved å skrive :!rm TEST hvis du er på et Unix-lignende operativsystem, eller :!del TEST hvis du bruker MS-DOS. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.5.3: VELGE TEKST SOM SKAL LAGRES - ** For � lagre en del av en fil, skriv v bevegelse :w FILNAVN ** + ** For å lagre en del av en fil, skriv v bevegelse :w FILNAVN ** - 1. Flytt mark�ren til denne linjen. + 1. Flytt markøren til denne linjen. - 2. Trykk v og flytt mark�ren til det femte elementet nedenfor. Legg merke + 2. Trykk v og flytt markøren til det femte elementet nedenfor. Legg merke til at teksten blir markert. - 3. Trykk : (kolon). P� bunnen av skjermen vil :'<,'> komme til syne. + 3. Trykk : (kolon). På bunnen av skjermen vil :'<,'> komme til syne. 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller - at du ser :'<,'>w TEST f�r du trykker Enter. + at du ser :'<,'>w TEST før du trykker Enter. 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls - for � se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. + for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. -MERK: Ved � trykke v startes visuelt valg. Du kan flytte mark�ren rundt for - � gj�re det valgte omr�det st�rre eller mindre. Deretter kan du bruke en - operator for � gj�re noe med teksten. For eksempel sletter d teksten. +MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for + å gjøre det valgte området større eller mindre. Deretter kan du bruke en + operator for å gjøre noe med teksten. For eksempel sletter d teksten. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.4: HENTING OG SAMMENSL�ING AV FILER + Leksjon 1.5.4: HENTING OG SAMMENSLÅING AV FILER - ** For � lese inn en annen fil inn i n�v�rende buffer, skriv :r FILNAVN ** + ** For å lese inn en annen fil inn i nåværende buffer, skriv :r FILNAVN ** - 1. Plasser mark�ren like over denne linjen. + 1. Plasser markøren like over denne linjen. -MERK: Etter � ha utf�rt steg 2 vil du se teksten fra leksjon 1.5.3. G� deretter - NED for � se denne leksjonen igjen. +MERK: Etter å ha utført steg 2 vil du se teksten fra leksjon 1.5.3. Gå deretter + NED for å se denne leksjonen igjen. - 2. Hent TEST-filen ved � bruke kommandoen :r TEST der TEST er navnet p� - filen du brukte. Filen du henter blir plassert nedenfor mark�rlinjen. + 2. Hent TEST-filen ved å bruke kommandoen :r TEST der TEST er navnet på + filen du brukte. Filen du henter blir plassert nedenfor markørlinjen. - 3. For � sjekke at filen ble hentet, g� tilbake og se at det er to kopier av + 3. For å sjekke at filen ble hentet, gå tilbake og se at det er to kopier av leksjon 1.5.3, originalen og denne versjonen. -MERK: Du kan ogs� lese utdataene av en ekstern kommando. For eksempel, :r !ls - leser utdataene av ls-kommandoen og legger dem nedenfor mark�ren. +MERK: Du kan også lese utdataene av en ekstern kommando. For eksempel, :r !ls + leser utdataene av ls-kommandoen og legger dem nedenfor markøren. @@ -692,90 +692,90 @@ MERK: Du kan ogs OPPSUMMERING AV LEKSJON 1.5 - 1. :!kommando utf�rer en ekstern kommandio. + 1. :!kommando utfører en ekstern kommandio. Noen nyttige eksempler er: (MS-DOS) (Unix) :!dir :!ls - List filene i katalogen. :!del FILNAVN :!rm FILNAVN - Slett filen FILNAVN. - 2. :w FILNAVN skriver den n�v�rende Vim-filen disken med navnet FILNAVN . + 2. :w FILNAVN skriver den nåværende Vim-filen disken med navnet FILNAVN . 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen FILNAVN. - 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor mark�ren. + 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markøren. - 5. :r !dir leser utdataene fra �dir�-kommandoen og legger dem nedenfor - mark�rposisjonen. + 5. :r !dir leser utdataene fra «dir»-kommandoen og legger dem nedenfor + markørposisjonen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.1: ��PNE LINJE�-KOMMANDOEN + Leksjon 1.6.1: «ÅPNE LINJE»-KOMMANDOEN - ** Skriv o for � ��pne opp� for en ny linje etter mark�ren og g� til + ** Skriv o for å «åpne opp» for en ny linje etter markøren og gå til innsettingsmodus ** - 1. Flytt mark�ren til linjen nedenfor merket --->. + 1. Flytt markøren til linjen nedenfor merket --->. - 2. Skriv o (liten o) for � �pne opp en linje NEDENFOR mark�ren og g� inn i + 2. Skriv o (liten o) for å åpne opp en linje NEDENFOR markøren og gå inn i innsettingsmodus. - 3. Skriv litt tekst og trykk for � g� ut av innsettingsmodusen. + 3. Skriv litt tekst og trykk for å gå ut av innsettingsmodusen. ----> Etter at o er skrevet blir mark�ren plassert p� den tomme linjen. +---> Etter at o er skrevet blir markøren plassert på den tomme linjen. - 4. For � �pne en ny linje OVER mark�ren, trykk rett og slett en stor O - istedenfor en liten o . Pr�v dette p� linjen nedenfor. + 4. For å åpne en ny linje OVER markøren, trykk rett og slett en stor O + istedenfor en liten o . Prøv dette på linjen nedenfor. ----> Lag ny linje over denne ved � trykke O mens mark�ren er p� denne linjen. +---> Lag ny linje over denne ved å trykke O mens markøren er på denne linjen. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.2: �LEGG TIL�-KOMMANDOEN + Leksjon 1.6.2: «LEGG TIL»-KOMMANDOEN - ** Skriv a for � legge til tekst ETTER mark�ren. ** + ** Skriv a for å legge til tekst ETTER markøren. ** - 1. Flytt mark�ren til starten av linjen merket ---> nedenfor. + 1. Flytt markøren til starten av linjen merket ---> nedenfor. - 2. Trykk e til mark�ren er p� slutten av �li�. + 2. Trykk e til markøren er på slutten av «li». - 3. Trykk a (liten a) for � legge til tekst ETTER mark�ren. + 3. Trykk a (liten a) for å legge til tekst ETTER markøren. - 4. Fullf�r ordet s�nn som p� linjen nedenfor. Trykk for � g� ut av + 4. Fullfør ordet sånn som på linjen nedenfor. Trykk for å gå ut av innsettingsmodusen. - 5. Bruk e for � g� til det neste ufullstendige ordet og repeter steg 3 og + 5. Bruk e for å gå til det neste ufullstendige ordet og repeter steg 3 og 4. ----> Denne li lar deg �ve p� � leg til tek p� en linje. ----> Denne linjen lar deg �ve p� � legge til tekst p� en linje. +---> Denne li lar deg øve på å leg til tek på en linje. +---> Denne linjen lar deg øve på å legge til tekst på en linje. -Merk: a, i og A g�r alle til den samme innsettingsmodusen, den eneste +Merk: a, i og A går alle til den samme innsettingsmodusen, den eneste forskjellen er hvor tegnene blir satt inn. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.3: EN ANNEN M�TE � ERSTATTE P� + Leksjon 1.6.3: EN ANNEN MÅTE Å ERSTATTE PÅ - ** Skriv en stor R for � erstatte mer enn ett tegn. ** + ** Skriv en stor R for å erstatte mer enn ett tegn. ** - 1. Flytt mark�ren til den f�rste linjen nedenfor merket --->. Flytt mark�ren - til begynnelsen av den f�rste �xxx�-en. + 1. Flytt markøren til den første linjen nedenfor merket --->. Flytt markøren + til begynnelsen av den første «xxx»-en. - 2. Trykk R og skriv inn tallet som st�r nedenfor p� den andre linjen s� + 2. Trykk R og skriv inn tallet som står nedenfor på den andre linjen så det erstatter xxx. - 3. Trykk for � g� ut av erstatningsmodusen. Legg merke til at resten + 3. Trykk for å gå ut av erstatningsmodusen. Legg merke til at resten av linjen forblir uforandret. - 4. Repeter stegene for � erstatte den gjenv�rende xxx. + 4. Repeter stegene for å erstatte den gjenværende xxx. ----> Ved � legge 123 til xxx f�r vi xxx. ----> Ved � legge 123 til 456 f�r vi 579. +---> Ved å legge 123 til xxx får vi xxx. +---> Ved å legge 123 til 456 får vi 579. MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives erstatter et eksisterende tegn. @@ -784,89 +784,89 @@ MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives Leksjon 1.6.4: KOPIERE OG LIME INN TEKST - ** Bruk y-operatoren for � kopiere tekst og p for � lime den inn ** + ** Bruk y-operatoren for å kopiere tekst og p for å lime den inn ** - 1. G� til linjen merket ---> nedenfor og plasser mark�ren etter �a)�. + 1. Gå til linjen merket ---> nedenfor og plasser markøren etter «a)». - 2. G� inn i visuell modus med v og flytt mark�ren til like f�r �f�rste�. + 2. Gå inn i visuell modus med v og flytt markøren til like før «første». - 3. Trykk y for � kopiere (engelsk: �yank�) den uthevede teksten. + 3. Trykk y for å kopiere (engelsk: «yank») den uthevede teksten. - 4. Flytt mark�ren til slutten av den neste linjen: j$ + 4. Flytt markøren til slutten av den neste linjen: j$ - 5. Trykk p for � lime inn teksten. Trykk deretter: a andre . + 5. Trykk p for å lime inn teksten. Trykk deretter: a andre . - 6. Bruk visuell modus for � velge � valget.�, kopier det med y , g� til + 6. Bruk visuell modus for å velge « valget.», kopier det med y , gå til slutten av den neste linjen med j$ og legg inn teksten der med p . ----> a) Dette er det f�rste valget. +---> a) Dette er det første valget. b) -Merk: Du kan ogs� bruke y som en operator; yw kopierer ett ord. +Merk: Du kan også bruke y som en operator; yw kopierer ett ord. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Leksjon 1.6.5: SETT VALG - ** Sett et valg s� s�k eller erstatning ignorerer store/sm� bokstaver. ** + ** Sett et valg så søk eller erstatning ignorerer store/små bokstaver. ** - 1. Let etter �ignore� ved � skrive: /ignore - Repeter flere ganger ved � trykke n . + 1. Let etter «ignore» ved å skrive: /ignore + Repeter flere ganger ved å trykke n . - 2. Sett �ic�-valget (Ignore Case) ved � skrive: :set ic + 2. Sett «ic»-valget (Ignore Case) ved å skrive: :set ic - 3. S�k etter �ignore� igjen ved � trykke n . - Legg merke til at b�de �Ignore� og �IGNORE� blir funnet. + 3. Søk etter «ignore» igjen ved å trykke n . + Legg merke til at både «Ignore» og «IGNORE» blir funnet. - 4. Sett �hlsearch�- og �incsearch�-valgene: :set hls is + 4. Sett «hlsearch»- og «incsearch»-valgene: :set hls is - 5. Skriv s�kekommandoen igjen og se hva som skjer: /ignore + 5. Skriv søkekommandoen igjen og se hva som skjer: /ignore - 6. For � sl� av ignorering av store/sm� bokstaver, skriv: :set noic + 6. For å slå av ignorering av store/små bokstaver, skriv: :set noic -Merk: For � fjerne uthevingen av treff, skriv: :nohlsearch -Merk: Hvis du vil ignorere store/sm� bokstaver for kun en s�kekommando, bruk +Merk: For å fjerne uthevingen av treff, skriv: :nohlsearch +Merk: Hvis du vil ignorere store/små bokstaver for kun en søkekommando, bruk \c i uttrykket: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.6 - 1. Trykk o for � legge til en linje NEDENFOR mark�ren og g� inn i + 1. Trykk o for å legge til en linje NEDENFOR markøren og gå inn i innsettingsmodus. - Trykk O for � �pne en linje OVER mark�ren. + Trykk O for å åpne en linje OVER markøren. - 2. Skriv a for � sette inn tekst ETTER mark�ren. - Skriv A for � sette inn tekst etter slutten av linjen. + 2. Skriv a for å sette inn tekst ETTER markøren. + Skriv A for å sette inn tekst etter slutten av linjen. - 3. Kommandoen e g�r til slutten av et ord. + 3. Kommandoen e går til slutten av et ord. - 4. Operatoren y (�yank�) kopierer tekst, p (�paste�) limer den inn. + 4. Operatoren y («yank») kopierer tekst, p («paste») limer den inn. - 5. Ved � trykke R g�r du inn i erstatningsmodus helt til trykkes. + 5. Ved å trykke R går du inn i erstatningsmodus helt til trykkes. - 6. Skriv �:set xxx� for � sette valget �xxx�. Noen valg er: - �ic� �ignorecase� ignorer store/sm� bokstaver under s�k - �is� �incsearch� vis delvise treff for en s�ketekst - �hls� �hlsearch� uthev alle s�ketreff + 6. Skriv «:set xxx» for å sette valget «xxx». Noen valg er: + «ic» «ignorecase» ignorer store/små bokstaver under søk + «is» «incsearch» vis delvise treff for en søketekst + «hls» «hlsearch» uthev alle søketreff - 7. Legg til �no� foran valget for � sl� det av: :set noic + 7. Legg til «no» foran valget for å slå det av: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.1: F� HJELP + Leksjon 1.7.1: FÅ HJELP ** Bruk det innebygde hjelpesystemet. ** - Vim har et omfattende innebygget hjelpesystem. For � starte det, pr�v en av - disse m�tene: + Vim har et omfattende innebygget hjelpesystem. For å starte det, prøv en av + disse måtene: - Trykk Hjelp-tasten (hvis du har en) - Trykk F1-tasten (hvis du har en) - Skriv :help - Les teksten i hjelpevinduet for � finne ut hvordan hjelpen virker. - Skriv CTRL-W CTRL-W for � hoppe fra et vindu til et annet - Skriv :q for � lukke hjelpevinduet. + Les teksten i hjelpevinduet for å finne ut hvordan hjelpen virker. + Skriv CTRL-W CTRL-W for å hoppe fra et vindu til et annet + Skriv :q for å lukke hjelpevinduet. - Du kan f� hjelp for omtrent alle temaer om Vim ved � skrive et parameter til - �:help�-kommandoen. Pr�v disse (ikke glem � trykke ): + Du kan få hjelp for omtrent alle temaer om Vim ved å skrive et parameter til + «:help»-kommandoen. Prøv disse (ikke glem å trykke ): :help w :help c_CTRL-D @@ -876,64 +876,64 @@ Merk: Hvis du vil ignorere store/sm Leksjon 1.7.2: LAG ET OPPSTARTSSKRIPT - ** Sl� p� funksjoner i Vim ** + ** Slå på funksjoner i Vim ** - Vim har mange flere funksjoner enn Vi, men flesteparten av dem er sl�tt av - som standard. For � begynne � bruke flere funksjoner m� du lage en - �vimrc�-fil. + Vim har mange flere funksjoner enn Vi, men flesteparten av dem er slått av + som standard. For å begynne å bruke flere funksjoner må du lage en + «vimrc»-fil. - 1. Start redigeringen av �vimrc�-filen. Dette avhenger av systemet ditt: + 1. Start redigeringen av «vimrc»-filen. Dette avhenger av systemet ditt: :e ~/.vimrc for Unix :e ~/_vimrc for MS Windows - 2. Les inn eksempelfilen for �vimrc�: + 2. Les inn eksempelfilen for «vimrc»: :r $VIMRUNTIME/vimrc_example.vim 3. Lagre filen med: :w Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til - alle dine foretrukne oppsett i denne �vimrc�-filen. + alle dine foretrukne oppsett i denne «vimrc»-filen. For mer informasjon, skriv :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.3: FULLF�RING + Leksjon 1.7.3: FULLFØRING - ** Kommandolinjefullf�ring med CTRL-D og ** + ** Kommandolinjefullføring med CTRL-D og ** - 1. V�r sikker p� at Vim ikke er i Vi-kompatibel modus: :set nocp + 1. Vær sikker på at Vim ikke er i Vi-kompatibel modus: :set nocp 2. Se hvilke filer som er i katalogen: :!ls eller :!dir - 3. Skriv starten p� en kommando: :e + 3. Skriv starten på en kommando: :e 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med - �e�. + «e». - 5. Trykk og Vim vil fullf�re kommandonavnet til �:edit�. + 5. Trykk og Vim vil fullføre kommandonavnet til «:edit». - 6. Legg til et mellomrom og starten p� et eksisterende filnavn: :edit FIL + 6. Legg til et mellomrom og starten på et eksisterende filnavn: :edit FIL - 7. Trykk . Vim vil fullf�re navnet (hvis det er unikt). + 7. Trykk . Vim vil fullføre navnet (hvis det er unikt). -MERK: Fullf�ring fungerer for mange kommandoer. Pr�v ved � trykke CTRL-D og +MERK: Fullføring fungerer for mange kommandoer. Prøv ved å trykke CTRL-D og . Det er spesielt nyttig for bruk sammen med :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ OPPSUMMERING AV LEKSJON 1.7 - 1. Skriv :help eller trykk eller for � �pne et hjelpevindu. + 1. Skriv :help eller trykk eller for å åpne et hjelpevindu. - 2. Skriv :help kommando for � f� hjelp om kommando . + 2. Skriv :help kommando for å få hjelp om kommando . - 3. Trykk CTRL-W CTRL-W for � hoppe til et annet vindu. + 3. Trykk CTRL-W CTRL-W for å hoppe til et annet vindu. - 4. Trykk :q for � lukke hjelpevinduet. + 4. Trykk :q for å lukke hjelpevinduet. - 5. Opprett et vimrc-oppstartsskript for � lagre favorittvalgene dine. + 5. Opprett et vimrc-oppstartsskript for å lagre favorittvalgene dine. - 6. N�r du skriver en �:�-kommando, trykk CTRL-D for � se mulige - fullf�ringer. Trykk for � bruke en fullf�ring. + 6. Når du skriver en «:»-kommando, trykk CTRL-D for å se mulige + fullføringer. Trykk for å bruke en fullføring. @@ -943,30 +943,30 @@ MERK: Fullf ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Her slutter innf�ringen i Vim. Den var ment som en rask oversikt over - editoren, akkurat nok til � la deg sette i gang med enkel bruk. Den er p� - langt n�r komplett, da Vim har mange flere kommandoer. Les bruksanvisningen - ved � skrive :help user-manual . + Her slutter innføringen i Vim. Den var ment som en rask oversikt over + editoren, akkurat nok til å la deg sette i gang med enkel bruk. Den er på + langt nær komplett, da Vim har mange flere kommandoer. Les bruksanvisningen + ved å skrive :help user-manual . For videre lesing og studier, kan denne boken anbefales: - �Vim - Vi Improved� av Steve Oualline + «Vim - Vi Improved» av Steve Oualline Utgiver: New Riders - Den f�rste boken som er fullt og helt dedisert til Vim. Spesielt nyttig for + Den første boken som er fullt og helt dedisert til Vim. Spesielt nyttig for nybegynnere. Inneholder mange eksempler og illustrasjoner. Se https://iccf-holland.org/click5.html - Denne boken er eldre og handler mer om Vi enn Vim, men anbefales ogs�: - �Learning the Vi Editor� av Linda Lamb + Denne boken er eldre og handler mer om Vi enn Vim, men anbefales også: + «Learning the Vi Editor» av Linda Lamb Utgiver: O'Reilly & Associates Inc. - Det er en god bok for � f� vite omtrent hva som helst om Vi. - Den sjette utgaven inneholder ogs� informasjon om Vim. + Det er en god bok for å få vite omtrent hva som helst om Vi. + Den sjette utgaven inneholder også informasjon om Vim. - Denne innf�ringen er skrevet av Michael C. Pierce og Robert K. Ware, - Colorado School of Mines med id�er av Charles Smith, Colorado State + Denne innføringen er skrevet av Michael C. Pierce og Robert K. Ware, + Colorado School of Mines med idéer av Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu . Modifisert for Vim av Bram Moolenaar. - Oversatt av �yvind A. Holm. E-mail: vimtutor _AT_ sunbase.org + Oversatt av Øyvind A. Holm. E-mail: vimtutor _AT_ sunbase.org Id: tutor.no 406 2007-03-18 22:48:36Z sunny ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.no.utf-8 b/runtime/tutor/tutor1.no.utf-8 deleted file mode 100644 index 4459f17b66..0000000000 --- a/runtime/tutor/tutor1.no.utf-8 +++ /dev/null @@ -1,973 +0,0 @@ -=============================================================================== -= V e l k o m m e n t i l i n n f ø r i n g e n i V i m -- Ver. 1.7 = -=============================================================================== - - Vim er en meget kraftig editor med mange kommandoer, alt for mange til å - kunne gå gjennom alle i en innføring som denne. Den er beregnet på å - sette deg inn i bruken av nok kommandoer så du vil være i stand til lett - å kunne bruke Vim som en editor til alle formål. - - Tiden som kreves for å gå gjennom denne innføringen tar ca. 25-30 - minutter, avhengig av hvor mye tid du bruker til eksperimentering. - - MERK: - Kommandoene i leksjonene vil modifisere teksten. Lag en kopi av denne - filen som du kan øve deg på (hvis du kjørte «vimtutor»-kommandoen, er - dette allerede en kopi). - - Det er viktig å huske at denne innføringen er beregnet på læring gjennom - bruk. Det betyr at du må utføre kommandoene for å lære dem skikkelig. - Hvis du bare leser teksten, vil du glemme kommandoene! - - Først av alt, sjekk at «Caps Lock» IKKE er aktiv og trykk «j»-tasten for - å flytte markøren helt til leksjon 1.1.1 fyller skjermen. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.1: FLYTTING AV MARKØREN - - - ** For å flytte markøren, trykk tastene h, j, k, l som vist. ** - ^ - k Tips: h-tasten er til venstre og flytter til venstre. - < h l > l-tasten er til høyre og flytter til høyre. - j j-tasten ser ut som en pil som peker nedover. - v - 1. Flytt markøren rundt på skjermen til du har fått det inn i fingrene. - - 2. Hold inne nedovertasten (j) til den repeterer. - Nå vet du hvordan du beveger deg til neste leksjon. - - 3. Gå til leksjon 1.1.2 ved hjelp av nedovertasten. - -Merk: Hvis du blir usikker på noe du har skrevet, trykk for å gå til - normalmodus. Skriv deretter kommandoen du ønsket på nytt. - -Merk: Piltastene skal også virke. Men ved å bruke hjkl vil du være i stand til - å bevege markøren mye raskere når du er blitt vant til det. Helt sant! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.2: AVSLUTTE VIM - - - !! MERK: Før du utfører noen av punktene nedenfor, les hele leksjonen!! - - 1. Trykk -tasten (for å forsikre deg om at du er i normalmodus). - - 2. Skriv: :q! . - Dette avslutter editoren og FORKASTER alle forandringer som du har gjort. - - 3. Når du ser kommandolinjen i skallet, skriv kommandoen som startet denne - innføringen. Den er: vimtutor - - 4. Hvis du er sikker på at du husker dette, utfør punktene 1 til 3 for å - avslutte og starte editoren på nytt. - -MERK: :q! forkaster alle forandringer som du gjorde. I løpet av noen - få leksjoner vil du lære hvordan du lagrer forandringene til en fil. - - 5. Flytt markøren ned til leksjon 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.3: REDIGERING AV TEKST -- SLETTING - - - ** Trykk x for å slette tegnet under markøren. ** - - 1. Flytt markøren til den første linjen merket med --->. - - 2. For å ordne feilene på linjen, flytt markøren til den er oppå tegnet som - skal slettes. - - 3. Trykk tasten x for å slette det uønskede tegnet. - - 4. Repeter punkt 2 til 4 til setningen er lik den som er under. - ----> Hessstennnn brrråsnudddde ii gaaata. ----> Hesten bråsnudde i gata. - - 5. Nå som linjen er korrekt, gå til leksjon 1.1.4. - -MERK: Når du går gjennom innføringen, ikke bare prøv å huske kommandoene, men - bruk dem helt til de sitter. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.4: REDIGERING AV TEKST -- INNSETTING - - - ** Trykk i for å sette inn tekst. ** - - 1. Flytt markøren til den første linjen som er merket med --->. - - 2. For å gjøre den første linjen lik den andre, flytt markøren til den står - på tegnet ETTER posisjonen der teksten skal settes inn. - - 3. Trykk i og skriv inn teksten som mangler. - - 4. Etterhvert som hver feil er fikset, trykk for å returnere til - normalmodus. Repeter punkt 2 til 4 til setningen er korrekt. - ----> Det er tkst som mnglr . ----> Det er ganske mye tekst som mangler her. - - 5. Når du føler deg komfortabel med å sette inn tekst, gå til oppsummeringen - nedenfor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.5: REDIGERING AV TEKST -- LEGGE TIL - - - ** Trykk A for å legge til tekst. ** - - 1. Flytt markøren til den første linjen nedenfor merket --->. - Det har ikke noe å si hvor markøren er plassert på den linjen. - - 2. Trykk A og skriv inn det som skal legges til. - - 3. Når teksten er lagt til, trykk for å returnere til normalmodusen. - - 4. Flytt markøren til den andre linjen markert med ---> og repeter steg 2 og - 3 for å reparere denne setningen. - ----> Det mangler noe tekst p - Det mangler noe tekst på denne linjen. ----> Det mangler også litt tek - Det mangler også litt tekst på denne linjen. - - 5. Når du føler at du behersker å legge til tekst, gå til leksjon 1.1.6. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.1.6: REDIGERE EN FIL - - - ** Bruk :wq for å lagre en fil og avslutte. ** - - !! MERK: Før du utfører noen av stegene nedenfor, les hele denne leksjonen!! - - 1. Avslutt denne innføringen som du gjorde i leksjon 1.1.2: :q! - - 2. Skriv denne kommandoen på kommandolinja: vim tutor - «vim» er kommandoen for å starte Vim-editoren, «tutor» er navnet på fila - som du vil redigere. Bruk en fil som kan forandres. - - 3. Sett inn og slett tekst som du lærte i de foregående leksjonene. - - 4. Lagre filen med forandringene og avslutt Vim med: :wq - - 5. Start innføringen på nytt og flytt ned til oppsummeringen som følger. - - 6. Etter å ha lest og forstått stegene ovenfor: Sett i gang. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.1 - - - 1. Markøren beveges ved hjelp av piltastene eller hjkl-tastene. - h (venstre) j (ned) k (opp) l (høyre) - - 2. For å starte Vim fra skall-kommandolinjen, skriv: vim FILNAVN - - 3. For å avslutte Vim, skriv: :q! for å forkaste endringer. - ELLER skriv: :wq for å lagre forandringene. - - 4. For å slette tegnet under markøren, trykk: x - - 5. For å sette inn eller legge til tekst, trykk: - i skriv innsatt tekst sett inn før markøren - A skriv tillagt tekst legg til på slutten av linjen - -MERK: Når du trykker går du til normalmodus eller du avbryter en uønsket - og delvis fullført kommando. - - Nå kan du gå videre til leksjon 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.1: SLETTEKOMMANDOER - - - ** Trykk dw for å slette et ord. ** - - 1. Trykk for å være sikker på at du er i normalmodus. - - 2. Flytt markøren til den første linjen nedenfor merket --->. - - 3. Flytt markøren til begynnelsen av ordet som skal slettes. - - 4. Trykk dw og ordet vil forsvinne. - -MERK: Bokstaven d vil komme til syne på den nederste linjen på skjermen når - du skriver den. Vim venter på at du skal skrive w . Hvis du ser et annet - tegn enn d har du skrevet noe feil; trykk og start på nytt. - ----> Det er agurk tre ord eple som ikke hører pære hjemme i denne setningen. ----> Det er tre ord som ikke hører hjemme i denne setningen. - - 5. Repeter punkt 3 og 4 til den første setningen er lik den andre. Gå - deretter til leksjon 1.2.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.2: FLERE SLETTEKOMMANDOER - - - ** Trykk d$ for å slette til slutten av linjen. ** - - 1. Trykk for å være sikker på at du er i normalmodus. - - 2. Flytt markøren til linjen nedenfor merket --->. - - 3. Flytt markøren til punktet der linjen skal kuttes (ETTER første punktum). - - 4. Trykk d$ for å slette alt til slutten av linjen. - ----> Noen skrev slutten på linjen en gang for mye. linjen en gang for mye. - - 5. Gå til leksjon 1.2.3 for å forstå hva som skjer. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.3: OM OPERATORER OG BEVEGELSER - - - Mange kommandoer som forandrer teksten er laget ut i fra en operator og en - bevegelse. Formatet for en slettekommando med sletteoperatoren d er: - - d bevegelse - - Der: - d - er sletteoperatoren. - bevegelse - er hva operatoren vil opere på (listet nedenfor). - - En kort liste med bevegelser: - w - til starten av det neste ordet, UNNTATT det første tegnet. - e - til slutten av det nåværende ordet, INKLUDERT det siste tegnet. - $ - til slutten av linjen, INKLUDERT det siste tegnet. - - Ved å skrive de vil altså alt fra markøren til slutten av ordet bli - slettet. - -MERK: Ved å skrive kun bevegelsen i normalmodusen uten en operator vil - markøren flyttes som spesifisert. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKSJON 1.2.4: BRUK AV TELLER FOR EN BEVEGELSE - - - ** Ved å skrive et tall foran en bevegelse repeterer den så mange ganger. ** - - 1. Flytt markøren til starten av linjen markert ---> nedenfor. - - 2. Skriv 2w for å flytte markøren to ord framover. - - 3. Skriv 3e for å flytte markøren framover til slutten av det tredje - ordet. - - 4. Skriv 0 (null) for å flytte til starten av linjen. - - 5. Repeter steg 2 og 3 med forskjellige tall. - ----> Dette er en linje med noen ord som du kan bevege deg rundt på. - - 6. Gå videre til leksjon 1.2.5. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.5: BRUK AV ANTALL FOR Å SLETTE MER - - - ** Et tall sammen med en operator repeterer den så mange ganger. ** - - I kombinasjonen med sletteoperatoren og en bevegelse nevnt ovenfor setter du - inn antall før bevegelsen for å slette mer: - d nummer bevegelse - - 1. Flytt markøren til det første ordet med STORE BOKSTAVER på linjen markert - med --->. - - 2. Skriv 2dw for å slette de to ordene med store bokstaver. - - 3. Repeter steg 1 og 2 med forskjelling antall for å slette de etterfølgende - ordene som har store bokstaver. - ----> Denne ABC DE linjen FGHI JK LMN OP er nå Q RS TUV litt mer lesbar. - -MERK: Et antall mellom operatoren d og bevegelsen virker på samme måte som å - bruke bevegelsen uten en operator. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.6: OPERERE PÅ LINJER - - - ** Trykk dd for å slette en hel linje. ** - - På grunn av at sletting av linjer er mye brukt, fant utviklerne av Vi ut at - det vil være lettere å rett og slett trykke to d-er for å slette en linje. - - 1. Flytt markøren til den andre linjen i verset nedenfor. - 2. Trykk dd å slette linjen. - 3. Flytt deretter til den fjerde linjen. - 4. Trykk 2dd for å slette to linjer. - ----> 1) Roser er røde, ----> 2) Gjørme er gøy, ----> 3) Fioler er blå, ----> 4) Jeg har en bil, ----> 5) Klokker viser tiden, ----> 6) Druer er søte ----> 7) Og du er likeså. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.2.7: ANGRE-KOMMANDOEN - - - ** Trykk u for å angre siste kommando, U for å fikse en hel linje. ** - - 1. Flytt markøren til linjen nedenfor merket ---> og plasser den på den - første feilen. - 2. Trykk x for å slette det første uønskede tegnet. - 3. Trykk så u for å angre den siste utførte kommandoen. - 4. Deretter ordner du alle feilene på linjene ved å bruke kommandoen x . - 5. Trykk nå en stor U for å sette linjen tilbake til det den var - originalt. - 6. Trykk u noen ganger for å angre U og foregående kommandoer. - 7. Deretter trykker du CTRL-R (hold CTRL nede mens du trykker R) noen - ganger for å gjenopprette kommandoene (omgjøre angrekommandoene). - ----> RReparer feiilene påå denne linnnjen oog erssstatt dem meed angre. - - 8. Dette er meget nyttige kommandoer. Nå kan du gå til oppsummeringen av - leksjon 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.2 - - - 1. For å slette fra markøren fram til det neste ordet, trykk: dw - 2. For å slette fra markøren til slutten av en linje, trykk: d$ - 3. For å slette en hel linje, trykk: dd - - 4. For å repetere en bevegelse, sett et nummer foran: 2w - 5. Formatet for en forandringskommando er: - operator [nummer] bevegelse - der: - operator - hva som skal gjøres, f.eks. d for å slette - [nummer] - et valgfritt antall for å repetere bevegelsen - bevegelse - hva kommandoen skal operere på, eksempelvis w (ord), - $ (til slutten av linjen) og så videre. - - 6. For å gå til starten av en linje, bruk en null: 0 - - 7. For å angre tidligere endringer, skriv: u (liten u) - For å angre alle forandringer på en linje, skriv: U (stor U) - For å omgjøre angringen, trykk: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.1: «LIM INN»-KOMMANDOEN - - - ** Trykk p for å lime inn tidligere slettet tekst etter markøren ** - - 1. Flytt markøren til den første linjen med ---> nedenfor. - - 2. Trykk dd for å slette linjen og lagre den i et Vim-register. - - 3. Flytt markøren til c)-linjen, OVER posisjonen linjen skal settes inn. - - 4. Trykk p for å legge linjen under markøren. - - 5. Repeter punkt 2 til 4 helt til linjene er i riktig rekkefølge. - ----> d) Kan du også lære? ----> b) Fioler er blå, ----> c) Intelligens må læres, ----> a) Roser er røde, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.2: «ERSTATT»-KOMMANDOEN - - - ** Trykk rx for å erstatte tegnet under markøren med x. ** - - 1. Flytt markøren til den første linjen nedenfor merket --->. - - 2. Flytt markøren så den står oppå den første feilen. - - 3. Trykk r og deretter tegnet som skal være der. - - 4. Repeter punkt 2 og 3 til den første linjen er lik den andre. - ----> Da dfnne lynjxn ble zkrevet, var det nøen som tjykket feite taster! ----> Da denne linjen ble skrevet, var det noen som trykket feile taster! - - 5. Gå videre til leksjon 1.3.2. - -MERK: Husk at du bør lære ved å BRUKE, ikke pugge. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.3: «FORANDRE»-OPERATOREN - - - ** For å forandre til slutten av et ord, trykk ce . ** - - 1. Flytt markøren til den første linjen nedenfor som er merket --->. - - 2. Plasser markøren på u i «lubjwr». - - 3. Trykk ce og det korrekte ordet (i dette tilfellet, skriv «injen»). - - 4. Trykk og gå til det neste tegnet som skal forandres. - - 5. Repeter punkt 3 og 4 helt til den første setningen er lik den andre. - ----> Denne lubjwr har noen wgh som må forkwåp med «forækzryas»-kommandoen. ----> Denne linjen har noen ord som må forandres med «forandre»-kommandoen. - -Vær oppmerksom på at ce sletter ordet og går inn i innsettingsmodus. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.3.4: FLERE FORANDRINGER VED BRUK AV c - - - ** Forandringskommandoen blir brukt med de samme bevegelser som «slett». ** - - 1. Forandringsoperatoren fungerer på samme måte som «slett». Formatet er: - - c [nummer] bevegelse - - 2. Bevegelsene er de samme, som for eksempel w (ord) og $ (slutten av en - linje). - - 3. Gå til den første linjen nedenfor som er merket --->. - - 4. Flytt markøren til den første feilen. - - 5. Skriv c$ og skriv resten av linjen lik den andre og trykk . - ----> Slutten på denne linjen trenger litt hjelp for å gjøre den lik den neste. ----> Slutten på denne linjen trenger å bli rettet ved bruk av c$-kommandoen. - -MERK: Du kan bruke slettetasten for å rette feil mens du skriver. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.3 - - - 1. For å legge tilbake tekst som nettopp er blitt slettet, trykk p . Dette - limer inn den slettede teksten ETTER markøren (hvis en linje ble slettet - vil den bli limt inn på linjen under markøren). - - 2. For å erstatte et tegn under markøren, trykk r og deretter tegnet som - du vil ha der. - - 3. Forandringsoperatoren lar deg forandre fra markøren til dit bevegelsen - tar deg. Det vil si, skriv ce for å forandre fra markøren til slutten - av ordet, c$ for å forandre til slutten av linjen. - - 4. Formatet for «forandre» er: - - c [nummer] bevegelse - -Nå kan du gå til neste leksjon. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.1: POSISJONERING AV MARKØREN OG FILSTATUS - - ** Trykk CTRL-G for å vise posisjonen i filen og filstatusen. - Trykk G for å gå til en spesifikk linje i filen. ** - - Merk: Les hele leksjonen før du utfører noen av punktene! - - 1. Hold nede Ctrl-tasten og trykk g . Vi kaller dette CTRL-G. En melding - vil komme til syne på bunnen av skjermen med filnavnet og posisjonen i - filen. Husk linjenummeret for bruk i steg 3. - -Merk: Du kan se markørposisjonen i nederste høyre hjørne av skjermen. Dette - skjer når «ruler»-valget er satt (forklart i leksjon 6). - - 2. Trykk G for å gå til bunnen av filen. - Skriv gg for å gå til begynnelsen av filen. - - 3. Skriv inn linjenummeret du var på og deretter G . Dette vil føre deg - tilbake til linjen du var på da du først trykket CTRL-G. - - 4. Utfør steg 1 til 3 hvis du føler deg sikker på prosedyren. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.2: SØKEKOMMANDOEN - - ** Skriv / etterfulgt av en søkestreng som du vil lete etter. ** - - 1. Trykk / når du er i normalmodusen. Legg merke til at skråstreken og - markøren kommer til syne på bunnen av skjermen i likhet med - «:»-kommandoene. - - 2. Skriv «feeeiil» og trykk . Dette er teksten du vil lete etter. - - 3. For å finne neste forekomst av søkestrengen, trykk n . - For å lete etter samme søketeksten i motsatt retning, trykk N . - - 4. For å lete etter en tekst bakover i filen, bruk ? istedenfor / . - - 5. For å gå tilbake til der du kom fra, trykk CTRL-O (Hold Ctrl nede mens - du trykker bokstaven o ). Repeter for å gå enda lengre tilbake. CTRL-I - går framover. - ----> «feeeiil» er ikke måten å skrive «feil» på, feeeiil er helt feil. -Merk: Når søkingen når slutten av filen, vil den fortsette fra starten unntatt - hvis «wrapscan»-valget er resatt. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.3: FINN SAMSVARENDE PARENTESER - - - ** Trykk % for å finne en samsvarende ), ] eller } . ** - - 1. Plasser markøren på en (, [ eller { på linjen nedenfor merket --->. - - 2. Trykk % . - - 3. Markøren vil gå til den samsvarende parentesen eller hakeparentesen. - - 4. Trykk % for å flytte markøren til den andre samsvarende parentesen. - - 5. Flytt markøren til en annen (, ), [, ], { eller } og se hva % gjør. - ----> Dette ( er en testlinje med (, [ ] og { } i den )). - -Merk: Dette er veldig nyttig til feilsøking i programmer som har ubalansert - antall parenteser! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.4.4: ERSTATT-KOMMANDOEN - - - ** Skriv :s/gammel/ny/g for å erstatte «gammel» med «ny». ** - - 1. Flytt markøren til linjen nedenfor som er merket med --->. - - 2. Skriv :s/deen/den/ . Legg merke til at denne kommandoen bare - forandrer den første forekomsten av «deen» på linjen. - - 3. Skriv :s/deen/den/g . Når g-flagget legges til, betyr dette global - erstatning på linjen og erstatter alle forekomster av «deen» på linjen. - ----> deen som kan kaste deen tyngste steinen lengst er deen beste - - 4. For å erstatte alle forekomster av en tekststreng mellom to linjer, - skriv :#,#s/gammel/ny/g der #,# er linjenumrene på de to linjene for - linjeområdet erstatningen skal gjøres. - Skriv :%s/gammel/ny/g for å erstatte tekst i hele filen. - Skriv :%s/gammel/ny/gc for å finne alle forekomster i hele filen, og - deretter spørre om teksten skal erstattes eller - ikke. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.4 - - - 1. Ctrl-G viser nåværende posisjon i filen og filstatusen. - G går til slutten av filen. - nummer G går til det linjenummeret. - gg går til den første linjen. - - 2. Skriv / etterfulgt av en søketekst for å lete FRAMOVER etter teksten. - Skriv ? etterfulgt av en søketekst for å lete BAKOVER etter teksten. - Etter et søk kan du trykke n for å finne neste forekomst i den samme - retningen eller N for å lete i motsatt retning. - CTRL-O tar deg tilbake til gamle posisjoner, CTRL-I til nyere posisjoner. - - 3. Skriv % når markøren står på en (, ), [, ], { eller } for å finne den - som samsvarer. - - 4. Erstatte «gammel» med første «ny» på en linje: :s/gammel/ny - Erstatte alle «gammel» med «ny» på en linje: :s/gammel/ny/g - Erstatte tekst mellom to linjenumre: :#,#s/gammel/ny/g - Erstatte alle forekomster i en fil: :%s/gammel/ny/g - For å godkjenne hver erstatning, legg til «c»: :%s/gammel/ny/gc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.1: HVORDAN UTFØRE EN EKSTERN KOMMANDO - - - ** Skriv :! etterfulgt av en ekstern kommando for å utføre denne. ** - - 1. Skriv den velkjente kommandoen : for å plassere markøren på bunnen av - skjermen. Dette lar deg skrive en kommandolinjekommando. - - 2. Nå kan du skrive tegnet ! . Dette lar deg utføre en hvilken som helst - ekstern kommando. - - 3. Som et eksempel, skriv ls etter utropstegnet og trykk . Du vil - nå få en liste over filene i katalogen, akkurat som om du hadde kjørt - kommandoen direkte fra kommandolinjen i skallet. Eller bruk :!dir hvis - «ls» ikke virker. - -MERK: Det er mulig å kjøre alle eksterne kommandoer på denne måten, også med - parametere. - -MERK: Alle «:»-kommandoer må avsluttes med . Fra dette punktet er det - ikke alltid vi nevner det. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.2: MER OM LAGRING AV FILER - - - ** For å lagre endringene gjort i en tekst, skriv :w FILNAVN. ** - - 1. Skriv :!dir eller :!ls for å få en liste over filene i katalogen. Du - vet allerede at du må trykke etter dette. - - 2. Velg et filnavn på en fil som ikke finnes, som for eksempel TEST . - - 3. Skriv :w TEST (der TEST er filnavnet du velger). - - 4. Dette lagrer hele filen (denne innføringen) under navnet TEST . For å - sjekke dette, skriv :!dir eller :!ls igjen for å se innholdet av - katalogen. - -Merk: Hvis du nå hadde avsluttet Vim og startet på nytt igjen med «vim TEST», - ville filen vært en eksakt kopi av innføringen da du lagret den. - - 5. Fjern filen ved å skrive :!rm TEST hvis du er på et Unix-lignende - operativsystem, eller :!del TEST hvis du bruker MS-DOS. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.3: VELGE TEKST SOM SKAL LAGRES - - - ** For å lagre en del av en fil, skriv v bevegelse :w FILNAVN ** - - 1. Flytt markøren til denne linjen. - - 2. Trykk v og flytt markøren til det femte elementet nedenfor. Legg merke - til at teksten blir markert. - - 3. Trykk : (kolon). På bunnen av skjermen vil :'<,'> komme til syne. - - 4. Trykk w TEST , der TEST er et filnavn som ikke finnes enda. Kontroller - at du ser :'<,'>w TEST før du trykker Enter. - - 5. Vim vil skrive de valgte linjene til filen TEST. Bruk :!dir eller :!ls - for å se den. Ikke slett den enda! Vi vil bruke den i neste leksjon. - -MERK: Ved å trykke v startes visuelt valg. Du kan flytte markøren rundt for - å gjøre det valgte området større eller mindre. Deretter kan du bruke en - operator for å gjøre noe med teksten. For eksempel sletter d teksten. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.5.4: HENTING OG SAMMENSLÅING AV FILER - - - ** For å lese inn en annen fil inn i nåværende buffer, skriv :r FILNAVN ** - - 1. Plasser markøren like over denne linjen. - -MERK: Etter å ha utført steg 2 vil du se teksten fra leksjon 1.5.3. Gå deretter - NED for å se denne leksjonen igjen. - - 2. Hent TEST-filen ved å bruke kommandoen :r TEST der TEST er navnet på - filen du brukte. Filen du henter blir plassert nedenfor markørlinjen. - - 3. For å sjekke at filen ble hentet, gå tilbake og se at det er to kopier av - leksjon 1.5.3, originalen og denne versjonen. - -MERK: Du kan også lese utdataene av en ekstern kommando. For eksempel, :r !ls - leser utdataene av ls-kommandoen og legger dem nedenfor markøren. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.5 - - - 1. :!kommando utfører en ekstern kommandio. - - Noen nyttige eksempler er: - (MS-DOS) (Unix) - :!dir :!ls - List filene i katalogen. - :!del FILNAVN :!rm FILNAVN - Slett filen FILNAVN. - - 2. :w FILNAVN skriver den nåværende Vim-filen disken med navnet FILNAVN . - - 3. v bevegelse :w FILNAVN lagrer de visuelt valgte linjene til filen - FILNAVN. - - 4. :r FILNAVN henter filen FILNAVN og legger den inn nedenfor markøren. - - 5. :r !dir leser utdataene fra «dir»-kommandoen og legger dem nedenfor - markørposisjonen. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.1: «ÅPNE LINJE»-KOMMANDOEN - - - ** Skriv o for å «åpne opp» for en ny linje etter markøren og gå til - innsettingsmodus ** - - 1. Flytt markøren til linjen nedenfor merket --->. - - 2. Skriv o (liten o) for å åpne opp en linje NEDENFOR markøren og gå inn i - innsettingsmodus. - - 3. Skriv litt tekst og trykk for å gå ut av innsettingsmodusen. - ----> Etter at o er skrevet blir markøren plassert på den tomme linjen. - - 4. For å åpne en ny linje OVER markøren, trykk rett og slett en stor O - istedenfor en liten o . Prøv dette på linjen nedenfor. - ----> Lag ny linje over denne ved å trykke O mens markøren er på denne linjen. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.2: «LEGG TIL»-KOMMANDOEN - - - ** Skriv a for å legge til tekst ETTER markøren. ** - - 1. Flytt markøren til starten av linjen merket ---> nedenfor. - - 2. Trykk e til markøren er på slutten av «li». - - 3. Trykk a (liten a) for å legge til tekst ETTER markøren. - - 4. Fullfør ordet sånn som på linjen nedenfor. Trykk for å gå ut av - innsettingsmodusen. - - 5. Bruk e for å gå til det neste ufullstendige ordet og repeter steg 3 og - 4. - ----> Denne li lar deg øve på å leg til tek på en linje. ----> Denne linjen lar deg øve på å legge til tekst på en linje. - -Merk: a, i og A går alle til den samme innsettingsmodusen, den eneste - forskjellen er hvor tegnene blir satt inn. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.3: EN ANNEN MÅTE Å ERSTATTE PÅ - - - ** Skriv en stor R for å erstatte mer enn ett tegn. ** - - 1. Flytt markøren til den første linjen nedenfor merket --->. Flytt markøren - til begynnelsen av den første «xxx»-en. - - 2. Trykk R og skriv inn tallet som står nedenfor på den andre linjen så - det erstatter xxx. - - 3. Trykk for å gå ut av erstatningsmodusen. Legg merke til at resten - av linjen forblir uforandret. - - 4. Repeter stegene for å erstatte den gjenværende xxx. - ----> Ved å legge 123 til xxx får vi xxx. ----> Ved å legge 123 til 456 får vi 579. - -MERK: Erstatningsmodus er lik insettingsmodus, men hvert tegn som skrives - erstatter et eksisterende tegn. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.4: KOPIERE OG LIME INN TEKST - - - ** Bruk y-operatoren for å kopiere tekst og p for å lime den inn ** - - 1. Gå til linjen merket ---> nedenfor og plasser markøren etter «a)». - - 2. Gå inn i visuell modus med v og flytt markøren til like før «første». - - 3. Trykk y for å kopiere (engelsk: «yank») den uthevede teksten. - - 4. Flytt markøren til slutten av den neste linjen: j$ - - 5. Trykk p for å lime inn teksten. Trykk deretter: a andre . - - 6. Bruk visuell modus for å velge « valget.», kopier det med y , gå til - slutten av den neste linjen med j$ og legg inn teksten der med p . - ----> a) Dette er det første valget. - b) - -Merk: Du kan også bruke y som en operator; yw kopierer ett ord. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.6.5: SETT VALG - - - ** Sett et valg så søk eller erstatning ignorerer store/små bokstaver. ** - - 1. Let etter «ignore» ved å skrive: /ignore - Repeter flere ganger ved å trykke n . - - 2. Sett «ic»-valget (Ignore Case) ved å skrive: :set ic - - 3. Søk etter «ignore» igjen ved å trykke n . - Legg merke til at både «Ignore» og «IGNORE» blir funnet. - - 4. Sett «hlsearch»- og «incsearch»-valgene: :set hls is - - 5. Skriv søkekommandoen igjen og se hva som skjer: /ignore - - 6. For å slå av ignorering av store/små bokstaver, skriv: :set noic - -Merk: For å fjerne uthevingen av treff, skriv: :nohlsearch -Merk: Hvis du vil ignorere store/små bokstaver for kun en søkekommando, bruk - \c i uttrykket: /ignore\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.6 - - 1. Trykk o for å legge til en linje NEDENFOR markøren og gå inn i - innsettingsmodus. - Trykk O for å åpne en linje OVER markøren. - - 2. Skriv a for å sette inn tekst ETTER markøren. - Skriv A for å sette inn tekst etter slutten av linjen. - - 3. Kommandoen e går til slutten av et ord. - - 4. Operatoren y («yank») kopierer tekst, p («paste») limer den inn. - - 5. Ved å trykke R går du inn i erstatningsmodus helt til trykkes. - - 6. Skriv «:set xxx» for å sette valget «xxx». Noen valg er: - «ic» «ignorecase» ignorer store/små bokstaver under søk - «is» «incsearch» vis delvise treff for en søketekst - «hls» «hlsearch» uthev alle søketreff - - 7. Legg til «no» foran valget for å slå det av: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.1: FÅ HJELP - - - ** Bruk det innebygde hjelpesystemet. ** - - Vim har et omfattende innebygget hjelpesystem. For å starte det, prøv en av - disse måtene: - - Trykk Hjelp-tasten (hvis du har en) - - Trykk F1-tasten (hvis du har en) - - Skriv :help - - Les teksten i hjelpevinduet for å finne ut hvordan hjelpen virker. - Skriv CTRL-W CTRL-W for å hoppe fra et vindu til et annet - Skriv :q for å lukke hjelpevinduet. - - Du kan få hjelp for omtrent alle temaer om Vim ved å skrive et parameter til - «:help»-kommandoen. Prøv disse (ikke glem å trykke ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.2: LAG ET OPPSTARTSSKRIPT - - - ** Slå på funksjoner i Vim ** - - Vim har mange flere funksjoner enn Vi, men flesteparten av dem er slått av - som standard. For å begynne å bruke flere funksjoner må du lage en - «vimrc»-fil. - - 1. Start redigeringen av «vimrc»-filen. Dette avhenger av systemet ditt: - :e ~/.vimrc for Unix - :e ~/_vimrc for MS Windows - - 2. Les inn eksempelfilen for «vimrc»: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Lagre filen med: - :w - - Neste gang du starter Vim vil den bruke syntaks-utheving. Du kan legge til - alle dine foretrukne oppsett i denne «vimrc»-filen. - For mer informasjon, skriv :help vimrc-intro -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Leksjon 1.7.3: FULLFØRING - - - ** Kommandolinjefullføring med CTRL-D og ** - - 1. Vær sikker på at Vim ikke er i Vi-kompatibel modus: :set nocp - - 2. Se hvilke filer som er i katalogen: :!ls eller :!dir - - 3. Skriv starten på en kommando: :e - - 4. Trykk CTRL-D og Vim vil vise en liste over kommandoer som starter med - «e». - - 5. Trykk og Vim vil fullføre kommandonavnet til «:edit». - - 6. Legg til et mellomrom og starten på et eksisterende filnavn: :edit FIL - - 7. Trykk . Vim vil fullføre navnet (hvis det er unikt). - -MERK: Fullføring fungerer for mange kommandoer. Prøv ved å trykke CTRL-D og - . Det er spesielt nyttig for bruk sammen med :help . -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - OPPSUMMERING AV LEKSJON 1.7 - - - 1. Skriv :help eller trykk eller for å åpne et hjelpevindu. - - 2. Skriv :help kommando for å få hjelp om kommando . - - 3. Trykk CTRL-W CTRL-W for å hoppe til et annet vindu. - - 4. Trykk :q for å lukke hjelpevinduet. - - 5. Opprett et vimrc-oppstartsskript for å lagre favorittvalgene dine. - - 6. Når du skriver en «:»-kommando, trykk CTRL-D for å se mulige - fullføringer. Trykk for å bruke en fullføring. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Her slutter innføringen i Vim. Den var ment som en rask oversikt over - editoren, akkurat nok til å la deg sette i gang med enkel bruk. Den er på - langt nær komplett, da Vim har mange flere kommandoer. Les bruksanvisningen - ved å skrive :help user-manual . - - For videre lesing og studier, kan denne boken anbefales: - «Vim - Vi Improved» av Steve Oualline - Utgiver: New Riders - Den første boken som er fullt og helt dedisert til Vim. Spesielt nyttig for - nybegynnere. Inneholder mange eksempler og illustrasjoner. - Se https://iccf-holland.org/click5.html - - Denne boken er eldre og handler mer om Vi enn Vim, men anbefales også: - «Learning the Vi Editor» av Linda Lamb - Utgiver: O'Reilly & Associates Inc. - Det er en god bok for å få vite omtrent hva som helst om Vi. - Den sjette utgaven inneholder også informasjon om Vim. - - Denne innføringen er skrevet av Michael C. Pierce og Robert K. Ware, - Colorado School of Mines med idéer av Charles Smith, Colorado State - University. E-mail: bware@mines.colorado.edu . - - Modifisert for Vim av Bram Moolenaar. - Oversatt av Øyvind A. Holm. E-mail: vimtutor _AT_ sunbase.org - Id: tutor.no 406 2007-03-18 22:48:36Z sunny - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -vim: set ts=8 : diff --git a/runtime/tutor/tutor1.pl b/runtime/tutor/tutor1.pl index 5d75bdeac7..cd3d5bd354 100644 --- a/runtime/tutor/tutor1.pl +++ b/runtime/tutor/tutor1.pl @@ -2,92 +2,92 @@ = W i t a j w t u t o r i a l u V I M - a - Wersja 1.7. = =============================================================================== - Vim to pot�ny edytor, kt�ry posiada wiele polece�, zbyt du�o, by - wyja�ni� je wszystkie w tym tutorialu. Ten przewodnik ma nauczy� - Ci� pos�ugiwa� si� wystarczaj�co wieloma komendami, by� m�g� �atwo - u�ywa� Vima jako edytora og�lnego przeznaczenia. + Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo, by + wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć + Cię posługiwać się wystarczająco wieloma komendami, byś mógł łatwo + używać Vima jako edytora ogólnego przeznaczenia. - Czas potrzebny na uko�czenie tutoriala to 25 do 30 minut i zale�y - od tego jak wiele czasu sp�dzisz na eksperymentowaniu. + Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy + od tego jak wiele czasu spędzisz na eksperymentowaniu. UWAGA: - Polecenia wykonywane w czasie lekcji zmodyfikuj� tekst. Zr�b - wcze�niej kopi� tego pliku do �wicze� (je�li zacz��e� komend� - "vimtutor", to ju� pracujesz na kopii). + Polecenia wykonywane w czasie lekcji zmodyfikują tekst. Zrób + wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą + "vimtutor", to już pracujesz na kopii). - Pami�taj, �e przewodnik ten zosta� zaprojektowany do nauki poprzez - �wiczenia. Oznacza to, �e musisz wykonywa� polecenia, by nauczy� si� ich - prawid�owo. Je�li b�dziesz jedynie czyta� tekst, szybko zapomnisz wiele - polece�! + Pamiętaj, że przewodnik ten został zaprojektowany do nauki poprzez + ćwiczenia. Oznacza to, że musisz wykonywać polecenia, by nauczyć się ich + prawidłowo. Jeśli będziesz jedynie czytał tekst, szybko zapomnisz wiele + poleceń! - Teraz upewnij si�, �e nie masz wci�ni�tego Caps Locka i wciskaj j - tak d�ugo dop�ki Lekcja 1.1.1. nie wype�ni ca�kowicie ekranu. + Teraz upewnij się, że nie masz wciśniętego Caps Locka i wciskaj j + tak długo dopóki Lekcja 1.1.1. nie wypełni całkowicie ekranu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.1.: PORUSZANIE SI� KURSOREM + Lekcja 1.1.1.: PORUSZANIE SIĘ KURSOREM - ** By wykona� ruch kursorem, wci�nij h, j, k, l jak pokazano. ** + ** By wykonać ruch kursorem, wciśnij h, j, k, l jak pokazano. ** ^ - k Wskaz�wka: h jest po lewej + k Wskazówka: h jest po lewej < h l > l jest po prawej - j j wygl�da jak strza�ka w d� + j j wygląda jak strzałka w dół v - 1. Poruszaj kursorem dop�ki nie b�dziesz pewien, �e pami�tasz polecenia. + 1. Poruszaj kursorem dopóki nie będziesz pewien, że pamiętasz polecenia. - 2. Trzymaj j tak d�ugo a� b�dzie si� powtarza�. - Teraz wiesz jak doj�� do nast�pnej lekcji. + 2. Trzymaj j tak długo aż będzie się powtarzał. + Teraz wiesz jak dojść do następnej lekcji. - 3. U�ywaj�c strza�ki w d� przejd� do nast�pnej lekcji. + 3. Używając strzałki w dół przejdź do następnej lekcji. -Uwaga: Je�li nie jeste� pewien czego� co wpisa�e�, wci�nij , by wr�ci� do - trybu Normal. Wtedy powt�rz polecenie. +Uwaga: Jeśli nie jesteś pewien czegoś co wpisałeś, wciśnij , by wrócić do + trybu Normal. Wtedy powtórz polecenie. -Uwaga: Klawisze kursora tak�e powinny dzia�a�, ale u�ywaj�c hjkl b�dziesz - w stanie porusza� si� o wiele szybciej, jak si� tylko przyzwyczaisz. - Naprawd�! +Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz + w stanie poruszać się o wiele szybciej, jak się tylko przyzwyczaisz. + Naprawdę! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.1.2.: WYCHODZENIE Z VIM-a - !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj ca�� lekcj� !! + !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj całą lekcję !! - 1. Wci�nij (aby upewni� si�, �e jeste� w trybie Normal). + 1. Wciśnij (aby upewnić się, że jesteś w trybie Normal). 2. Wpisz: :q!. - To spowoduje wyj�cie z edytora PORZUCAJ�C wszelkie zmiany, jakie - zd��y�e� zrobi�. Je�li chcesz zapami�ta� zmiany i wyj��, + To spowoduje wyjście z edytora PORZUCAJĄC wszelkie zmiany, jakie + zdążyłeś zrobić. Jeśli chcesz zapamiętać zmiany i wyjść, wpisz: :wq - 3. Kiedy widzisz znak zach�ty pow�oki wpisz komend�, �eby wr�ci� + 3. Kiedy widzisz znak zachęty powłoki wpisz komendę, żeby wrócić do tutoriala. Czyli: vimtutor - 4. Je�li chcesz zapami�ta� polecenia, wykonaj kroki 1. do 3., aby - wyj�� i wr�ci� do edytora. + 4. Jeśli chcesz zapamiętać polecenia, wykonaj kroki 1. do 3., aby + wyjść i wrócić do edytora. -UWAGA: :q! porzuca wszelkie zmiany jakie zrobi�e�. W nast�pnych - lekcjach dowiesz si� jak je zapami�tywa�. +UWAGA: :q! porzuca wszelkie zmiany jakie zrobiłeś. W następnych + lekcjach dowiesz się jak je zapamiętywać. - 5. Przenie� kursor do lekcji 1.1.3. + 5. Przenieś kursor do lekcji 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.1.3.: EDYCJA TEKSTU - KASOWANIE - ** Wci�nij x aby usun�� znak pod kursorem. ** + ** Wciśnij x aby usunąć znak pod kursorem. ** - 1. Przenie� kursor do linii poni�ej oznaczonej --->. + 1. Przenieś kursor do linii poniżej oznaczonej --->. - 2. By poprawi� b��dy, naprowad� kursor na znak do usuni�cia. + 2. By poprawić błędy, naprowadź kursor na znak do usunięcia. - 3. Wci�nij x aby usun�� niechciany znak. + 3. Wciśnij x aby usunąć niechciany znak. - 4. Powtarzaj kroki 2. do 4. dop�ki zdanie nie jest poprawne. + 4. Powtarzaj kroki 2. do 4. dopóki zdanie nie jest poprawne. ----> Kkrowa prrzeskoczy�a prrzez ksii�ycc. +---> Kkrowa prrzeskoczyła prrzez ksiiężycc. - 5. Teraz, kiedy zdanie jest poprawione, przejd� do Lekcji 1.1.4. + 5. Teraz, kiedy zdanie jest poprawione, przejdź do Lekcji 1.1.4. -UWAGA: Ucz si� przez �wiczenie, nie wkuwanie. +UWAGA: Ucz się przez ćwiczenie, nie wkuwanie. @@ -97,135 +97,135 @@ Lekcja 1.1.4.: EDYCJA TEKSTU - INSERT (wprowadzanie) - ** Wci�nij i aby wstawi� tekst. ** + ** Wciśnij i aby wstawić tekst. ** - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej --->. + 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. - 2. Aby poprawi� pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym, - gdzie tekst ma by� wstawiony. + 2. Aby poprawić pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym, + gdzie tekst ma być wstawiony. - 3. Wci�nij i a nast�pnie wpisz konieczne poprawki. + 3. Wciśnij i a następnie wpisz konieczne poprawki. - 4. Po poprawieniu b��du wci�nij , by wr�ci� do trybu Normal. - Powtarzaj kroki 2. do 4., aby poprawi� ca�e zdanie. + 4. Po poprawieniu błędu wciśnij , by wrócić do trybu Normal. + Powtarzaj kroki 2. do 4., aby poprawić całe zdanie. ----> W tej brkje troch� . ----> W tej linii brakuje troch� tekstu. +---> W tej brkje trochę . +---> W tej linii brakuje trochę tekstu. - 5. Kiedy czujesz si� swobodnie wstawiaj�c tekst, przejd� do - podsumowania poni�ej. + 5. Kiedy czujesz się swobodnie wstawiając tekst, przejdź do + podsumowania poniżej. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.1.5.: EDYCJA TEKSTU - APPENDING (dodawanie) - ** Wci�nij A by doda� tekst. ** + ** Wciśnij A by dodać tekst. ** - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej --->. - Nie ma znaczenia, kt�ry to b�dzie znak. + 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. + Nie ma znaczenia, który to będzie znak. - 2. Wci�nij A i wpisz odpowiednie dodatki. + 2. Wciśnij A i wpisz odpowiednie dodatki. - 3. Kiedy tekst zosta� dodany, wci�nij i wr�� do trybu Normalnego. + 3. Kiedy tekst został dodany, wciśnij i wróć do trybu Normalnego. - 4. Przenie� kursor do drugiej linii oznaczonej ---> i powt�rz kroki 2. i 3., - aby poprawi� zdanie. + 4. Przenieś kursor do drugiej linii oznaczonej ---> i powtórz kroki 2. i 3., + aby poprawić zdanie. ---> Brakuje tu tro - Brakuje tu troch� tekstu. ----> Tu te� troch� bra - Tu te� troch� brakuje. + Brakuje tu trochę tekstu. +---> Tu też trochę bra + Tu też trochę brakuje. - 5. Kiedy ju� utrwali�e� �wiczenie, przejd� do lekcji 1.1.6. + 5. Kiedy już utrwaliłeś ćwiczenie, przejdź do lekcji 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.1.6.: EDYCJA PLIKU - ** U�yj :wq aby zapisa� plik i wyj��. ** + ** Użyj :wq aby zapisać plik i wyjść. ** - !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczytaj ca�� lekcj� !! + !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczytaj całą lekcję !! - 1. Zako�cz tutorial tak jak w lekcji 1.1.2.: :q! - lub, je�li masz dost�p do innego terminala, wykonaj kolejne kroki tam. + 1. Zakończ tutorial tak jak w lekcji 1.1.2.: :q! + lub, jeśli masz dostęp do innego terminala, wykonaj kolejne kroki tam. - 2. W pow�oce wydaj polecenie: vim tutor - "vim" jest poleceniem uruchamiaj�cym edytor Vim. 'tutor' to nazwa pliku, - jaki chcesz edytowa�. U�yj pliku, kt�ry mo�e zosta� zmieniony. + 2. W powłoce wydaj polecenie: vim tutor + "vim" jest poleceniem uruchamiającym edytor Vim. 'tutor' to nazwa pliku, + jaki chcesz edytować. Użyj pliku, który może zostać zmieniony. - 3. Dodaj i usu� tekst tak, jak si� nauczy�e� w poprzednich lekcjach. + 3. Dodaj i usuń tekst tak, jak się nauczyłeś w poprzednich lekcjach. - 4. Zapisz plik ze zmianami i opu�� Vima: :wq + 4. Zapisz plik ze zmianami i opuść Vima: :wq - 5. Je�li zako�czy�e� vimtutor w kroku 1., uruchom go ponownie i przejd� - do podsumowania poni�ej. + 5. Jeśli zakończyłeś vimtutor w kroku 1., uruchom go ponownie i przejdź + do podsumowania poniżej. - 6. Po przeczytaniu wszystkich krok�w i ich zrozumieniu: wykonaj je. + 6. Po przeczytaniu wszystkich kroków i ich zrozumieniu: wykonaj je. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1.1. PODSUMOWANIE - 1. Poruszasz kursorem u�ywaj�c "strza�ek" i klawiszy hjkl . - h (w lewo) j (w d�) k (do g�ry) l (w prawo) + 1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl . + h (w lewo) j (w dół) k (do góry) l (w prawo) - 2. By wej�� do Vima, (z pow�oki) wpisz: + 2. By wejść do Vima, (z powłoki) wpisz: vim NAZWA_PLIKU - 3. By wyj�� z Vima, wpisz: - :q! by usun�� wszystkie zmiany. - LUB: :wq by zmiany zachowa�. + 3. By wyjść z Vima, wpisz: + :q! by usunąć wszystkie zmiany. + LUB: :wq by zmiany zachować. - 4. By usun�� znak pod kursorem, wci�nij: x + 4. By usunąć znak pod kursorem, wciśnij: x - 5. By wstawi� tekst przed kursorem lub doda�: + 5. By wstawić tekst przed kursorem lub dodać: i wpisz tekst wstawi przed kursorem - A wpisz tekst doda na ko�cu linii + A wpisz tekst doda na końcu linii -UWAGA: Wci�ni�cie przeniesie Ci� z powrotem do trybu Normal - lub odwo�a niechciane lub cz�ciowo wprowadzone polecenia. +UWAGA: Wciśnięcie przeniesie Cię z powrotem do trybu Normal + lub odwoła niechciane lub częściowo wprowadzone polecenia. -Teraz mo�emy kontynuowa� i przej�� do Lekcji 1.2. +Teraz możemy kontynuować i przejść do Lekcji 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.2.1.: POLECENIE DELETE (usuwanie) - ** Wpisz dw by usun�� wyraz. ** + ** Wpisz dw by usunąć wyraz. ** - 1. Wci�nij , by upewni� si�, �e jeste� w trybie Normal. + 1. Wciśnij , by upewnić się, że jesteś w trybie Normal. - 2. Przenie� kursor do linii poni�ej oznaczonej --->. + 2. Przenieś kursor do linii poniżej oznaczonej --->. - 3. Przesu� kursor na pocz�tek wyrazu, kt�ry chcesz usun��. + 3. Przesuń kursor na początek wyrazu, który chcesz usunąć. - 4. Wpisz dw by usun�� wyraz. + 4. Wpisz dw by usunąć wyraz. - UWAGA: Litera d pojawi si� na dole ekranu. Vim czeka na wpisanie w . - Je�li zobaczysz inny znak, oznacza to, �e wpisa�e� co� �le; wci�nij - i zacznij od pocz�tku. + UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w . + Jeśli zobaczysz inny znak, oznacza to, że wpisałeś coś źle; wciśnij + i zacznij od początku. ----> Jest tu par� papier wyraz�w, kt�re kamie� nie nale�� do no�yce tego zdania. +---> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania. - 5. Powtarzaj kroki 3. i 4. dop�ki zdanie nie b�dzie poprawne, potem - przejd� do Lekcji 1.2.2. + 5. Powtarzaj kroki 3. i 4. dopóki zdanie nie będzie poprawne, potem + przejdź do Lekcji 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.2.: WI�CEJ POLECE� USUWAJ�CYCH + Lekcja 1.2.2.: WIĘCEJ POLECEŃ USUWAJĄCYCH - ** Wpisz d$ aby usun�� tekst do ko�ca linii. ** + ** Wpisz d$ aby usunąć tekst do końca linii. ** - 1. Wci�nij aby si� upewni�, �e jeste� w trybie Normal. + 1. Wciśnij aby się upewnić, że jesteś w trybie Normal. - 2. Przenie� kursor do linii poni�ej oznaczonej --->. + 2. Przenieś kursor do linii poniżej oznaczonej --->. - 3. Przenie� kursor do ko�ca poprawnego zdania (PO pierwszej . ). + 3. Przenieś kursor do końca poprawnego zdania (PO pierwszej . ). - 4. Wpisz d$ aby usun�� reszt� linii. + 4. Wpisz d$ aby usunąć resztę linii. ----> Kto� wpisa� koniec tego zdania dwukrotnie. zdania dwukrotnie. +---> Ktoś wpisał koniec tego zdania dwukrotnie. zdania dwukrotnie. - 5. Przejd� do Lekcji 1.2.3., by zrozumie� co si� sta�o. + 5. Przejdź do Lekcji 1.2.3., by zrozumieć co się stało. @@ -235,68 +235,68 @@ Lekcja 1.2.3.: O OPERATORACH I RUCHACH - Wiele polece� zmieniaj�cych tekst jest z�o�onych z operatora i ruchu. - Format dla polecenia usuwaj�cego z operatorem d jest nast�puj�cy: + Wiele poleceń zmieniających tekst jest złożonych z operatora i ruchu. + Format dla polecenia usuwającego z operatorem d jest następujący: d ruch gdzie: d - operator usuwania. - ruch - na czym polecenie b�dzie wykonywane (lista poni�ej). + ruch - na czym polecenie będzie wykonywane (lista poniżej). - Kr�tka lista ruch�w: - w - do pocz�tku nast�pnego wyrazu WY��CZAJ�C pierwszy znak. - e - do ko�ca bie��cego wyrazu, W��CZAJ�C ostatni znak. - $ - do ko�ca linii, W��CZAJ�C ostatni znak. + Krótka lista ruchów: + w - do początku następnego wyrazu WYŁĄCZAJĄC pierwszy znak. + e - do końca bieżącego wyrazu, WŁĄCZAJĄC ostatni znak. + $ - do końca linii, WŁĄCZAJĄC ostatni znak. -W ten spos�b wpisanie de usunie znaki od kursora do ko�ca wyrazu. +W ten sposób wpisanie de usunie znaki od kursora do końca wyrazu. UWAGA: Wpisanie tylko ruchu w trybie Normal bez operatora przeniesie kursor - tak, jak to okre�lono. + tak, jak to określono. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.4.: U�YCIE MNO�NIKA DLA RUCHU + Lekcja 1.2.4.: UŻYCIE MNOŻNIKA DLA RUCHU - ** Wpisanie liczby przed ruchem powtarza ruch odpowiedni� ilo�� razy. ** + ** Wpisanie liczby przed ruchem powtarza ruch odpowiednią ilość razy. ** - 1. Przenie� kursor na pocz�tek linii poni�ej zaznaczonej --->. + 1. Przenieś kursor na początek linii poniżej zaznaczonej --->. - 2. Wpisz 2w aby przenie�� kursor o dwa wyrazy do przodu. + 2. Wpisz 2w aby przenieść kursor o dwa wyrazy do przodu. - 3. Wpisz 3e aby przenie�� kursor do ko�ca trzeciego wyrazu w prz�d. + 3. Wpisz 3e aby przenieść kursor do końca trzeciego wyrazu w przód. - 4. Wpisz 0 (zero), aby przenie�� kursor na pocz�tek linii. + 4. Wpisz 0 (zero), aby przenieść kursor na początek linii. - 5. Powt�rz kroki 2. i 3. z innymi liczbami. + 5. Powtórz kroki 2. i 3. z innymi liczbami. - ---> To jest zwyk�y wiersz z wyrazami, po kt�rych mo�esz si� porusza�. + ---> To jest zwykły wiersz z wyrazami, po których możesz się poruszać. - 6. Przejd� do lekcji 1.2.5. + 6. Przejdź do lekcji 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.5.: U�YCIE MNO�NIKA, BY WI�CEJ USUN�� + Lekcja 1.2.5.: UŻYCIE MNOŻNIKA, BY WIĘCEJ USUNĄĆ - ** Wpisanie liczby z operatorem powtarza go odpowiedni� ilo�� razy. ** + ** Wpisanie liczby z operatorem powtarza go odpowiednią ilość razy. ** - W wy�ej wspomnianej kombinacji operatora usuwania i ruchu podaj mno�nik - przed ruchem, by wi�cej usun��: + W wyżej wspomnianej kombinacji operatora usuwania i ruchu podaj mnożnik + przed ruchem, by więcej usunąć: d liczba ruch - 1. Przenie� kursor do pierwszego wyrazu KAPITALIKAMI w linii zaznaczonej --->. + 1. Przenieś kursor do pierwszego wyrazu KAPITALIKAMI w linii zaznaczonej --->. - 2. Wpisz 2dw aby usun�� dwa wyrazy KAPITALIKAMI. + 2. Wpisz 2dw aby usunąć dwa wyrazy KAPITALIKAMI. - 3. Powtarzaj kroki 1. i 2. z innymi mno�nikami, aby usun�� kolejne wyrazy + 3. Powtarzaj kroki 1. i 2. z innymi mnożnikami, aby usunąć kolejne wyrazy KAPITALIKAMI jednym poleceniem ----> ta ASD WE linia QWE ASDF ZXCV FG wyraz�w zosta�a ERT FGH CF oczyszczona. +---> ta ASD WE linia QWE ASDF ZXCV FG wyrazów została ERT FGH CF oczyszczona. -UWAGA: Mno�nik pomi�dzy operatorem d i ruchem dzia�a podobnie do ruchu bez +UWAGA: Mnożnik pomiędzy operatorem d i ruchem działa podobnie do ruchu bez operatora. @@ -304,68 +304,68 @@ Lekcja 1.2.6.: OPEROWANIE NA LINIACH - ** Wpisz dd aby usun�� ca�� lini�. ** + ** Wpisz dd aby usunąć całą linię. ** - Z powodu cz�sto�ci usuwania ca�ych linii, projektanci Vi zdecydowali, �e - b�dzie �atwiej wpisa� dwa razy d aby usun�� lini�. + Z powodu częstości usuwania całych linii, projektanci Vi zdecydowali, że + będzie łatwiej wpisać dwa razy d aby usunąć linię. - 1. Przenie� kursor do drugiego zdania z wierszyka poni�ej. - 2. Wpisz dd aby usun�� wiersz. - 3. Teraz przenie� si� do czwartego wiersza. - 4. Wpisz 2dd aby usun�� dwa wiersze. + 1. Przenieś kursor do drugiego zdania z wierszyka poniżej. + 2. Wpisz dd aby usunąć wiersz. + 3. Teraz przenieś się do czwartego wiersza. + 4. Wpisz 2dd aby usunąć dwa wiersze. ----> 1) R�e s� czerwone, ----> 2) B�oto jest fajne, ----> 3) Fio�ki s� niebieskie, ----> 4) Mam samoch�d, +---> 1) Róże są czerwone, +---> 2) Błoto jest fajne, +---> 3) Fiołki są niebieskie, +---> 4) Mam samochód, ---> 5) Zegar podaje czas, ----> 6) Cukier jest s�odki, ----> 7) I ty te�. +---> 6) Cukier jest słodki, +---> 7) I ty też. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.2.7.: POLECENIE UNDO (cofnij) - ** Wci�nij u aby cofn�� skutki ostatniego polecenia. - U za�, by cofn�� skutki dla ca�ej linii. ** + ** Wciśnij u aby cofnąć skutki ostatniego polecenia. + U zaś, by cofnąć skutki dla całej linii. ** - 1. Przenie� kursor do zdania poni�ej oznaczonego ---> i umie�� go na - pierwszym b��dzie. - 2. Wpisz x aby usun�� pierwszy niechciany znak. - 3. Teraz wci�nij u aby cofn�� skutki ostatniego polecenia. - 4. Tym razem popraw wszystkie b��dy w linii u�ywaj�c polecenia x . - 5. Teraz wci�nij wielkie U aby przywr�ci� lini� do oryginalnego stanu. - 6. Teraz wci�nij u kilka razy, by cofn�� U i poprzednie polecenia. - 7. Teraz wpisz CTRL-R (trzymaj r�wnocze�nie wci�ni�te klawisze CTRL i R) - kilka razy, by cofn�� cofni�cia. + 1. Przenieś kursor do zdania poniżej oznaczonego ---> i umieść go na + pierwszym błędzie. + 2. Wpisz x aby usunąć pierwszy niechciany znak. + 3. Teraz wciśnij u aby cofnąć skutki ostatniego polecenia. + 4. Tym razem popraw wszystkie błędy w linii używając polecenia x . + 5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu. + 6. Teraz wciśnij u kilka razy, by cofnąć U i poprzednie polecenia. + 7. Teraz wpisz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R) + kilka razy, by cofnąć cofnięcia. ----> Poopraw b��dyyy w teej liniii i zaamiie� je prrzez coofnij. +---> Poopraw błędyyy w teej liniii i zaamiień je prrzez coofnij. - 8. To s� bardzo po�yteczne polecenia. + 8. To są bardzo pożyteczne polecenia. - Przejd� teraz do podsumowania Lekcji 1.2. + Przejdź teraz do podsumowania Lekcji 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1.2. PODSUMOWANIE - 1. By usun�� znaki od kursora do nast�pnego wyrazu, wpisz: dw - 2. By usun�� znaki od kursora do ko�ca linii, wpisz: d$ - 3. By usun�� ca�� lini�: dd - 4. By powt�rzy� ruch, poprzed� go liczb�: 2w + 1. By usunąć znaki od kursora do następnego wyrazu, wpisz: dw + 2. By usunąć znaki od kursora do końca linii, wpisz: d$ + 3. By usunąć całą linię: dd + 4. By powtórzyć ruch, poprzedź go liczbą: 2w 5. Format polecenia zmiany to: operator [liczba] ruch gdzie: - operator - to, co trzeba zrobi� (np. d dla usuwania) - [liczba] - opcjonalne, ile razy powt�rzy� ruch + operator - to, co trzeba zrobić (np. d dla usuwania) + [liczba] - opcjonalne, ile razy powtórzyć ruch ruch - przenosi nad tekstem do operowania, takim jak w (wyraz), - $ (do ko�ca linii) etc. + $ (do końca linii) etc. - 6. By przej�� do pocz�tku linii, u�yj zera: 0 - 7. By cofn�� poprzednie polecenie, wpisz: u (ma�e u) - By cofn�� wszystkie zmiany w linii, wpisz: U (wielkie U) - By cofn�� cofni�cie, wpisz: CTRL-R + 6. By przejść do początku linii, użyj zera: 0 + 7. By cofnąć poprzednie polecenie, wpisz: u (małe u) + By cofnąć wszystkie zmiany w linii, wpisz: U (wielkie U) + By cofnąć cofnięcie, wpisz: CTRL-R @@ -373,182 +373,182 @@ Lekcja 1.3.1.: POLECENIE PUT (wstaw) - ** Wpisz p by wstawi� ostatnie usuni�cia za kursorem. ** + ** Wpisz p by wstawić ostatnie usunięcia za kursorem. ** - 1. Przenie� kursor do pierwszej linii ---> poni�ej. + 1. Przenieś kursor do pierwszej linii ---> poniżej. - 2. Wpisz dd aby usun�� lini� i przechowa� j� w rejestrze Vima. + 2. Wpisz dd aby usunąć linię i przechować ją w rejestrze Vima. - 3. Przenie� kursor do linii c), POWY�EJ tej, gdzie usuni�ta linia powinna - si� znajdowa�. + 3. Przenieś kursor do linii c), POWYŻEJ tej, gdzie usunięta linia powinna + się znajdować. - 4. Wci�nij p by wstawi� lini� poni�ej kursora. + 4. Wciśnij p by wstawić linię poniżej kursora. - 5. Powtarzaj kroki 2. do 4. a� znajd� si� w odpowiednim porz�dku. + 5. Powtarzaj kroki 2. do 4. aż znajdą się w odpowiednim porządku. ----> d) Jak dwa anio�ki. ----> b) Na dole fio�ki, ----> c) A my si� kochamy, ----> a) Na g�rze r�e, +---> d) Jak dwa aniołki. +---> b) Na dole fiołki, +---> c) A my się kochamy, +---> a) Na górze róże, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.2.: POLECENIE REPLACE (zast�p) + Lekcja 1.3.2.: POLECENIE REPLACE (zastąp) - ** Wpisz rx aby zast�pi� znak pod kursorem na x . ** + ** Wpisz rx aby zastąpić znak pod kursorem na x . ** - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej ---> + 1. Przenieś kursor do pierwszej linii poniżej oznaczonej ---> - 2. Ustaw kursor na pierwszym b��dzie. + 2. Ustaw kursor na pierwszym błędzie. - 3. Wpisz r a potem znak jaki powinien go zast�pi�. + 3. Wpisz r a potem znak jaki powinien go zastąpić. - 4. Powtarzaj kroki 2. i 3. dop�ki pierwsza linia nie b�dzie taka, jak druga. + 4. Powtarzaj kroki 2. i 3. dopóki pierwsza linia nie będzie taka, jak druga. ----> Kjedy ten wiersz bi� wst�kiwany, kto� wcizn�� per� z�ych klawirzy! ----> Kiedy ten wiersz by� wstukiwany, kto� wcisn�� par� z�ych klawiszy! +---> Kjedy ten wiersz bił wstókiwany, ktoś wciznął perę złych klawirzy! +---> Kiedy ten wiersz był wstukiwany, ktoś wcisnął parę złych klawiszy! - 5. Teraz czas na Lekcj� 1.3.3. + 5. Teraz czas na Lekcję 1.3.3. -UWAGA: Pami�taj, by uczy� si� �wicz�c, a nie pami�ciowo. +UWAGA: Pamiętaj, by uczyć się ćwicząc, a nie pamięciowo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.3.: OPERATOR CHANGE (zmie�) + Lekcja 1.3.3.: OPERATOR CHANGE (zmień) - ** By zmieni� do ko�ca wyrazu, wpisz ce . ** + ** By zmienić do końca wyrazu, wpisz ce . ** - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej --->. + 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. - 2. Umie�� kursor na u w lunos. + 2. Umieść kursor na u w lunos. 3. Wpisz ce i popraw wyraz (w tym wypadku wstaw inia ). - 4. Wci�nij i przejd� do nast�pnej planowanej zmiany. + 4. Wciśnij i przejdź do następnej planowanej zmiany. - 5. Powtarzaj kroki 3. i 4. dop�ki pierwsze zdanie nie b�dzie takie same, + 5. Powtarzaj kroki 3. i 4. dopóki pierwsze zdanie nie będzie takie same, jak drugie. ----> Ta lunos ma pire s��w, kt�re t�ina zbnic u�ifajonc pcmazu zmie�. ----> Ta linia ma par� s��w, kt�re trzeba zmieni� u�ywaj�c polecenia zmie�. +---> Ta lunos ma pire słów, które tżina zbnic użifajonc pcmazu zmień. +---> Ta linia ma parę słów, które trzeba zmienić używając polecenia zmień. - Zauwa�, �e ce nie tylko zamienia wyraz, ale tak�e zmienia tryb na + Zauważ, że ce nie tylko zamienia wyraz, ale także zmienia tryb na Insert (wprowadzanie). ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.4.: WI�CEJ ZMIAN U�YWAJ�C c + Lekcja 1.3.4.: WIĘCEJ ZMIAN UŻYWAJĄC c - ** Polecenie change u�ywa takich samych ruch�w, jak delete. ** + ** Polecenie change używa takich samych ruchów, jak delete. ** - 1. Operator change dzia�a tak samo, jak delete. Format wygl�da tak: + 1. Operator change działa tak samo, jak delete. Format wygląda tak: c [liczba] ruch - 2. Ruchy s� tak�e takie same, np.: w (wyraz), $ (koniec linii) etc. + 2. Ruchy są także takie same, np.: w (wyraz), $ (koniec linii) etc. - 3. Przenie� si� do pierwszej linii poni�ej oznaczonej ---> + 3. Przenieś się do pierwszej linii poniżej oznaczonej ---> - 4. Ustaw kursor na pierwszym b��dzie. + 4. Ustaw kursor na pierwszym błędzie. - 5. Wpisz c$ , popraw koniec wiersza i wci�nij . + 5. Wpisz c$ , popraw koniec wiersza i wciśnij . ----> Koniec tego wiersza musi by� poprawiony, aby wygl�da� tak, jak drugi. ----> Koniec tego wiersza musi by� poprawiony u�ywaj�c polecenia c$ . +---> Koniec tego wiersza musi być poprawiony, aby wyglądał tak, jak drugi. +---> Koniec tego wiersza musi być poprawiony używając polecenia c$ . -UWAGA: Mo�esz u�ywa� aby poprawia� b��dy w czasie pisania. +UWAGA: Możesz używać aby poprawiać błędy w czasie pisania. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1.3. PODSUMOWANIE - 1. Aby wstawi� tekst, kt�ry zosta� wcze�niej usuni�ty wci�nij p . To - polecenie wstawia skasowany tekst PO kursorze (je�li ca�a linia - zosta�a usuni�ta, zostanie ona umieszczona w linii poni�ej kursora). + 1. Aby wstawić tekst, który został wcześniej usunięty wciśnij p . To + polecenie wstawia skasowany tekst PO kursorze (jeśli cała linia + została usunięta, zostanie ona umieszczona w linii poniżej kursora). - 2. By zamieni� znak pod kursorem, wci�nij r a potem znak, kt�ry ma zast�pi� + 2. By zamienić znak pod kursorem, wciśnij r a potem znak, który ma zastąpić oryginalny. - 3. Operator change pozwala Ci na zast�pienie od kursora do miejsca, gdzie - zabra�by Ci� ruch. Np. wpisz ce aby zamieni� tekst od kursora do ko�ca - wyrazu, c$ aby zmieni� tekst do ko�ca linii. + 3. Operator change pozwala Ci na zastąpienie od kursora do miejsca, gdzie + zabrałby Cię ruch. Np. wpisz ce aby zamienić tekst od kursora do końca + wyrazu, c$ aby zmienić tekst do końca linii. - 4. Format do polecenia change (zmie�): + 4. Format do polecenia change (zmień): c [liczba] obiekt - Teraz przejd� do nast�pnej lekcji. + Teraz przejdź do następnej lekcji. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.1.: PO�O�ENIE KURSORA ORAZ STATUS PLIKU + Lekcja 1.4.1.: POŁOŻENIE KURSORA ORAZ STATUS PLIKU - ** Naci�nij CTRL-G aby zobaczy� swoje po�o�enie w pliku i status - pliku. Naci�nij G aby przej�� do linii w pliku. ** + ** Naciśnij CTRL-G aby zobaczyć swoje położenie w pliku i status + pliku. Naciśnij G aby przejść do linii w pliku. ** - UWAGA: Przeczytaj ca�� lekcj� zanim wykonasz jakie� polecenia!!! + UWAGA: Przeczytaj całą lekcję zanim wykonasz jakieś polecenia!!! - 1. Przytrzymaj klawisz CTRL i wci�nij g . U�ywamy notacji CTRL-G. - Na dole strony pojawi si� pasek statusu z nazw� pliku i pozycj� w pliku. - Zapami�taj numer linii dla potrzeb kroku 3. + 1. Przytrzymaj klawisz CTRL i wciśnij g . Używamy notacji CTRL-G. + Na dole strony pojawi się pasek statusu z nazwą pliku i pozycją w pliku. + Zapamiętaj numer linii dla potrzeb kroku 3. -UWAGA: Mo�esz te� zobaczy� pozycj� kursora w prawym, dolnym rogu ekranu. - Dzieje si� tak kiedy ustawiona jest opcja 'ruler' (wi�cej w lekcji 6.). +UWAGA: Możesz też zobaczyć pozycję kursora w prawym, dolnym rogu ekranu. + Dzieje się tak kiedy ustawiona jest opcja 'ruler' (więcej w lekcji 6.). - 2. Wci�nij G aby przej�� na koniec pliku. - Wci�nij gg aby przej�� do pocz�tku pliku. + 2. Wciśnij G aby przejść na koniec pliku. + Wciśnij gg aby przejść do początku pliku. - 3. Wpisz numer linii, w kt�rej by�e� a potem G . To przeniesie Ci� - z powrotem do linii, w kt�rej by�e� kiedy wcisn��e� CTRL-G. + 3. Wpisz numer linii, w której byłeś a potem G . To przeniesie Cię + z powrotem do linii, w której byłeś kiedy wcisnąłeś CTRL-G. - 4. Je�li czujesz si� wystarczaj�co pewnie, wykonaj kroki 1-3. + 4. Jeśli czujesz się wystarczająco pewnie, wykonaj kroki 1-3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.4.2.: POLECENIE SZUKAJ - ** Wpisz / a nast�pnie wyra�enie, aby je znale��. ** + ** Wpisz / a następnie wyrażenie, aby je znaleźć. ** - 1. W trybie Normal wpisz / . Zauwa�, �e znak ten oraz kursor pojawi� - si� na dole ekranu tak samo, jak polecenie : . + 1. W trybie Normal wpisz / . Zauważ, że znak ten oraz kursor pojawią + się na dole ekranu tak samo, jak polecenie : . - 2. Teraz wpisz b�ond . To jest s�owo, kt�rego chcesz szuka�. + 2. Teraz wpisz błond . To jest słowo, którego chcesz szukać. - 3. By szuka� tej samej frazy ponownie, po prostu wci�nij n . - Aby szuka� tej frazy w przeciwnym, kierunku wci�nij N . + 3. By szukać tej samej frazy ponownie, po prostu wciśnij n . + Aby szukać tej frazy w przeciwnym, kierunku wciśnij N . - 4. Je�li chcesz szuka� frazy do ty�u, u�yj polecenia ? zamiast / . + 4. Jeśli chcesz szukać frazy do tyłu, użyj polecenia ? zamiast / . - 5. Aby wr�ci� gdzie by�e�, wci�nij CTRL-O. Powtarzaj, by wr�ci� dalej. CTRL-I + 5. Aby wrócić gdzie byłeś, wciśnij CTRL-O. Powtarzaj, by wrócić dalej. CTRL-I idzie do przodu. -Uwaga: 'b�ond' to nie jest metoda, by przeliterowa� b��d; 'b�ond' to b��d. -Uwaga: Kiedy szukanie osi�gnie koniec pliku, b�dzie kontynuowane od pocz�tku - o ile opcja 'wrapscan' nie zosta�a przestawiona. +Uwaga: 'błond' to nie jest metoda, by przeliterować błąd; 'błond' to błąd. +Uwaga: Kiedy szukanie osiągnie koniec pliku, będzie kontynuowane od początku + o ile opcja 'wrapscan' nie została przestawiona. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.3.: W POSZUKIWANIU PARUJ�CYCH NAWIAS�W + Lekcja 1.4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW - ** Wpisz % by znale�� paruj�cy ), ], lub } . ** + ** Wpisz % by znaleźć parujący ), ], lub } . ** - 1. Umie�� kursor na kt�rym� z (, [, lub { w linii poni�ej oznaczonej --->. + 1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->. 2. Teraz wpisz znak % . - 3. Kursor powinien si� znale�� na paruj�cym nawiasie. + 3. Kursor powinien się znaleźć na parującym nawiasie. - 4. Wci�nij % aby przenie�� kursor z powrotem do paruj�cego nawiasu. + 4. Wciśnij % aby przenieść kursor z powrotem do parującego nawiasu. - 5. Przenie� kursor do innego (,),[,],{ lub } i zobacz co robi % . + 5. Przenieś kursor do innego (,),[,],{ lub } i zobacz co robi % . ---> To ( jest linia testowa z (, [, ] i {, } . )) -Uwaga: Ta funkcja jest bardzo u�yteczna w debuggowaniu programu +Uwaga: Ta funkcja jest bardzo użyteczna w debuggowaniu programu z niesparowanymi nawiasami! @@ -557,137 +557,137 @@ Lekcja 1.4.4.: POLECENIE SUBSTITUTE (zamiana) - ** Wpisz :s/stary/nowy/g aby zamieni� 'stary' na 'nowy'. ** + ** Wpisz :s/stary/nowy/g aby zamienić 'stary' na 'nowy'. ** - 1. Przenie� kursor do linii poni�ej oznaczonej --->. + 1. Przenieś kursor do linii poniżej oznaczonej --->. - 2. Wpisz :s/czaas/czas . Zauwa�, �e to polecenie zmienia - tylko pierwsze wyst�pienie 'czaas' w linii. + 2. Wpisz :s/czaas/czas . Zauważ, że to polecenie zmienia + tylko pierwsze wystąpienie 'czaas' w linii. - 3. Teraz wpisz :s/czaas/czas/g . Dodane g oznacza zamian� (substytucj�) - globalnie w ca�ej linii. Zmienia wszystkie wyst�pienia 'czaas' w linii. + 3. Teraz wpisz :s/czaas/czas/g . Dodane g oznacza zamianę (substytucję) + globalnie w całej linii. Zmienia wszystkie wystąpienia 'czaas' w linii. ----> Najlepszy czaas na zobaczenie naj�adniejszych kwiat�w to czaas wiosny. +---> Najlepszy czaas na zobaczenie najładniejszych kwiatów to czaas wiosny. - 4. Aby zmieni� wszystkie wyst�pienia �a�cucha znak�w pomi�dzy dwoma liniami, - wpisz: :#,#s/stare/nowe/g gdzie #,# s� numerami linii ograniczaj�cych - region, gdzie ma nast�pi� zamiana. - wpisz :%s/stare/nowe/g by zmieni� wszystkie wyst�pienia w ca�ym pliku. - wpisz :%s/stare/nowe/gc by zmieni� wszystkie wyst�pienia w ca�ym - pliku, prosz�c o potwierdzenie za ka�dym razem. + 4. Aby zmienić wszystkie wystąpienia łańcucha znaków pomiędzy dwoma liniami, + wpisz: :#,#s/stare/nowe/g gdzie #,# są numerami linii ograniczających + region, gdzie ma nastąpić zamiana. + wpisz :%s/stare/nowe/g by zmienić wszystkie wystąpienia w całym pliku. + wpisz :%s/stare/nowe/gc by zmienić wszystkie wystąpienia w całym + pliku, prosząc o potwierdzenie za każdym razem. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1.4. PODSUMOWANIE - 1. CTRL-G poka�e Twoj� pozycj� w pliku i status pliku. SHIFT-G przenosi - Ci� do ko�ca pliku. - G przenosi do ko�ca pliku. + 1. CTRL-G pokaże Twoją pozycję w pliku i status pliku. SHIFT-G przenosi + Cię do końca pliku. + G przenosi do końca pliku. liczba G przenosi do linii [liczba]. gg przenosi do pierwszej linii. - 2. Wpisanie / a nast�pnie �a�cucha znak�w szuka �a�cucha DO PRZODU. - Wpisanie ? a nast�pnie �a�cucha znak�w szuka �a�cucha DO TY�U. - Po wyszukiwaniu wci�nij n by znale�� nast�pne wyst�pienie szukanej - frazy w tym samym kierunku lub N by szuka� w kierunku przeciwnym. + 2. Wpisanie / a następnie łańcucha znaków szuka łańcucha DO PRZODU. + Wpisanie ? a następnie łańcucha znaków szuka łańcucha DO TYŁU. + Po wyszukiwaniu wciśnij n by znaleźć następne wystąpienie szukanej + frazy w tym samym kierunku lub N by szukać w kierunku przeciwnym. CTRL-O przenosi do starszych pozycji, CTRL-I do nowszych. - 3. Wpisanie % gdy kursor znajduje si� na (,),[,],{, lub } lokalizuje - paruj�cy znak. + 3. Wpisanie % gdy kursor znajduje się na (,),[,],{, lub } lokalizuje + parujący znak. - 4. By zamieni� pierwszy stary na nowy w linii, wpisz :s/stary/nowy - By zamieni� wszystkie stary na nowy w linii, wpisz :s/stary/nowy/g - By zamieni� frazy pomi�dzy dwoma liniami # wpisz :#,#s/stary/nowy/g - By zamieni� wszystkie wyst�pienia w pliku, wpisz :%s/stary/nowy/g - By Vim prosi� Ci� o potwierdzenie, dodaj 'c' :%s/stary/nowy/gc + 4. By zamienić pierwszy stary na nowy w linii, wpisz :s/stary/nowy + By zamienić wszystkie stary na nowy w linii, wpisz :s/stary/nowy/g + By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g + By zamienić wszystkie wystąpienia w pliku, wpisz :%s/stary/nowy/g + By Vim prosił Cię o potwierdzenie, dodaj 'c' :%s/stary/nowy/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.1.: JAK WYKONA� POLECENIA ZEWN�TRZNE? + Lekcja 1.5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE? - ** Wpisz :! a nast�pnie zewn�trzne polecenie, by je wykona�. ** + ** Wpisz :! a następnie zewnętrzne polecenie, by je wykonać. ** - 1. Wpisz znajome polecenie : by ustawi� kursor na dole ekranu. To pozwala - na wprowadzenie komendy linii polece�. + 1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala + na wprowadzenie komendy linii poleceń. - 2. Teraz wstaw ! (wykrzyknik). To umo�liwi Ci wykonanie dowolnego - zewn�trznego polecenia pow�oki. + 2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego + zewnętrznego polecenia powłoki. - 3. Jako przyk�ad wpisz ls za ! a nast�pnie wci�nij . To polecenie - poka�e spis plik�w w Twoim katalogu, tak jakby� by� przy znaku zach�ty - pow�oki. Mo�esz te� u�y� :!dir je�li ls nie dzia�a. + 3. Jako przykład wpisz ls za ! a następnie wciśnij . To polecenie + pokaże spis plików w Twoim katalogu, tak jakbyś był przy znaku zachęty + powłoki. Możesz też użyć :!dir jeśli ls nie działa. -Uwaga: W ten spos�b mo�na wykona� wszystkie polecenia pow�oki. -Uwaga: Wszystkie polecenia : musz� by� zako�czone . - Od tego momentu nie zawsze b�dziemy o tym wspomina�. +Uwaga: W ten sposób można wykonać wszystkie polecenia powłoki. +Uwaga: Wszystkie polecenia : muszą być zakończone . + Od tego momentu nie zawsze będziemy o tym wspominać. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.2.: WI�CEJ O ZAPISYWANIU PLIK�W + Lekcja 1.5.2.: WIĘCEJ O ZAPISYWANIU PLIKÓW - ** By zachowa� zmiany w tek�cie, wpisz :w NAZWA_PLIKU . ** + ** By zachować zmiany w tekście, wpisz :w NAZWA_PLIKU . ** - 1. Wpisz :!dir lub :!ls by zobaczy� spis plik�w w katalogu. - Ju� wiesz, �e musisz po tym wcisn�� . + 1. Wpisz :!dir lub :!ls by zobaczyć spis plików w katalogu. + Już wiesz, że musisz po tym wcisnąć . - 2. Wybierz nazw� pliku, jaka jeszcze nie istnieje, np. TEST. + 2. Wybierz nazwę pliku, jaka jeszcze nie istnieje, np. TEST. - 3. Teraz wpisz: :w TEST (gdzie TEST jest nazw� pliku jak� wybra�e�.) + 3. Teraz wpisz: :w TEST (gdzie TEST jest nazwą pliku jaką wybrałeś.) - 4. To polecenie zapami�ta ca�y plik (Vim Tutor) pod nazw� TEST. - By to sprawdzi�, wpisz :!dir lub :!ls �eby znowu zobaczy� list� plik�w. + 4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST. + By to sprawdzić, wpisz :!dir lub :!ls żeby znowu zobaczyć listę plików. -Uwaga: Zauwa�, �e gdyby� teraz wyszed� z Vima, a nast�pnie wszed� ponownie - poleceniem vim TEST , plik by�by dok�adn� kopi� tutoriala, kiedy go - zapisywa�e�. +Uwaga: Zauważ, że gdybyś teraz wyszedł z Vima, a następnie wszedł ponownie + poleceniem vim TEST , plik byłby dokładną kopią tutoriala, kiedy go + zapisywałeś. - 5. Teraz usu� plik wpisuj�c (MS-DOS): :!del TEST + 5. Teraz usuń plik wpisując (MS-DOS): :!del TEST lub (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.5.3.: WYBRANIE TEKSTU DO ZAPISU - ** By zachowa� cz�� pliku, wpisz v ruch :w NAZWA_PLIKU ** + ** By zachować część pliku, wpisz v ruch :w NAZWA_PLIKU ** - 1. Przenie� kursor do tego wiersza. + 1. Przenieś kursor do tego wiersza. - 2. Wci�nij v i przenie� kursor do punktu 5. Zauwa�, �e tekst zosta� - pod�wietlony. + 2. Wciśnij v i przenieś kursor do punktu 5. Zauważ, że tekst został + podświetlony. - 3. Wci�nij znak : . Na dole ekranu pojawi si� :'<,'> . + 3. Wciśnij znak : . Na dole ekranu pojawi się :'<,'> . - 4. Wpisz w TEST , gdzie TEST to nazwa pliku, kt�ry jeszcze nie istnieje. - Upewnij si�, �e widzisz :'<,'>w TEST zanim wci�niesz Enter. + 4. Wpisz w TEST , gdzie TEST to nazwa pliku, który jeszcze nie istnieje. + Upewnij się, że widzisz :'<,'>w TEST zanim wciśniesz Enter. - 5. Vim zapisze wybrane linie do pliku TEST. U�yj :!dir lub :!ls , �eby to - zobaczy�. Jeszcze go nie usuwaj! U�yjemy go w nast�pnej lekcji. + 5. Vim zapisze wybrane linie do pliku TEST. Użyj :!dir lub :!ls , żeby to + zobaczyć. Jeszcze go nie usuwaj! Użyjemy go w następnej lekcji. -UWAGA: Wci�ni�cie v zaczyna tryb Wizualny. Mo�esz porusza� kursorem, by - zmieni� rozmiary zaznaczenia. Mo�esz te� u�y� operatora, by zrobi� co� - z tekstem. Na przyk�ad d usuwa tekst. +UWAGA: Wciśnięcie v zaczyna tryb Wizualny. Możesz poruszać kursorem, by + zmienić rozmiary zaznaczenia. Możesz też użyć operatora, by zrobić coś + z tekstem. Na przykład d usuwa tekst. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.4.: WSTAWIANIE I ��CZENIE PLIK�W + Lekcja 1.5.4.: WSTAWIANIE I ŁĄCZENIE PLIKÓW - ** By wstawi� zawarto�� pliku, wpisz :r NAZWA_PLIKU ** + ** By wstawić zawartość pliku, wpisz :r NAZWA_PLIKU ** - 1. Umie�� kursor tu� powy�ej tej linii. + 1. Umieść kursor tuż powyżej tej linii. -UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 1.5.3. Potem przejd� - do DO�U, by zobaczy� ponownie t� lekcj�. +UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 1.5.3. Potem przejdź + do DOŁU, by zobaczyć ponownie tę lekcję. - 2. Teraz wczytaj plik TEST u�ywaj�c polecenia :r TEST , gdzie TEST - jest nazw� pliku. - Wczytany plik jest umieszczony poni�ej linii z kursorem. + 2. Teraz wczytaj plik TEST używając polecenia :r TEST , gdzie TEST + jest nazwą pliku. + Wczytany plik jest umieszczony poniżej linii z kursorem. - 3. By sprawdzi� czy plik zosta� wczytany, cofnij kursor i zobacz, �e - teraz s� dwie kopie Lekcji 1.5.3., orygina� i kopia z pliku. + 3. By sprawdzić czy plik został wczytany, cofnij kursor i zobacz, że + teraz są dwie kopie Lekcji 1.5.3., oryginał i kopia z pliku. -UWAGA: Mo�esz te� wczyta� wyj�cie zewn�trznego polecenia. Na przyk�ad - :r !ls wczytuje wyj�cie polecenia ls i umieszcza je pod poni�ej +UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład + :r !ls wczytuje wyjście polecenia ls i umieszcza je pod poniżej kursora. @@ -695,45 +695,45 @@ LEKCJA 1.5. PODSUMOWANIE - 1. :!polecenie wykonuje polecenie zewn�trzne. + 1. :!polecenie wykonuje polecenie zewnętrzne. - U�ytecznymi przyk�adami s�: + Użytecznymi przykładami są: - :!dir - pokazuje spis plik�w w katalogu. + :!dir - pokazuje spis plików w katalogu. :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU. - 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazw� NAZWA_PLIKU. + 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazwą NAZWA_PLIKU. 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. 4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do - bie��cego pliku poni�ej kursora. + bieżącego pliku poniżej kursora. - 5. :r !dir wczytuje wyj�cie polecenia dir i umieszcza je poni�ej kursora. + 5. :r !dir wczytuje wyjście polecenia dir i umieszcza je poniżej kursora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.1.: POLECENIE OPEN (otw�rz) + Lekcja 1.6.1.: POLECENIE OPEN (otwórz) - ** Wpisz o by otworzy� lini� poni�ej kursora i przenie�� si� do + ** Wpisz o by otworzyć linię poniżej kursora i przenieść się do trybu Insert (wprowadzanie). ** - 1. Przenie� kursor do linii poni�ej oznaczonej --->. + 1. Przenieś kursor do linii poniżej oznaczonej --->. - 2. Wpisz o (ma�e), by otworzy� lini� PONI�EJ kursora i przenie�� si� + 2. Wpisz o (małe), by otworzyć linię PONIŻEJ kursora i przenieść się do trybu Insert (wprowadzanie). - 3. Wpisz troch� tekstu i wci�nij by wyj�� z trybu Insert (wprowadzanie). + 3. Wpisz trochę tekstu i wciśnij by wyjść z trybu Insert (wprowadzanie). ----> Po wci�ni�ciu o kursor znajdzie si� w otwartej linii w trybie Insert. +---> Po wciśnięciu o kursor znajdzie się w otwartej linii w trybie Insert. - 4. By otworzy� lini� POWY�EJ kursora, wci�nij wielkie O zamiast ma�ego - o . Wypr�buj to na linii poni�ej. + 4. By otworzyć linię POWYŻEJ kursora, wciśnij wielkie O zamiast małego + o . Wypróbuj to na linii poniżej. ----> Otw�rz lini� powy�ej wciskaj�c SHIFT-O gdy kursor b�dzie na tej linii. +---> Otwórz linię powyżej wciskając SHIFT-O gdy kursor będzie na tej linii. @@ -741,137 +741,137 @@ Lekcja 1.6.2.: POLECENIE APPEND (dodaj) - ** Wpisz a by doda� tekst ZA kursorem. ** + ** Wpisz a by dodać tekst ZA kursorem. ** - 1. Przenie� kursor do pocz�tku pierwszej linii poni�ej oznaczonej ---> + 1. Przenieś kursor do początku pierwszej linii poniżej oznaczonej ---> - 2. Wciskaj e dop�ki kursor nie b�dzie na ko�cu li . + 2. Wciskaj e dopóki kursor nie będzie na końcu li . - 3. Wpisz a (ma�e), aby doda� tekst ZA znakiem pod kursorem. + 3. Wpisz a (małe), aby dodać tekst ZA znakiem pod kursorem. - 4. Doko�cz wyraz tak, jak w linii poni�ej. Wci�nij aby opu�ci� tryb + 4. Dokończ wyraz tak, jak w linii poniżej. Wciśnij aby opuścić tryb Insert. - 5. U�yj e by przej�� do kolejnego niedoko�czonego wyrazu i powtarzaj kroki + 5. Użyj e by przejść do kolejnego niedokończonego wyrazu i powtarzaj kroki 3. i 4. ----> Ta li poz Ci �wi dodaw teks do ko� lin ----> Ta linia pozwoli Ci �wiczy� dodawanie tekstu do ko�ca linii. +---> Ta li poz Ci ćwi dodaw teks do koń lin +---> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii. -Uwaga: a , i oraz A prowadz� do trybu Insert, jedyn� r�nic� jest miejsce, - gdzie nowe znaki b�d� dodawane. +Uwaga: a , i oraz A prowadzą do trybu Insert, jedyną różnicą jest miejsce, + gdzie nowe znaki będą dodawane. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.3.: INNA WERSJA REPLACE (zamiana) - ** Wpisz wielkie R by zamieni� wi�cej ni� jeden znak. ** + ** Wpisz wielkie R by zamienić więcej niż jeden znak. ** - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej --->. Przenie� + 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. Przenieś kursor do pierwszego xxx . - 2. Wci�nij R i wpisz numer poni�ej w drugiej linii, tak, �e zast�pi on + 2. Wciśnij R i wpisz numer poniżej w drugiej linii, tak, że zastąpi on xxx. - 3. Wci�nij by opu�ci� tryb Replace. Zauwa�, �e reszta linii pozostaje + 3. Wciśnij by opuścić tryb Replace. Zauważ, że reszta linii pozostaje niezmieniona. - 5. Powtarzaj kroki by wymieni� wszystkie xxx. + 5. Powtarzaj kroki by wymienić wszystkie xxx. ---> Dodanie 123 do xxx daje xxx. ---> Dodanie 123 do 456 daje 579. -UWAGA: Tryb Replace jest jak tryb Insert, ale ka�dy znak usuwa istniej�cy +UWAGA: Tryb Replace jest jak tryb Insert, ale każdy znak usuwa istniejący znak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.4.: KOPIOWANIE I WKLEJANIE TEKSTU - ** u�yj operatora y aby skopiowa� tekst i p aby go wklei� ** + ** użyj operatora y aby skopiować tekst i p aby go wkleić ** - 1. Przejd� do linii oznaczonej ---> i umie�� kursor za "a)". + 1. Przejdź do linii oznaczonej ---> i umieść kursor za "a)". - 2. Wejd� w tryb Wizualny v i przenie� kursor na pocz�tek "pierwszy". + 2. Wejdź w tryb Wizualny v i przenieś kursor na początek "pierwszy". - 3. Wci�nij y aby kopiowa� (yankowa�) pod�wietlony tekst. + 3. Wciśnij y aby kopiować (yankować) podświetlony tekst. - 4. Przenie� kursor do ko�ca nast�pnej linii: j$ + 4. Przenieś kursor do końca następnej linii: j$ - 5. Wci�nij p aby wklei� (wpakowa�) tekst. Dodaj: a drugi . + 5. Wciśnij p aby wkleić (wpakować) tekst. Dodaj: a drugi . - 6. U�yj trybu Wizualnego, aby wybra� " element.", yankuj go y , przejd� do - ko�ca nast�pnej linii j$ i upakuj tam tekst z p . + 6. Użyj trybu Wizualnego, aby wybrać " element.", yankuj go y , przejdź do + końca następnej linii j$ i upakuj tam tekst z p . ---> a) to jest pierwszy element. b) -Uwaga: mo�esz u�y� y jako operatora; yw kopiuje jeden wyraz. +Uwaga: możesz użyć y jako operatora; yw kopiuje jeden wyraz. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.6.5.: USTAWIANIE OPCJI -** Ustawianie opcji tak, by szukaj lub substytucja ignorowa�y wielko�� liter ** +** Ustawianie opcji tak, by szukaj lub substytucja ignorowały wielkość liter ** - 1. Szukaj 'ignore' wpisuj�c: /ignore - Powt�rz szukanie kilka razy naciskaj�c klawisz n . + 1. Szukaj 'ignore' wpisując: /ignore + Powtórz szukanie kilka razy naciskając klawisz n . - 2. Ustaw opcj� 'ic' (Ignore case -- ignoruj wielko�� liter) poprzez + 2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez wpisanie: :set ic - 3. Teraz szukaj 'ignore' ponownie wciskaj�c: n - Zauwa�, �e Ignore i IGNORE tak�e s� teraz znalezione. + 3. Teraz szukaj 'ignore' ponownie wciskając: n + Zauważ, że Ignore i IGNORE także są teraz znalezione. 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is - 5. Teraz wprowad� polecenie szukaj ponownie i zobacz co si� zdarzy: + 5. Teraz wprowadź polecenie szukaj ponownie i zobacz co się zdarzy: /ignore - 6. Aby wy��czy� ignorowanie wielko�ci liter: :set noic + 6. Aby wyłączyć ignorowanie wielkości liter: :set noic -Uwaga: Aby usun�� pod�wietlanie dopasowa�, wpisz: :nohlsearch -Uwaga: Aby ignorowa� wielko�� liter dla jednego wyszukiwania: /ignore\c +Uwaga: Aby usunąć podświetlanie dopasowań, wpisz: :nohlsearch +Uwaga: Aby ignorować wielkość liter dla jednego wyszukiwania: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1.6. PODSUMOWANIE - 1. Wpisanie o otwiera lini� PONI�EJ kursora. - Wpisanie O otwiera lini� POWY�EJ kursora. + 1. Wpisanie o otwiera linię PONIŻEJ kursora. + Wpisanie O otwiera linię POWYŻEJ kursora. - 2. Wpisanie a wstawia tekst ZA znakiem, na kt�rym jest kursor. - Wpisanie A dodaje tekst na ko�cu linii. + 2. Wpisanie a wstawia tekst ZA znakiem, na którym jest kursor. + Wpisanie A dodaje tekst na końcu linii. - 3. Polecenie e przenosi do ko�ca wyrazu. + 3. Polecenie e przenosi do końca wyrazu. 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja) go. - 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dop�ki - nie zostanie wci�ni�ty . - 6. Wpisanie ":set xxx" ustawia opcj� "xxx". Niekt�re opcje: - 'ic' 'ignorecase' ignoruj wielko�� znak�w - 'is' 'incsearch' poka� cz�ciowe dopasowania - 'hls' 'hlsearch' pod�wietl wszystkie dopasowania - Mo�esz u�y� zar�wno d�ugiej, jak i kr�tkiej formy. - 7. Dodaj "no", aby wy��czy� opcj�: :set noic + 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki + nie zostanie wciśnięty . + 6. Wpisanie ":set xxx" ustawia opcję "xxx". Niektóre opcje: + 'ic' 'ignorecase' ignoruj wielkość znaków + 'is' 'incsearch' pokaż częściowe dopasowania + 'hls' 'hlsearch' podświetl wszystkie dopasowania + Możesz użyć zarówno długiej, jak i krótkiej formy. + 7. Dodaj "no", aby wyłączyć opcję: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.7.1.: JAK UZYSKA� POMOC? + LEKCJA 1.7.1.: JAK UZYSKAĆ POMOC? - ** U�ycie systemu pomocy on-line ** + ** Użycie systemu pomocy on-line ** - Vim posiada bardzo dobry system pomocy on-line. By zacz��, spr�buj jednej - z trzech mo�liwo�ci: - - wci�nij klawisz (je�li taki masz) - - wci�nij klawisz (je�li taki masz) + Vim posiada bardzo dobry system pomocy on-line. By zacząć, spróbuj jednej + z trzech możliwości: + - wciśnij klawisz (jeśli taki masz) + - wciśnij klawisz (jeśli taki masz) - wpisz :help - Przeczytaj tekst w oknie pomocy, aby dowiedzie� si� jak dzia�a pomoc. - wpisz CTRL-W CTRL-W aby przeskoczy� z jednego okna do innego - wpisz :q aby zamkn�� okno pomocy. + Przeczytaj tekst w oknie pomocy, aby dowiedzieć się jak działa pomoc. + wpisz CTRL-W CTRL-W aby przeskoczyć z jednego okna do innego + wpisz :q aby zamknąć okno pomocy. - Mo�esz te� znale�� pomoc na ka�dy temat podaj�c argument polecenia ":help". - Spr�buj tych (nie zapomnij wcisn�� ): + Możesz też znaleźć pomoc na każdy temat podając argument polecenia ":help". + Spróbuj tych (nie zapomnij wcisnąć ): :help w :help c_CTRL-D @@ -880,63 +880,63 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCJA 1.7.2.: TWORZENIE SKRYPTU STARTOWEGO - ** W��cz mo�liwo�ci Vima ** + ** Włącz możliwości Vima ** - Vim ma o wiele wi�cej mo�liwo�ci ni� Vi, ale wi�kszo�� z nich jest domy�lnie - wy��czona. Je�li chcesz w��czy� te mo�liwo�ci na starcie musisz utworzy� + Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie + wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć plik "vimrc". - 1. Pocz�tek edycji pliku "vimrc" zale�y od Twojego systemu: + 1. Początek edycji pliku "vimrc" zależy od Twojego systemu: :edit ~/.vimrc dla Uniksa :edit ~/_vimrc dla MS-Windows - 2. Teraz wczytaj przyk�adowy plik "vimrc": + 2. Teraz wczytaj przykładowy plik "vimrc": :read $VIMRUNTIME/vimrc_example.vim 3. Zapisz plik: :w - Nast�pnym razem, gdy zaczniesz prac� w Vimie b�dzie on u�ywa� pod�wietlania - sk�adni. Mo�esz doda� wszystkie swoje ulubione ustawienia do tego pliku + Następnym razem, gdy zaczniesz pracę w Vimie będzie on używać podświetlania + składni. Możesz dodać wszystkie swoje ulubione ustawienia do tego pliku "vimrc". - Aby uzyska� wi�cej informacji, wpisz :help vimrc-intro + Aby uzyskać więcej informacji, wpisz :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.7.3.: UZUPE�NIANIE + Lekcja 1.7.3.: UZUPEŁNIANIE - ** Uzupe�nianie linii polece� z CTRL-D i ** + ** Uzupełnianie linii poleceń z CTRL-D i ** - 1. Upewnij si�, �e Vim nie jest w trybie kompatybilno�ci: :set nocp + 1. Upewnij się, że Vim nie jest w trybie kompatybilności: :set nocp - 2. Zerknij, jakie pliki s� w bie��cym katalogu: :!ls lub :!dir + 2. Zerknij, jakie pliki są w bieżącym katalogu: :!ls lub :!dir - 3. Wpisz pocz�tek polecenia: :e + 3. Wpisz początek polecenia: :e - 4. Wci�nij CTRL-D i Vim poka�e list� polece�, jakie zaczynaj� si� na "e". + 4. Wciśnij CTRL-D i Vim pokaże listę poleceń, jakie zaczynają się na "e". - 5. Wci�nij i Vim uzupe�ni polecenie do ":edit". + 5. Wciśnij i Vim uzupełni polecenie do ":edit". - 6. Dodaj spacj� i zacznij wpisywa� nazw� istniej�cego pliku: :edit FIL + 6. Dodaj spację i zacznij wpisywać nazwę istniejącego pliku: :edit FIL - 7. Wci�nij . Vim uzupe�ni nazw� (je�li jest niepowtarzalna). + 7. Wciśnij . Vim uzupełni nazwę (jeśli jest niepowtarzalna). -UWAGA: Uzupe�nianie dzia�a dla wielu polece�. Spr�buj wcisn�� CTRL-D i . - U�yteczne zw�aszcza przy :help . +UWAGA: Uzupełnianie działa dla wielu poleceń. Spróbuj wcisnąć CTRL-D i . + Użyteczne zwłaszcza przy :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcja 1.7. PODSUMOWANIE - 1. Wpisz :help albo wci�nij lub aby otworzy� okno pomocy. + 1. Wpisz :help albo wciśnij lub aby otworzyć okno pomocy. - 2. Wpisz :help cmd aby uzyska� pomoc o cmd . + 2. Wpisz :help cmd aby uzyskać pomoc o cmd . - 3. Wpisz CTRL-W CTRL-W aby przeskoczy� do innego okna. + 3. Wpisz CTRL-W CTRL-W aby przeskoczyć do innego okna. - 4. Wpisz :q aby zamkn�� okno pomocy. + 4. Wpisz :q aby zamknąć okno pomocy. - 5. Utw�rz plik startowy vimrc aby zachowa� wybrane ustawienia. + 5. Utwórz plik startowy vimrc aby zachować wybrane ustawienia. - 6. Po poleceniu : , wci�nij CTRL-D aby zobaczy� mo�liwe uzupe�nienia. - Wci�nij aby u�y� jednego z nich. + 6. Po poleceniu : , wciśnij CTRL-D aby zobaczyć możliwe uzupełnienia. + Wciśnij aby użyć jednego z nich. @@ -945,40 +945,40 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Tutaj si� ko�czy tutorial Vima. Zosta� on pomy�lany tak, aby da� kr�tki - przegl�d jego mo�liwo�ci, wystarczaj�cy by� m�g� go u�ywa�. Jest on - daleki od kompletno�ci, poniewa� Vim ma o wiele, wiele wi�cej polece�. + Tutaj się kończy tutorial Vima. Został on pomyślany tak, aby dać krótki + przegląd jego możliwości, wystarczający byś mógł go używać. Jest on + daleki od kompletności, ponieważ Vim ma o wiele, wiele więcej poleceń. - Dla dalszej nauki rekomendujemy ksi��k�: + Dla dalszej nauki rekomendujemy książkę: Vim - Vi Improved - autor Steve Oualline Wydawca: New Riders - Pierwsza ksi��ka ca�kowicie po�wi�cona Vimowi. U�yteczna zw�aszcza dla - pocz�tkuj�cych. Zawiera wiele przyk�ad�w i ilustracji. + Pierwsza książka całkowicie poświęcona Vimowi. Użyteczna zwłaszcza dla + początkujących. Zawiera wiele przykładów i ilustracji. Zobacz https://iccf-holland.org./click5.html - Starsza pozycja i bardziej o Vi ni� o Vimie, ale tak�e warta + Starsza pozycja i bardziej o Vi niż o Vimie, ale także warta polecenia: Learning the Vi Editor - autor Linda Lamb Wydawca: O'Reilly & Associates Inc. - To dobra ksi��ka, by dowiedzie� si� niemal wszystkiego, co chcia�by� zrobi� - z Vi. Sz�sta edycja zawiera te� informacje o Vimie. + To dobra książka, by dowiedzieć się niemal wszystkiego, co chciałbyś zrobić + z Vi. Szósta edycja zawiera też informacje o Vimie. Po polsku wydano: Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins Wydawca: Helion 2001 (O'Reilly). ISBN: 83-7197-472-8 http://helion.pl/ksiazki/vilek.htm - Jest to ksi��eczka zawieraj�ca spis polece� vi i jego najwa�niejszych - klon�w (mi�dzy innymi Vima). + Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych + klonów (między innymi Vima). Edytor vi - autorzy Linda Lamb i Arnold Robbins Wydawca: Helion 2001 (O'Reilly) - wg 6. ang. wydania ISBN: 83-7197-539-2 http://helion.pl/ksiazki/viedyt.htm - Rozszerzona wersja Learning the Vi Editor w polskim t�umaczeniu. + Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu. - Ten tutorial zosta� napisany przez Michaela C. Pierce'a i Roberta K. Ware'a, - Colorado School of Mines korzystaj�c z pomocy Charlesa Smitha, + Ten tutorial został napisany przez Michaela C. Pierce'a i Roberta K. Ware'a, + Colorado School of Mines korzystając z pomocy Charlesa Smitha, Colorado State University. E-mail: bware@mines.colorado.edu. @@ -986,10 +986,10 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Przet�umaczone przez Miko�aja Machowskiego, - Sierpie� 2001, + Przetłumaczone przez Mikołaja Machowskiego, + Sierpień 2001, rev. Marzec 2002 - 2nd rev. Wrzesie� 2004 + 2nd rev. Wrzesień 2004 3rd rev. Marzec 2006 - 4th rev. Grudzie� 2008 - Wszelkie uwagi prosz� kierowa� na: mikmach@wp.pl + 4th rev. Grudzień 2008 + Wszelkie uwagi proszę kierować na: mikmach@wp.pl diff --git a/runtime/tutor/tutor1.pl.cp1250 b/runtime/tutor/tutor1.pl.cp1250 deleted file mode 100644 index f8f5012ac0..0000000000 --- a/runtime/tutor/tutor1.pl.cp1250 +++ /dev/null @@ -1,995 +0,0 @@ -=============================================================================== -= W i t a j w t u t o r i a l u V I M - a - Wersja 1.7. = -=============================================================================== - - Vim to pot�ny edytor, kt�ry posiada wiele polece�, zbyt du�o, by - wyja�ni� je wszystkie w tym tutorialu. Ten przewodnik ma nauczy� - Ci� pos�ugiwa� si� wystarczaj�co wieloma komendami, by� m�g� �atwo - u�ywa� Vima jako edytora og�lnego przeznaczenia. - - Czas potrzebny na uko�czenie tutoriala to 25 do 30 minut i zale�y - od tego jak wiele czasu sp�dzisz na eksperymentowaniu. - - UWAGA: - Polecenia wykonywane w czasie lekcji zmodyfikuj� tekst. Zr�b - wcze�niej kopi� tego pliku do �wicze� (je�li zacz��e� komend� - "vimtutor", to ju� pracujesz na kopii). - - Pami�taj, �e przewodnik ten zosta� zaprojektowany do nauki poprzez - �wiczenia. Oznacza to, �e musisz wykonywa� polecenia, by nauczy� si� ich - prawid�owo. Je�li b�dziesz jedynie czyta� tekst, szybko zapomnisz wiele - polece�! - - Teraz upewnij si�, �e nie masz wci�ni�tego Caps Locka i wciskaj j - tak d�ugo dop�ki Lekcja 1.1.1. nie wype�ni ca�kowicie ekranu. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.1.: PORUSZANIE SI� KURSOREM - - ** By wykona� ruch kursorem, wci�nij h, j, k, l jak pokazano. ** - - ^ - k Wskaz�wka: h jest po lewej - < h l > l jest po prawej - j j wygl�da jak strza�ka w d� - v - 1. Poruszaj kursorem dop�ki nie b�dziesz pewien, �e pami�tasz polecenia. - - 2. Trzymaj j tak d�ugo a� b�dzie si� powtarza�. - Teraz wiesz jak doj�� do nast�pnej lekcji. - - 3. U�ywaj�c strza�ki w d� przejd� do nast�pnej lekcji. - -Uwaga: Je�li nie jeste� pewien czego� co wpisa�e�, wci�nij , by wr�ci� do - trybu Normal. Wtedy powt�rz polecenie. - -Uwaga: Klawisze kursora tak�e powinny dzia�a�, ale u�ywaj�c hjkl b�dziesz - w stanie porusza� si� o wiele szybciej, jak si� tylko przyzwyczaisz. - Naprawd�! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.2.: WYCHODZENIE Z VIM-a - - !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj ca�� lekcj� !! - - 1. Wci�nij (aby upewni� si�, �e jeste� w trybie Normal). - 2. Wpisz: :q!. - To spowoduje wyj�cie z edytora PORZUCAJ�C wszelkie zmiany, jakie - zd��y�e� zrobi�. Je�li chcesz zapami�ta� zmiany i wyj��, - wpisz: :wq - - 3. Kiedy widzisz znak zach�ty pow�oki wpisz komend�, �eby wr�ci� - do tutoriala. Czyli: vimtutor - - 4. Je�li chcesz zapami�ta� polecenia, wykonaj kroki 1. do 3., aby - wyj�� i wr�ci� do edytora. - -UWAGA: :q! porzuca wszelkie zmiany jakie zrobi�e�. W nast�pnych - lekcjach dowiesz si� jak je zapami�tywa�. - - 5. Przenie� kursor do lekcji 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.3.: EDYCJA TEKSTU - KASOWANIE - - ** Wci�nij x aby usun�� znak pod kursorem. ** - - 1. Przenie� kursor do linii poni�ej oznaczonej --->. - - 2. By poprawi� b��dy, naprowad� kursor na znak do usuni�cia. - - 3. Wci�nij x aby usun�� niechciany znak. - - 4. Powtarzaj kroki 2. do 4. dop�ki zdanie nie jest poprawne. - ----> Kkrowa prrzeskoczy�a prrzez ksii�ycc. - - 5. Teraz, kiedy zdanie jest poprawione, przejd� do Lekcji 1.1.4. - -UWAGA: Ucz si� przez �wiczenie, nie wkuwanie. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.4.: EDYCJA TEKSTU - INSERT (wprowadzanie) - - - ** Wci�nij i aby wstawi� tekst. ** - - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej --->. - - 2. Aby poprawi� pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym, - gdzie tekst ma by� wstawiony. - - 3. Wci�nij i a nast�pnie wpisz konieczne poprawki. - - 4. Po poprawieniu b��du wci�nij , by wr�ci� do trybu Normal. - Powtarzaj kroki 2. do 4., aby poprawi� ca�e zdanie. - ----> W tej brkje troch� . ----> W tej linii brakuje troch� tekstu. - - 5. Kiedy czujesz si� swobodnie wstawiaj�c tekst, przejd� do - podsumowania poni�ej. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.5.: EDYCJA TEKSTU - APPENDING (dodawanie) - - - ** Wci�nij A by doda� tekst. ** - - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej --->. - Nie ma znaczenia, kt�ry to b�dzie znak. - - 2. Wci�nij A i wpisz odpowiednie dodatki. - - 3. Kiedy tekst zosta� dodany, wci�nij i wr�� do trybu Normalnego. - - 4. Przenie� kursor do drugiej linii oznaczonej ---> i powt�rz kroki 2. i 3., - aby poprawi� zdanie. - ----> Brakuje tu tro - Brakuje tu troch� tekstu. ----> Tu te� troch� bra - Tu te� troch� brakuje. - - 5. Kiedy ju� utrwali�e� �wiczenie, przejd� do lekcji 1.1.6. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.6.: EDYCJA PLIKU - - ** U�yj :wq aby zapisa� plik i wyj��. ** - - !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczytaj ca�� lekcj� !! - - 1. Zako�cz tutorial tak jak w lekcji 1.1.2.: :q! - lub, je�li masz dost�p do innego terminala, wykonaj kolejne kroki tam. - - 2. W pow�oce wydaj polecenie: vim tutor - "vim" jest poleceniem uruchamiaj�cym edytor Vim. 'tutor' to nazwa pliku, - jaki chcesz edytowa�. U�yj pliku, kt�ry mo�e zosta� zmieniony. - - 3. Dodaj i usu� tekst tak, jak si� nauczy�e� w poprzednich lekcjach. - - 4. Zapisz plik ze zmianami i opu�� Vima: :wq - - 5. Je�li zako�czy�e� vimtutor w kroku 1., uruchom go ponownie i przejd� - do podsumowania poni�ej. - - 6. Po przeczytaniu wszystkich krok�w i ich zrozumieniu: wykonaj je. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.1. PODSUMOWANIE - - 1. Poruszasz kursorem u�ywaj�c "strza�ek" i klawiszy hjkl . - h (w lewo) j (w d�) k (do g�ry) l (w prawo) - - 2. By wej�� do Vima, (z pow�oki) wpisz: - vim NAZWA_PLIKU - - 3. By wyj�� z Vima, wpisz: - :q! by usun�� wszystkie zmiany. - LUB: :wq by zmiany zachowa�. - - 4. By usun�� znak pod kursorem, wci�nij: x - - 5. By wstawi� tekst przed kursorem lub doda�: - i wpisz tekst wstawi przed kursorem - A wpisz tekst doda na ko�cu linii - -UWAGA: Wci�ni�cie przeniesie Ci� z powrotem do trybu Normal - lub odwo�a niechciane lub cz�ciowo wprowadzone polecenia. - -Teraz mo�emy kontynuowa� i przej�� do Lekcji 1.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.1.: POLECENIE DELETE (usuwanie) - - - ** Wpisz dw by usun�� wyraz. ** - - 1. Wci�nij , by upewni� si�, �e jeste� w trybie Normal. - - 2. Przenie� kursor do linii poni�ej oznaczonej --->. - - 3. Przesu� kursor na pocz�tek wyrazu, kt�ry chcesz usun��. - - 4. Wpisz dw by usun�� wyraz. - - UWAGA: Litera d pojawi si� na dole ekranu. Vim czeka na wpisanie w . - Je�li zobaczysz inny znak, oznacza to, �e wpisa�e� co� �le; wci�nij - i zacznij od pocz�tku. - ----> Jest tu par� papier wyraz�w, kt�re kamie� nie nale�� do no�yce tego zdania. - - 5. Powtarzaj kroki 3. i 4. dop�ki zdanie nie b�dzie poprawne, potem - przejd� do Lekcji 1.2.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.2.: WI�CEJ POLECE� USUWAJ�CYCH - - - ** Wpisz d$ aby usun�� tekst do ko�ca linii. ** - - 1. Wci�nij aby si� upewni�, �e jeste� w trybie Normal. - - 2. Przenie� kursor do linii poni�ej oznaczonej --->. - - 3. Przenie� kursor do ko�ca poprawnego zdania (PO pierwszej . ). - - 4. Wpisz d$ aby usun�� reszt� linii. - ----> Kto� wpisa� koniec tego zdania dwukrotnie. zdania dwukrotnie. - - - 5. Przejd� do Lekcji 1.2.3., by zrozumie� co si� sta�o. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.3.: O OPERATORACH I RUCHACH - - - Wiele polece� zmieniaj�cych tekst jest z�o�onych z operatora i ruchu. - Format dla polecenia usuwaj�cego z operatorem d jest nast�puj�cy: - - d ruch - - gdzie: - d - operator usuwania. - ruch - na czym polecenie b�dzie wykonywane (lista poni�ej). - - Kr�tka lista ruch�w: - w - do pocz�tku nast�pnego wyrazu WY��CZAJ�C pierwszy znak. - e - do ko�ca bie��cego wyrazu, W��CZAJ�C ostatni znak. - $ - do ko�ca linii, W��CZAJ�C ostatni znak. - -W ten spos�b wpisanie de usunie znaki od kursora do ko�ca wyrazu. - -UWAGA: Wpisanie tylko ruchu w trybie Normal bez operatora przeniesie kursor - tak, jak to okre�lono. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.4.: U�YCIE MNO�NIKA DLA RUCHU - - - ** Wpisanie liczby przed ruchem powtarza ruch odpowiedni� ilo�� razy. ** - - 1. Przenie� kursor na pocz�tek linii poni�ej zaznaczonej --->. - - 2. Wpisz 2w aby przenie�� kursor o dwa wyrazy do przodu. - - 3. Wpisz 3e aby przenie�� kursor do ko�ca trzeciego wyrazu w prz�d. - - 4. Wpisz 0 (zero), aby przenie�� kursor na pocz�tek linii. - - 5. Powt�rz kroki 2. i 3. z innymi liczbami. - - - ---> To jest zwyk�y wiersz z wyrazami, po kt�rych mo�esz si� porusza�. - - 6. Przejd� do lekcji 1.2.5. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.5.: U�YCIE MNO�NIKA, BY WI�CEJ USUN�� - - - ** Wpisanie liczby z operatorem powtarza go odpowiedni� ilo�� razy. ** - - W wy�ej wspomnianej kombinacji operatora usuwania i ruchu podaj mno�nik - przed ruchem, by wi�cej usun��: - d liczba ruch - - 1. Przenie� kursor do pierwszego wyrazu KAPITALIKAMI w linii zaznaczonej --->. - - 2. Wpisz 2dw aby usun�� dwa wyrazy KAPITALIKAMI. - - 3. Powtarzaj kroki 1. i 2. z innymi mno�nikami, aby usun�� kolejne wyrazy - KAPITALIKAMI jednym poleceniem - ----> ta ASD WE linia QWE ASDF ZXCV FG wyraz�w zosta�a ERT FGH CF oczyszczona. - -UWAGA: Mno�nik pomi�dzy operatorem d i ruchem dzia�a podobnie do ruchu bez - operatora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.6.: OPEROWANIE NA LINIACH - - - ** Wpisz dd aby usun�� ca�� lini�. ** - - Z powodu cz�sto�ci usuwania ca�ych linii, projektanci Vi zdecydowali, �e - b�dzie �atwiej wpisa� dwa razy d aby usun�� lini�. - - 1. Przenie� kursor do drugiego zdania z wierszyka poni�ej. - 2. Wpisz dd aby usun�� wiersz. - 3. Teraz przenie� si� do czwartego wiersza. - 4. Wpisz 2dd aby usun�� dwa wiersze. - ----> 1) R�e s� czerwone, ----> 2) B�oto jest fajne, ----> 3) Fio�ki s� niebieskie, ----> 4) Mam samoch�d, ----> 5) Zegar podaje czas, ----> 6) Cukier jest s�odki, ----> 7) I ty te�. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.7.: POLECENIE UNDO (cofnij) - - - ** Wci�nij u aby cofn�� skutki ostatniego polecenia. - U za�, by cofn�� skutki dla ca�ej linii. ** - - 1. Przenie� kursor do zdania poni�ej oznaczonego ---> i umie�� go na - pierwszym b��dzie. - 2. Wpisz x aby usun�� pierwszy niechciany znak. - 3. Teraz wci�nij u aby cofn�� skutki ostatniego polecenia. - 4. Tym razem popraw wszystkie b��dy w linii u�ywaj�c polecenia x . - 5. Teraz wci�nij wielkie U aby przywr�ci� lini� do oryginalnego stanu. - 6. Teraz wci�nij u kilka razy, by cofn�� U i poprzednie polecenia. - 7. Teraz wpisz CTRL-R (trzymaj r�wnocze�nie wci�ni�te klawisze CTRL i R) - kilka razy, by cofn�� cofni�cia. - ----> Poopraw b��dyyy w teej liniii i zaamiie� je prrzez coofnij. - - 8. To s� bardzo po�yteczne polecenia. - - Przejd� teraz do podsumowania Lekcji 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.2. PODSUMOWANIE - - - 1. By usun�� znaki od kursora do nast�pnego wyrazu, wpisz: dw - 2. By usun�� znaki od kursora do ko�ca linii, wpisz: d$ - 3. By usun�� ca�� lini�: dd - 4. By powt�rzy� ruch, poprzed� go liczb�: 2w - 5. Format polecenia zmiany to: - operator [liczba] ruch - gdzie: - operator - to, co trzeba zrobi� (np. d dla usuwania) - [liczba] - opcjonalne, ile razy powt�rzy� ruch - ruch - przenosi nad tekstem do operowania, takim jak w (wyraz), - $ (do ko�ca linii) etc. - - 6. By przej�� do pocz�tku linii, u�yj zera: 0 - 7. By cofn�� poprzednie polecenie, wpisz: u (ma�e u) - By cofn�� wszystkie zmiany w linii, wpisz: U (wielkie U) - By cofn�� cofni�cie, wpisz: CTRL-R - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.1.: POLECENIE PUT (wstaw) - - - ** Wpisz p by wstawi� ostatnie usuni�cia za kursorem. ** - - 1. Przenie� kursor do pierwszej linii ---> poni�ej. - - 2. Wpisz dd aby usun�� lini� i przechowa� j� w rejestrze Vima. - - 3. Przenie� kursor do linii c), POWY�EJ tej, gdzie usuni�ta linia powinna - si� znajdowa�. - - 4. Wci�nij p by wstawi� lini� poni�ej kursora. - - 5. Powtarzaj kroki 2. do 4. a� znajd� si� w odpowiednim porz�dku. - ----> d) Jak dwa anio�ki. ----> b) Na dole fio�ki, ----> c) A my si� kochamy, ----> a) Na g�rze r�e, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.2.: POLECENIE REPLACE (zast�p) - - - ** Wpisz rx aby zast�pi� znak pod kursorem na x . ** - - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej ---> - - 2. Ustaw kursor na pierwszym b��dzie. - - 3. Wpisz r a potem znak jaki powinien go zast�pi�. - - 4. Powtarzaj kroki 2. i 3. dop�ki pierwsza linia nie b�dzie taka, jak druga. - ----> Kjedy ten wiersz bi� wst�kiwany, kto� wcizn�� per� z�ych klawirzy! ----> Kiedy ten wiersz by� wstukiwany, kto� wcisn�� par� z�ych klawiszy! - - 5. Teraz czas na Lekcj� 1.3.3. - - -UWAGA: Pami�taj, by uczy� si� �wicz�c, a nie pami�ciowo. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.3.: OPERATOR CHANGE (zmie�) - - ** By zmieni� do ko�ca wyrazu, wpisz ce . ** - - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej --->. - - 2. Umie�� kursor na u w lunos. - - 3. Wpisz ce i popraw wyraz (w tym wypadku wstaw inia ). - - 4. Wci�nij i przejd� do nast�pnej planowanej zmiany. - - 5. Powtarzaj kroki 3. i 4. dop�ki pierwsze zdanie nie b�dzie takie same, - jak drugie. - ----> Ta lunos ma pire s��w, kt�re t�ina zbnic u�ifajonc pcmazu zmie�. ----> Ta linia ma par� s��w, kt�re trzeba zmieni� u�ywaj�c polecenia zmie�. - - Zauwa�, �e ce nie tylko zamienia wyraz, ale tak�e zmienia tryb na - Insert (wprowadzanie). - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.4.: WI�CEJ ZMIAN U�YWAJ�C c - - - ** Polecenie change u�ywa takich samych ruch�w, jak delete. ** - - 1. Operator change dzia�a tak samo, jak delete. Format wygl�da tak: - - c [liczba] ruch - - 2. Ruchy s� tak�e takie same, np.: w (wyraz), $ (koniec linii) etc. - - 3. Przenie� si� do pierwszej linii poni�ej oznaczonej ---> - - 4. Ustaw kursor na pierwszym b��dzie. - - 5. Wpisz c$ , popraw koniec wiersza i wci�nij . - ----> Koniec tego wiersza musi by� poprawiony, aby wygl�da� tak, jak drugi. ----> Koniec tego wiersza musi by� poprawiony u�ywaj�c polecenia c$ . - -UWAGA: Mo�esz u�ywa� aby poprawia� b��dy w czasie pisania. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.3. PODSUMOWANIE - - - 1. Aby wstawi� tekst, kt�ry zosta� wcze�niej usuni�ty wci�nij p . To - polecenie wstawia skasowany tekst PO kursorze (je�li ca�a linia - zosta�a usuni�ta, zostanie ona umieszczona w linii poni�ej kursora). - - 2. By zamieni� znak pod kursorem, wci�nij r a potem znak, kt�ry ma zast�pi� - oryginalny. - - 3. Operator change pozwala Ci na zast�pienie od kursora do miejsca, gdzie - zabra�by Ci� ruch. Np. wpisz ce aby zamieni� tekst od kursora do ko�ca - wyrazu, c$ aby zmieni� tekst do ko�ca linii. - - 4. Format do polecenia change (zmie�): - - c [liczba] obiekt - - Teraz przejd� do nast�pnej lekcji. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.1.: PO�O�ENIE KURSORA ORAZ STATUS PLIKU - - ** Naci�nij CTRL-G aby zobaczy� swoje po�o�enie w pliku i status - pliku. Naci�nij G aby przej�� do linii w pliku. ** - - UWAGA: Przeczytaj ca�� lekcj� zanim wykonasz jakie� polecenia!!! - - 1. Przytrzymaj klawisz CTRL i wci�nij g . U�ywamy notacji CTRL-G. - Na dole strony pojawi si� pasek statusu z nazw� pliku i pozycj� w pliku. - Zapami�taj numer linii dla potrzeb kroku 3. - -UWAGA: Mo�esz te� zobaczy� pozycj� kursora w prawym, dolnym rogu ekranu. - Dzieje si� tak kiedy ustawiona jest opcja 'ruler' (wi�cej w lekcji 6.). - - 2. Wci�nij G aby przej�� na koniec pliku. - Wci�nij gg aby przej�� do pocz�tku pliku. - - 3. Wpisz numer linii, w kt�rej by�e� a potem G . To przeniesie Ci� - z powrotem do linii, w kt�rej by�e� kiedy wcisn��e� CTRL-G. - - 4. Je�li czujesz si� wystarczaj�co pewnie, wykonaj kroki 1-3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.2.: POLECENIE SZUKAJ - - - ** Wpisz / a nast�pnie wyra�enie, aby je znale��. ** - - 1. W trybie Normal wpisz / . Zauwa�, �e znak ten oraz kursor pojawi� - si� na dole ekranu tak samo, jak polecenie : . - - 2. Teraz wpisz b�ond . To jest s�owo, kt�rego chcesz szuka�. - - 3. By szuka� tej samej frazy ponownie, po prostu wci�nij n . - Aby szuka� tej frazy w przeciwnym, kierunku wci�nij N . - - 4. Je�li chcesz szuka� frazy do ty�u, u�yj polecenia ? zamiast / . - - 5. Aby wr�ci� gdzie by�e�, wci�nij CTRL-O. Powtarzaj, by wr�ci� dalej. CTRL-I - idzie do przodu. - -Uwaga: 'b�ond' to nie jest metoda, by przeliterowa� b��d; 'b�ond' to b��d. -Uwaga: Kiedy szukanie osi�gnie koniec pliku, b�dzie kontynuowane od pocz�tku - o ile opcja 'wrapscan' nie zosta�a przestawiona. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.3.: W POSZUKIWANIU PARUJ�CYCH NAWIAS�W - - - ** Wpisz % by znale�� paruj�cy ), ], lub } . ** - - 1. Umie�� kursor na kt�rym� z (, [, lub { w linii poni�ej oznaczonej --->. - - 2. Teraz wpisz znak % . - - 3. Kursor powinien si� znale�� na paruj�cym nawiasie. - - 4. Wci�nij % aby przenie�� kursor z powrotem do paruj�cego nawiasu. - - 5. Przenie� kursor do innego (,),[,],{ lub } i zobacz co robi % . - ----> To ( jest linia testowa z (, [, ] i {, } . )) - -Uwaga: Ta funkcja jest bardzo u�yteczna w debuggowaniu programu - z niesparowanymi nawiasami! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.4.: POLECENIE SUBSTITUTE (zamiana) - - - ** Wpisz :s/stary/nowy/g aby zamieni� 'stary' na 'nowy'. ** - - 1. Przenie� kursor do linii poni�ej oznaczonej --->. - - 2. Wpisz :s/czaas/czas . Zauwa�, �e to polecenie zmienia - tylko pierwsze wyst�pienie 'czaas' w linii. - - 3. Teraz wpisz :s/czaas/czas/g . Dodane g oznacza zamian� (substytucj�) - globalnie w ca�ej linii. Zmienia wszystkie wyst�pienia 'czaas' w linii. - ----> Najlepszy czaas na zobaczenie naj�adniejszych kwiat�w to czaas wiosny. - - 4. Aby zmieni� wszystkie wyst�pienia �a�cucha znak�w pomi�dzy dwoma liniami, - wpisz: :#,#s/stare/nowe/g gdzie #,# s� numerami linii ograniczaj�cych - region, gdzie ma nast�pi� zamiana. - wpisz :%s/stare/nowe/g by zmieni� wszystkie wyst�pienia w ca�ym pliku. - wpisz :%s/stare/nowe/gc by zmieni� wszystkie wyst�pienia w ca�ym - pliku, prosz�c o potwierdzenie za ka�dym razem. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.4. PODSUMOWANIE - - 1. CTRL-G poka�e Twoj� pozycj� w pliku i status pliku. SHIFT-G przenosi - Ci� do ko�ca pliku. - G przenosi do ko�ca pliku. - liczba G przenosi do linii [liczba]. - gg przenosi do pierwszej linii. - - 2. Wpisanie / a nast�pnie �a�cucha znak�w szuka �a�cucha DO PRZODU. - Wpisanie ? a nast�pnie �a�cucha znak�w szuka �a�cucha DO TY�U. - Po wyszukiwaniu wci�nij n by znale�� nast�pne wyst�pienie szukanej - frazy w tym samym kierunku lub N by szuka� w kierunku przeciwnym. - CTRL-O przenosi do starszych pozycji, CTRL-I do nowszych. - - 3. Wpisanie % gdy kursor znajduje si� na (,),[,],{, lub } lokalizuje - paruj�cy znak. - - 4. By zamieni� pierwszy stary na nowy w linii, wpisz :s/stary/nowy - By zamieni� wszystkie stary na nowy w linii, wpisz :s/stary/nowy/g - By zamieni� frazy pomi�dzy dwoma liniami # wpisz :#,#s/stary/nowy/g - By zamieni� wszystkie wyst�pienia w pliku, wpisz :%s/stary/nowy/g - By Vim prosi� Ci� o potwierdzenie, dodaj 'c' :%s/stary/nowy/gc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.1.: JAK WYKONA� POLECENIA ZEWN�TRZNE? - - - ** Wpisz :! a nast�pnie zewn�trzne polecenie, by je wykona�. ** - - 1. Wpisz znajome polecenie : by ustawi� kursor na dole ekranu. To pozwala - na wprowadzenie komendy linii polece�. - - 2. Teraz wstaw ! (wykrzyknik). To umo�liwi Ci wykonanie dowolnego - zewn�trznego polecenia pow�oki. - - 3. Jako przyk�ad wpisz ls za ! a nast�pnie wci�nij . To polecenie - poka�e spis plik�w w Twoim katalogu, tak jakby� by� przy znaku zach�ty - pow�oki. Mo�esz te� u�y� :!dir je�li ls nie dzia�a. - -Uwaga: W ten spos�b mo�na wykona� wszystkie polecenia pow�oki. -Uwaga: Wszystkie polecenia : musz� by� zako�czone . - Od tego momentu nie zawsze b�dziemy o tym wspomina�. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.2.: WI�CEJ O ZAPISYWANIU PLIK�W - - - ** By zachowa� zmiany w tek�cie, wpisz :w NAZWA_PLIKU . ** - - 1. Wpisz :!dir lub :!ls by zobaczy� spis plik�w w katalogu. - Ju� wiesz, �e musisz po tym wcisn�� . - - 2. Wybierz nazw� pliku, jaka jeszcze nie istnieje, np. TEST. - - 3. Teraz wpisz: :w TEST (gdzie TEST jest nazw� pliku jak� wybra�e�.) - - 4. To polecenie zapami�ta ca�y plik (Vim Tutor) pod nazw� TEST. - By to sprawdzi�, wpisz :!dir lub :!ls �eby znowu zobaczy� list� plik�w. - -Uwaga: Zauwa�, �e gdyby� teraz wyszed� z Vima, a nast�pnie wszed� ponownie - poleceniem vim TEST , plik by�by dok�adn� kopi� tutoriala, kiedy go - zapisywa�e�. - - 5. Teraz usu� plik wpisuj�c (MS-DOS): :!del TEST - lub (Unix): :!rm TEST - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.3.: WYBRANIE TEKSTU DO ZAPISU - - - ** By zachowa� cz�� pliku, wpisz v ruch :w NAZWA_PLIKU ** - - 1. Przenie� kursor do tego wiersza. - - 2. Wci�nij v i przenie� kursor do punktu 5. Zauwa�, �e tekst zosta� - pod�wietlony. - - 3. Wci�nij znak : . Na dole ekranu pojawi si� :'<,'> . - - 4. Wpisz w TEST , gdzie TEST to nazwa pliku, kt�ry jeszcze nie istnieje. - Upewnij si�, �e widzisz :'<,'>w TEST zanim wci�niesz Enter. - - 5. Vim zapisze wybrane linie do pliku TEST. U�yj :!dir lub :!ls , �eby to - zobaczy�. Jeszcze go nie usuwaj! U�yjemy go w nast�pnej lekcji. - -UWAGA: Wci�ni�cie v zaczyna tryb Wizualny. Mo�esz porusza� kursorem, by - zmieni� rozmiary zaznaczenia. Mo�esz te� u�y� operatora, by zrobi� co� - z tekstem. Na przyk�ad d usuwa tekst. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.4.: WSTAWIANIE I ��CZENIE PLIK�W - - - ** By wstawi� zawarto�� pliku, wpisz :r NAZWA_PLIKU ** - - 1. Umie�� kursor tu� powy�ej tej linii. - -UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 1.5.3. Potem przejd� - do DO�U, by zobaczy� ponownie t� lekcj�. - - 2. Teraz wczytaj plik TEST u�ywaj�c polecenia :r TEST , gdzie TEST - jest nazw� pliku. - Wczytany plik jest umieszczony poni�ej linii z kursorem. - - 3. By sprawdzi� czy plik zosta� wczytany, cofnij kursor i zobacz, �e - teraz s� dwie kopie Lekcji 1.5.3., orygina� i kopia z pliku. - -UWAGA: Mo�esz te� wczyta� wyj�cie zewn�trznego polecenia. Na przyk�ad - :r !ls wczytuje wyj�cie polecenia ls i umieszcza je pod poni�ej - kursora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.5. PODSUMOWANIE - - - 1. :!polecenie wykonuje polecenie zewn�trzne. - - U�ytecznymi przyk�adami s�: - - :!dir - pokazuje spis plik�w w katalogu. - - :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU. - - 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazw� NAZWA_PLIKU. - - 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. - - 4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do - bie��cego pliku poni�ej kursora. - - 5. :r !dir wczytuje wyj�cie polecenia dir i umieszcza je poni�ej kursora. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.1.: POLECENIE OPEN (otw�rz) - - - ** Wpisz o by otworzy� lini� poni�ej kursora i przenie�� si� do - trybu Insert (wprowadzanie). ** - - 1. Przenie� kursor do linii poni�ej oznaczonej --->. - - 2. Wpisz o (ma�e), by otworzy� lini� PONI�EJ kursora i przenie�� si� - do trybu Insert (wprowadzanie). - - 3. Wpisz troch� tekstu i wci�nij by wyj�� z trybu Insert (wprowadzanie). - ----> Po wci�ni�ciu o kursor znajdzie si� w otwartej linii w trybie Insert. - - 4. By otworzy� lini� POWY�EJ kursora, wci�nij wielkie O zamiast ma�ego - o . Wypr�buj to na linii poni�ej. - ----> Otw�rz lini� powy�ej wciskaj�c SHIFT-O gdy kursor b�dzie na tej linii. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.2.: POLECENIE APPEND (dodaj) - - - ** Wpisz a by doda� tekst ZA kursorem. ** - - 1. Przenie� kursor do pocz�tku pierwszej linii poni�ej oznaczonej ---> - - 2. Wciskaj e dop�ki kursor nie b�dzie na ko�cu li . - - 3. Wpisz a (ma�e), aby doda� tekst ZA znakiem pod kursorem. - - 4. Doko�cz wyraz tak, jak w linii poni�ej. Wci�nij aby opu�ci� tryb - Insert. - - 5. U�yj e by przej�� do kolejnego niedoko�czonego wyrazu i powtarzaj kroki - 3. i 4. - ----> Ta li poz Ci �wi dodaw teks do ko� lin ----> Ta linia pozwoli Ci �wiczy� dodawanie tekstu do ko�ca linii. - -Uwaga: a , i oraz A prowadz� do trybu Insert, jedyn� r�nic� jest miejsce, - gdzie nowe znaki b�d� dodawane. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.3.: INNA WERSJA REPLACE (zamiana) - - - ** Wpisz wielkie R by zamieni� wi�cej ni� jeden znak. ** - - 1. Przenie� kursor do pierwszej linii poni�ej oznaczonej --->. Przenie� - kursor do pierwszego xxx . - - 2. Wci�nij R i wpisz numer poni�ej w drugiej linii, tak, �e zast�pi on - xxx. - - 3. Wci�nij by opu�ci� tryb Replace. Zauwa�, �e reszta linii pozostaje - niezmieniona. - - 5. Powtarzaj kroki by wymieni� wszystkie xxx. - ----> Dodanie 123 do xxx daje xxx. ----> Dodanie 123 do 456 daje 579. - -UWAGA: Tryb Replace jest jak tryb Insert, ale ka�dy znak usuwa istniej�cy - znak. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.4.: KOPIOWANIE I WKLEJANIE TEKSTU - - - ** u�yj operatora y aby skopiowa� tekst i p aby go wklei� ** - - 1. Przejd� do linii oznaczonej ---> i umie�� kursor za "a)". - - 2. Wejd� w tryb Wizualny v i przenie� kursor na pocz�tek "pierwszy". - - 3. Wci�nij y aby kopiowa� (yankowa�) pod�wietlony tekst. - - 4. Przenie� kursor do ko�ca nast�pnej linii: j$ - - 5. Wci�nij p aby wklei� (wpakowa�) tekst. Dodaj: a drugi . - - 6. U�yj trybu Wizualnego, aby wybra� " element.", yankuj go y , przejd� do - ko�ca nast�pnej linii j$ i upakuj tam tekst z p . - ----> a) to jest pierwszy element. - b) -Uwaga: mo�esz u�y� y jako operatora; yw kopiuje jeden wyraz. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.5.: USTAWIANIE OPCJI - - -** Ustawianie opcji tak, by szukaj lub substytucja ignorowa�y wielko�� liter ** - - 1. Szukaj 'ignore' wpisuj�c: /ignore - Powt�rz szukanie kilka razy naciskaj�c klawisz n . - - 2. Ustaw opcj� 'ic' (Ignore case -- ignoruj wielko�� liter) poprzez - wpisanie: :set ic - - 3. Teraz szukaj 'ignore' ponownie wciskaj�c: n - Zauwa�, �e Ignore i IGNORE tak�e s� teraz znalezione. - - 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is - - 5. Teraz wprowad� polecenie szukaj ponownie i zobacz co si� zdarzy: - /ignore - - 6. Aby wy��czy� ignorowanie wielko�ci liter: :set noic - -Uwaga: Aby usun�� pod�wietlanie dopasowa�, wpisz: :nohlsearch -Uwaga: Aby ignorowa� wielko�� liter dla jednego wyszukiwania: /ignore\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.6. PODSUMOWANIE - - - 1. Wpisanie o otwiera lini� PONI�EJ kursora. - Wpisanie O otwiera lini� POWY�EJ kursora. - - 2. Wpisanie a wstawia tekst ZA znakiem, na kt�rym jest kursor. - Wpisanie A dodaje tekst na ko�cu linii. - - 3. Polecenie e przenosi do ko�ca wyrazu. - 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja) go. - 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dop�ki - nie zostanie wci�ni�ty . - 6. Wpisanie ":set xxx" ustawia opcj� "xxx". Niekt�re opcje: - 'ic' 'ignorecase' ignoruj wielko�� znak�w - 'is' 'incsearch' poka� cz�ciowe dopasowania - 'hls' 'hlsearch' pod�wietl wszystkie dopasowania - Mo�esz u�y� zar�wno d�ugiej, jak i kr�tkiej formy. - 7. Dodaj "no", aby wy��czy� opcj�: :set noic - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.7.1.: JAK UZYSKA� POMOC? - - ** U�ycie systemu pomocy on-line ** - - Vim posiada bardzo dobry system pomocy on-line. By zacz��, spr�buj jednej - z trzech mo�liwo�ci: - - wci�nij klawisz (je�li taki masz) - - wci�nij klawisz (je�li taki masz) - - wpisz :help - - Przeczytaj tekst w oknie pomocy, aby dowiedzie� si� jak dzia�a pomoc. - wpisz CTRL-W CTRL-W aby przeskoczy� z jednego okna do innego - wpisz :q aby zamkn�� okno pomocy. - - Mo�esz te� znale�� pomoc na ka�dy temat podaj�c argument polecenia ":help". - Spr�buj tych (nie zapomnij wcisn�� ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.7.2.: TWORZENIE SKRYPTU STARTOWEGO - - ** W��cz mo�liwo�ci Vima ** - - Vim ma o wiele wi�cej mo�liwo�ci ni� Vi, ale wi�kszo�� z nich jest domy�lnie - wy��czona. Je�li chcesz w��czy� te mo�liwo�ci na starcie musisz utworzy� - plik "vimrc". - - 1. Pocz�tek edycji pliku "vimrc" zale�y od Twojego systemu: - :edit ~/.vimrc dla Uniksa - :edit ~/_vimrc dla MS-Windows - 2. Teraz wczytaj przyk�adowy plik "vimrc": - :read $VIMRUNTIME/vimrc_example.vim - 3. Zapisz plik: - :w - - Nast�pnym razem, gdy zaczniesz prac� w Vimie b�dzie on u�ywa� pod�wietlania - sk�adni. Mo�esz doda� wszystkie swoje ulubione ustawienia do tego pliku - "vimrc". - Aby uzyska� wi�cej informacji, wpisz :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.7.3.: UZUPE�NIANIE - - - ** Uzupe�nianie linii polece� z CTRL-D i ** - - 1. Upewnij si�, �e Vim nie jest w trybie kompatybilno�ci: :set nocp - - 2. Zerknij, jakie pliki s� w bie��cym katalogu: :!ls lub :!dir - - 3. Wpisz pocz�tek polecenia: :e - - 4. Wci�nij CTRL-D i Vim poka�e list� polece�, jakie zaczynaj� si� na "e". - - 5. Wci�nij i Vim uzupe�ni polecenie do ":edit". - - 6. Dodaj spacj� i zacznij wpisywa� nazw� istniej�cego pliku: :edit FIL - - 7. Wci�nij . Vim uzupe�ni nazw� (je�li jest niepowtarzalna). - -UWAGA: Uzupe�nianie dzia�a dla wielu polece�. Spr�buj wcisn�� CTRL-D i . - U�yteczne zw�aszcza przy :help . -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.7. PODSUMOWANIE - - - 1. Wpisz :help albo wci�nij lub aby otworzy� okno pomocy. - - 2. Wpisz :help cmd aby uzyska� pomoc o cmd . - - 3. Wpisz CTRL-W CTRL-W aby przeskoczy� do innego okna. - - 4. Wpisz :q aby zamkn�� okno pomocy. - - 5. Utw�rz plik startowy vimrc aby zachowa� wybrane ustawienia. - - 6. Po poleceniu : , wci�nij CTRL-D aby zobaczy� mo�liwe uzupe�nienia. - Wci�nij aby u�y� jednego z nich. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Tutaj si� ko�czy tutorial Vima. Zosta� on pomy�lany tak, aby da� kr�tki - przegl�d jego mo�liwo�ci, wystarczaj�cy by� m�g� go u�ywa�. Jest on - daleki od kompletno�ci, poniewa� Vim ma o wiele, wiele wi�cej polece�. - - Dla dalszej nauki rekomendujemy ksi��k�: - Vim - Vi Improved - autor Steve Oualline - Wydawca: New Riders - Pierwsza ksi��ka ca�kowicie po�wi�cona Vimowi. U�yteczna zw�aszcza dla - pocz�tkuj�cych. Zawiera wiele przyk�ad�w i ilustracji. - Zobacz https://iccf-holland.org./click5.html - - Starsza pozycja i bardziej o Vi ni� o Vimie, ale tak�e warta - polecenia: - Learning the Vi Editor - autor Linda Lamb - Wydawca: O'Reilly & Associates Inc. - To dobra ksi��ka, by dowiedzie� si� niemal wszystkiego, co chcia�by� zrobi� - z Vi. Sz�sta edycja zawiera te� informacje o Vimie. - - Po polsku wydano: - Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins - Wydawca: Helion 2001 (O'Reilly). - ISBN: 83-7197-472-8 - http://helion.pl/ksiazki/vilek.htm - Jest to ksi��eczka zawieraj�ca spis polece� vi i jego najwa�niejszych - klon�w (mi�dzy innymi Vima). - - Edytor vi - autorzy Linda Lamb i Arnold Robbins - Wydawca: Helion 2001 (O'Reilly) - wg 6. ang. wydania - ISBN: 83-7197-539-2 - http://helion.pl/ksiazki/viedyt.htm - Rozszerzona wersja Learning the Vi Editor w polskim t�umaczeniu. - - Ten tutorial zosta� napisany przez Michaela C. Pierce'a i Roberta K. Ware'a, - Colorado School of Mines korzystaj�c z pomocy Charlesa Smitha, - Colorado State University. - E-mail: bware@mines.colorado.edu. - - Zmodyfikowane dla Vima przez Brama Moolenaara. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Przet�umaczone przez Miko�aja Machowskiego, - Sierpie� 2001, - rev. Marzec 2002 - 2nd rev. Wrzesie� 2004 - 3rd rev. Marzec 2006 - 4th rev. Grudzie� 2008 - Wszelkie uwagi prosz� kierowa� na: mikmach@wp.pl diff --git a/runtime/tutor/tutor1.pl.utf-8 b/runtime/tutor/tutor1.pl.utf-8 deleted file mode 100644 index cd3d5bd354..0000000000 --- a/runtime/tutor/tutor1.pl.utf-8 +++ /dev/null @@ -1,995 +0,0 @@ -=============================================================================== -= W i t a j w t u t o r i a l u V I M - a - Wersja 1.7. = -=============================================================================== - - Vim to potężny edytor, który posiada wiele poleceń, zbyt dużo, by - wyjaśnić je wszystkie w tym tutorialu. Ten przewodnik ma nauczyć - Cię posługiwać się wystarczająco wieloma komendami, byś mógł łatwo - używać Vima jako edytora ogólnego przeznaczenia. - - Czas potrzebny na ukończenie tutoriala to 25 do 30 minut i zależy - od tego jak wiele czasu spędzisz na eksperymentowaniu. - - UWAGA: - Polecenia wykonywane w czasie lekcji zmodyfikują tekst. Zrób - wcześniej kopię tego pliku do ćwiczeń (jeśli zacząłeś komendą - "vimtutor", to już pracujesz na kopii). - - Pamiętaj, że przewodnik ten został zaprojektowany do nauki poprzez - ćwiczenia. Oznacza to, że musisz wykonywać polecenia, by nauczyć się ich - prawidłowo. Jeśli będziesz jedynie czytał tekst, szybko zapomnisz wiele - poleceń! - - Teraz upewnij się, że nie masz wciśniętego Caps Locka i wciskaj j - tak długo dopóki Lekcja 1.1.1. nie wypełni całkowicie ekranu. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.1.: PORUSZANIE SIĘ KURSOREM - - ** By wykonać ruch kursorem, wciśnij h, j, k, l jak pokazano. ** - - ^ - k Wskazówka: h jest po lewej - < h l > l jest po prawej - j j wygląda jak strzałka w dół - v - 1. Poruszaj kursorem dopóki nie będziesz pewien, że pamiętasz polecenia. - - 2. Trzymaj j tak długo aż będzie się powtarzał. - Teraz wiesz jak dojść do następnej lekcji. - - 3. Używając strzałki w dół przejdź do następnej lekcji. - -Uwaga: Jeśli nie jesteś pewien czegoś co wpisałeś, wciśnij , by wrócić do - trybu Normal. Wtedy powtórz polecenie. - -Uwaga: Klawisze kursora także powinny działać, ale używając hjkl będziesz - w stanie poruszać się o wiele szybciej, jak się tylko przyzwyczaisz. - Naprawdę! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.2.: WYCHODZENIE Z VIM-a - - !! UWAGA: Przed wykonaniem jakiegokolwiek polecenia przeczytaj całą lekcję !! - - 1. Wciśnij (aby upewnić się, że jesteś w trybie Normal). - 2. Wpisz: :q!. - To spowoduje wyjście z edytora PORZUCAJĄC wszelkie zmiany, jakie - zdążyłeś zrobić. Jeśli chcesz zapamiętać zmiany i wyjść, - wpisz: :wq - - 3. Kiedy widzisz znak zachęty powłoki wpisz komendę, żeby wrócić - do tutoriala. Czyli: vimtutor - - 4. Jeśli chcesz zapamiętać polecenia, wykonaj kroki 1. do 3., aby - wyjść i wrócić do edytora. - -UWAGA: :q! porzuca wszelkie zmiany jakie zrobiłeś. W następnych - lekcjach dowiesz się jak je zapamiętywać. - - 5. Przenieś kursor do lekcji 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.3.: EDYCJA TEKSTU - KASOWANIE - - ** Wciśnij x aby usunąć znak pod kursorem. ** - - 1. Przenieś kursor do linii poniżej oznaczonej --->. - - 2. By poprawić błędy, naprowadź kursor na znak do usunięcia. - - 3. Wciśnij x aby usunąć niechciany znak. - - 4. Powtarzaj kroki 2. do 4. dopóki zdanie nie jest poprawne. - ----> Kkrowa prrzeskoczyła prrzez ksiiężycc. - - 5. Teraz, kiedy zdanie jest poprawione, przejdź do Lekcji 1.1.4. - -UWAGA: Ucz się przez ćwiczenie, nie wkuwanie. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.4.: EDYCJA TEKSTU - INSERT (wprowadzanie) - - - ** Wciśnij i aby wstawić tekst. ** - - 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. - - 2. Aby poprawić pierwszy wiersz, ustaw kursor na pierwszym znaku PO tym, - gdzie tekst ma być wstawiony. - - 3. Wciśnij i a następnie wpisz konieczne poprawki. - - 4. Po poprawieniu błędu wciśnij , by wrócić do trybu Normal. - Powtarzaj kroki 2. do 4., aby poprawić całe zdanie. - ----> W tej brkje trochę . ----> W tej linii brakuje trochę tekstu. - - 5. Kiedy czujesz się swobodnie wstawiając tekst, przejdź do - podsumowania poniżej. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.5.: EDYCJA TEKSTU - APPENDING (dodawanie) - - - ** Wciśnij A by dodać tekst. ** - - 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. - Nie ma znaczenia, który to będzie znak. - - 2. Wciśnij A i wpisz odpowiednie dodatki. - - 3. Kiedy tekst został dodany, wciśnij i wróć do trybu Normalnego. - - 4. Przenieś kursor do drugiej linii oznaczonej ---> i powtórz kroki 2. i 3., - aby poprawić zdanie. - ----> Brakuje tu tro - Brakuje tu trochę tekstu. ----> Tu też trochę bra - Tu też trochę brakuje. - - 5. Kiedy już utrwaliłeś ćwiczenie, przejdź do lekcji 1.1.6. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.1.6.: EDYCJA PLIKU - - ** Użyj :wq aby zapisać plik i wyjść. ** - - !! UWAGA: zanim wykonasz jakiekolwiek polecenia przeczytaj całą lekcję !! - - 1. Zakończ tutorial tak jak w lekcji 1.1.2.: :q! - lub, jeśli masz dostęp do innego terminala, wykonaj kolejne kroki tam. - - 2. W powłoce wydaj polecenie: vim tutor - "vim" jest poleceniem uruchamiającym edytor Vim. 'tutor' to nazwa pliku, - jaki chcesz edytować. Użyj pliku, który może zostać zmieniony. - - 3. Dodaj i usuń tekst tak, jak się nauczyłeś w poprzednich lekcjach. - - 4. Zapisz plik ze zmianami i opuść Vima: :wq - - 5. Jeśli zakończyłeś vimtutor w kroku 1., uruchom go ponownie i przejdź - do podsumowania poniżej. - - 6. Po przeczytaniu wszystkich kroków i ich zrozumieniu: wykonaj je. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.1. PODSUMOWANIE - - 1. Poruszasz kursorem używając "strzałek" i klawiszy hjkl . - h (w lewo) j (w dół) k (do góry) l (w prawo) - - 2. By wejść do Vima, (z powłoki) wpisz: - vim NAZWA_PLIKU - - 3. By wyjść z Vima, wpisz: - :q! by usunąć wszystkie zmiany. - LUB: :wq by zmiany zachować. - - 4. By usunąć znak pod kursorem, wciśnij: x - - 5. By wstawić tekst przed kursorem lub dodać: - i wpisz tekst wstawi przed kursorem - A wpisz tekst doda na końcu linii - -UWAGA: Wciśnięcie przeniesie Cię z powrotem do trybu Normal - lub odwoła niechciane lub częściowo wprowadzone polecenia. - -Teraz możemy kontynuować i przejść do Lekcji 1.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.1.: POLECENIE DELETE (usuwanie) - - - ** Wpisz dw by usunąć wyraz. ** - - 1. Wciśnij , by upewnić się, że jesteś w trybie Normal. - - 2. Przenieś kursor do linii poniżej oznaczonej --->. - - 3. Przesuń kursor na początek wyrazu, który chcesz usunąć. - - 4. Wpisz dw by usunąć wyraz. - - UWAGA: Litera d pojawi się na dole ekranu. Vim czeka na wpisanie w . - Jeśli zobaczysz inny znak, oznacza to, że wpisałeś coś źle; wciśnij - i zacznij od początku. - ----> Jest tu parę papier wyrazów, które kamień nie należą do nożyce tego zdania. - - 5. Powtarzaj kroki 3. i 4. dopóki zdanie nie będzie poprawne, potem - przejdź do Lekcji 1.2.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.2.: WIĘCEJ POLECEŃ USUWAJĄCYCH - - - ** Wpisz d$ aby usunąć tekst do końca linii. ** - - 1. Wciśnij aby się upewnić, że jesteś w trybie Normal. - - 2. Przenieś kursor do linii poniżej oznaczonej --->. - - 3. Przenieś kursor do końca poprawnego zdania (PO pierwszej . ). - - 4. Wpisz d$ aby usunąć resztę linii. - ----> Ktoś wpisał koniec tego zdania dwukrotnie. zdania dwukrotnie. - - - 5. Przejdź do Lekcji 1.2.3., by zrozumieć co się stało. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.3.: O OPERATORACH I RUCHACH - - - Wiele poleceń zmieniających tekst jest złożonych z operatora i ruchu. - Format dla polecenia usuwającego z operatorem d jest następujący: - - d ruch - - gdzie: - d - operator usuwania. - ruch - na czym polecenie będzie wykonywane (lista poniżej). - - Krótka lista ruchów: - w - do początku następnego wyrazu WYŁĄCZAJĄC pierwszy znak. - e - do końca bieżącego wyrazu, WŁĄCZAJĄC ostatni znak. - $ - do końca linii, WŁĄCZAJĄC ostatni znak. - -W ten sposób wpisanie de usunie znaki od kursora do końca wyrazu. - -UWAGA: Wpisanie tylko ruchu w trybie Normal bez operatora przeniesie kursor - tak, jak to określono. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.4.: UŻYCIE MNOŻNIKA DLA RUCHU - - - ** Wpisanie liczby przed ruchem powtarza ruch odpowiednią ilość razy. ** - - 1. Przenieś kursor na początek linii poniżej zaznaczonej --->. - - 2. Wpisz 2w aby przenieść kursor o dwa wyrazy do przodu. - - 3. Wpisz 3e aby przenieść kursor do końca trzeciego wyrazu w przód. - - 4. Wpisz 0 (zero), aby przenieść kursor na początek linii. - - 5. Powtórz kroki 2. i 3. z innymi liczbami. - - - ---> To jest zwykły wiersz z wyrazami, po których możesz się poruszać. - - 6. Przejdź do lekcji 1.2.5. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.5.: UŻYCIE MNOŻNIKA, BY WIĘCEJ USUNĄĆ - - - ** Wpisanie liczby z operatorem powtarza go odpowiednią ilość razy. ** - - W wyżej wspomnianej kombinacji operatora usuwania i ruchu podaj mnożnik - przed ruchem, by więcej usunąć: - d liczba ruch - - 1. Przenieś kursor do pierwszego wyrazu KAPITALIKAMI w linii zaznaczonej --->. - - 2. Wpisz 2dw aby usunąć dwa wyrazy KAPITALIKAMI. - - 3. Powtarzaj kroki 1. i 2. z innymi mnożnikami, aby usunąć kolejne wyrazy - KAPITALIKAMI jednym poleceniem - ----> ta ASD WE linia QWE ASDF ZXCV FG wyrazów została ERT FGH CF oczyszczona. - -UWAGA: Mnożnik pomiędzy operatorem d i ruchem działa podobnie do ruchu bez - operatora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.6.: OPEROWANIE NA LINIACH - - - ** Wpisz dd aby usunąć całą linię. ** - - Z powodu częstości usuwania całych linii, projektanci Vi zdecydowali, że - będzie łatwiej wpisać dwa razy d aby usunąć linię. - - 1. Przenieś kursor do drugiego zdania z wierszyka poniżej. - 2. Wpisz dd aby usunąć wiersz. - 3. Teraz przenieś się do czwartego wiersza. - 4. Wpisz 2dd aby usunąć dwa wiersze. - ----> 1) Róże są czerwone, ----> 2) Błoto jest fajne, ----> 3) Fiołki są niebieskie, ----> 4) Mam samochód, ----> 5) Zegar podaje czas, ----> 6) Cukier jest słodki, ----> 7) I ty też. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.2.7.: POLECENIE UNDO (cofnij) - - - ** Wciśnij u aby cofnąć skutki ostatniego polecenia. - U zaś, by cofnąć skutki dla całej linii. ** - - 1. Przenieś kursor do zdania poniżej oznaczonego ---> i umieść go na - pierwszym błędzie. - 2. Wpisz x aby usunąć pierwszy niechciany znak. - 3. Teraz wciśnij u aby cofnąć skutki ostatniego polecenia. - 4. Tym razem popraw wszystkie błędy w linii używając polecenia x . - 5. Teraz wciśnij wielkie U aby przywrócić linię do oryginalnego stanu. - 6. Teraz wciśnij u kilka razy, by cofnąć U i poprzednie polecenia. - 7. Teraz wpisz CTRL-R (trzymaj równocześnie wciśnięte klawisze CTRL i R) - kilka razy, by cofnąć cofnięcia. - ----> Poopraw błędyyy w teej liniii i zaamiień je prrzez coofnij. - - 8. To są bardzo pożyteczne polecenia. - - Przejdź teraz do podsumowania Lekcji 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.2. PODSUMOWANIE - - - 1. By usunąć znaki od kursora do następnego wyrazu, wpisz: dw - 2. By usunąć znaki od kursora do końca linii, wpisz: d$ - 3. By usunąć całą linię: dd - 4. By powtórzyć ruch, poprzedź go liczbą: 2w - 5. Format polecenia zmiany to: - operator [liczba] ruch - gdzie: - operator - to, co trzeba zrobić (np. d dla usuwania) - [liczba] - opcjonalne, ile razy powtórzyć ruch - ruch - przenosi nad tekstem do operowania, takim jak w (wyraz), - $ (do końca linii) etc. - - 6. By przejść do początku linii, użyj zera: 0 - 7. By cofnąć poprzednie polecenie, wpisz: u (małe u) - By cofnąć wszystkie zmiany w linii, wpisz: U (wielkie U) - By cofnąć cofnięcie, wpisz: CTRL-R - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.1.: POLECENIE PUT (wstaw) - - - ** Wpisz p by wstawić ostatnie usunięcia za kursorem. ** - - 1. Przenieś kursor do pierwszej linii ---> poniżej. - - 2. Wpisz dd aby usunąć linię i przechować ją w rejestrze Vima. - - 3. Przenieś kursor do linii c), POWYŻEJ tej, gdzie usunięta linia powinna - się znajdować. - - 4. Wciśnij p by wstawić linię poniżej kursora. - - 5. Powtarzaj kroki 2. do 4. aż znajdą się w odpowiednim porządku. - ----> d) Jak dwa aniołki. ----> b) Na dole fiołki, ----> c) A my się kochamy, ----> a) Na górze róże, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.2.: POLECENIE REPLACE (zastąp) - - - ** Wpisz rx aby zastąpić znak pod kursorem na x . ** - - 1. Przenieś kursor do pierwszej linii poniżej oznaczonej ---> - - 2. Ustaw kursor na pierwszym błędzie. - - 3. Wpisz r a potem znak jaki powinien go zastąpić. - - 4. Powtarzaj kroki 2. i 3. dopóki pierwsza linia nie będzie taka, jak druga. - ----> Kjedy ten wiersz bił wstókiwany, ktoś wciznął perę złych klawirzy! ----> Kiedy ten wiersz był wstukiwany, ktoś wcisnął parę złych klawiszy! - - 5. Teraz czas na Lekcję 1.3.3. - - -UWAGA: Pamiętaj, by uczyć się ćwicząc, a nie pamięciowo. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.3.: OPERATOR CHANGE (zmień) - - ** By zmienić do końca wyrazu, wpisz ce . ** - - 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. - - 2. Umieść kursor na u w lunos. - - 3. Wpisz ce i popraw wyraz (w tym wypadku wstaw inia ). - - 4. Wciśnij i przejdź do następnej planowanej zmiany. - - 5. Powtarzaj kroki 3. i 4. dopóki pierwsze zdanie nie będzie takie same, - jak drugie. - ----> Ta lunos ma pire słów, które tżina zbnic użifajonc pcmazu zmień. ----> Ta linia ma parę słów, które trzeba zmienić używając polecenia zmień. - - Zauważ, że ce nie tylko zamienia wyraz, ale także zmienia tryb na - Insert (wprowadzanie). - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.3.4.: WIĘCEJ ZMIAN UŻYWAJĄC c - - - ** Polecenie change używa takich samych ruchów, jak delete. ** - - 1. Operator change działa tak samo, jak delete. Format wygląda tak: - - c [liczba] ruch - - 2. Ruchy są także takie same, np.: w (wyraz), $ (koniec linii) etc. - - 3. Przenieś się do pierwszej linii poniżej oznaczonej ---> - - 4. Ustaw kursor na pierwszym błędzie. - - 5. Wpisz c$ , popraw koniec wiersza i wciśnij . - ----> Koniec tego wiersza musi być poprawiony, aby wyglądał tak, jak drugi. ----> Koniec tego wiersza musi być poprawiony używając polecenia c$ . - -UWAGA: Możesz używać aby poprawiać błędy w czasie pisania. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.3. PODSUMOWANIE - - - 1. Aby wstawić tekst, który został wcześniej usunięty wciśnij p . To - polecenie wstawia skasowany tekst PO kursorze (jeśli cała linia - została usunięta, zostanie ona umieszczona w linii poniżej kursora). - - 2. By zamienić znak pod kursorem, wciśnij r a potem znak, który ma zastąpić - oryginalny. - - 3. Operator change pozwala Ci na zastąpienie od kursora do miejsca, gdzie - zabrałby Cię ruch. Np. wpisz ce aby zamienić tekst od kursora do końca - wyrazu, c$ aby zmienić tekst do końca linii. - - 4. Format do polecenia change (zmień): - - c [liczba] obiekt - - Teraz przejdź do następnej lekcji. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.1.: POŁOŻENIE KURSORA ORAZ STATUS PLIKU - - ** Naciśnij CTRL-G aby zobaczyć swoje położenie w pliku i status - pliku. Naciśnij G aby przejść do linii w pliku. ** - - UWAGA: Przeczytaj całą lekcję zanim wykonasz jakieś polecenia!!! - - 1. Przytrzymaj klawisz CTRL i wciśnij g . Używamy notacji CTRL-G. - Na dole strony pojawi się pasek statusu z nazwą pliku i pozycją w pliku. - Zapamiętaj numer linii dla potrzeb kroku 3. - -UWAGA: Możesz też zobaczyć pozycję kursora w prawym, dolnym rogu ekranu. - Dzieje się tak kiedy ustawiona jest opcja 'ruler' (więcej w lekcji 6.). - - 2. Wciśnij G aby przejść na koniec pliku. - Wciśnij gg aby przejść do początku pliku. - - 3. Wpisz numer linii, w której byłeś a potem G . To przeniesie Cię - z powrotem do linii, w której byłeś kiedy wcisnąłeś CTRL-G. - - 4. Jeśli czujesz się wystarczająco pewnie, wykonaj kroki 1-3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.2.: POLECENIE SZUKAJ - - - ** Wpisz / a następnie wyrażenie, aby je znaleźć. ** - - 1. W trybie Normal wpisz / . Zauważ, że znak ten oraz kursor pojawią - się na dole ekranu tak samo, jak polecenie : . - - 2. Teraz wpisz błond . To jest słowo, którego chcesz szukać. - - 3. By szukać tej samej frazy ponownie, po prostu wciśnij n . - Aby szukać tej frazy w przeciwnym, kierunku wciśnij N . - - 4. Jeśli chcesz szukać frazy do tyłu, użyj polecenia ? zamiast / . - - 5. Aby wrócić gdzie byłeś, wciśnij CTRL-O. Powtarzaj, by wrócić dalej. CTRL-I - idzie do przodu. - -Uwaga: 'błond' to nie jest metoda, by przeliterować błąd; 'błond' to błąd. -Uwaga: Kiedy szukanie osiągnie koniec pliku, będzie kontynuowane od początku - o ile opcja 'wrapscan' nie została przestawiona. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.3.: W POSZUKIWANIU PARUJĄCYCH NAWIASÓW - - - ** Wpisz % by znaleźć parujący ), ], lub } . ** - - 1. Umieść kursor na którymś z (, [, lub { w linii poniżej oznaczonej --->. - - 2. Teraz wpisz znak % . - - 3. Kursor powinien się znaleźć na parującym nawiasie. - - 4. Wciśnij % aby przenieść kursor z powrotem do parującego nawiasu. - - 5. Przenieś kursor do innego (,),[,],{ lub } i zobacz co robi % . - ----> To ( jest linia testowa z (, [, ] i {, } . )) - -Uwaga: Ta funkcja jest bardzo użyteczna w debuggowaniu programu - z niesparowanymi nawiasami! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.4.4.: POLECENIE SUBSTITUTE (zamiana) - - - ** Wpisz :s/stary/nowy/g aby zamienić 'stary' na 'nowy'. ** - - 1. Przenieś kursor do linii poniżej oznaczonej --->. - - 2. Wpisz :s/czaas/czas . Zauważ, że to polecenie zmienia - tylko pierwsze wystąpienie 'czaas' w linii. - - 3. Teraz wpisz :s/czaas/czas/g . Dodane g oznacza zamianę (substytucję) - globalnie w całej linii. Zmienia wszystkie wystąpienia 'czaas' w linii. - ----> Najlepszy czaas na zobaczenie najładniejszych kwiatów to czaas wiosny. - - 4. Aby zmienić wszystkie wystąpienia łańcucha znaków pomiędzy dwoma liniami, - wpisz: :#,#s/stare/nowe/g gdzie #,# są numerami linii ograniczających - region, gdzie ma nastąpić zamiana. - wpisz :%s/stare/nowe/g by zmienić wszystkie wystąpienia w całym pliku. - wpisz :%s/stare/nowe/gc by zmienić wszystkie wystąpienia w całym - pliku, prosząc o potwierdzenie za każdym razem. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.4. PODSUMOWANIE - - 1. CTRL-G pokaże Twoją pozycję w pliku i status pliku. SHIFT-G przenosi - Cię do końca pliku. - G przenosi do końca pliku. - liczba G przenosi do linii [liczba]. - gg przenosi do pierwszej linii. - - 2. Wpisanie / a następnie łańcucha znaków szuka łańcucha DO PRZODU. - Wpisanie ? a następnie łańcucha znaków szuka łańcucha DO TYŁU. - Po wyszukiwaniu wciśnij n by znaleźć następne wystąpienie szukanej - frazy w tym samym kierunku lub N by szukać w kierunku przeciwnym. - CTRL-O przenosi do starszych pozycji, CTRL-I do nowszych. - - 3. Wpisanie % gdy kursor znajduje się na (,),[,],{, lub } lokalizuje - parujący znak. - - 4. By zamienić pierwszy stary na nowy w linii, wpisz :s/stary/nowy - By zamienić wszystkie stary na nowy w linii, wpisz :s/stary/nowy/g - By zamienić frazy pomiędzy dwoma liniami # wpisz :#,#s/stary/nowy/g - By zamienić wszystkie wystąpienia w pliku, wpisz :%s/stary/nowy/g - By Vim prosił Cię o potwierdzenie, dodaj 'c' :%s/stary/nowy/gc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.1.: JAK WYKONAĆ POLECENIA ZEWNĘTRZNE? - - - ** Wpisz :! a następnie zewnętrzne polecenie, by je wykonać. ** - - 1. Wpisz znajome polecenie : by ustawić kursor na dole ekranu. To pozwala - na wprowadzenie komendy linii poleceń. - - 2. Teraz wstaw ! (wykrzyknik). To umożliwi Ci wykonanie dowolnego - zewnętrznego polecenia powłoki. - - 3. Jako przykład wpisz ls za ! a następnie wciśnij . To polecenie - pokaże spis plików w Twoim katalogu, tak jakbyś był przy znaku zachęty - powłoki. Możesz też użyć :!dir jeśli ls nie działa. - -Uwaga: W ten sposób można wykonać wszystkie polecenia powłoki. -Uwaga: Wszystkie polecenia : muszą być zakończone . - Od tego momentu nie zawsze będziemy o tym wspominać. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.2.: WIĘCEJ O ZAPISYWANIU PLIKÓW - - - ** By zachować zmiany w tekście, wpisz :w NAZWA_PLIKU . ** - - 1. Wpisz :!dir lub :!ls by zobaczyć spis plików w katalogu. - Już wiesz, że musisz po tym wcisnąć . - - 2. Wybierz nazwę pliku, jaka jeszcze nie istnieje, np. TEST. - - 3. Teraz wpisz: :w TEST (gdzie TEST jest nazwą pliku jaką wybrałeś.) - - 4. To polecenie zapamięta cały plik (Vim Tutor) pod nazwą TEST. - By to sprawdzić, wpisz :!dir lub :!ls żeby znowu zobaczyć listę plików. - -Uwaga: Zauważ, że gdybyś teraz wyszedł z Vima, a następnie wszedł ponownie - poleceniem vim TEST , plik byłby dokładną kopią tutoriala, kiedy go - zapisywałeś. - - 5. Teraz usuń plik wpisując (MS-DOS): :!del TEST - lub (Unix): :!rm TEST - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.3.: WYBRANIE TEKSTU DO ZAPISU - - - ** By zachować część pliku, wpisz v ruch :w NAZWA_PLIKU ** - - 1. Przenieś kursor do tego wiersza. - - 2. Wciśnij v i przenieś kursor do punktu 5. Zauważ, że tekst został - podświetlony. - - 3. Wciśnij znak : . Na dole ekranu pojawi się :'<,'> . - - 4. Wpisz w TEST , gdzie TEST to nazwa pliku, który jeszcze nie istnieje. - Upewnij się, że widzisz :'<,'>w TEST zanim wciśniesz Enter. - - 5. Vim zapisze wybrane linie do pliku TEST. Użyj :!dir lub :!ls , żeby to - zobaczyć. Jeszcze go nie usuwaj! Użyjemy go w następnej lekcji. - -UWAGA: Wciśnięcie v zaczyna tryb Wizualny. Możesz poruszać kursorem, by - zmienić rozmiary zaznaczenia. Możesz też użyć operatora, by zrobić coś - z tekstem. Na przykład d usuwa tekst. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.5.4.: WSTAWIANIE I ŁĄCZENIE PLIKÓW - - - ** By wstawić zawartość pliku, wpisz :r NAZWA_PLIKU ** - - 1. Umieść kursor tuż powyżej tej linii. - -UWAGA: Po wykonaniu kroku 2. zobaczysz tekst z Lekcji 1.5.3. Potem przejdź - do DOŁU, by zobaczyć ponownie tę lekcję. - - 2. Teraz wczytaj plik TEST używając polecenia :r TEST , gdzie TEST - jest nazwą pliku. - Wczytany plik jest umieszczony poniżej linii z kursorem. - - 3. By sprawdzić czy plik został wczytany, cofnij kursor i zobacz, że - teraz są dwie kopie Lekcji 1.5.3., oryginał i kopia z pliku. - -UWAGA: Możesz też wczytać wyjście zewnętrznego polecenia. Na przykład - :r !ls wczytuje wyjście polecenia ls i umieszcza je pod poniżej - kursora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.5. PODSUMOWANIE - - - 1. :!polecenie wykonuje polecenie zewnętrzne. - - Użytecznymi przykładami są: - - :!dir - pokazuje spis plików w katalogu. - - :!rm NAZWA_PLIKU - usuwa plik NAZWA_PLIKU. - - 2. :w NAZWA_PLIKU zapisuje obecny plik Vima na dysk z nazwą NAZWA_PLIKU. - - 3. v ruch :w NAZWA_PLIKU zapisuje Wizualnie wybrane linie do NAZWA_PLIKU. - - 4. :r NAZWA_PLIKU wczytuje z dysku plik NAZWA_PLIKU i wstawia go do - bieżącego pliku poniżej kursora. - - 5. :r !dir wczytuje wyjście polecenia dir i umieszcza je poniżej kursora. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.1.: POLECENIE OPEN (otwórz) - - - ** Wpisz o by otworzyć linię poniżej kursora i przenieść się do - trybu Insert (wprowadzanie). ** - - 1. Przenieś kursor do linii poniżej oznaczonej --->. - - 2. Wpisz o (małe), by otworzyć linię PONIŻEJ kursora i przenieść się - do trybu Insert (wprowadzanie). - - 3. Wpisz trochę tekstu i wciśnij by wyjść z trybu Insert (wprowadzanie). - ----> Po wciśnięciu o kursor znajdzie się w otwartej linii w trybie Insert. - - 4. By otworzyć linię POWYŻEJ kursora, wciśnij wielkie O zamiast małego - o . Wypróbuj to na linii poniżej. - ----> Otwórz linię powyżej wciskając SHIFT-O gdy kursor będzie na tej linii. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.2.: POLECENIE APPEND (dodaj) - - - ** Wpisz a by dodać tekst ZA kursorem. ** - - 1. Przenieś kursor do początku pierwszej linii poniżej oznaczonej ---> - - 2. Wciskaj e dopóki kursor nie będzie na końcu li . - - 3. Wpisz a (małe), aby dodać tekst ZA znakiem pod kursorem. - - 4. Dokończ wyraz tak, jak w linii poniżej. Wciśnij aby opuścić tryb - Insert. - - 5. Użyj e by przejść do kolejnego niedokończonego wyrazu i powtarzaj kroki - 3. i 4. - ----> Ta li poz Ci ćwi dodaw teks do koń lin ----> Ta linia pozwoli Ci ćwiczyć dodawanie tekstu do końca linii. - -Uwaga: a , i oraz A prowadzą do trybu Insert, jedyną różnicą jest miejsce, - gdzie nowe znaki będą dodawane. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.3.: INNA WERSJA REPLACE (zamiana) - - - ** Wpisz wielkie R by zamienić więcej niż jeden znak. ** - - 1. Przenieś kursor do pierwszej linii poniżej oznaczonej --->. Przenieś - kursor do pierwszego xxx . - - 2. Wciśnij R i wpisz numer poniżej w drugiej linii, tak, że zastąpi on - xxx. - - 3. Wciśnij by opuścić tryb Replace. Zauważ, że reszta linii pozostaje - niezmieniona. - - 5. Powtarzaj kroki by wymienić wszystkie xxx. - ----> Dodanie 123 do xxx daje xxx. ----> Dodanie 123 do 456 daje 579. - -UWAGA: Tryb Replace jest jak tryb Insert, ale każdy znak usuwa istniejący - znak. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.4.: KOPIOWANIE I WKLEJANIE TEKSTU - - - ** użyj operatora y aby skopiować tekst i p aby go wkleić ** - - 1. Przejdź do linii oznaczonej ---> i umieść kursor za "a)". - - 2. Wejdź w tryb Wizualny v i przenieś kursor na początek "pierwszy". - - 3. Wciśnij y aby kopiować (yankować) podświetlony tekst. - - 4. Przenieś kursor do końca następnej linii: j$ - - 5. Wciśnij p aby wkleić (wpakować) tekst. Dodaj: a drugi . - - 6. Użyj trybu Wizualnego, aby wybrać " element.", yankuj go y , przejdź do - końca następnej linii j$ i upakuj tam tekst z p . - ----> a) to jest pierwszy element. - b) -Uwaga: możesz użyć y jako operatora; yw kopiuje jeden wyraz. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.6.5.: USTAWIANIE OPCJI - - -** Ustawianie opcji tak, by szukaj lub substytucja ignorowały wielkość liter ** - - 1. Szukaj 'ignore' wpisując: /ignore - Powtórz szukanie kilka razy naciskając klawisz n . - - 2. Ustaw opcję 'ic' (Ignore case -- ignoruj wielkość liter) poprzez - wpisanie: :set ic - - 3. Teraz szukaj 'ignore' ponownie wciskając: n - Zauważ, że Ignore i IGNORE także są teraz znalezione. - - 4. Ustaw opcje 'hlsearch' i 'incsearch': :set hls is - - 5. Teraz wprowadź polecenie szukaj ponownie i zobacz co się zdarzy: - /ignore - - 6. Aby wyłączyć ignorowanie wielkości liter: :set noic - -Uwaga: Aby usunąć podświetlanie dopasowań, wpisz: :nohlsearch -Uwaga: Aby ignorować wielkość liter dla jednego wyszukiwania: /ignore\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.6. PODSUMOWANIE - - - 1. Wpisanie o otwiera linię PONIŻEJ kursora. - Wpisanie O otwiera linię POWYŻEJ kursora. - - 2. Wpisanie a wstawia tekst ZA znakiem, na którym jest kursor. - Wpisanie A dodaje tekst na końcu linii. - - 3. Polecenie e przenosi do końca wyrazu. - 4. Operator y yankuje (kopiuje) tekst, p pakuje (wkleja) go. - 5. Wpisanie wielkiego R wprowadza w tryb Replace (zamiana) dopóki - nie zostanie wciśnięty . - 6. Wpisanie ":set xxx" ustawia opcję "xxx". Niektóre opcje: - 'ic' 'ignorecase' ignoruj wielkość znaków - 'is' 'incsearch' pokaż częściowe dopasowania - 'hls' 'hlsearch' podświetl wszystkie dopasowania - Możesz użyć zarówno długiej, jak i krótkiej formy. - 7. Dodaj "no", aby wyłączyć opcję: :set noic - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.7.1.: JAK UZYSKAĆ POMOC? - - ** Użycie systemu pomocy on-line ** - - Vim posiada bardzo dobry system pomocy on-line. By zacząć, spróbuj jednej - z trzech możliwości: - - wciśnij klawisz (jeśli taki masz) - - wciśnij klawisz (jeśli taki masz) - - wpisz :help - - Przeczytaj tekst w oknie pomocy, aby dowiedzieć się jak działa pomoc. - wpisz CTRL-W CTRL-W aby przeskoczyć z jednego okna do innego - wpisz :q aby zamknąć okno pomocy. - - Możesz też znaleźć pomoc na każdy temat podając argument polecenia ":help". - Spróbuj tych (nie zapomnij wcisnąć ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCJA 1.7.2.: TWORZENIE SKRYPTU STARTOWEGO - - ** Włącz możliwości Vima ** - - Vim ma o wiele więcej możliwości niż Vi, ale większość z nich jest domyślnie - wyłączona. Jeśli chcesz włączyć te możliwości na starcie musisz utworzyć - plik "vimrc". - - 1. Początek edycji pliku "vimrc" zależy od Twojego systemu: - :edit ~/.vimrc dla Uniksa - :edit ~/_vimrc dla MS-Windows - 2. Teraz wczytaj przykładowy plik "vimrc": - :read $VIMRUNTIME/vimrc_example.vim - 3. Zapisz plik: - :w - - Następnym razem, gdy zaczniesz pracę w Vimie będzie on używać podświetlania - składni. Możesz dodać wszystkie swoje ulubione ustawienia do tego pliku - "vimrc". - Aby uzyskać więcej informacji, wpisz :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.7.3.: UZUPEŁNIANIE - - - ** Uzupełnianie linii poleceń z CTRL-D i ** - - 1. Upewnij się, że Vim nie jest w trybie kompatybilności: :set nocp - - 2. Zerknij, jakie pliki są w bieżącym katalogu: :!ls lub :!dir - - 3. Wpisz początek polecenia: :e - - 4. Wciśnij CTRL-D i Vim pokaże listę poleceń, jakie zaczynają się na "e". - - 5. Wciśnij i Vim uzupełni polecenie do ":edit". - - 6. Dodaj spację i zacznij wpisywać nazwę istniejącego pliku: :edit FIL - - 7. Wciśnij . Vim uzupełni nazwę (jeśli jest niepowtarzalna). - -UWAGA: Uzupełnianie działa dla wielu poleceń. Spróbuj wcisnąć CTRL-D i . - Użyteczne zwłaszcza przy :help . -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcja 1.7. PODSUMOWANIE - - - 1. Wpisz :help albo wciśnij lub aby otworzyć okno pomocy. - - 2. Wpisz :help cmd aby uzyskać pomoc o cmd . - - 3. Wpisz CTRL-W CTRL-W aby przeskoczyć do innego okna. - - 4. Wpisz :q aby zamknąć okno pomocy. - - 5. Utwórz plik startowy vimrc aby zachować wybrane ustawienia. - - 6. Po poleceniu : , wciśnij CTRL-D aby zobaczyć możliwe uzupełnienia. - Wciśnij aby użyć jednego z nich. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Tutaj się kończy tutorial Vima. Został on pomyślany tak, aby dać krótki - przegląd jego możliwości, wystarczający byś mógł go używać. Jest on - daleki od kompletności, ponieważ Vim ma o wiele, wiele więcej poleceń. - - Dla dalszej nauki rekomendujemy książkę: - Vim - Vi Improved - autor Steve Oualline - Wydawca: New Riders - Pierwsza książka całkowicie poświęcona Vimowi. Użyteczna zwłaszcza dla - początkujących. Zawiera wiele przykładów i ilustracji. - Zobacz https://iccf-holland.org./click5.html - - Starsza pozycja i bardziej o Vi niż o Vimie, ale także warta - polecenia: - Learning the Vi Editor - autor Linda Lamb - Wydawca: O'Reilly & Associates Inc. - To dobra książka, by dowiedzieć się niemal wszystkiego, co chciałbyś zrobić - z Vi. Szósta edycja zawiera też informacje o Vimie. - - Po polsku wydano: - Edytor vi. Leksykon kieszonkowy - autor Arnold Robbins - Wydawca: Helion 2001 (O'Reilly). - ISBN: 83-7197-472-8 - http://helion.pl/ksiazki/vilek.htm - Jest to książeczka zawierająca spis poleceń vi i jego najważniejszych - klonów (między innymi Vima). - - Edytor vi - autorzy Linda Lamb i Arnold Robbins - Wydawca: Helion 2001 (O'Reilly) - wg 6. ang. wydania - ISBN: 83-7197-539-2 - http://helion.pl/ksiazki/viedyt.htm - Rozszerzona wersja Learning the Vi Editor w polskim tłumaczeniu. - - Ten tutorial został napisany przez Michaela C. Pierce'a i Roberta K. Ware'a, - Colorado School of Mines korzystając z pomocy Charlesa Smitha, - Colorado State University. - E-mail: bware@mines.colorado.edu. - - Zmodyfikowane dla Vima przez Brama Moolenaara. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Przetłumaczone przez Mikołaja Machowskiego, - Sierpień 2001, - rev. Marzec 2002 - 2nd rev. Wrzesień 2004 - 3rd rev. Marzec 2006 - 4th rev. Grudzień 2008 - Wszelkie uwagi proszę kierować na: mikmach@wp.pl diff --git a/runtime/tutor/tutor1.pt b/runtime/tutor/tutor1.pt index d3dcb05e15..a731365a6f 100644 --- a/runtime/tutor/tutor1.pt +++ b/runtime/tutor/tutor1.pt @@ -1,251 +1,251 @@ =============================================================================== -= B e m - v i n d o ao t u t o r i a l do V I M - Vers�o 1.8 pt_BR = += B e m - v i n d o ao t u t o r i a l do V I M - Versão 1.8 pt_BR = =============================================================================== - Vim � um poderoso editor que possui muitos comandos, tantos que seria - imposs�vel ensin�-los num tutorial como este, que � concebido para + Vim é um poderoso editor que possui muitos comandos, tantos que seria + impossível ensiná-los num tutorial como este, que é concebido para apresentar os comandos suficientes para permiti-lo usar facilmente o - Vim como um editor de textos gen�rico. + Vim como um editor de textos genérico. - O tempo necess�rio para completar o tutorial � de cerca de 25-30 minutos, - dependendo de quanto tempo � gasto praticando os comandos. + O tempo necessário para completar o tutorial é de cerca de 25-30 minutos, + dependendo de quanto tempo é gasto praticando os comandos. - ATEN��O: - Os comandos nas li��es modificam este texto. Fa�a uma c�pia deste - arquivo para praticar os comandos (se usou o "vimtutor", esta j� - � uma c�pia). + ATENÇÃO: + Os comandos nas lições modificam este texto. Faça uma cópia deste + arquivo para praticar os comandos (se usou o "vimtutor", esta já + é uma cópia). - � importante lembrar que este tutorial � concebido para ensinar pela - pr�tica. Isso significa que voc� precisa executar os comandos para - aprend�-los adequadamente. Se voc� somente ler o texto, esquecer� os + É importante lembrar que este tutorial é concebido para ensinar pela + prática. Isso significa que você precisa executar os comandos para + aprendê-los adequadamente. Se você somente ler o texto, esquecerá os comandos! - Agora, certifique-se de que sua tecla Shift-Lock (ou Caps Lock) n�o esteja - ativada e pressione a tecla j o bastante para mover o cursor at� que a - Li��o 1.1.1 apare�a inteiramente na tela. + Agora, certifique-se de que sua tecla Shift-Lock (ou Caps Lock) não esteja + ativada e pressione a tecla j o bastante para mover o cursor até que a + Lição 1.1.1 apareça inteiramente na tela. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.1.1: MOVER O CURSOR + Lição 1.1.1: MOVER O CURSOR ** Para mover o cursor, pressione as teclas h,j,k,l conforme indicado. ** ^ - k Dica: A tecla h est� � esquerda e move � esquerda. - < h l > A tecla l est� � direita e move � direita. + k Dica: A tecla h está à esquerda e move à esquerda. + < h l > A tecla l está à direita e move à direita. j A tecla j se parece com uma seta para baixo. v - 1. Mova o cursor pela tela at� que voc� se sinta confort�vel. + 1. Mova o cursor pela tela até que você se sinta confortável. - 2. Segure pressionada a tecla (j) at� haver repeti��o. - Agora voc� j� sabe como ir para a pr�xima li��o. + 2. Segure pressionada a tecla (j) até haver repetição. + Agora você já sabe como ir para a próxima lição. - 3. Usando a tecla j, v� para a Li��o 1.1.2. + 3. Usando a tecla j, vá para a Lição 1.1.2. -NOTA: Se est� inseguro sobre o que digitou, pressione para - coloc�-lo no modo Normal. Ent�o redigite o comando que queria. +NOTA: Se está inseguro sobre o que digitou, pressione para + colocá-lo no modo Normal. Então redigite o comando que queria. -NOTA: As teclas de cursor funcionam tamb�m. Mas usando hjkl, t�o logo - esteja acostumado, voc� poder� se mover muito mais rapidamente. +NOTA: As teclas de cursor funcionam também. Mas usando hjkl, tão logo + esteja acostumado, você poderá se mover muito mais rapidamente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.1.2: SAIR DO VIM + Lição 1.1.2: SAIR DO VIM - !! NOTA: Antes de executar quaisquer dos passos abaixo, leia a li��o inteira !! + !! NOTA: Antes de executar quaisquer dos passos abaixo, leia a lição inteira !! - 1. Pressione (para ter certeza de que est� no modo Normal). + 1. Pressione (para ter certeza de que está no modo Normal). 2. Digite: :q! . - Assim, sai do editor SEM salvar qualquer mudan�a feita. + Assim, sai do editor SEM salvar qualquer mudança feita. 3. Repita o procedimento que o trouxe a este tutorial. O procedimento pode - ter sido a digita��o de: vimtutor . + ter sido a digitação de: vimtutor . - 4. Se memorizou estes passos e est� confiante, execute os passos de + 4. Se memorizou estes passos e está confiante, execute os passos de 1 a 3 para sair e reentrar no editor. -NOTA: :q! descarta qualquer mudan�a. Em uma pr�xima li��o ser� - ensinado como salvar as mudan�as feitas em um arquivo. +NOTA: :q! descarta qualquer mudança. Em uma próxima lição será + ensinado como salvar as mudanças feitas em um arquivo. - 5. Des�a o cursor at� a Li��o 1.1.3. + 5. Desça o cursor até a Lição 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.1.3: EDITAR TEXTOS - REMO��O + Lição 1.1.3: EDITAR TEXTOS - REMOÇÃO ** Pressione x para deletar o caractere sob o cursor. ** 1. Mova o cursor para a linha abaixo marcada com --->. - 2. Para corrigir os erros, mova o cursor at� que ele esteja sobre o + 2. Para corrigir os erros, mova o cursor até que ele esteja sobre o caractere a ser deletado. 3. Pressione a tecla x para remover o caractere incorreto. - 4. Repita os passos 2 at� 4 at� que a frase esteja correta. + 4. Repita os passos 2 até 4 até que a frase esteja correta. ---> A vvaca pullouu por ccimaa dda luuua. - 5. Agora que a frase est� correta, prossiga para a Li��o 1.1.4. + 5. Agora que a frase está correta, prossiga para a Lição 1.1.4. -NOTA: Enquanto segue este tutorial, n�o tente memorizar, aprenda pelo uso. +NOTA: Enquanto segue este tutorial, não tente memorizar, aprenda pelo uso. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.1.4: EDITAR TEXTOS - INSER��O + Lição 1.1.4: EDITAR TEXTOS - INSERÇÃO ** Pressione i para inserir texto. ** - 1. Mova o cursor at� a primeira linha abaixo marcada com --->. + 1. Mova o cursor até a primeira linha abaixo marcada com --->. - 2. Para deixar a primeira linha igual � segunda, mova o cursor para - o primeiro caractere DEPOIS de onde o texto dever� ser inserido. + 2. Para deixar a primeira linha igual à segunda, mova o cursor para + o primeiro caractere DEPOIS de onde o texto deverá ser inserido. - 3. Pressione i e digite as adi��es necess�rias. + 3. Pressione i e digite as adições necessárias. 4. Assim que cada erro for corrigido pressione para retornar ao modo - Normal. Repita os passos 2 at� 4 para corrigir a frase. + Normal. Repita os passos 2 até 4 para corrigir a frase. ---> Tem text fatado nesta . ---> Tem algum texto faltando nesta linha. - 5. Quando se sentir � vontade com a inser��o de texto, mova o cursor para - a Li��o 1.1.5. + 5. Quando se sentir à vontade com a inserção de texto, mova o cursor para + a Lição 1.1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.1.5: EDITAR TEXTO - ADICIONAR + Lição 1.1.5: EDITAR TEXTO - ADICIONAR ** Pressione A para adicionar texto. ** 1. Mova o cursor para a primeira linha abaixo marcada com --->. - N�o importa sobre qual caractere o cursor estar� na linha. + Não importa sobre qual caractere o cursor estará na linha. - 2. Pressione A e digite as adi��es necess�rias. + 2. Pressione A e digite as adições necessárias. 3. Quando adicionar o texto, pressione para retornar ao modo Normal. 4. Mova o cursor para a segunda linha marcada ---> e repita os passos 2 e 3 para corrigir a frase. ----> H� algum texto faltando nes - H� algum texto faltando nesta linha. ----> H� algum texto faltan - H� algum texto faltando aqui. +---> Há algum texto faltando nes + Há algum texto faltando nesta linha. +---> Há algum texto faltan + Há algum texto faltando aqui. - 5. Quando se sentir confort�vel adicionando texto, v� para a Li��o 1.1.6. + 5. Quando se sentir confortável adicionando texto, vá para a Lição 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.1.6: EDITAR UM ARQUIVO + Lição 1.1.6: EDITAR UM ARQUIVO ** Use :wq para salvar um arquivo e sair. ** - !! NOTA: Leia toda a li��o antes de executar as instru��es!! + !! NOTA: Leia toda a lição antes de executar as instruções!! - 1. Saia deste tutorial como o fez na li��o 1.1.2: :q! - Ou, se tiver acesso a outro terminal, fa�a o seguinte nele. + 1. Saia deste tutorial como o fez na lição 1.1.2: :q! + Ou, se tiver acesso a outro terminal, faça o seguinte nele. 2. No prompt do shell, digite esse comando: vim tutor - 'vim' � o comando para iniciar o editor Vim e 'tutor' � o nome do - arquivo que voc� quer editar. Use um arquivo que possa ser modificado. + 'vim' é o comando para iniciar o editor Vim e 'tutor' é o nome do + arquivo que você quer editar. Use um arquivo que possa ser modificado. - 3. Insira e apague texto tal como aprendeu nas li��es anteriores. + 3. Insira e apague texto tal como aprendeu nas lições anteriores. - 4. Salve o arquivo com as mudan�as e saia do Vim com: :wq + 4. Salve o arquivo com as mudanças e saia do Vim com: :wq - 5. Se tiver sa�do do vimtutor no passo 1, reinicie o vimtutor e v� para + 5. Se tiver saído do vimtutor no passo 1, reinicie o vimtutor e vá para o resumo seguinte. - 6. Ap�s ler os passos acima e compreend�-los, execute-os. + 6. Após ler os passos acima e compreendê-los, execute-os. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LI��O 1.1 + RESUMO DA LIÇÃO 1.1 - 1. O cursor � movido usando tanto as teclas de seta quanto as teclas hjkl. + 1. O cursor é movido usando tanto as teclas de seta quanto as teclas hjkl. h (esquerda) j (para baixo) k (para cima) l (direita) 2. Para entrar no Vim a partir de um shell digite: vim NOMEDOARQUIVO - 3. Para sair do Vim digite: :q! para descartar as altera��es. - OU digite: :wq para salvar as altera��es. + 3. Para sair do Vim digite: :q! para descartar as alterações. + OU digite: :wq para salvar as alterações. 4. Para deletar um caractere sob o cursor no modo Normal digite: x - 5. Para inserir texto na posi��o do cursor enquanto estiver no modo Normal + 5. Para inserir texto na posição do cursor enquanto estiver no modo Normal digite: i digite o texto inserir depois do cursor A digite o texto adicionar no final da linha -NOTA: Pressionando voc� ir� para o modo Normal ou cancelar� um comando +NOTA: Pressionando você irá para o modo Normal ou cancelará um comando ainda incompleto. -Agora continue com a Li��o 1.2. +Agora continue com a Lição 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.2.1: COMANDOS DE REMO��O + Lição 1.2.1: COMANDOS DE REMOÇÃO ** Digite dw para apagar uma palavra. ** - 1. Pressione para ter certeza de que est� no modo Normal. + 1. Pressione para ter certeza de que está no modo Normal. - 2. Mova o cursor at� a linha abaixo marcada com --->. + 2. Mova o cursor até a linha abaixo marcada com --->. - 3. Mova o cursor at� o come�o da palavra que precisa ser deletada. + 3. Mova o cursor até o começo da palavra que precisa ser deletada. 4. Digite dw para fazer a palavra desaparecer. - NOTA: A letra d vai aparecer na �ltima linha da tela enquanto voc� a - digita. O Vim o est� esperando digitar um w . Se digitou + NOTA: A letra d vai aparecer na última linha da tela enquanto você a + digita. O Vim o está esperando digitar um w . Se digitou alguma coisa errada, pressione e comece de novo. ----> Tem a algumas oi palavras divers�o que n�o pertencem papel a esta frase. +---> Tem a algumas oi palavras diversão que não pertencem papel a esta frase. - 5. Repita os passos 3 ao 4 at� que a frase esteja correta e v� para a - Li��o 1.2.2. + 5. Repita os passos 3 ao 4 até que a frase esteja correta e vá para a + Lição 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.2.2: MAIS COMANDOS DE REMO��O + Lição 1.2.2: MAIS COMANDOS DE REMOÇÃO - ** Digite d$ para deletar at� o fim da linha. ** + ** Digite d$ para deletar até o fim da linha. ** 1. Pressione para ter certeza de estar no modo Normal. - 2. Mova o cursor at� a linha abaixo marcada com --->. + 2. Mova o cursor até a linha abaixo marcada com --->. - 3. Mova o cursor at� o fim da linha correta (DEPOIS do primeiro . ). + 3. Mova o cursor até o fim da linha correta (DEPOIS do primeiro . ). - 4. Digite d$ para apagar at� o fim da linha. + 4. Digite d$ para apagar até o fim da linha. ----> Algu�m digitou o fim desta linha duas vezes. desta linha duas vezes. +---> Alguém digitou o fim desta linha duas vezes. desta linha duas vezes. - 5. V� para a li��o 1.2.3 para entender o funcionamento deste comando. + 5. Vá para a lição 1.2.3 para entender o funcionamento deste comando. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.2.3: SOBRE OPERADORES E MOVIMENTOS + Lição 1.2.3: SOBRE OPERADORES E MOVIMENTOS - Muitos comandos que mudam texto s�o feitos de um operador e de um movimento. - O formato para um comando apagar com o operador de remo��o d tem a + Muitos comandos que mudam texto são feitos de um operador e de um movimento. + O formato para um comando apagar com o operador de remoção d tem a seguinte forma: d movimento Onde: - d - � o operador apagar. - movimento - � o movimento sobre o qual o operador age (listado abaixo). + d - é o operador apagar. + movimento - é o movimento sobre o qual o operador age (listado abaixo). Uma pequena lista de teclas de movimento: - w - at� o in�cio da pr�xima palavra, excluindo seu primeiro caractere. - e - at� o fim da palavra atual, incluindo seu �ltimo caractere. - $ - at� o fim da linha, incluindo seu �ltimo caractere. + w - até o início da próxima palavra, excluindo seu primeiro caractere. + e - até o fim da palavra atual, incluindo seu último caractere. + $ - até o fim da linha, incluindo seu último caractere. Portanto, digitar de apaga do cursor ao fim da palavra. @@ -254,287 +254,287 @@ operador, faz o cursor se mover como especificado na lista de teclas de movimento. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.2.4: USAR UM CONTADOR PARA UM MOVIMENTO + Lição 1.2.4: USAR UM CONTADOR PARA UM MOVIMENTO - ** Digitar um n�mero antes de um movimento repete-o o tanto de vezes. ** + ** Digitar um número antes de um movimento repete-o o tanto de vezes. ** - 1. Mova o cursor para o come�o da linha marcada com ---> abaixo. + 1. Mova o cursor para o começo da linha marcada com ---> abaixo. 2. Digite 2w para mover o cursor duas palavras adiante. 3. Digite 3e para mover o cursor para o fim da terceira palavra adiante. - 4. Digite 0 (zero) para mover para o in�cio da linha. + 4. Digite 0 (zero) para mover para o início da linha. - 5. Repita os passos 2 e 3 com diferentes n�meros. + 5. Repita os passos 2 e 3 com diferentes números. ----> Esta � uma linha com algumas palavras para permiti-lo fazer movimentos. +---> Esta é uma linha com algumas palavras para permiti-lo fazer movimentos. - 6. V� para a Li��o 1.2.5. + 6. Vá para a Lição 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.2.5: USAR UM CONTADOR PARA APAGAR MAIS + Lição 1.2.5: USAR UM CONTADOR PARA APAGAR MAIS - ** Digitar um n�mero com um operador repete-o esse n�mero de vezes. ** + ** Digitar um número com um operador repete-o esse número de vezes. ** - Voc� deve inserir um contador entre o operador de remo��o e o de movimento + Você deve inserir um contador entre o operador de remoção e o de movimento mencionados acima para apagar mais: - d n�mero movimento + d número movimento - 1. Movimente o cursor para a primeira palavra em LETRAS MAI�SCULAS na + 1. Movimente o cursor para a primeira palavra em LETRAS MAIÚSCULAS na linha marcada com --->. - 2. Digite d2w para deletar as duas palavras em LETRAS MAI�SCULAS. + 2. Digite d2w para deletar as duas palavras em LETRAS MAIÚSCULAS. 3. Repita os passos 1 e 2 com diferentes contadores para deletar as - palavras em LETRAS MAI�SCULAS com um comando. + palavras em LETRAS MAIÚSCULAS com um comando. ----> esta ABC DE linha FGHI JK LMN OP de palavras est� Q RS TUV limpa. +---> esta ABC DE linha FGHI JK LMN OP de palavras está Q RS TUV limpa. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.2.6: TRABALHAR COM LINHAS + Lição 1.2.6: TRABALHAR COM LINHAS ** Digite dd para apagar uma linha inteira. ** - Em virtude da frequ�ncia em deletar uma linha inteira, os desenvolvedores + Em virtude da frequência em deletar uma linha inteira, os desenvolvedores do Vi decidiram que seria mais simples digitar dois d para apagar uma linha. - 1. Mova o cursor at� a segunda linha da frase abaixo. + 1. Mova o cursor até a segunda linha da frase abaixo. 2. Digite dd para apagar a linha. - 3. Agora mova at� a quarta linha. + 3. Agora mova até a quarta linha. 4. Digite 2dd para apagar duas linhas. ----> 1) Rosas s�o vermelhas, ----> 2) Lama � divertida, ----> 3) Violetas s�o azuis, +---> 1) Rosas são vermelhas, +---> 2) Lama é divertida, +---> 3) Violetas são azuis, ---> 4) Eu tenho um carro, ----> 5) Rel�gios dizem as horas, ----> 6) A��car � doce, ----> 7) Assim como voc�. +---> 5) Relógios dizem as horas, +---> 6) Açúcar é doce, +---> 7) Assim como você. -Notas do tradutor: Lama (mud) em ingl�s pode significar fofoca, difama��o. - H� rima no texto original. +Notas do tradutor: Lama (mud) em inglês pode significar fofoca, difamação. + Há rima no texto original. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.2.7: O COMANDO UNDO (DESFAZER) + Lição 1.2.7: O COMANDO UNDO (DESFAZER) -** Pressione u para desfazer os �ltimos comandos, U recupera a linha inteira.** +** Pressione u para desfazer os últimos comandos, U recupera a linha inteira.** 1. Mova o cursor para a linha abaixo marcada com ---> e posicione-o sobre o primeiro erro. 2. Digite x para deletar o primeiro caractere errado. - 3. Agora, digite u para desfazer o �ltimo comando executado. + 3. Agora, digite u para desfazer o último comando executado. 4. Desta vez, corrija todos os erros na linha usando o comando x . - 5. Agora, digite um U mai�sculo para retornar a linha ao seu estado original. + 5. Agora, digite um U maiúsculo para retornar a linha ao seu estado original. 6. Digite u algumas vezes para desfazer o U e os comandos anteriores. 7. Digite CTRL-R (segurando a tecla CTRL enquanto digita R) algumas vezes para refazer os comandos (desfazer os undos). ---> Corriija os erros nnesta linha e reetorne-os com undo. - 8. Esses comandos s�o muito �teis. Agora v� para o resumo da Li��o 1.2. + 8. Esses comandos são muito úteis. Agora vá para o resumo da Lição 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LI��O 1.2 + RESUMO DA LIÇÃO 1.2 - 1. Para apagar do cursor at� a pr�xima palavra, digite: dw - 2. Para apagar do cursor at� o fim de uma linha, digite: d$ + 1. Para apagar do cursor até a próxima palavra, digite: dw + 2. Para apagar do cursor até o fim de uma linha, digite: d$ 3. Para apagar uma linha inteira, digite: dd - 4. Para repetir um movimento, adicione antes um n�mero: 2w - 5. O formato para um comando no modo Normal �: - operador [n�mero] movimento + 4. Para repetir um movimento, adicione antes um número: 2w + 5. O formato para um comando no modo Normal é: + operador [número] movimento onde: - operador - � o que ser� feito, como d para apagar - [n�mero] - quantas vezes o comando ser� repetido - movimento - movimento sobre o texto que receber� a opera��o, como - w (palavra), $ (at� o fim da linha), etc. + operador - é o que será feito, como d para apagar + [número] - quantas vezes o comando será repetido + movimento - movimento sobre o texto que receberá a operação, como + w (palavra), $ (até o fim da linha), etc. - 6. Para ir ao in�cio da linha, use um zero: 0 + 6. Para ir ao início da linha, use um zero: 0 - 7. Para desfazer uma a��o anterior, digite: u (min�sculo) - Para desfazer todas as altera��es em uma linha, digite: U (mai�sculo) + 7. Para desfazer uma ação anterior, digite: u (minúsculo) + Para desfazer todas as alterações em uma linha, digite: U (maiúsculo) Para desfazer o que foi desfeito, digite: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.3.1: O COMANDO COLAR + Lição 1.3.1: O COMANDO COLAR - ** Digite p para colar ap�s o cursor o que acabou de apagar. ** + ** Digite p para colar após o cursor o que acabou de apagar. ** - 1. Mova o cursor at� a primeira linha marcada com --->. + 1. Mova o cursor até a primeira linha marcada com --->. - 2. Digite dd para apagar a linha e guard�-la num registro do Vim. + 2. Digite dd para apagar a linha e guardá-la num registro do Vim. - 3. Mova o cursor at� a linha c) ACIMA de onde a linha apagada deveria estar. + 3. Mova o cursor até a linha c) ACIMA de onde a linha apagada deveria estar. 4. No modo Normal, digite p para inserir a linha. - 5. Repita os passos 2 ao 4 para p�r todas as linhas na ordem correta. + 5. Repita os passos 2 ao 4 para pôr todas as linhas na ordem correta. ----> d) Voc� pode aprender tamb�m? ----> b) Violetas s�o azuis, ----> c) Intelig�ncia se aprende, ----> a) Rosas s�o vermelhas, +---> d) Você pode aprender também? +---> b) Violetas são azuis, +---> c) Inteligência se aprende, +---> a) Rosas são vermelhas, -Nota do tradutor: H� rima no original. +Nota do tradutor: Há rima no original. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.3.2: O COMANDO SUBSTITUIR + Lição 1.3.2: O COMANDO SUBSTITUIR ** Digite rx para substituir o caractere sob o cursor por x . ** - 1. Mova o cursor at� a primeira linha abaixo marcada com --->. + 1. Mova o cursor até a primeira linha abaixo marcada com --->. - 2. Mova o cursor at� que esteja sobre o primeiro erro. + 2. Mova o cursor até que esteja sobre o primeiro erro. - 3. Digite r e ent�o o caractere que deveria estar l�. + 3. Digite r e então o caractere que deveria estar lá. - 4. Repita os passos 2 e 3 at� que a primeira linha esteja igual � segunda. + 4. Repita os passos 2 e 3 até que a primeira linha esteja igual à segunda. ---> Quendo este limha foi dugitada, alguem pressioniu algumas teclas erradzs! ----> Quando esta linha foi digitada, algu�m pressionou algumas teclas erradas! +---> Quando esta linha foi digitada, alguém pressionou algumas teclas erradas! - 5. Agora v� para a Li��o 1.3.3. + 5. Agora vá para a Lição 1.3.3. -NOTA: Lembre-se que voc� deve aprender pelo uso, n�o pela memoriza��o. +NOTA: Lembre-se que você deve aprender pelo uso, não pela memorização. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.3.3: O OPERADOR CHANGE (MUDAR) + Lição 1.3.3: O OPERADOR CHANGE (MUDAR) - ** Para alterar at� o fim de uma palavra, digite ce . ** + ** Para alterar até o fim de uma palavra, digite ce . ** - 1. Mova o cursor at� a primeira linha abaixo marcada com --->. + 1. Mova o cursor até a primeira linha abaixo marcada com --->. 2. Posicione o cursor sobre o u em lunba. 3. Digite ce e a palavra correta (nesse caso, digite 'inha'.) - 4. Pressione e mova para o pr�ximo caractere a ser alterado. + 4. Pressione e mova para o próximo caractere a ser alterado. - 5. Repita os passos 3 e 4 at� que a primeira frase esteja igual � segunda. + 5. Repita os passos 3 e 4 até que a primeira frase esteja igual à segunda. ---> Essa lunba tem pwlesmfr que ocrimmm soi alteradas cup o comando change. ---> Essa linha tem palavras que precisam ser alteradas com o comando change. -Note que ce n�o somente substitui a palavra, mas tamb�m o coloca no modo -de Inser��o. +Note que ce não somente substitui a palavra, mas também o coloca no modo +de Inserção. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.3.4: MAIS MUDAN�AS USANDO c + Lição 1.3.4: MAIS MUDANÇAS USANDO c - ** O operador change � usado com os mesmos movimentos que o delete. ** + ** O operador change é usado com os mesmos movimentos que o delete. ** - 1. O operador change trabalha da mesma maneira que o delete. O formato �: + 1. O operador change trabalha da mesma maneira que o delete. O formato é: - c [n�mero] movimento + c [número] movimento - 2. Os movimentos tamb�m s�o os mesmos: w (palavra) e $ (fim da linha). + 2. Os movimentos também são os mesmos: w (palavra) e $ (fim da linha). - 3. Mova at� a primeira linha abaixo marcada com --->. + 3. Mova até a primeira linha abaixo marcada com --->. - 4. Mova o cursor at� o primeiro erro. + 4. Mova o cursor até o primeiro erro. - 5. Digite c$ e digite o resto da segunda linha para torn�-las iguais e + 5. Digite c$ e digite o resto da segunda linha para torná-las iguais e pressione . ----> O fim desta linha precisa de ajuda para ficar igual � segunda. +---> O fim desta linha precisa de ajuda para ficar igual à segunda. ---> O fim desta linha precisa ser corrigido usando o comando c$. -NOTA: Voc� pode usar a tecla Backspace para corrigir erros enquanto digita. +NOTA: Você pode usar a tecla Backspace para corrigir erros enquanto digita. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LI��O 1.3 + RESUMO DA LIÇÃO 1.3 - 1. Para reinserir um texto que j� foi apagado, digite p . Isso coloca o texto - deletado AP�S o cursor (se uma linha � deletada ela ser� inserida na linha + 1. Para reinserir um texto que já foi apagado, digite p . Isso coloca o texto + deletado APÓS o cursor (se uma linha é deletada ela será inserida na linha abaixo do cursor). - 2. Para substituir o caractere sob o cursor, digite r e ent�o o caractere - que substituir� o original. + 2. Para substituir o caractere sob o cursor, digite r e então o caractere + que substituirá o original. - 3. O comando change possibilita mudar do cursor at� onde o movimento for. - Ex: Digite ce para mudar do cursor at� o fim de uma palavra, c$ para - mudar at� o fim da linha. + 3. O comando change possibilita mudar do cursor até onde o movimento for. + Ex: Digite ce para mudar do cursor até o fim de uma palavra, c$ para + mudar até o fim da linha. - 4. O formato para uma opera��o change �: + 4. O formato para uma operação change é: - c [n�mero] movimento + c [número] movimento -Agora v� para a pr�xima li��o. +Agora vá para a próxima lição. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.4.1: LOCALIZA��O DO CURSOR E ESTADO DO ARQUIVO + Lição 1.4.1: LOCALIZAÇÃO DO CURSOR E ESTADO DO ARQUIVO - ** Digite CTRL-G para mostrar sua localiza��o no arquivo e seu estado. + ** Digite CTRL-G para mostrar sua localização no arquivo e seu estado. Digite G para mover para uma linha do arquivo. ** - Nota: Leia esta li��o inteira antes de executar qualquer um dos passos!! + Nota: Leia esta lição inteira antes de executar qualquer um dos passos!! 1. Segure pressionada a tecla Ctrl e pressione g . Chamamos isso de - CTRL-G. Uma mensagem aparecer� no rodap� da p�gina com o nome do arquivo - e a sua posi��o no arquivo. Lembre-se do n�mero da linha para o Passo 3. + CTRL-G. Uma mensagem aparecerá no rodapé da página com o nome do arquivo + e a sua posição no arquivo. Lembre-se do número da linha para o Passo 3. -NOTA: A posi��o do cursor pode estar vis�vel no canto direito inferior da - tela. Isso acontece quando a op��o 'ruler' est� ativa +NOTA: A posição do cursor pode estar visível no canto direito inferior da + tela. Isso acontece quando a opção 'ruler' está ativa (veja :help 'ruler' ). - 2. Pressione G para se mover at� o fim do arquivo. - Digite gg para se mover at� o in�cio do arquivo. + 2. Pressione G para se mover até o fim do arquivo. + Digite gg para se mover até o início do arquivo. - 3. Digite o n�mero da linha em que estava e ent�o G . Assim o cursor retornar� - � linha em que estava quando pressionou CTRL-G. + 3. Digite o número da linha em que estava e então G . Assim o cursor retornará + à linha em que estava quando pressionou CTRL-G. - 4. Se estiver seguro para faz�-los, execute os passos 1 a 3. + 4. Se estiver seguro para fazê-los, execute os passos 1 a 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.4.2: O COMANDO BUSCAR + Lição 1.4.2: O COMANDO BUSCAR ** Digite / seguido por uma frase para procurar por ela. ** 1. No modo Normal digite o caractere / . Note que ele e o cursor aparecem - no rodap� da tela, como ocorre com o comando : . + no rodapé da tela, como ocorre com o comando : . - 2. Agora digite 'errroo' . Esta � a palavra que quer procurar. + 2. Agora digite 'errroo' . Esta é a palavra que quer procurar. 3. Para buscar a mesma palavra de novo, simplesmente tecle n . - Para buscar a mesma palavra na dire��o oposta, tecle N . + Para buscar a mesma palavra na direção oposta, tecle N . - 4. Se quer procurar por uma frase de tr�s para frente, use ? em vez de / . + 4. Se quer procurar por uma frase de trás para frente, use ? em vez de / . 5. Para voltar aonde estava, pressione CTRL-O (mantenha a tecla Ctrl - pressionada e pressione a tecla o). Repita para voltar a outras posi��es. - CTRL-I segue para posi��es mais recentes. + pressionada e pressione a tecla o). Repita para voltar a outras posições. + CTRL-I segue para posições mais recentes. ----> "errroo" n�o � uma maneira de escrever erro; errroo � um erro. +---> "errroo" não é uma maneira de escrever erro; errroo é um erro. -NOTA: Quando a busca atinge o fim do arquivo ela continuar� do come�o, a - menos que a op��o 'wrapscan' esteja desativada. +NOTA: Quando a busca atinge o fim do arquivo ela continuará do começo, a + menos que a opção 'wrapscan' esteja desativada. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.4.3: BUSCA DE PAR�NTESES CORRESPONDENTES + Lição 1.4.3: BUSCA DE PARÊNTESES CORRESPONDENTES ** Digite % para encontrar um ),], ou } correspondente. ** @@ -543,21 +543,21 @@ NOTA: Quando a busca atinge o fim do arquivo ela continuar 2. Agora digite o caractere % . - 3. O cursor deve estar no par�ntese ou colchete que casa com o primeiro. + 3. O cursor deve estar no parêntese ou colchete que casa com o primeiro. - 4. Digite % para mover o cursor de volta ao primeiro colchete ou par�ntese + 4. Digite % para mover o cursor de volta ao primeiro colchete ou parêntese (por casamento). ----> Isto ( � uma linha de teste contendo (, [ ] e { }. )) +---> Isto ( é uma linha de teste contendo (, [ ] e { }. )) -Nota: Isso � muito �til para corrigir um programa com par�ntese n�o-casado! +Nota: Isso é muito útil para corrigir um programa com parêntese não-casado! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.4.4: O COMANDO SUBSTITUIR + Lição 1.4.4: O COMANDO SUBSTITUIR ** Digite :s/velho/novo/g para substituir 'velho' por 'novo'. ** @@ -565,148 +565,148 @@ Nota: Isso 1. Mova o cursor para a linha abaixo marcada com --->. 2. Digite :s/aa/a . Note que este comando somente muda a - primeira ocorr�ncia na linha. + primeira ocorrência na linha. 3. Agora digite :s/aa/a/g significando substituir globalmente na linha. - Isto muda todas as ocorr�ncias na linha. + Isto muda todas as ocorrências na linha. ----> aa melhor �poca para ver aas flores � aa primavera. +---> aa melhor época para ver aas flores é aa primavera. - 4. Para mudar toda ocorr�ncia de uma string entre duas linhas, - digite :#,#s/velho/novo/g onde #,# s�o os n�meros das duas linhas. - Digite :%s/velho/novo/g para mudar todas as ocorr�ncias no arquivo + 4. Para mudar toda ocorrência de uma string entre duas linhas, + digite :#,#s/velho/novo/g onde #,# são os números das duas linhas. + Digite :%s/velho/novo/g para mudar todas as ocorrências no arquivo inteiro. - Digite :%s/velho/novo/gc para mudar todas as ocorr�ncias no arquivo - inteiro, com a op��o de confirmar cada - substitui��o. + Digite :%s/velho/novo/gc para mudar todas as ocorrências no arquivo + inteiro, com a opção de confirmar cada + substituição. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LI��O 1.4 + RESUMO DA LIÇÃO 1.4 - 1. CTRL-G mostra em que ponto do arquivo est� e o estado dele. + 1. CTRL-G mostra em que ponto do arquivo está e o estado dele. G move para o fim do arquivo. - n�mero G move para a linha com esse n�mero. + número G move para a linha com esse número. gg move para a primeira linha. - 2. Digitando / seguido por uma express�o procura � FRENTE por ela. - Digitando ? seguido por uma express�o procura pela express�o de TR�S + 2. Digitando / seguido por uma expressão procura À FRENTE por ela. + Digitando ? seguido por uma expressão procura pela expressão de TRÁS PARA FRENTE. - Ap�s uma busca, digite n para achar a pr�xima ocorr�ncia na mesma dire��o - ou N para procurar na dire��o oposta. - CTRL-O leva a posi��es antigas e CTRL-I a posi��es mais recentes. + Após uma busca, digite n para achar a próxima ocorrência na mesma direção + ou N para procurar na direção oposta. + CTRL-O leva a posições antigas e CTRL-I a posições mais recentes. - 3. Digitando % enquanto o cursor est� sobre um (,),[,],{, ou } localiza + 3. Digitando % enquanto o cursor está sobre um (,),[,],{, ou } localiza o par que casa com ele. 4. Para substituir: o primeiro 'velho' de uma linha por 'novo' digite :s/velho/novo todos os 'velho' em uma linha por 'novo' digite :s/velho/novo/g - express�es entre dois n�meros (#) de linhas digite :#,#s/velho/novo - todas as ocorr�ncias no arquivo digite :%s/velho/novo/g - Para confirmar cada substitui��o adicione 'c' :%s/velho/novo/gc + expressões entre dois números (#) de linhas digite :#,#s/velho/novo + todas as ocorrências no arquivo digite :%s/velho/novo/g + Para confirmar cada substituição adicione 'c' :%s/velho/novo/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.5.1: COMO EXECUTAR UM COMANDO EXTERNO + Lição 1.5.1: COMO EXECUTAR UM COMANDO EXTERNO - ** Digite :! seguido por um comando externo para execut�-lo. ** + ** Digite :! seguido por um comando externo para executá-lo. ** - 1. Digite o familiar comando : para levar o cursor ao rodap� da tela. Isso + 1. Digite o familiar comando : para levar o cursor ao rodapé da tela. Isso o permite entrar um comando. - 2. Agora digite o caractere ! (ponto de exclama��o). Isso o permite + 2. Agora digite o caractere ! (ponto de exclamação). Isso o permite executar qualquer comando do shell. - 3. Como um exemplo digite ls seguindo o ! e ent�o tecle . Isto - mostrar� uma listagem do seu diret�rio, como se voc� estivesse no - prompt do shell. Ou use :!dir se ls n�o funcionar. + 3. Como um exemplo digite ls seguindo o ! e então tecle . Isto + mostrará uma listagem do seu diretório, como se você estivesse no + prompt do shell. Ou use :!dir se ls não funcionar. -NOTA: � poss�vel executar qualquer comando externo dessa maneira, inclusive +NOTA: É possível executar qualquer comando externo dessa maneira, inclusive com argumentos. NOTA: Todos os comandos : devem ser finalizados teclando-se - Daqui em diante n�o mencionaremos isso todas as vezes. + Daqui em diante não mencionaremos isso todas as vezes. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.5.2: MAIS SOBRE SALVAR ARQUIVOS + Lição 1.5.2: MAIS SOBRE SALVAR ARQUIVOS - ** Para salvar as altera��es no texto, digite :w NOMEDOARQUIVO. ** + ** Para salvar as alterações no texto, digite :w NOMEDOARQUIVO. ** - 1. Digite :!dir ou :!ls para ter uma listagem de seu diret�rio. - Voc� j� deve saber que precisa teclar depois disso. + 1. Digite :!dir ou :!ls para ter uma listagem de seu diretório. + Você já deve saber que precisa teclar depois disso. - 2. Escolha um nome de arquivo que ainda n�o exista, como TESTE. + 2. Escolha um nome de arquivo que ainda não exista, como TESTE. - 3. Agora digite: :w TESTE (onde TESTE � o nome que voc� escolheu.) + 3. Agora digite: :w TESTE (onde TESTE é o nome que você escolheu.) 4. Isto salva o arquivo inteiro (o Vim Tutor) com o nome TESTE. - Para verificar isso, digite :!ls de novo para ver seu diret�rio. + Para verificar isso, digite :!ls de novo para ver seu diretório. NOTA: Se sair do Vim e entrar de novo com o nome do arquivo TESTE, - o arquivo deve ser uma c�pia exata do tutorial quando voc� o salvou. + o arquivo deve ser uma cópia exata do tutorial quando você o salvou. 5. Agora remova o arquivo digitando (MS-DOS): :!del TESTE ou (Unix): :!rm TESTE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.5.3: SELECIONAR O TEXTO A SER SALVO + Lição 1.5.3: SELECIONAR O TEXTO A SER SALVO ** Para salvar parte de um arquivo, digite v movimento :w NOMEDOARQUIVO ** 1. Mova o cursor para esta linha. 2. Pressione v e mova o cursor para o quinto item abaixo. Note que o texto - � real�ado. + é realçado. - 3. Pressione o caractere : e note que aparecer� :'<,'> no lado inferior + 3. Pressione o caractere : e note que aparecerá :'<,'> no lado inferior da tela. - 4. Digite w TESTE , sendo TESTE um nome de arquivo que n�o existe ainda. + 4. Digite w TESTE , sendo TESTE um nome de arquivo que não existe ainda. Certifique-se de ver :'<,'>w TESTE antes de pressionar . - 5. O Vim salvar� as linhas selecionadas no arquivo TESTE. Use :!dir ou - !:ls para v�-lo. N�o o apague ainda! N�s o usaremos na pr�xima li��o. + 5. O Vim salvará as linhas selecionadas no arquivo TESTE. Use :!dir ou + !:ls para vê-lo. Não o apague ainda! Nós o usaremos na próxima lição. -NOTA: Pressionar v inicia o modo Visual de sele��o. Voc� pode mover o -cursor pela tela para tornar a sele��o maior ou menor. Pode, ent�o, usar um -operador para executar alguma a��o. Por exemplo, d apaga o texto. +NOTA: Pressionar v inicia o modo Visual de seleção. Você pode mover o +cursor pela tela para tornar a seleção maior ou menor. Pode, então, usar um +operador para executar alguma ação. Por exemplo, d apaga o texto. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.5.4: RECUPERAR E UNIR ARQUIVOS + Lição 1.5.4: RECUPERAR E UNIR ARQUIVOS - ** Para inserir o conte�do de um arquivo, digite :r NOMEDOARQUIVO ** + ** Para inserir o conteúdo de um arquivo, digite :r NOMEDOARQUIVO ** 1. Posicione o cursor logo acima desta linha. -NOTA: Depois de executar o Passo 2 voc� ver� a Li��o 1.5.3. Ent�o DES�A o - cursor para ver esta li��o novamente. +NOTA: Depois de executar o Passo 2 você verá a Lição 1.5.3. Então DESÇA o + cursor para ver esta lição novamente. - 2. Agora recupere o arquivo TESTE usando o comando :r TESTE onde TESTE � o + 2. Agora recupere o arquivo TESTE usando o comando :r TESTE onde TESTE é o nome do arquivo. - O arquivo recuperado � colocado abaixo da linha atual do cursor. + O arquivo recuperado é colocado abaixo da linha atual do cursor. 3. Para verificar que o arquivo foi recuperado, volte com o cursor e verifique - que agora existem duas c�pias da Li��o 1.5.3, a original e a vers�o do + que agora existem duas cópias da Lição 1.5.3, a original e a versão do arquivo. -NOTA: Voc� tamb�m pode ler a sa�da de um comando externo. Por exemplo, :r !ls - l� a sa�da do comando ls e coloca o resultado abaixo do cursor. +NOTA: Você também pode ler a saída de um comando externo. Por exemplo, :r !ls + lê a saída do comando ls e coloca o resultado abaixo do cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LI��O 1.5 + RESUMO DA LIÇÃO 1.5 1. :!comando executa um comando externo. - Alguns exemplos �teis s�o: + Alguns exemplos úteis são: (MS-DOS) (UNIX) - :!dir :!ls - lista conte�do do diret�rio. + :!dir :!ls - lista conteúdo do diretório. :!del ARQUIVO :!rm ARQUIVO - remove ARQUIVO. 2. :w ARQUIVO salva o atual arquivo do Vim para o disco com o nome ARQUIVO. @@ -715,71 +715,71 @@ NOTA: Voc ARQUIVO. 4. :r ARQUIVO recupera ARQUIVO do disco e o insere dentro do arquivo atual - na posi��o do cursor. + na posição do cursor. - 5. :r !dir l� a sa�da do comando dir e coloca o resultado abaixo da posi��o + 5. :r !dir lê a saída do comando dir e coloca o resultado abaixo da posição atual do cursor. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.6.1: O COMANDO ABRIR + Lição 1.6.1: O COMANDO ABRIR ** Digite o para abrir uma linha em baixo do cursor e ir para o modo de - Inser��o. ** + Inserção. ** 1. Mova o cursor para a linha abaixo marcada com --->. - 2. Digite o (min�sculo) para abrir uma linha ABAIXO do cursor e ir para o - modo de Inser��o. + 2. Digite o (minúsculo) para abrir uma linha ABAIXO do cursor e ir para o + modo de Inserção. 3. Agora digite algum texto e pressione para sair do modo de - Inser��o. + Inserção. ----> Ap�s teclar o o cursor � colocado na linha aberta no modo de Inser��o. +---> Após teclar o o cursor é colocado na linha aberta no modo de Inserção. - 4. Para abrir uma linha ACIMA do cursor, simplesmente tecle um O mai�sculo, - em vez de um o min�sculo. Tente isso na linha abaixo. + 4. Para abrir uma linha ACIMA do cursor, simplesmente tecle um O maiúsculo, + em vez de um o minúsculo. Tente isso na linha abaixo. ----> Abra uma linha acima desta teclando O enquanto o cursor est� nesta linha. +---> Abra uma linha acima desta teclando O enquanto o cursor está nesta linha. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.6.2: O COMANDO ADICIONAR + Lição 1.6.2: O COMANDO ADICIONAR ** Digite a para inserir texto DEPOIS do cursor. ** - 1. Mova o cursor para o in�cio da linha marcada com ---> . + 1. Mova o cursor para o início da linha marcada com ---> . - 2. Pressione e at� o cursor ficar sobre o final de li . + 2. Pressione e até o cursor ficar sobre o final de li . - 3. Digite um a (min�sculo) para adicionar texto DEPOIS do caractere sob o + 3. Digite um a (minúsculo) para adicionar texto DEPOIS do caractere sob o cursor. 4. Complete a palavra conforme a linha abaixo. Pressione para sair do - modo de Inser��o. + modo de Inserção. - 5. Use e para mover para a pr�xima palavra incompleta repita os passos 3 + 5. Use e para mover para a próxima palavra incompleta repita os passos 3 e 4. ----> Esta lin o permite pratic a adi� de texto a uma linha. ----> Esta linha o permite praticar a adi��o de texto a uma linha. +---> Esta lin o permite pratic a adiç de texto a uma linha. +---> Esta linha o permite praticar a adição de texto a uma linha. -NOTA: a, i e A levam ao mesmo modo de Inser��o, a �nica diferen�a � onde os - caracteres s�o inseridos. +NOTA: a, i e A levam ao mesmo modo de Inserção, a única diferença é onde os + caracteres são inseridos. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.6.3: UMA OUTRA VERS�O DO SUBSTITUIR + Lição 1.6.3: UMA OUTRA VERSÃO DO SUBSTITUIR - ** Digite um R mai�sculo para substituir mais de um caractere. ** + ** Digite um R maiúsculo para substituir mais de um caractere. ** 1. Mova o cursor para a primeira linha abaixo marcada com --->. Mova o - cursor para o in�cio do primeiro xxx . + cursor para o início do primeiro xxx . - 2. Agora pressione R e digite os n�meros que est�o abaixo dele, na segunda + 2. Agora pressione R e digite os números que estão abaixo dele, na segunda linha, para substituir o xxx . - 3. Pressione para sair do modo de Substitui��o. Note que o resto da + 3. Pressione para sair do modo de Substituição. Note que o resto da linha permanece inalterado. 4. Repita os passos para substituir os xxx restantes. @@ -787,103 +787,103 @@ NOTA: a, i e A levam ao mesmo modo de Inser ---> Adicionando 123 a xxx resulta em xxx. ---> Adicionando 123 a 456 resulta em 579. -NOTA: O modo de Substitui��o � como o modo de Inser��o, mas cada caractere +NOTA: O modo de Substituição é como o modo de Inserção, mas cada caractere digitado apaga um caractere existente. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.6.4: COPIAR E COLAR TEXTO + Lição 1.6.4: COPIAR E COLAR TEXTO - ** Use o operador y para copiar texto e p para col�-lo. ** + ** Use o operador y para copiar texto e p para colá-lo. ** - 1. V� � linha marcada com ---> abaixo e posicione o cursor ap�s "a)". + 1. Vá à linha marcada com ---> abaixo e posicione o cursor após "a)". 2. Inicie o modo Visual com v e mova o cursor para logo antes de "primeiro". 3. Digite y para copiar o texto selecionado. - 4. Mova o cursor para o fim da pr�xima linha: j$ + 4. Mova o cursor para o fim da próxima linha: j$ - 5. Digite p para colar o texto. Ent�o, digite: o segundo . + 5. Digite p para colar o texto. Então, digite: o segundo . 6. Use o modo Visual para selecionar " item.", copie-o com y , mova para - o fim da pr�xima linha com j$ e cole o texto com p . + o fim da próxima linha com j$ e cole o texto com p . ----> a) esse � o primeiro item. +---> a) esse é o primeiro item. b) -NOTA: Voc� tamb�m pode usar y como um operador; por exemplo, yw copia uma +NOTA: Você também pode usar y como um operador; por exemplo, yw copia uma palavra. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.6.5: CONFIGURAR PREFER�NCIAS + Lição 1.6.5: CONFIGURAR PREFERÊNCIAS - ** Configure uma prefer�ncia de modo que uma busca ou substitui��o - ignore se as letras s�o mai�sculas ou min�sculas. ** + ** Configure uma preferência de modo que uma busca ou substituição + ignore se as letras são maiúsculas ou minúsculas. ** 1. Procure por 'ignore' entrando: /ignore - Repita v�rias vezes teclando n . + Repita várias vezes teclando n . - 2. Configure a op��o 'ic' (Ignore case) digitando: :set ic + 2. Configure a opção 'ic' (Ignore case) digitando: :set ic 3. Agora procure por 'ignore' de novo teclando: n - Repita v�rias vezes. + Repita várias vezes. - 4. Configure as op��es 'hlsearch' e 'incsearch': :set hls is + 4. Configure as opções 'hlsearch' e 'incsearch': :set hls is 5. Agora entre com o comando buscar de novo, e veja o que acontece: /ignore - 6. Para desabilitar a diferencia��o entre mai�sculas e min�sculas: + 6. Para desabilitar a diferenciação entre maiúsculas e minúsculas: :set noic NOTA: Para remover o realce dos termos localizados entre: :nohlsearch -NOTA: Se quiser ignorar a diferen�a entre mai�sculas e min�sculas em apenas +NOTA: Se quiser ignorar a diferença entre maiúsculas e minúsculas em apenas uma pesquisa, use \c no comando: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LI��O 1.6 + RESUMO DA LIÇÃO 1.6 1. Digite o para abrir uma linha ABAIXO do cursor e iniciar o modo de - Inser��o. - Digite O para abrir uma linha ACIMA da linha onde o cursor est�. + Inserção. + Digite O para abrir uma linha ACIMA da linha onde o cursor está. - 2. Digite a para adicionar texto DEPOIS do caractere onde est� o cursor. + 2. Digite a para adicionar texto DEPOIS do caractere onde está o cursor. Digite A para adicionar texto ao fim da linha. 3. O comando e move o cursor para o fim de uma palavra. 4. O operador y copia texto, p cola o texto copiado. - 5. Digitando R entra-se no modo de Substitui��o at� que seja + 5. Digitando R entra-se no modo de Substituição até que seja pressionado. - 6. Digitando ":set xxx" modifica-se a op��o "xxx". Algumas op��es s�o: - 'ic' 'ignorecase' ignora diferen�a entre mai�sculas/min�sculas + 6. Digitando ":set xxx" modifica-se a opção "xxx". Algumas opções são: + 'ic' 'ignorecase' ignora diferença entre maiúsculas/minúsculas 'is' 'incsearch' realiza a busca enquanto se digita - 'hls' 'hlsearch' real�a todos os trechos localizados - Voc� tanto pode usar o nome curto quanto o nome longo da op��o. + 'hls' 'hlsearch' realça todos os trechos localizados + Você tanto pode usar o nome curto quanto o nome longo da opção. - 7. Adicione o prefixo "no" para desabilitar uma op��o: :set noic + 7. Adicione o prefixo "no" para desabilitar uma opção: :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LI��O 1.7.1: OBTENDO AJUDA + LIÇÃO 1.7.1: OBTENDO AJUDA - ** Use o sistema de ajuda do pr�prio Vim ** + ** Use o sistema de ajuda do próprio Vim ** - O Vim possui sistema de ajuda abrangente. Para come�ar, tente algum - desses tr�s: - - pressione a tecla (se voc� tiver uma) - - pressione a tecla (se voc� tiver uma) + O Vim possui sistema de ajuda abrangente. Para começar, tente algum + desses três: + - pressione a tecla (se você tiver uma) + - pressione a tecla (se você tiver uma) - digite :help Leia o texto da ajuda para aprender como o sistema de ajuda funciona. Digite CTRL-W CTRL-W para pular de uma janela a outra. Digite :q para fechar a janela da ajuda. - Voc� pode encontrar ajuda sobre qualquer assunto, fornecendo um argumento - para o comando ":help". Tente isto (n�o se esque�a de pressionar ): + Você pode encontrar ajuda sobre qualquer assunto, fornecendo um argumento + para o comando ":help". Tente isto (não se esqueça de pressionar ): :help w :help c_CTRL-D @@ -891,54 +891,54 @@ NOTA: Se quiser ignorar a diferen :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.7.2: CRIAR UM SCRIPT DE INICIALIZA��O + Lição 1.7.2: CRIAR UM SCRIPT DE INICIALIZAÇÃO ** Habilite recursos do Vim ** - O Vim tem muito mais recursos do que o Vi, mas na sua maioria eles s�o - desabilitados por padr�o. Para usar mais recursos, voc� tem que criar um + O Vim tem muito mais recursos do que o Vi, mas na sua maioria eles são + desabilitados por padrão. Para usar mais recursos, você tem que criar um arquivo "vimrc". 1. Comece a editar o arquivo "vimrc". Isso depende do sistema: :e ~/.vimrc para Unix :e ~/_vimrc para MS-Windows - 2. Agora, leia o conte�do do arquivo "vimrc" de exemplo: + 2. Agora, leia o conteúdo do arquivo "vimrc" de exemplo: :r $VIMRUNTIME/vimrc_example.vim 3. Salve o arquivo com: :w - Da pr�xima vez que o Vim for iniciado, ele usar� realce de sintaxe. Voc� - pode adicionar suas configura��es preferidas para esse arquivo "vimrc". Para - maiores informa��es, digite: :help vimrc-intro + Da próxima vez que o Vim for iniciado, ele usará realce de sintaxe. Você + pode adicionar suas configurações preferidas para esse arquivo "vimrc". Para + maiores informações, digite: :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Li��o 1.7.3: COMPLETA��O + Lição 1.7.3: COMPLETAÇÃO - ** Completa��o da linha de comando com CTRL-D e ** + ** Completação da linha de comando com CTRL-D e ** - 1. Certifique-se de que o Vim n�o est� no modo compat�vel: :set nocp + 1. Certifique-se de que o Vim não está no modo compatível: :set nocp - 2. Veja quais arquivos existem no diret�rio: :!ls ou :!dir + 2. Veja quais arquivos existem no diretório: :!ls ou :!dir - 3. Digite o in�cio de um comando: :e + 3. Digite o início de um comando: :e - 4. Pressione CTRL-D e o Vim mostrar� a lista dos comandos iniciados + 4. Pressione CTRL-D e o Vim mostrará a lista dos comandos iniciados com "e". - 5. Pressione e o Vim completar� o nome do comando para ":edit". + 5. Pressione e o Vim completará o nome do comando para ":edit". - 6. Agora, adicione um espa�o e o in�cio do nome de um arquivo existente: + 6. Agora, adicione um espaço e o início do nome de um arquivo existente: :edit ARQ - 7. Pressione . O Vim completar� o nome (se ele for �nico). + 7. Pressione . O Vim completará o nome (se ele for único). -NOTA: A completa��o funciona com muitos comandos. Basta pressionar CTRL-D e -. Isso � especialmente �til para :help . +NOTA: A completação funciona com muitos comandos. Basta pressionar CTRL-D e +. Isso é especialmente útil para :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LI��O 1.7 + RESUMO DA LIÇÃO 1.7 1. Digite :help ou pressione ou para abrir a janela de ajuda. @@ -949,11 +949,11 @@ NOTA: A completa 4. Digite :q para fechar a janela de ajuda. - 5. Crie um script de inicializa��o vimrc para ativar automaticamente as suas - configura��es preferidas. + 5. Crie um script de inicialização vimrc para ativar automaticamente as suas + configurações preferidas. 6. Quando pressionar um comando : , pressione CTRL-D para ver as possibilidades - de completa��o. Pressione para us�-la. + de completação. Pressione para usá-la. @@ -961,43 +961,43 @@ NOTA: A completa ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Isto conclui o tutorial do Vim, uma breve apresenta��o do editor Vim, - somente o bastante para que voc� possa usar o editor com facilidade. - Ele est� longe de ser completo, uma vez que o Vim possui muitos, muitos mais - comandos. O pr�ximo passo � ler o manual: ":help user-manual". + Isto conclui o tutorial do Vim, uma breve apresentação do editor Vim, + somente o bastante para que você possa usar o editor com facilidade. + Ele está longe de ser completo, uma vez que o Vim possui muitos, muitos mais + comandos. O próximo passo é ler o manual: ":help user-manual". - Livro recomendado em Portugu�s sobre o Vim: - O editor de texto Vim - de S�rgio Luiz Ara�jo da Silva et al. + Livro recomendado em Português sobre o Vim: + O editor de texto Vim - de Sérgio Luiz Araújo da Silva et al. http://code.google.com/p/vimbook/ - Para futura leitura e estudo, este livro � recomendado: + Para futura leitura e estudo, este livro é recomendado: Vim - Vi Improved - de Steve Oualline Editora: New Riders - Este � o primeiro livro completamente dedicado ao Vim. Especialmente �til - para iniciantes, com muitos exemplos e ilustra��es. + Este é o primeiro livro completamente dedicado ao Vim. Especialmente útil + para iniciantes, com muitos exemplos e ilustrações. Veja https://iccf-holland.org/click5.html - Esse livro � mais antigo e mais sobre o Vi do que sobre o Vim, mas tamb�m � + Esse livro é mais antigo e mais sobre o Vi do que sobre o Vim, mas também é recomendado: Learning the Vi Editor - de Linda Lamb Editora: O'Reilly & Associates Inc. - Este � um bom livro para aprender quase tudo o que voc� quer fazer com o Vi. - A sexta edi��o tamb�m inclui informa��es sobre o Vim. + Este é um bom livro para aprender quase tudo o que você quer fazer com o Vi. + A sexta edição também inclui informações sobre o Vim. Este tutorial foi escrito por Michael C. Pierce e Robert K. Ware, - Colorado School of Mines, usando id�ias fornecidas por Charles Smith, + Colorado School of Mines, usando idéias fornecidas por Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. Modificado para o Vim por Bram Moolenaar. - Vers�o 1.4 traduzida para o portugu�s por Marcelo Drudi Miranda, Escola - Polit�cnica da Universidade de S�o Paulo. + Versão 1.4 traduzida para o português por Marcelo Drudi Miranda, Escola + Politécnica da Universidade de São Paulo. - Revis�o e atualiza��o da tradu��o para a vers�o 1.7 por Jakson Aquino, - Universidade Federal do Cear�: E-mail: jalvesaq@gmail.com + Revisão e atualização da tradução para a versão 1.7 por Jakson Aquino, + Universidade Federal do Ceará: E-mail: jalvesaq@gmail.com - Nova revis�o e atualiza��o para a vers�o 1.8 por Ron� Gon�alves, - Universidade Federal de Uberl�ndia. + Nova revisão e atualização para a versão 1.8 por Roní Gonçalves, + Universidade Federal de Uberlândia. Last Change: 2017 Feb 11 diff --git a/runtime/tutor/tutor1.pt.utf-8 b/runtime/tutor/tutor1.pt.utf-8 deleted file mode 100644 index a731365a6f..0000000000 --- a/runtime/tutor/tutor1.pt.utf-8 +++ /dev/null @@ -1,1004 +0,0 @@ -=============================================================================== -= B e m - v i n d o ao t u t o r i a l do V I M - Versão 1.8 pt_BR = -=============================================================================== - - Vim é um poderoso editor que possui muitos comandos, tantos que seria - impossível ensiná-los num tutorial como este, que é concebido para - apresentar os comandos suficientes para permiti-lo usar facilmente o - Vim como um editor de textos genérico. - - O tempo necessário para completar o tutorial é de cerca de 25-30 minutos, - dependendo de quanto tempo é gasto praticando os comandos. - - ATENÇÃO: - Os comandos nas lições modificam este texto. Faça uma cópia deste - arquivo para praticar os comandos (se usou o "vimtutor", esta já - é uma cópia). - - É importante lembrar que este tutorial é concebido para ensinar pela - prática. Isso significa que você precisa executar os comandos para - aprendê-los adequadamente. Se você somente ler o texto, esquecerá os - comandos! - - Agora, certifique-se de que sua tecla Shift-Lock (ou Caps Lock) não esteja - ativada e pressione a tecla j o bastante para mover o cursor até que a - Lição 1.1.1 apareça inteiramente na tela. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.1.1: MOVER O CURSOR - - - ** Para mover o cursor, pressione as teclas h,j,k,l conforme indicado. ** - ^ - k Dica: A tecla h está à esquerda e move à esquerda. - < h l > A tecla l está à direita e move à direita. - j A tecla j se parece com uma seta para baixo. - v - 1. Mova o cursor pela tela até que você se sinta confortável. - - 2. Segure pressionada a tecla (j) até haver repetição. - Agora você já sabe como ir para a próxima lição. - - 3. Usando a tecla j, vá para a Lição 1.1.2. - -NOTA: Se está inseguro sobre o que digitou, pressione para - colocá-lo no modo Normal. Então redigite o comando que queria. - -NOTA: As teclas de cursor funcionam também. Mas usando hjkl, tão logo - esteja acostumado, você poderá se mover muito mais rapidamente. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.1.2: SAIR DO VIM - - - !! NOTA: Antes de executar quaisquer dos passos abaixo, leia a lição inteira !! - - 1. Pressione (para ter certeza de que está no modo Normal). - - 2. Digite: :q! . - Assim, sai do editor SEM salvar qualquer mudança feita. - - 3. Repita o procedimento que o trouxe a este tutorial. O procedimento pode - ter sido a digitação de: vimtutor . - - 4. Se memorizou estes passos e está confiante, execute os passos de - 1 a 3 para sair e reentrar no editor. - -NOTA: :q! descarta qualquer mudança. Em uma próxima lição será - ensinado como salvar as mudanças feitas em um arquivo. - - 5. Desça o cursor até a Lição 1.1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.1.3: EDITAR TEXTOS - REMOÇÃO - - ** Pressione x para deletar o caractere sob o cursor. ** - - - 1. Mova o cursor para a linha abaixo marcada com --->. - - 2. Para corrigir os erros, mova o cursor até que ele esteja sobre o - caractere a ser deletado. - - 3. Pressione a tecla x para remover o caractere incorreto. - - 4. Repita os passos 2 até 4 até que a frase esteja correta. - ----> A vvaca pullouu por ccimaa dda luuua. - - 5. Agora que a frase está correta, prossiga para a Lição 1.1.4. - -NOTA: Enquanto segue este tutorial, não tente memorizar, aprenda pelo uso. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.1.4: EDITAR TEXTOS - INSERÇÃO - - ** Pressione i para inserir texto. ** - - - 1. Mova o cursor até a primeira linha abaixo marcada com --->. - - 2. Para deixar a primeira linha igual à segunda, mova o cursor para - o primeiro caractere DEPOIS de onde o texto deverá ser inserido. - - 3. Pressione i e digite as adições necessárias. - - 4. Assim que cada erro for corrigido pressione para retornar ao modo - Normal. Repita os passos 2 até 4 para corrigir a frase. - ----> Tem text fatado nesta . ----> Tem algum texto faltando nesta linha. - - 5. Quando se sentir à vontade com a inserção de texto, mova o cursor para - a Lição 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.1.5: EDITAR TEXTO - ADICIONAR - - ** Pressione A para adicionar texto. ** - - 1. Mova o cursor para a primeira linha abaixo marcada com --->. - Não importa sobre qual caractere o cursor estará na linha. - - 2. Pressione A e digite as adições necessárias. - - 3. Quando adicionar o texto, pressione para retornar ao modo Normal. - - 4. Mova o cursor para a segunda linha marcada ---> e repita os passos 2 e 3 - para corrigir a frase. - ----> Há algum texto faltando nes - Há algum texto faltando nesta linha. ----> Há algum texto faltan - Há algum texto faltando aqui. - - 5. Quando se sentir confortável adicionando texto, vá para a Lição 1.1.6. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.1.6: EDITAR UM ARQUIVO - - ** Use :wq para salvar um arquivo e sair. ** - - !! NOTA: Leia toda a lição antes de executar as instruções!! - - 1. Saia deste tutorial como o fez na lição 1.1.2: :q! - Ou, se tiver acesso a outro terminal, faça o seguinte nele. - - 2. No prompt do shell, digite esse comando: vim tutor - 'vim' é o comando para iniciar o editor Vim e 'tutor' é o nome do - arquivo que você quer editar. Use um arquivo que possa ser modificado. - - 3. Insira e apague texto tal como aprendeu nas lições anteriores. - - 4. Salve o arquivo com as mudanças e saia do Vim com: :wq - - 5. Se tiver saído do vimtutor no passo 1, reinicie o vimtutor e vá para - o resumo seguinte. - - 6. Após ler os passos acima e compreendê-los, execute-os. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LIÇÃO 1.1 - - 1. O cursor é movido usando tanto as teclas de seta quanto as teclas hjkl. - h (esquerda) j (para baixo) k (para cima) l (direita) - - 2. Para entrar no Vim a partir de um shell digite: vim NOMEDOARQUIVO - - 3. Para sair do Vim digite: :q! para descartar as alterações. - OU digite: :wq para salvar as alterações. - - 4. Para deletar um caractere sob o cursor no modo Normal digite: x - - 5. Para inserir texto na posição do cursor enquanto estiver no modo Normal - digite: - i digite o texto inserir depois do cursor - A digite o texto adicionar no final da linha - -NOTA: Pressionando você irá para o modo Normal ou cancelará um comando - ainda incompleto. - -Agora continue com a Lição 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.2.1: COMANDOS DE REMOÇÃO - - ** Digite dw para apagar uma palavra. ** - - - 1. Pressione para ter certeza de que está no modo Normal. - - 2. Mova o cursor até a linha abaixo marcada com --->. - - 3. Mova o cursor até o começo da palavra que precisa ser deletada. - - 4. Digite dw para fazer a palavra desaparecer. - - NOTA: A letra d vai aparecer na última linha da tela enquanto você a - digita. O Vim o está esperando digitar um w . Se digitou - alguma coisa errada, pressione e comece de novo. - ----> Tem a algumas oi palavras diversão que não pertencem papel a esta frase. - - 5. Repita os passos 3 ao 4 até que a frase esteja correta e vá para a - Lição 1.2.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.2.2: MAIS COMANDOS DE REMOÇÃO - - ** Digite d$ para deletar até o fim da linha. ** - - - - 1. Pressione para ter certeza de estar no modo Normal. - - 2. Mova o cursor até a linha abaixo marcada com --->. - - 3. Mova o cursor até o fim da linha correta (DEPOIS do primeiro . ). - - 4. Digite d$ para apagar até o fim da linha. - ----> Alguém digitou o fim desta linha duas vezes. desta linha duas vezes. - - 5. Vá para a lição 1.2.3 para entender o funcionamento deste comando. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.2.3: SOBRE OPERADORES E MOVIMENTOS - - Muitos comandos que mudam texto são feitos de um operador e de um movimento. - O formato para um comando apagar com o operador de remoção d tem a - seguinte forma: - - d movimento - - Onde: - d - é o operador apagar. - movimento - é o movimento sobre o qual o operador age (listado abaixo). - - Uma pequena lista de teclas de movimento: - w - até o início da próxima palavra, excluindo seu primeiro caractere. - e - até o fim da palavra atual, incluindo seu último caractere. - $ - até o fim da linha, incluindo seu último caractere. - - Portanto, digitar de apaga do cursor ao fim da palavra. - -NOTA: Pressionar apenas a tecla de movimento em modo Normal, sem o -operador, faz o cursor se mover como especificado na lista de teclas de -movimento. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.2.4: USAR UM CONTADOR PARA UM MOVIMENTO - - ** Digitar um número antes de um movimento repete-o o tanto de vezes. ** - - - 1. Mova o cursor para o começo da linha marcada com ---> abaixo. - - 2. Digite 2w para mover o cursor duas palavras adiante. - - 3. Digite 3e para mover o cursor para o fim da terceira palavra adiante. - - 4. Digite 0 (zero) para mover para o início da linha. - - 5. Repita os passos 2 e 3 com diferentes números. - ----> Esta é uma linha com algumas palavras para permiti-lo fazer movimentos. - - 6. Vá para a Lição 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.2.5: USAR UM CONTADOR PARA APAGAR MAIS - - ** Digitar um número com um operador repete-o esse número de vezes. ** - - - Você deve inserir um contador entre o operador de remoção e o de movimento - mencionados acima para apagar mais: - d número movimento - - 1. Movimente o cursor para a primeira palavra em LETRAS MAIÚSCULAS na - linha marcada com --->. - - 2. Digite d2w para deletar as duas palavras em LETRAS MAIÚSCULAS. - - 3. Repita os passos 1 e 2 com diferentes contadores para deletar as - palavras em LETRAS MAIÚSCULAS com um comando. - ----> esta ABC DE linha FGHI JK LMN OP de palavras está Q RS TUV limpa. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.2.6: TRABALHAR COM LINHAS - - ** Digite dd para apagar uma linha inteira. ** - - Em virtude da frequência em deletar uma linha inteira, os desenvolvedores - do Vi decidiram que seria mais simples digitar dois d para apagar uma linha. - - 1. Mova o cursor até a segunda linha da frase abaixo. - 2. Digite dd para apagar a linha. - 3. Agora mova até a quarta linha. - 4. Digite 2dd para apagar duas linhas. - ----> 1) Rosas são vermelhas, ----> 2) Lama é divertida, ----> 3) Violetas são azuis, ----> 4) Eu tenho um carro, ----> 5) Relógios dizem as horas, ----> 6) Açúcar é doce, ----> 7) Assim como você. - -Notas do tradutor: Lama (mud) em inglês pode significar fofoca, difamação. - Há rima no texto original. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.2.7: O COMANDO UNDO (DESFAZER) - -** Pressione u para desfazer os últimos comandos, U recupera a linha inteira.** - - - 1. Mova o cursor para a linha abaixo marcada com ---> e posicione-o sobre o - primeiro erro. - 2. Digite x para deletar o primeiro caractere errado. - 3. Agora, digite u para desfazer o último comando executado. - 4. Desta vez, corrija todos os erros na linha usando o comando x . - 5. Agora, digite um U maiúsculo para retornar a linha ao seu estado original. - 6. Digite u algumas vezes para desfazer o U e os comandos anteriores. - 7. Digite CTRL-R (segurando a tecla CTRL enquanto digita R) algumas vezes - para refazer os comandos (desfazer os undos). - ----> Corriija os erros nnesta linha e reetorne-os com undo. - - 8. Esses comandos são muito úteis. Agora vá para o resumo da Lição 1.2. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LIÇÃO 1.2 - - - 1. Para apagar do cursor até a próxima palavra, digite: dw - 2. Para apagar do cursor até o fim de uma linha, digite: d$ - 3. Para apagar uma linha inteira, digite: dd - 4. Para repetir um movimento, adicione antes um número: 2w - 5. O formato para um comando no modo Normal é: - operador [número] movimento - onde: - operador - é o que será feito, como d para apagar - [número] - quantas vezes o comando será repetido - movimento - movimento sobre o texto que receberá a operação, como - w (palavra), $ (até o fim da linha), etc. - - 6. Para ir ao início da linha, use um zero: 0 - - 7. Para desfazer uma ação anterior, digite: u (minúsculo) - Para desfazer todas as alterações em uma linha, digite: U (maiúsculo) - Para desfazer o que foi desfeito, digite: CTRL-R - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.3.1: O COMANDO COLAR - - ** Digite p para colar após o cursor o que acabou de apagar. ** - - - 1. Mova o cursor até a primeira linha marcada com --->. - - 2. Digite dd para apagar a linha e guardá-la num registro do Vim. - - 3. Mova o cursor até a linha c) ACIMA de onde a linha apagada deveria estar. - - 4. No modo Normal, digite p para inserir a linha. - - 5. Repita os passos 2 ao 4 para pôr todas as linhas na ordem correta. - ----> d) Você pode aprender também? ----> b) Violetas são azuis, ----> c) Inteligência se aprende, ----> a) Rosas são vermelhas, - -Nota do tradutor: Há rima no original. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.3.2: O COMANDO SUBSTITUIR - - ** Digite rx para substituir o caractere sob o cursor por x . ** - - - 1. Mova o cursor até a primeira linha abaixo marcada com --->. - - 2. Mova o cursor até que esteja sobre o primeiro erro. - - 3. Digite r e então o caractere que deveria estar lá. - - 4. Repita os passos 2 e 3 até que a primeira linha esteja igual à segunda. - ----> Quendo este limha foi dugitada, alguem pressioniu algumas teclas erradzs! ----> Quando esta linha foi digitada, alguém pressionou algumas teclas erradas! - - 5. Agora vá para a Lição 1.3.3. - -NOTA: Lembre-se que você deve aprender pelo uso, não pela memorização. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.3.3: O OPERADOR CHANGE (MUDAR) - - ** Para alterar até o fim de uma palavra, digite ce . ** - - - 1. Mova o cursor até a primeira linha abaixo marcada com --->. - - 2. Posicione o cursor sobre o u em lunba. - - 3. Digite ce e a palavra correta (nesse caso, digite 'inha'.) - - 4. Pressione e mova para o próximo caractere a ser alterado. - - 5. Repita os passos 3 e 4 até que a primeira frase esteja igual à segunda. - ----> Essa lunba tem pwlesmfr que ocrimmm soi alteradas cup o comando change. ----> Essa linha tem palavras que precisam ser alteradas com o comando change. - -Note que ce não somente substitui a palavra, mas também o coloca no modo -de Inserção. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.3.4: MAIS MUDANÇAS USANDO c - - ** O operador change é usado com os mesmos movimentos que o delete. ** - - - 1. O operador change trabalha da mesma maneira que o delete. O formato é: - - c [número] movimento - - 2. Os movimentos também são os mesmos: w (palavra) e $ (fim da linha). - - 3. Mova até a primeira linha abaixo marcada com --->. - - 4. Mova o cursor até o primeiro erro. - - 5. Digite c$ e digite o resto da segunda linha para torná-las iguais e - pressione . - ----> O fim desta linha precisa de ajuda para ficar igual à segunda. ----> O fim desta linha precisa ser corrigido usando o comando c$. - -NOTA: Você pode usar a tecla Backspace para corrigir erros enquanto digita. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LIÇÃO 1.3 - - - 1. Para reinserir um texto que já foi apagado, digite p . Isso coloca o texto - deletado APÓS o cursor (se uma linha é deletada ela será inserida na linha - abaixo do cursor). - - 2. Para substituir o caractere sob o cursor, digite r e então o caractere - que substituirá o original. - - 3. O comando change possibilita mudar do cursor até onde o movimento for. - Ex: Digite ce para mudar do cursor até o fim de uma palavra, c$ para - mudar até o fim da linha. - - 4. O formato para uma operação change é: - - c [número] movimento - -Agora vá para a próxima lição. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.4.1: LOCALIZAÇÃO DO CURSOR E ESTADO DO ARQUIVO - - ** Digite CTRL-G para mostrar sua localização no arquivo e seu estado. - Digite G para mover para uma linha do arquivo. ** - - Nota: Leia esta lição inteira antes de executar qualquer um dos passos!! - - 1. Segure pressionada a tecla Ctrl e pressione g . Chamamos isso de - CTRL-G. Uma mensagem aparecerá no rodapé da página com o nome do arquivo - e a sua posição no arquivo. Lembre-se do número da linha para o Passo 3. - -NOTA: A posição do cursor pode estar visível no canto direito inferior da - tela. Isso acontece quando a opção 'ruler' está ativa - (veja :help 'ruler' ). - - 2. Pressione G para se mover até o fim do arquivo. - Digite gg para se mover até o início do arquivo. - - 3. Digite o número da linha em que estava e então G . Assim o cursor retornará - à linha em que estava quando pressionou CTRL-G. - - 4. Se estiver seguro para fazê-los, execute os passos 1 a 3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.4.2: O COMANDO BUSCAR - - ** Digite / seguido por uma frase para procurar por ela. ** - - 1. No modo Normal digite o caractere / . Note que ele e o cursor aparecem - no rodapé da tela, como ocorre com o comando : . - - 2. Agora digite 'errroo' . Esta é a palavra que quer procurar. - - 3. Para buscar a mesma palavra de novo, simplesmente tecle n . - Para buscar a mesma palavra na direção oposta, tecle N . - - 4. Se quer procurar por uma frase de trás para frente, use ? em vez de / . - - 5. Para voltar aonde estava, pressione CTRL-O (mantenha a tecla Ctrl - pressionada e pressione a tecla o). Repita para voltar a outras posições. - CTRL-I segue para posições mais recentes. - ----> "errroo" não é uma maneira de escrever erro; errroo é um erro. - -NOTA: Quando a busca atinge o fim do arquivo ela continuará do começo, a - menos que a opção 'wrapscan' esteja desativada. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.4.3: BUSCA DE PARÊNTESES CORRESPONDENTES - - ** Digite % para encontrar um ),], ou } correspondente. ** - - - 1. Posicione o cursor em qualquer (, [, ou { na linha abaixo marcada com --->. - - 2. Agora digite o caractere % . - - 3. O cursor deve estar no parêntese ou colchete que casa com o primeiro. - - 4. Digite % para mover o cursor de volta ao primeiro colchete ou parêntese - (por casamento). - ----> Isto ( é uma linha de teste contendo (, [ ] e { }. )) - -Nota: Isso é muito útil para corrigir um programa com parêntese não-casado! - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.4.4: O COMANDO SUBSTITUIR - - ** Digite :s/velho/novo/g para substituir 'velho' por 'novo'. ** - - - 1. Mova o cursor para a linha abaixo marcada com --->. - - 2. Digite :s/aa/a . Note que este comando somente muda a - primeira ocorrência na linha. - - 3. Agora digite :s/aa/a/g significando substituir globalmente na linha. - Isto muda todas as ocorrências na linha. - ----> aa melhor época para ver aas flores é aa primavera. - - 4. Para mudar toda ocorrência de uma string entre duas linhas, - digite :#,#s/velho/novo/g onde #,# são os números das duas linhas. - Digite :%s/velho/novo/g para mudar todas as ocorrências no arquivo - inteiro. - Digite :%s/velho/novo/gc para mudar todas as ocorrências no arquivo - inteiro, com a opção de confirmar cada - substituição. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LIÇÃO 1.4 - - - 1. CTRL-G mostra em que ponto do arquivo está e o estado dele. - G move para o fim do arquivo. - número G move para a linha com esse número. - gg move para a primeira linha. - - 2. Digitando / seguido por uma expressão procura À FRENTE por ela. - Digitando ? seguido por uma expressão procura pela expressão de TRÁS - PARA FRENTE. - Após uma busca, digite n para achar a próxima ocorrência na mesma direção - ou N para procurar na direção oposta. - CTRL-O leva a posições antigas e CTRL-I a posições mais recentes. - - 3. Digitando % enquanto o cursor está sobre um (,),[,],{, ou } localiza - o par que casa com ele. - - 4. Para substituir: - o primeiro 'velho' de uma linha por 'novo' digite :s/velho/novo - todos os 'velho' em uma linha por 'novo' digite :s/velho/novo/g - expressões entre dois números (#) de linhas digite :#,#s/velho/novo - todas as ocorrências no arquivo digite :%s/velho/novo/g - Para confirmar cada substituição adicione 'c' :%s/velho/novo/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.5.1: COMO EXECUTAR UM COMANDO EXTERNO - - - ** Digite :! seguido por um comando externo para executá-lo. ** - - 1. Digite o familiar comando : para levar o cursor ao rodapé da tela. Isso - o permite entrar um comando. - - 2. Agora digite o caractere ! (ponto de exclamação). Isso o permite - executar qualquer comando do shell. - - 3. Como um exemplo digite ls seguindo o ! e então tecle . Isto - mostrará uma listagem do seu diretório, como se você estivesse no - prompt do shell. Ou use :!dir se ls não funcionar. - -NOTA: É possível executar qualquer comando externo dessa maneira, inclusive - com argumentos. - -NOTA: Todos os comandos : devem ser finalizados teclando-se - Daqui em diante não mencionaremos isso todas as vezes. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.5.2: MAIS SOBRE SALVAR ARQUIVOS - - ** Para salvar as alterações no texto, digite :w NOMEDOARQUIVO. ** - - - 1. Digite :!dir ou :!ls para ter uma listagem de seu diretório. - Você já deve saber que precisa teclar depois disso. - - 2. Escolha um nome de arquivo que ainda não exista, como TESTE. - - 3. Agora digite: :w TESTE (onde TESTE é o nome que você escolheu.) - - 4. Isto salva o arquivo inteiro (o Vim Tutor) com o nome TESTE. - Para verificar isso, digite :!ls de novo para ver seu diretório. - -NOTA: Se sair do Vim e entrar de novo com o nome do arquivo TESTE, - o arquivo deve ser uma cópia exata do tutorial quando você o salvou. - - 5. Agora remova o arquivo digitando (MS-DOS): :!del TESTE - ou (Unix): :!rm TESTE - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.5.3: SELECIONAR O TEXTO A SER SALVO - - ** Para salvar parte de um arquivo, digite v movimento :w NOMEDOARQUIVO ** - - 1. Mova o cursor para esta linha. - - 2. Pressione v e mova o cursor para o quinto item abaixo. Note que o texto - é realçado. - - 3. Pressione o caractere : e note que aparecerá :'<,'> no lado inferior - da tela. - - 4. Digite w TESTE , sendo TESTE um nome de arquivo que não existe ainda. - Certifique-se de ver :'<,'>w TESTE antes de pressionar . - - 5. O Vim salvará as linhas selecionadas no arquivo TESTE. Use :!dir ou - !:ls para vê-lo. Não o apague ainda! Nós o usaremos na próxima lição. - -NOTA: Pressionar v inicia o modo Visual de seleção. Você pode mover o -cursor pela tela para tornar a seleção maior ou menor. Pode, então, usar um -operador para executar alguma ação. Por exemplo, d apaga o texto. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.5.4: RECUPERAR E UNIR ARQUIVOS - - ** Para inserir o conteúdo de um arquivo, digite :r NOMEDOARQUIVO ** - - - 1. Posicione o cursor logo acima desta linha. - -NOTA: Depois de executar o Passo 2 você verá a Lição 1.5.3. Então DESÇA o - cursor para ver esta lição novamente. - - 2. Agora recupere o arquivo TESTE usando o comando :r TESTE onde TESTE é o - nome do arquivo. - O arquivo recuperado é colocado abaixo da linha atual do cursor. - - 3. Para verificar que o arquivo foi recuperado, volte com o cursor e verifique - que agora existem duas cópias da Lição 1.5.3, a original e a versão do - arquivo. - -NOTA: Você também pode ler a saída de um comando externo. Por exemplo, :r !ls - lê a saída do comando ls e coloca o resultado abaixo do cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LIÇÃO 1.5 - - - 1. :!comando executa um comando externo. - - Alguns exemplos úteis são: - (MS-DOS) (UNIX) - :!dir :!ls - lista conteúdo do diretório. - :!del ARQUIVO :!rm ARQUIVO - remove ARQUIVO. - - 2. :w ARQUIVO salva o atual arquivo do Vim para o disco com o nome ARQUIVO. - - 3. v movimento :w ARQUIVO salva as linhas Visualmente selecionadas em - ARQUIVO. - - 4. :r ARQUIVO recupera ARQUIVO do disco e o insere dentro do arquivo atual - na posição do cursor. - - 5. :r !dir lê a saída do comando dir e coloca o resultado abaixo da posição - atual do cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.6.1: O COMANDO ABRIR - - ** Digite o para abrir uma linha em baixo do cursor e ir para o modo de - Inserção. ** - - 1. Mova o cursor para a linha abaixo marcada com --->. - - 2. Digite o (minúsculo) para abrir uma linha ABAIXO do cursor e ir para o - modo de Inserção. - - 3. Agora digite algum texto e pressione para sair do modo de - Inserção. - ----> Após teclar o o cursor é colocado na linha aberta no modo de Inserção. - - 4. Para abrir uma linha ACIMA do cursor, simplesmente tecle um O maiúsculo, - em vez de um o minúsculo. Tente isso na linha abaixo. - ----> Abra uma linha acima desta teclando O enquanto o cursor está nesta linha. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.6.2: O COMANDO ADICIONAR - - ** Digite a para inserir texto DEPOIS do cursor. ** - - 1. Mova o cursor para o início da linha marcada com ---> . - - 2. Pressione e até o cursor ficar sobre o final de li . - - 3. Digite um a (minúsculo) para adicionar texto DEPOIS do caractere sob o - cursor. - - 4. Complete a palavra conforme a linha abaixo. Pressione para sair do - modo de Inserção. - - 5. Use e para mover para a próxima palavra incompleta repita os passos 3 - e 4. - ----> Esta lin o permite pratic a adiç de texto a uma linha. ----> Esta linha o permite praticar a adição de texto a uma linha. - -NOTA: a, i e A levam ao mesmo modo de Inserção, a única diferença é onde os - caracteres são inseridos. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.6.3: UMA OUTRA VERSÃO DO SUBSTITUIR - - ** Digite um R maiúsculo para substituir mais de um caractere. ** - - - 1. Mova o cursor para a primeira linha abaixo marcada com --->. Mova o - cursor para o início do primeiro xxx . - - 2. Agora pressione R e digite os números que estão abaixo dele, na segunda - linha, para substituir o xxx . - - 3. Pressione para sair do modo de Substituição. Note que o resto da - linha permanece inalterado. - - 4. Repita os passos para substituir os xxx restantes. - ----> Adicionando 123 a xxx resulta em xxx. ----> Adicionando 123 a 456 resulta em 579. - -NOTA: O modo de Substituição é como o modo de Inserção, mas cada caractere - digitado apaga um caractere existente. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.6.4: COPIAR E COLAR TEXTO - - ** Use o operador y para copiar texto e p para colá-lo. ** - - 1. Vá à linha marcada com ---> abaixo e posicione o cursor após "a)". - - 2. Inicie o modo Visual com v e mova o cursor para logo antes de - "primeiro". - - 3. Digite y para copiar o texto selecionado. - - 4. Mova o cursor para o fim da próxima linha: j$ - - 5. Digite p para colar o texto. Então, digite: o segundo . - - 6. Use o modo Visual para selecionar " item.", copie-o com y , mova para - o fim da próxima linha com j$ e cole o texto com p . - ----> a) esse é o primeiro item. - b) - -NOTA: Você também pode usar y como um operador; por exemplo, yw copia uma - palavra. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.6.5: CONFIGURAR PREFERÊNCIAS - - ** Configure uma preferência de modo que uma busca ou substituição - ignore se as letras são maiúsculas ou minúsculas. ** - - 1. Procure por 'ignore' entrando: /ignore - Repita várias vezes teclando n . - - 2. Configure a opção 'ic' (Ignore case) digitando: :set ic - - 3. Agora procure por 'ignore' de novo teclando: n - Repita várias vezes. - - 4. Configure as opções 'hlsearch' e 'incsearch': :set hls is - - 5. Agora entre com o comando buscar de novo, e veja o que acontece: - /ignore - - 6. Para desabilitar a diferenciação entre maiúsculas e minúsculas: - :set noic - -NOTA: Para remover o realce dos termos localizados entre: :nohlsearch -NOTA: Se quiser ignorar a diferença entre maiúsculas e minúsculas em apenas - uma pesquisa, use \c no comando: /ignore\c - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LIÇÃO 1.6 - - 1. Digite o para abrir uma linha ABAIXO do cursor e iniciar o modo de - Inserção. - Digite O para abrir uma linha ACIMA da linha onde o cursor está. - - 2. Digite a para adicionar texto DEPOIS do caractere onde está o cursor. - Digite A para adicionar texto ao fim da linha. - - 3. O comando e move o cursor para o fim de uma palavra. - - 4. O operador y copia texto, p cola o texto copiado. - - 5. Digitando R entra-se no modo de Substituição até que seja - pressionado. - - 6. Digitando ":set xxx" modifica-se a opção "xxx". Algumas opções são: - 'ic' 'ignorecase' ignora diferença entre maiúsculas/minúsculas - 'is' 'incsearch' realiza a busca enquanto se digita - 'hls' 'hlsearch' realça todos os trechos localizados - Você tanto pode usar o nome curto quanto o nome longo da opção. - - 7. Adicione o prefixo "no" para desabilitar uma opção: :set noic - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LIÇÃO 1.7.1: OBTENDO AJUDA - - ** Use o sistema de ajuda do próprio Vim ** - - O Vim possui sistema de ajuda abrangente. Para começar, tente algum - desses três: - - pressione a tecla (se você tiver uma) - - pressione a tecla (se você tiver uma) - - digite :help - - Leia o texto da ajuda para aprender como o sistema de ajuda funciona. - Digite CTRL-W CTRL-W para pular de uma janela a outra. - Digite :q para fechar a janela da ajuda. - - Você pode encontrar ajuda sobre qualquer assunto, fornecendo um argumento - para o comando ":help". Tente isto (não se esqueça de pressionar ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.7.2: CRIAR UM SCRIPT DE INICIALIZAÇÃO - - ** Habilite recursos do Vim ** - - O Vim tem muito mais recursos do que o Vi, mas na sua maioria eles são - desabilitados por padrão. Para usar mais recursos, você tem que criar um - arquivo "vimrc". - - 1. Comece a editar o arquivo "vimrc". Isso depende do sistema: - :e ~/.vimrc para Unix - :e ~/_vimrc para MS-Windows - - 2. Agora, leia o conteúdo do arquivo "vimrc" de exemplo: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Salve o arquivo com: - :w - - Da próxima vez que o Vim for iniciado, ele usará realce de sintaxe. Você - pode adicionar suas configurações preferidas para esse arquivo "vimrc". Para - maiores informações, digite: :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lição 1.7.3: COMPLETAÇÃO - - ** Completação da linha de comando com CTRL-D e ** - - 1. Certifique-se de que o Vim não está no modo compatível: :set nocp - - 2. Veja quais arquivos existem no diretório: :!ls ou :!dir - - 3. Digite o início de um comando: :e - - 4. Pressione CTRL-D e o Vim mostrará a lista dos comandos iniciados - com "e". - - 5. Pressione e o Vim completará o nome do comando para ":edit". - - 6. Agora, adicione um espaço e o início do nome de um arquivo existente: - :edit ARQ - - 7. Pressione . O Vim completará o nome (se ele for único). - -NOTA: A completação funciona com muitos comandos. Basta pressionar CTRL-D e -. Isso é especialmente útil para :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - RESUMO DA LIÇÃO 1.7 - - - 1. Digite :help ou pressione ou para abrir a janela de ajuda. - - 2. Digite :help cmd para achar a ajuda sobre cmd . - - 3. Digite CTRL-W CTRL-W para pular de uma janela a outra. - - 4. Digite :q para fechar a janela de ajuda. - - 5. Crie um script de inicialização vimrc para ativar automaticamente as suas - configurações preferidas. - - 6. Quando pressionar um comando : , pressione CTRL-D para ver as possibilidades - de completação. Pressione para usá-la. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Isto conclui o tutorial do Vim, uma breve apresentação do editor Vim, - somente o bastante para que você possa usar o editor com facilidade. - Ele está longe de ser completo, uma vez que o Vim possui muitos, muitos mais - comandos. O próximo passo é ler o manual: ":help user-manual". - - Livro recomendado em Português sobre o Vim: - O editor de texto Vim - de Sérgio Luiz Araújo da Silva et al. - http://code.google.com/p/vimbook/ - - Para futura leitura e estudo, este livro é recomendado: - Vim - Vi Improved - de Steve Oualline - Editora: New Riders - Este é o primeiro livro completamente dedicado ao Vim. Especialmente útil - para iniciantes, com muitos exemplos e ilustrações. - Veja https://iccf-holland.org/click5.html - - Esse livro é mais antigo e mais sobre o Vi do que sobre o Vim, mas também é - recomendado: - Learning the Vi Editor - de Linda Lamb - Editora: O'Reilly & Associates Inc. - Este é um bom livro para aprender quase tudo o que você quer fazer com o Vi. - A sexta edição também inclui informações sobre o Vim. - - Este tutorial foi escrito por Michael C. Pierce e Robert K. Ware, - Colorado School of Mines, usando idéias fornecidas por Charles Smith, - Colorado State University. E-mail: bware@mines.colorado.edu. - - Modificado para o Vim por Bram Moolenaar. - - Versão 1.4 traduzida para o português por Marcelo Drudi Miranda, Escola - Politécnica da Universidade de São Paulo. - - Revisão e atualização da tradução para a versão 1.7 por Jakson Aquino, - Universidade Federal do Ceará: E-mail: jalvesaq@gmail.com - - Nova revisão e atualização para a versão 1.8 por Roní Gonçalves, - Universidade Federal de Uberlândia. - - Last Change: 2017 Feb 11 - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.ru b/runtime/tutor/tutor1.ru index ea3d97333b..c303c25daa 100644 --- a/runtime/tutor/tutor1.ru +++ b/runtime/tutor/tutor1.ru @@ -1,1017 +1,1017 @@ =============================================================================== -������ 1.7 = ����� ���������� �� ������� �� ��������� Vim = +версия 1.7 = ДОБРО ПОЖАЛОВАТЬ НА ЗАНЯТИЯ ПО РЕДАКТОРУ Vim = =============================================================================== -= ����� ������ = += ГЛАВА ПЕРВАЯ = =============================================================================== - ��������� Vim -- ��� ����� ������ ��������� ��������, ������� ��������� - ������, � ��� �� ������ ���������� ������� � ������ ����� ��������. - ������ �� ������� ������� ��������� �� �������, ������� �������� ��� � - ̣������� ������������ ��������� Vim � �������� ��������� ������ ����������. - �� �������� ���������� ����� �������� ����������� ����� 30 �����, �� ��� - ������� �� ����, ������� ������� �� ��������� ������������ ��������. - - ��������! �������� ������� ������, �� ������ �������� ����� � ���� �����, - ������� ������ ��� ����������, �������� ����� �����. ����� ����� ����� - �������������� �������, ������� ��� �����������. ���� �� ��������������� - �������� "vimtutor" ��� �������� ����� ��������, ������, ����� ��� �������. - - ����� �������, ��� ���� ������� ������������ ��� ������������� ��������. - ��� ��������, ��� �� ������ ��������� ������� ��� ����, ����� ��� ������� - �� �������. ���� �� ������ ���������� ���� �����, �� �� ��������� �������! - ������, ����������, ��� �� �������� ������� , ������� ������� j - ��������� ���, ���, ����� ���� 1.1.1 ��������� ���������� �� ������. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.1. ����������� ������� - -** ����� ���������� ������� � ��������� ������������, ������� ������� h,j,k,l ** - ^ ���������. - k ������� h ����� � ������ ��� ����������� �����. - < h l > ������� l ������ � ������ ��� ����������� ������. - j ������� j ������ �� ������� "����". + Программа Vim -- это очень мощный текстовый редактор, имеющий множество + команд, и все их просто невозможно описать в рамках этого учебника. + Данный же учебник призван объяснить те команды, которые позволят вам с + лёгкостью использовать программу Vim в качестве редактора общего назначения. + На освоение материалов этого учебника потребуется около 30 минут, но это + зависит от того, сколько времени вы посвятите практическим занятиям. + + Внимание! Выполняя задания уроков, вы будете изменять текст в этом файле, + поэтому прежде чем продолжить, создайте копию файла. Тогда можно будет + практиковаться столько, сколько это потребуется. Если вы воспользовались + командой "vimtutor" для открытия этого учебника, значит, копия уже создана. + + Важно помнить, что этот учебник предназначен для практического обучения. + Это означает, что вы должны применять команды для того, чтобы как следует + их изучить. Если вы просто прочитаете этот текст, то не запомните команды! + Теперь, убедившись, что не включена клавиша , нажмите клавишу j + несколько раз, так, чтобы урок 1.1.1 полностью поместился на экране. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Урок 1.1.1. ПЕРЕМЕЩЕНИЕ КАРЕТКИ + +** Чтобы перемещать каретку в указанных направлениях, нажмите клавиши h,j,k,l ** + ^ Подсказка. + k Клавиша h слева и удобна для перемещения влево. + < h l > Клавиша l справа и удобна для перемещения вправо. + j Клавиша j похожа на стрелку "вниз". v - 1. ����������� ������� � ������ ������������, ���� �� ������� �����������. + 1. Перемещайте каретку в разных направлениях, пока не ощутите уверенность. - 2. ����������� ������� ������� "����" (j) ��� ������������� ����������� - �������. ������ �� ������, ��� ������� � ���������� �����. + 2. Удерживайте нажатой клавишу "вниз" (j) для беспрерывного перемещения + каретки. Теперь вы знаете, как перейти к следующему уроку. - 3. ��������� ������� "����", �� ���� j , ��������� � ����� 1.1.2. + 3. Используя клавишу "вниз", то есть j , перейдите к уроку 1.1.2. -�����. - ���� �� �� ������� � ������������ ���������� ������, ������� ������� , - ����� ����������� �������� � ����� ������. ����� ����� ��������� �����. +Совет. + Если вы не уверены в правильности набранного текста, нажмите клавишу , + чтобы переключить редактор в режим команд. После этого повторите набор. -����������. - ������� ���������� �������� (�������) ����� ������ ��������. �� ������, ��� - ��������� ����������� ������� ��������� h j k l ������� �������, ����� - ������ ������� ���������������. +Примечание. + Клавиши управления курсором (стрелки) также должны работать. Но учтите, что + выполнять перемещение каретки клавишами h j k l намного быстрее, стоит + только немного потренироваться. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.2. ���������� ������ ��������� + Урок 1.1.2. ЗАВЕРШЕНИЕ РАБОТЫ ПРОГРАММЫ - ��������! ����� ����������� ��������� ���� ��������, �������� ���� ���������! + ВНИМАНИЕ! Перед выполнением описанных ниже действий, прочтите урок полностью! - 1. ������� ������� (����� ���� ���������, ��� ��������� ��������� � - ������ ������). + 1. Нажмите клавишу (чтобы быть уверенным, что программа находится в + режиме команд). - 2. �������� :q! - ��� ��������, ��� ���� ������� ��� ������� :q! � ������ ������� <����> - ���������� ���� ������� ������� ���������� ������ ��������� - ��� ���������� ����� ��������� ���������. + 2. Наберите :q! + Это означает, что надо набрать три символа :q! и нажать клавишу <ВВОД> + Исполнение этой команды вызовет завершение работы редактора + БЕЗ СОХРАНЕНИЯ любых сделанных изменений. - 3. � ����������� ��������� �������� �������� �������, ������� �� ��������� - ���� �������. ��� ����� ���� vimtutor + 3. В приглашении командной оболочки наберите команду, которой вы открывали + этот учебник. Это может быть vimtutor - 4. ���� ������� � ���, ��� ������ ����� ��������������, ��������� ���� - � 1 �� 3, ����� ��������� ������ � ����� ��������� ��������. + 4. Если уверены в том, что поняли смысл вышесказанного, выполните шаги + с 1 до 3, чтобы завершить работу и снова запустить редактор. -����������. - �� ������� :q! ����� �������� ����� ��������� ���������. ����� - ��������� ������ �� �������, ��� ��������� ��������� � ����. +Примечание. + По команде :q! будут сброшены любые сделанные изменения. Через + несколько уроков вы узнаете, как сохранять изменения в файл. - 5. ����������� ������� ���� � ����� 1.1.3. + 5. Переместите каретку вниз к уроку 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.3. �������������� - �������� ������ + Урок 1.1.3. РЕДАКТИРОВАНИЕ - УДАЛЕНИЕ ТЕКСТА - ** ����� ������� ������ ��� ��������, ������� ������� x ** + ** Чтобы удалить символ под кареткой, нажмите клавишу x ** - 1. ����������� ������� � ������ ���������� --->. + 1. Переместите каретку к строке помеченной --->. - 2. ����� ��������� ������, ����������� �������, ���� ��� �� �������� ��� - ��������� ��������. + 2. Чтобы исправить ошибки, перемещайте каретку, пока она не окажется над + удаляемым символом. - 3. ������� ������� x ��� �������� ���������� �������. + 3. Нажмите клавишу x для удаления требуемого символа. - 4. ��������� ���� �� 2 �� 4, ���� ������ �� ����� ����������. + 4. Повторите шаги со 2 по 4, пока строка не будет исправлена. ----> �� �������� ������ ������ ��� ������ �������. +---> От тттопота копытт пппыль ппо ппполю леттитт. - 5. ������, ����� ������ ����������, ���������� � ����� 1.1.4. + 5. Теперь, когда строка исправлена, переходите к уроку 1.1.4. -����������. - � ���� ���� ������� �� ��������� ����� �ӣ ����������, ������� � �������� - ������. +Примечание. + В ходе этих занятий не пытайтесь сразу всё запоминать, учитесь в процессе + работы. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.4. �������������� - ������� ������ + Урок 1.1.4. РЕДАКТИРОВАНИЕ - ВСТАВКА ТЕКСТА - ** ����� �������� �����, ������� ������� i ** + ** Чтобы вставить текст, нажмите клавишу i ** - 1. ����������� ������� � ������ ������ ���������� --->. + 1. Переместите каретку к первой строке помеченной --->. - 2. ����� ������� ������ ������ ���������� ������, ���������� ������� �� ��� - ������, ����� ������� ������� �������� �����. + 2. Чтобы сделать первую строку идентичной второй, установите каретку на тот + символ, ПЕРЕД которым следует вставить текст. - 3. ������� ������� i � �������� �����, ������� ��������� ��������. + 3. Нажмите клавишу i и наберите текст, который требуется вставить. - 4. ����� ����������� ������� ���������� �����, ������� ������� - ��� ������������ � ����� ������. - ��������� ���� �� 2 �� 4, ���� ����������� �� ����� ���������� ���������. + 4. После исправления каждого ошибочного слова, нажмите клавишу + для переключения в режим команд. + Повторите шаги со 2 по 4, пока предложение не будет исправлено полностью. ----> ����� ����� � ������ ��������� . ----> ����� ������ � ���� ������ ��������� �������. +---> Часть текта в строке бесследно . +---> Часть текста в этой строке бесследно пропало. - 5. ����� ������� ������� ������, ���������� � ����� 1.1.5. + 5. Когда освоите вставку текста, переходите к уроку 1.1.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.5. �������������� - ���������� ������ + Урок 1.1.5. РЕДАКТИРОВАНИЕ - ДОБАВЛЕНИЕ ТЕКСТА - ** ����� �������� �����, ������� ������� A ** + ** Чтобы добавить текст, нажмите клавишу A ** - 1. ����������� ������� � ������ ������ ���������� --->. - ������ �������, �� ����� ������� ����������� ������� � ���� ������. + 1. Переместите каретку к первой строке помеченной --->. + Сейчас неважно, на каком символе расположена каретка в этой строке. - 2. ������� ������� A � �������� �����, ������� ��������� ��������. + 2. Нажмите клавишу A и наберите текст, который требуется добавить. - 3. ����� ���������� ������ ������� ������� ��� �������� � ����� ������. + 3. После добавления текста нажмите клавишу для возврата в режим команд. - 4. ����������� ������� �� ��������� ������, ���������� ---> - � ��������� ���� �� 2 �� 3 ��� ����������� ���� ������. + 4. Переместите каретку на следующую строку, помеченную ---> + и повторите шаги со 2 по 3 для исправления этой строки. ----> ����� ������ � ���� ������ ������ - ����� ������ � ���� ������ ��������� �������. ----> ����� ����� ��������� ��� - ����� ����� ��������� ����� ������. +---> Часть текста в этой строке бессле + Часть текста в этой строке бесследно пропало. +---> Здесь также недостаёт час + Здесь также недостаёт части текста. - 5. ����� ������� ���������� ������, ���������� � ����� 1.1.6. + 5. Когда освоите добавление текста, переходите к уроку 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.6. �������������� � ������ ����� + УРОК 1.1.6. РЕДАКТИРОВАНИЕ И ЗАПИСЬ ФАЙЛА - ** ����� ��������� ���� � ������� ��������, ����������� ������� :wq ** + ** Чтобы сохранить файл и закрыть редактор, используйте команды :wq ** - ��������! ����� ����������� ��������� ���� ��������, �������� ���� ���������! + ВНИМАНИЕ! Перед выполнением описанных ниже действий, прочтите урок полностью! - 1. ��������� ������ ��������� Vim, ��� ������� � ����� 1.1.2 - :q! - ���� ���� ������ � ������� ���������, �� ��� ������ ������� ���������: + 1. Завершите работу редактора Vim, как указано в уроке 1.1.2 - :q! + Если есть доступ к другому терминалу, то там можете сделать следующее: - 2. � ����������� ��������� �������� ������� ������� vim tutor - ��� vim - ������� ��� ������� ��������� Vim, � tutor - ������������ - ����� ��� ��������������. ������� ����� ����, ������� ����� ��������. + 2. В приглашении командной оболочки введите команду vim tutor + где vim - команда для запуска редактора Vim, а tutor - наименование + файла для редактирования. Укажите такой файл, который можно изменять. - 3. ���������� � �������� �����, ��� ������� � ���������� ������. + 3. Вставляйте и удаляйте текст, как описано в предыдущих уроках. - 4. ��������� ���� ����Σ���� ���� � ��������� ������ ��������� Vim, - ������ ������� :wq + 4. Сохраните этот изменённый файл и завершите работу программы Vim, + набрав команду :wq - 5. ���� �� ����� �� vimtutor �� ���� 1, ������������� vimtutor � ���������� - ����� � ������. + 5. Если вы вышли из vimtutor на шаге 1, перезапустите vimtutor и переходите + далее к резюме. - 6. ����� ���� ��� �� ������ � ������ �������������, ��������� ��������� ����. + 6. После того как вы прочли и поняли вышесказанное, выполните описанные шаги. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.1 + РЕЗЮМЕ УРОКА 1.1 - 1. ������� ����� ���������� ���� ��������� �� ���������, ���� ��������� hjkl. - h (�����) j (����) k (�����) l (������) + 1. Каретку можно перемещать либо клавишами со стрелками, либо клавишами hjkl. + h (влево) j (вниз) k (вверх) l (вправо) - 2. ����� ��������� �������� Vim �� ����������� ��������� ��������, �������� - vim ���� + 2. Чтобы запустить редактор Vim из приглашения командной оболочки, наберите + vim ФАЙЛ - 3. ����� ��������� ������ ��������� Vim, ��������� ���� �� ���������: - :q! �� ���� ������� �� ����� ��������� ���������; - ��� - :wq �� ���� ������� ����� ��������� ���������. + 3. Чтобы завершить работу редактора Vim, выполните одно из следующих: + :q! по этой команде не будут сохранены изменения; + или + :wq по этой команде будут сохранены изменения. - 4. ����� ������� ������ ��� ��������, ������� ������� x � ������ ������. + 4. Чтобы удалить символ под кареткой, нажмите клавишу x в режиме команд. - 5. ����� �������� ����� ����� �������� - i �������� ����������� ����� - ����� �������� ����� � ����� ������ - A �������� ����������� ����� + 5. Чтобы вставить текст перед кареткой - i наберите вставляемый текст + Чтобы добавить текст в конце строки - A наберите добавляемый текст -����������. - �� ������� ������� ����� ��������� ������������ ��������� � ����� - ������ � ����������� ��������� ����� ����� ��������� �������. +Примечание. + По нажатию клавиши будет выполнено переключение редактора в режим + команд с прерыванием обработки любой ранее набранной команды. -������ ���������� � ����� 1.2. +Теперь переходите к уроку 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.1. ������� �������� + Урок 1.2.1. КОМАНДЫ УДАЛЕНИЯ - ** ����� ������� ����� ��� ��������, ����������� ������� dw ** + ** Чтобы удалить слово под кареткой, используйте команду dw ** - 1. ����������� �������� � ����� ������, ����� ������� . + 1. Переключите редактор в режим команд, нажав клавишу . - 2. ����������� ������� � ������ ���������� --->. + 2. Переместите каретку к строке помеченной --->. - 3. ���������� ������� �� ������ �����, ������� ������� �������. + 3. Установите каретку на начало слова, которое следует удалить. - 4. �������� dw ��� �������� ����� �����. + 4. Наберите dw для удаления этого слова. -����������. - ��� ������ ����� d ��� ����������� ������ � ����� ������ ������, � - ��������� ����� ������� ����� ��������� �������, � ������ ������ - w - ���� ���-�� �� ����������, ������� ������� � ������� �������. +Примечание. + При наборе буквы d она отобразится справа в самой нижней строке, и + программа будет ожидать ввода следующей команды, в данном случае - w + Если что-то не получается, нажмите клавишу и начните сначала. ----> ��������� ���� ������� � ���� ����������� �������� �������. +---> Несколько слов рафинад в этом предложении автокран излишни. - 5. ��������� ���� 3 � 4, ���� �� ��������� ��� ������, � ���������� � - ����� 1.2.2 + 5. Повторите шаги 3 и 4, пока не исправите все ошибки, и переходите к + уроку 1.2.2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.2. ��� ���� ������� �������� + Урок 1.2.2. ЕЩЁ ОДНА КОМАНДА УДАЛЕНИЯ - ** ����� ������� ����� �� ����� ������, ����������� ������� d$ ** + ** Чтобы удалить текст до конца строки, используйте команду d$ ** - 1. ����������� �������� � ����� ������, ����� ������� . + 1. Переключите редактор в режим команд, нажав клавишу . - 2. ����������� ������� � ������ ���������� --->. + 2. Переместите каретку к строке помеченной --->. - 3. ���������� ������� � ����� ����������� ����������� (����� ������ �����). + 3. Установите каретку в конце корректного предложения (ПОСЛЕ первой точки). - 4. �������� d$ ��� �������� ������� ������. + 4. Наберите d$ для удаления остатка строки. ----> ���-�� ������ ��������� ���� ������ ������. ��������� ���� ������ ������. +---> Кто-то набрал окончание этой строки дважды. окончание этой строки дважды. - 5. ����� ����� ����������� � ��� ��� ��� ����������, ���������� � ����� 1.2.3. + 5. Чтобы лучше разобраться в том как это происходит, обратитесь к уроку 1.2.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.3. ��������� � ������� + Урок 1.2.3. ОПЕРАТОРЫ И ОБЪЕКТЫ - ������ �������, ���������� �����, �������� ���������� � ����������� �� - ��������� � �������, � �������� ����������� ���� ��������. - ���, ��������, ������ ������� �������� � ���������� d ���������: + Многие команды, изменяющие текст, являются составными и формируются из + оператора и объекта, к которому применяется этот оператор. + Так, например, формат команды удаления с оператором d следующий: - d ������ - ��� - d - �������� ��������; - ������ - ������� ������ (������� ����), � ������� ����� �����Σ� ��������. + d объект + где + d - оператор удаления; + объект - область текста (указаны ниже), к которой будет применён оператор. - ������� �������� ��������: - w - �� ������� ������� �� ����� �����, ������� ����������� ������; - e - �� ������� ������� �� ����� �����, �������� ����������� ������; - $ - �� ������� ������� �� ����� ������, ������� ��������� ������. + Краткий перечень объектов: + w - от позиции каретки до конца слова, включая последующий пробел; + e - от позиции каретки до конца слова, исключая последующий пробел; + $ - от позиции каретки до конца строки, включая последний символ. - ����� �������, ���� ������� de ������� �������� ������ �� ������� ������� - �� ����� �����. + Таким образом, ввод команды de вызовет удаление текста от позиции каретки + до конца слова. -����������. - ���� � ������ ������, ��� ����� ��������, ������ ������� � ��������, - � ������� ������������ ������, �� ������� ����� ���������� ���, ��� - ������� � ������� ��������. +Примечание. + Если в режиме команд, без ввода оператор, нажать клавишу с символом, + с которым ассоциирован объект, то каретка будет перемещена так, как + указано в перечне объектов. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.4. ���������� �������� ��������� � ��������� + Урок 1.2.4. ПРИМЕНЕНИЕ СЧЁТЧИКА СОВМЕСТНО С ОБЪЕКТАМИ - ** ����� ����������� ������� ����������� ����������� ���������� ���, - ������� ����� �������� ��������� ����� ** + ** Чтобы перемещение каретка выполнялось необходимое количество раз, + укажите перед объектом требуемое число ** - 1. ���������� ������� �� ������ ������ ���������� --->. + 1. Установите каретку на начало строки помеченной --->. - 2. �������� 2w ��� ����������� ������� ���ң� � ������ ������� �����. + 2. Наберите 2w для перемещения каретки вперёд к началу второго слова. - 3. �������� 3e ��� ����������� ������� ���ң� � ����� �������� �����. + 3. Наберите 3e для перемещения каретки вперёд к концу третьего слова. - 4. �������� 0 (����) ��� ����������� ������� � ������ ������. + 4. Наберите 0 (ноль) для перемещения каретки к началу строки. - 5. ��������� ���� 2 � 3 � ���������� ���������� �����. + 5. Повторите шаги 2 и 3 с различными значениями чисел. ----> ������� ������ �� ����, ����� �� �� ��� ��������������� ���������� �������. +---> Обычная строка из слов, чтобы вы на ней потренировались перемещать каретку. - 6. ����� ������� ���, ���������� � ����� 1.2.5. + 6. Когда освоите это, переходите к уроку 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.5. ���������� �������� ��� �������������� �������� + Урок 1.2.5. ПРИМЕНЕНИЕ СЧЁТЧИКА ДЛЯ МНОЖЕСТВЕННОГО УДАЛЕНИЯ - ** ����� ��������� �������� ��������� ���, ������� ����� ��������� �������� ** + ** Чтобы применить оператор несколько раз, укажите число требуемых повторов ** - ��������� �����ģ���� ����� ��������� ������� �������� � �����������, ������� - ����� �������� ����� �������� ���������� �������� ��������. + Используя приведённые ранее составные команды удаления и перемещения, укажите + перед объектом число повторов выполнения операции удаления. - d ����� ������ + d число объект - 1. ���������� ������� �� ������ ����� �� ��������� ���� � ������ �� ---> + 1. Установите каретку на первом слове из прописных букв в строке со ---> - 2. �������� d2w ��� �������� ���� ������ ���� �� ������ ���� �� ��������� - ����. + 2. Наберите d2w для удаления двух идущих друг за другом слов из прописных + букв. - 3. ��������� ���� 1 � 2 � ��������� ������ �������� ��������, ����� ������� - ������ ���� �� ��������� ���� ����� ��������. + 3. Повторите шаги 1 и 2 с указанием других числовых значений, чтобы удалить + группы слов из прописных букв одной командой. ----> ��� ��� �� ������ ���� �� ��� ������� �� � �� ��� ������ ����. +---> эта АБВ ГД строка ЕЖЗИ КЛ МНО очищена от П РС ТУФ лишних слов. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.6. �������� �� �������� + Урок 1.2.6. ОПЕРАЦИИ СО СТРОКАМИ - ** ����� ������� ������ �������, ����������� ������� dd ** + ** Чтобы удалить строку целиком, используйте команду dd ** - ��� ��� ����� ��������� ��������� �������� ���� ������ �������, ��������� - ��������� ������ ��������� ���� �������, � ���������� ��� ����� ������ - ������ ������ �� ������� � ������ d. + Так как часто требуется выполнять удаление всей строки целиком, создатели + редактора решили облегчить этот процесс, и предложили для этого просто + дважды нажать на клавишу с буквой d. - 1. ����������� ������� � ������ ����� ���, ���������� --->. - 2. �������� dd ��� �������� ������. - 3. ������ ����������� ������� � ������ ����� ������, ���������� --->. - 4. �������� 2dd ��� �������� ���� ����� ������. + 1. Переместите каретку к строке номер два, помеченной --->. + 2. Наберите dd для удаления строки. + 3. Теперь переместите каретку к строке номер четыре, помеченной --->. + 4. Наберите 2dd для удаления двух строк подряд. ----> 1) ����� � ���� �� �������, ----> 2) �, ��� �������� �������� �����! ----> 3) � ����� �� "�����", "�����" - �������! ----> 4) �������� � ����� �� ���� ���������! ----> 5) ��� �������� - ��� �����, ��� �����... ----> 6) � ���� �� �������� � ���� "�" ----> 7) � ����� �� ������� �������� �����. +---> 1) Летом я хожу на стадион, +---> 2) О, как внезапно кончился диван! +---> 3) Я болею за "Зенит", "Зенит" - чемпион! +---> 4) Печально я гляжу на наше поколенье! +---> 5) Его грядущее - иль пусто, иль темно... +---> 6) Я сижу на скамейке в ложе "Б" +---> 7) И играю на большой жестяной трубе. -������������ ��������� ��� ��������� ����� ������ ����������� � � ������� - �����������, � ������� ��������� �����. +Дублирование оператора для обработки целой строки применяется и с другими + операторами, о которых говорится далее. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.7. ������� ������ + Урок 1.2.7. КОМАНДА ОТМЕНЫ - ** ����� �������� ��������� �������� ���������� �������, ������� ������� u - ����� �������� ������ ��� ���� ������, ������� ������� U ** + ** Чтобы отменить результат действия предыдущей команды, нажмите клавишу u + Чтобы отменить правки для всей строки, нажмите клавишу U ** - 1. ���������� ������� �� ������ ������, � ������ ���������� ---> - 2. ������� ������� x ��� �������� ������� ���������� �������. - 3. ������ ������� ������� u ��� ������ ��������� ����������� �������. - 4. ��������� ��� ������ � ������, ��������� ������� x . - 5. ������ ������� ������� U , ����� ������� ��� ������ � �������� ���������. - 6. ������� ������� u ��������� ��� ��� ������ ������� U - � ���������� ������. - 7. ������ ������� ������� CTRL-R (�.��. ��������� ������� ������� CTRL, - ������� ������� r) ��������� ��� ��� �������� �������� ������. + 1. Установите каретку на первой ошибке, в строке помеченной ---> + 2. Нажмите клавишу x для удаления первого ошибочного символа. + 3. Теперь нажмите клавишу u для отмены последней выполненной команды. + 4. Исправьте все ошибки в строке, используя команду x . + 5. Теперь нажмите клавишу U , чтобы вернуть всю строку в исходное состояние. + 6. Нажмите клавишу u несколько раз для отмены команды U + и предыдущих команд. + 7. Теперь нажмите клавиши CTRL-R (т. е. удерживая нажатой клавишу CTRL, + нажмите клавишу r) несколько раз для возврата действий команд. ----> ���������� ������� � ����� ������ � �������� �� �� �������� "������". +---> Испрравьте оошибки в этойй строке и вернитте их сс помощьью "отмены". - 8. ��� ����� ������ � �������� �������. + 8. Это очень нужные и полезные команды. -����� ���������� � ������ ����� 1.2. +Далее переходите к резюме урока 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.2 + РЕЗЮМЕ УРОКА 1.2 - 1. ����� ������� �����, ���������� ������� � ��� ������ � �������� dw - 2. ����� ������� ����� �� ������� ������� �� ����� �����, �������� de - 3. ����� ������� ����� �� ������� ������� �� ����� ������, �������� d$ - 4. ����� ������� ��� ������ �������, �������� dd + 1. Чтобы удалить слово, установите каретку в его начало и наберите dw + 2. Чтобы удалить текст от позиции каретки до конца слова, наберите de + 3. Чтобы удалить текст от позиции каретки до конца строки, наберите d$ + 4. Чтобы удалить всю строку целиком, наберите dd - 5. ����� ����������� ������� �� ���� ��� �� ��������� ���������� ��������, - ������� �� �����, ��������, 2w - 6. ������ ������ ���������: - �������� [�����] ������ - ��� - �������� - ����������� ��������, ��������, d ��� ��������; - [�����] - ���������� ����������� ��� �������� ��������� ��������, - ���� �� �������, �� ���� ������; - ������ - �� ��� ������������ ��������, ��������, w (�����), - $ (�ӣ, ��� ���� �� ����� ������) � �. �. + 5. Чтобы переместить каретку за один раз на некоторое количество объектов, + укажите их число, например, 2w + 6. Формат команд изменения: + оператор [число] объект + где + оператор - необходимые действия, например, d для удаления; + [число] - количество подпадающих под действие оператора объектов, + если не указано, то один объект; + объект - на что воздействует оператор, например, w (слово), + $ (всё, что есть до конца строки) и т. п. - 7. ����� ����������� ������� � ������ ������, ������� ������� 0 (����) + 7. Чтобы переместить каретку к началу строки, нажмите клавишу 0 (ноль) - 8. ����� �������� �������������� ��������, ������� u (�������� ����� u) - ����� �������� ��� ��������� � ������, ������� U (��������� ����� U) - ����� ������� ����Σ���� ���������, ������� CTRL-R + 8. Чтобы отменить предшествующие действия, нажмите u (строчная буква u) + Чтобы отменить все изменения в строке, нажмите U (прописная буква U) + Чтобы вернуть отменённые изменения, нажмите CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.3.1. ������� ������� + Урок 1.3.1. КОМАНДА ВСТАВКИ - ** ����� �������� ��������� ���̣���� �����, �������� ������� p ** + ** Чтобы вставить последний удалённый текст, наберите команду p ** - 1. ����������� ������� � ������ ������ ���������� --->. + 1. Переместите каретку к первой строке помеченной --->. - 2. �������� dd , ����� ������� ������, ��� ���� ��� ����� ������������� - �������� � ����������� ������� ��������� Vim. + 2. Наберите dd , чтобы удалить строку, при этом она будет автоматически + помещена в специальный регистр редактора Vim. - 3. ���������� ������� �� ������ ���� ���, � ������� ������� �������� - ���̣���� ������. + 3. Установите каретку на строку ВЫШЕ той, в которой следует вставить + удалённую строку. - 4. ���������, ��� ��������� � ������ ������ � ������� ������� p ��� ������� - ������ ���� ������� �������. + 4. Убедитесь, что программа в режиме команд и нажмите клавишу p для вставки + строки ниже позиции каретки. - 5. ��������� ���� �� 2 �� 4, ���� �� ���������� ��� ������ � ������ �������. + 5. Повторите шаги со 2 по 4, пока не расставите все строки в нужном порядке. ----> �) � ����� �������� �� ���. ----> �) ����� �� � ����� �������, ----> �) �� ������� ���� �������� ----> �) ��� ���� ����� ������� ������ +---> г) И лучше выдумать не мог. +---> б) Когда не в шутку занемог, +---> в) Он уважать себя заставил +---> а) Мой дядя самых честных правил ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.3.2. ������� ������ + Урок 1.3.2. КОМАНДА ЗАМЕНЫ - ** ����� �������� ������ ��� ��������, �������� r � ���������� ������ ** + ** Чтобы заменить символ под кареткой, наберите r и заменяющий символ ** - 1. ����������� ������� � ������ ������ ���������� --->. + 1. Переместите каретку к первой строке помеченной --->. - 2. ���������� ������� ���, ����� ��� ���������� ��� ������ ��������� ��������. + 2. Установите каретку так, чтобы она находилась над первым ошибочным символом. - 3. ������� ������� r � ����� �������� ������, ������������ ������. + 3. Нажмите клавишу r и затем наберите символ, исправляющий ошибку. - 4. ��������� ���� 2 � 3, ���� ������ ������ �� ����� ��������������� ������. + 4. Повторите шаги 2 и 3, пока первая строка не будет соответствовать второй. ----> � ������ ������ ���� ������ ���0��� � ������ ������� �� ��������! ----> � ������ ������ ���� ������ ���-��� � ������ ������� �� ��������! +---> В момегт набтра этой чтроки кое0кто с трудом попвдал по клваишам! +---> В момент набора этой строки кое-кто с трудом попадал по клавишам! - 5. ������ ���������� � ����� 1.3.3. + 5. Теперь переходите к уроку 1.3.3. -����������. - �������, ��� �� ������ ������� � �������� ������, � �� ������ �������. +Примечание. + Помните, что вы должны учиться в процессе работы, а не просто зубрить. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.3.3. �������� ��������� + Урок 1.3.3. ОПЕРАТОР ИЗМЕНЕНИЯ - ** ����� �������� ��������� �����, �������� ������� ce ** + ** Чтобы изменить окончание слова, наберите команду ce ** - 1. ����������� ������� � ������ ������ ���������� --->. + 1. Переместите каретку к первой строке помеченной --->. - 2. ���������� ������� ��� ������ o � ����� "����". + 2. Установите каретку над буквой o в слове "сола". - 3. �������� ������� ce � ��������� ����� (� ������ ������, �������� "���"). + 3. Наберите команду ce и исправьте слово (в данном случае, наберите "лов"). - 4. ������� ������� � ����������� ������� � ��������� ������ (� ������� - �������, ������� � �������� ���� �������� ��������� �����). + 4. Нажмите клавишу и переместите каретку к следующей ошибке (к первому + символу, начиная с которого надо изменить окончание слова). - 5. ��������� ���� 3 � 4 ���� ������ ������ �� ����� ��������������� ������. + 5. Повторите шаги 3 и 4 пока первая строка не будет соответствовать второй. ----> ��������� ���� � ���� ������ ������� ��������������. ----> ��������� ���� � ���� ������ ������� ��������������. +---> Несколько сола в эьгц строке тпгшцбь редалзкуюиесвх. +---> Несколько слов в этой строке требуют редактирования. -����������. - �������� ��������, ��� �� ������� ce �� ������ ��������� ����� �����, - �� � ���������� ������������ ��������� � ����� �������. - �� ������� cc ����� ���������� �� �� �����, �� ��� ����� ������. +Примечание. + Обратите внимание, что по команде ce не только удаляется часть слова, + но и происходит переключение редактора в режим вставки. + По команде cc будет выполнятся то же самое, но для целой строки. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.3.4. ��� ��������� �������� ������ � ���������� ��������� c + УРОК 1.3.4. ЕЩЁ НЕСКОЛЬКО СПОСОБОВ РАБОТЫ С ОПЕРАТОРОМ ИЗМЕНЕНИЯ c -** � ��������� ��������� ��������� �� �� �������, ��� � � ��������� �������� ** +** К оператору изменения применимы те же объекты, что и к оператору удаления ** - 1. �������� ��������� �������� ���������� ��������� ��������. ������ �������: + 1. Оператор изменения работает аналогично оператору удаления. Формат команды: - c [�����] ������ + c [число] объект - 2. ������� - ��� �� �� �����, ��� � �����: w (�����), $ (����� ������) � �. �. + 2. Объекты - это то же самое, что и ранее: w (слово), $ (конец строки) и т. п. - 3. ����������� ������� � ������ ������ ���������� --->. + 3. Переместите каретку к первой строке помеченной --->. - 4. ���������� ������� �� ������ ������. + 4. Установите каретку на первой ошибке. - 5. �������� c$ � �������������� ������ ������ ���, ����� ��� ��������� �� - ������, ����� ���� ������� ������� . + 5. Наберите c$ и отредактируйте первую строку так, чтобы она совпадала со + второй, после чего нажмите клавишу . ----> ��������� ���� ������ ����� ������� ������� ��� �� ������ ������. ----> ��������� ���� ������ ����� ��������� �������� c$ . +---> Окончание этой строки нужно сделать похожим как во второй строке. +---> Окончание этой строки нужно исправить командой c$ . -����������. - ������� ����� �������������� ��� ����������� ��� ������ ������. +Примечание. + Клавиша может использоваться для исправления при наборе текста. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.3 + РЕЗЮМЕ УРОКА 1.3 - 1. ����� �������� �����, ������� ��� ������ ��� ���̣�, �������� ������� p . - ����� ����� �������� ����� ������� ������� (���� ���� ������� ������, - �� ��� ����� �������� � ������ ���� ������ � ��������). + 1. Чтобы вставить текст, который был только что удалён, наберите команду p . + Текст будет вставлен ПОСЛЕ позиции каретки (если была удалена строка, + то она будет помещена в строке ниже строки с кареткой). - 2. ����� �������� ������ ��� ��������, �������� ������� r � ����� - ���������� ������. + 2. Чтобы заменить символ под кареткой, наберите команду r и затем + заменяющий символ. - 3. ��������� ��������� �������� ��������� ������ ������ �� ������� ������� - �� �������� ����� �����������. - ��������, �� ������� ce ����� �������� ����� �� ������� ������� �� ����� - �����, � �� ������� c$ - �� ����� ������. + 3. Операторы изменения изменяют указанный объект текста от позиции каретки + до конечной точки перемещения. + Например, по команде ce можно изменить текст от позиции каретки до конца + слова, а по команде c$ - до конца строки. - 4. ������ ������ ���������: + 4. Формат команд изменения: - c [�����] ������ + c [число] объект - ��� c - �������� ���������; - [�����] - ���������� ���������� �������� (�������������� �����); - ������ - ������ ������, ������� ����� ����Σ�. + где c - оператор изменения; + [число] - количество изменяемых объектов (необязательная часть); + объект - объект текста, который будет изменён. -������ ���������� � ���������� �����. +Теперь переходите к следующему уроку. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.4.1. ���������� � ����� � ������� ������� + УРОК 1.4.1. ИНФОРМАЦИЯ О ФАЙЛЕ И ПОЗИЦИЯ КАРЕТКИ - ** ����� �������� ���������� � ����� � ������� �������, ������� CTRL-g . - ����� ����������� ������� � �������� ������ � �����, ������� SHIFT-G ** + ** Чтобы получить информацию о файле и позиции каретки, нажмите CTRL-g . + Чтобы переместить каретку к заданной строке в файле, нажмите SHIFT-G ** - ��������! ���������� ���� ����, ������ ��� ��������� ����� ��������! + ВНИМАНИЕ! Прочитайте весь урок, прежде чем выполнять любые действия! - 1. ��������� ������� CTRL , ������� ������� g . ����� ������ �������� - ��������� � ������������� ����� � ������� ������, � ������� ��������� - �������. ��������� ���� ����� ������, �� ����������� �� ���� 3. + 1. Удерживая клавишу CTRL , нажмите клавишу g . Внизу экрана появится + сообщение с наименованием файла и номером строки, в которой находится + каретка. Запомните этот номер строки, он потребуется на шаге 3. - ����������. - ������� ������� ����� ������������ � ������ ������ ���� ���� ���������, - ���� ���������� �������� 'ruler' (��. :help 'ruler'). + Примечание. + Позиция каретки может отображаться в правом нижнем углу окна программы, + если установлен параметр 'ruler' (см. :help 'ruler'). - 2. ������� ������� SHIFT-G ��� ����������� ������� �� ��������� ������ �����. - ������ �������� gg ��� ����������� ������� �� ������ ������ �����. + 2. Нажмите клавиши SHIFT-G для перемещения каретки на последнюю строку файла. + Теперь наберите gg для перемещения каретки на первую строку файла. - 3. �������� ����� ������, ������� ��� ������� �� ���� 1, � ������� ������� - SHIFT-G. ������� ����� ���������� � �� ������, ��� ��� ����������, - ����� � ������ ��� ���� ������ ������� CTRL-g. + 3. Наберите номер строки, которой был получен на шаге 1, и нажмите клавиши + SHIFT-G. Каретка будет перемещена в ту строку, где она находилась, + когда в первый раз были нажаты клавиши CTRL-g. - 4. ���� �� ��������� �ӣ �������������, ��������� ���� � 1 �� 3. + 4. Если вы запомнили всё вышесказанное, выполните шаги с 1 по 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.4.2. ������� ������ + Урок 1.4.2. КОМАНДЫ ПОИСКА - ** ����� ���-�� �����, �������� ������� / � ����� ������� ������� ����� ** + ** Чтобы что-то найти, наберите команду / и затем введите искомую фразу ** - 1. � ������ ������ �������� ������ / . �������� ��������, ��� ���� ������ - ����� ������������ ����� ������. ��� ��, ��� � ��� ������ ������� : + 1. В режиме команд наберите символ / . Обратите внимание, что этот символ + будет отображаться внизу экрана. Так же, как и при наборе команды : - 2. ������ �������� �������� . ��� �� �����, ������� ��������� �����. + 2. Теперь наберите ошшшибка . Это то слово, которое требуется найти. - 3. ����� ��������� ����� �������� �����, ������ ������� ������� n . - ����� ������ ��� ����� � �������� �����������, ������� ������� SHIFT-N . + 3. Чтобы повторить поиск искомого слова, просто нажмите клавишу n . + Чтобы искать это слово в обратном направлении, нажмите клавиши SHIFT-N . - 4. ���� ��������� ����� ��������� ����� � �������� �����������, ����������� - ������� ? ������ ������� / . + 4. Если требуется сразу выполнить поиск в обратном направлении, используйте + команду ? вместо команды / . - 5. ����� ��������� ����, ������ ��� ����� �����, ������� ��������� ��� - ������� CTRL-O . ��� �������� ���ң�, ����������� ������� CTRL-I . + 5. Чтобы вернуться туда, откуда был начат поиск, нажмите несколько раз + клавиши CTRL-O . Для перехода вперёд, используйте команду CTRL-I . ----> "��������" ��� �� ������ ��������� ����� "������"; �������� ��� ������. +---> "ошшшибка" это не способ написания слова "ошибка"; ошшшибка это ошибка. -����������. - ���� ����� ��������� ����� �����, �� ����� ����� ��������� �� ������ �����. +Примечание. + Если будет достигнут конец файла, то поиск будет продолжен от начала файла. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.4.3. ����� ������ ������ + Урок 1.4.3. ПОИСК ПАРНЫХ СКОБОК - ** ����� ����� ������ ������ ��� (, [ ��� {, �������� ������� % ** + ** Чтобы найти парную скобку для (, [ или {, наберите команду % ** - 1. ��������� ������� �� ����� �� ������ (, [ ��� { � ������ ���������� --->. + 1. Поместите каретку на любой из скобок (, [ или { в строке помеченной --->. - 2. ������ ������� �� ���������� ������� � �������� % . + 2. Теперь нажмите на клавиатуре клавишу с символом % . - 3. ������� ����� ���������� �� ������ ������ ��� ��� ������, �� ������� - ����������� �������. + 3. Каретка будет перемещена на парную скобку для той скобки, на которой + установлена каретка. - 4. �������� % ��� �������� ������� ����� � ������ ������ ������. + 4. Наберите % для возврата каретки назад к первой парной скобке. ----> � ���� ( ������ ���� ����� (, ����� [ ] � { ����� } ������. )) +---> В этой ( строке есть такие (, такие [ ] и { такие } скобки. )) -����������. - ��� ����� ������ ��� ������� ��������, ����� � ���� ��������� ������! +Примечание. + Это очень удобно при отладке программ, когда в коде пропущены скобки! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.4.4. ������ ������ ���� + Урок 1.4.4. СПОСОБ ЗАМЕНЫ СЛОВ - ** ����� "���-��" �������� "���-��", �������� ������� :s/���/���/g ** + ** Чтобы "что-то" заменить "чем-то", наберите команду :s/что/чем/g ** - 1. ����������� ������� � ������ ���������� --->. + 1. Переместите каретку к строке помеченной --->. - 2. �������� :s/�����/����� . �������� �������� �� ��, ��� �� ���� - ������� ����� ������ ������ ������� ���������� ��������� � ������. + 2. Наберите :s/уводю/увожу . Обратите внимание на то, что по этой + команде будет замена только первого найденного вхождение в строке. - 3. ������ �������� :s/�����/�����/g , ����������� ���� 'g' �������� - ������ �� ���� ������. ����� ��������� ������ ���� ��������� � ������ - ����������. + 3. Теперь наберите :s/уводю/увожу/g , добавленный флаг 'g' означает + замена во всей строке. Будет выполнена замена всех найденных в строке + совпадений. ----> � ����� � ����������� ��������, � ����� ������ ���������� ����, � ����� - � ������� ����������. +---> Я уводю к отверженным селеньям, я уводю сквозь вековечный стон, я уводю + к забытым поколеньям. - 4. ����� �������� ��� ��������� �������� ����� � �����-�� ��������� �����, - �������� :#,#s/���/���/g ��� #,# - ����� ��������� � �������� ������ - ���������, � ������� ����� ��������� ������. - �������� :%s/���/���/g ����� �������� ��� ��������� �� �ӣ� �����. - �������� :%s/���/���/gc ����� ��������� ������ ������������� - ����� ������ �������. + 4. Чтобы заменить все вхождения искомого слова в каком-то диапазоне строк, + наберите :#,#s/что/чем/g где #,# - номер начальной и конечной строки + диапазона, в котором будет выполнена замена. + Наберите :%s/что/чем/g чтобы заменить все вхождения во всём файле. + Наберите :%s/что/чем/gc чтобы выдавался запрос подтверждения + перед каждой заменой. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.4 + РЕЗЮМЕ УРОКА 1.4 - 1. �� �����ģ���� ���� �������� ����� ���������: - CTRL-g - ����� ���������� � ����� � ������� ������� ������� � ���� ����� - SHIFT-G - ������� �� ��������� ������ ����� - ����� � SHIFT-G - ������� � ������ � ��������� ������� - gg - ������� �� ������ ������ ����� - 2. ��� ����� ������� / � ����������� ������� �����, ����� �������� ����� - ����� ����� ����� �� ������. - ��� ����� ������� ? � ����������� ������� �����, ����� �������� ����� - ����� ����� ����� �� ������. - ����� ������ ������� ����������, ������� n ��� �������� � ���������� - ����� � ��� �� ����������� ������ ��� SHIFT-N ��� ������ � - ��������������� �����������. - ��� ������� ������ CTRL-O ����� ������� � ����������� �����, � ��� - ������� ������ CTRL-I ����� ������� � ����� ���������� �����. - 3. ��� ������� % , ����� ������� �� ����� �� ������ ( ), [ ] ��� { }, - ����� ������� ţ ������ ������. - 4. ����� �������� ������ ��������� ����� � ������, �������� :s/���/��� - ����� �������� ��� ��������� ����� � ������, �������� :s/���/���/g - ����� �������� � ���������� ��������� �����, �������� :#,#s/���/���/g - ����� �������� ��� ��������� ����� � �����, �������� :%s/���/���/g - ����� ������������� �������������, �������� ���� 'c' :%s/���/���/gc + 1. По приведённым ниже командам будет выполнено: + CTRL-g - вывод информации о файле и текущей позиции каретки в этом файле + SHIFT-G - переход на последнюю строку файла + номер и SHIFT-G - переход к строке с указанным номером + gg - переход на первую строку файла + 2. При вводе символа / с последующим набором слова, будет выполнен поиск + этого слова ВПЕРЁД по тексту. + При вводе символа ? с последующим набором слова, будет выполнен поиск + этого слова НАЗАД по тексту. + После показа первого совпадения, нажмите n для перехода к следующему + слову в том же направлении поиска или SHIFT-N для поиска в + противоположном направлении. + При нажатии клавиш CTRL-O будет возврат к предыдущему слову, а при + нажатии клавиш CTRL-I будет переход к ранее найденному слову. + 3. При нажатии % , когда каретка на одной из скобок ( ), [ ] или { }, + будет найдена её парная скобка. + 4. Чтобы заменить первое найденное слово в строке, наберите :s/что/чем + Чтобы заменить все найденные слова в строке, наберите :s/что/чем/g + Чтобы заменить в указанными интервале строк, наберите :#,#s/что/чем/g + Чтобы заменить все найденные слова в файле, наберите :%s/что/чем/g + Чтобы запрашивалось подтверждение, добавьте флаг 'c' :%s/что/чем/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.5.1. ��� ������� �� ��������� ������� ������� + Урок 1.5.1. КАК ВЫЗВАТЬ ИЗ РЕДАКТОРА ВНЕШНЮЮ КОМАНДУ -** ����� ���� ��������� ������� ��������� ��������, �������� � ��������� :! ** +** Чтобы была выполнена команда командной оболочки, наберите в редакторе :! ** - 1. �������� ��� �������� ������� : , ����� ���������� ������� � ��������� - ������ ��������� � ������ ����������� �������. + 1. Наберите уже знакомую команду : , чтобы установить каретку в командной + строке редактора и ввести необходимую команду. - 2. ������ �������� ������ ! (��������������� ����). �� ���� ������� ����� - ������� ��������� ��������� ������� ������� ��������� ��������. + 2. Теперь наберите символ ! (восклицательный знак). По этой команде будет + вызвана указанная следующей внешняя команда командной оболочки. - 3. ��������, �������� ls ����� ����� ! � ������� . ����� ������� - �������� ������ � ������� ��������. �� ���� ����� ��������� ����� �� �� - �����, ��� ���� �� ������ ������� ls � ����������� ��������� ��������. - ���� � ������� �� �������������� ������� ls, �� �������� ������� :!dir + 3. Например, наберите ls сразу после ! и нажмите . Будет выведен + перечень файлов в текущем каталоге. То есть будет выполнено точно то же + самое, как если бы ввести команду ls в приглашении командной оболочки. + Если в системе не поддерживается команда ls, то наберите команду :!dir -����������. - ����� �������� ����� ��������� ����� ������� �������, � ��� ����� � � - ��������� ����������� ���������� ���� �������. +Примечание. + Таким способом можно выполнить любую внешнюю команду, в том числе и с + указанием необходимых аргументов этой команды. -�����. - ����� ����� �������, ������������ � : , ������ ���� ������ ������� - � ���������� ��� ����� �� ����������� ��������, �� ���������������. +Важно. + После ввода команды, начинающейся с : , должна быть нажата клавиша + В дальнейшем это может не указываться отдельно, но подразумеваться. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.5.2. ��� �������� ���� + Урок 1.5.2. КАК ЗАПИСАТЬ ФАЙЛ - ** ����� ��������� ���� �� ����� ����������� � ������, �������� :w ���� ** + ** Чтобы сохранить файл со всеми изменениями в тексте, наберите :w ФАЙЛ ** - 1. �������� :!dir ��� :!ls ��� ��������� ������� ������ � ������� - ��������. ��� �� �������, ����� ������ ������� ������� ������� + 1. Наберите :!dir или :!ls для получения перечня файлов в текущем + каталоге. Как вы помните, после набора команды нажмите клавишу - 2. ���������� �������� ��� �����, ������� �ݣ �� ����������, ��������, TEST. + 2. Придумайте название для файла, которое ещё не существует, например, TEST. - 3. ������ �������� :w TEST (����� TEST - ��� ����������� �������� �����). + 3. Теперь наберите :w TEST (здесь TEST - это придуманное название файла). - 4. �� ���� ������� ����� ��������� �����Σ� ������� ���� ("tutor") ��� ����� - �������� "TEST". ����� ��������� ���, ����� �������� ������� :!dir ��� - :!ls � ����������� ���������� ��������. + 4. По этой команде будет полностью сохранён текущий файл ("tutor") под новым + название "TEST". Чтобы проверить это, снова наберите команду :!dir или + :!ls и просмотрите содержимое каталога. -����������. - ���� ��������� ������ ��������� Vim � ����� ��������� ��� ����� � ������ - TEST (�. �. ������� ������� vim TEST ), ���� ���� ����� ������ ������ - �������� � ��� ������, ����� �� ��� �����Σ�. +Примечание. + Если завершить работу редактора Vim и затем запустить его снова с файлом + TEST (т. е. набрать команду vim TEST ), этот файл будет точной копией + учебника в тот момент, когда он был сохранён. - 5. ������ ������� ���� ����, ������ � ��������� ������� :!del TEST - (��� �� Windows) ��� :!rm TEST (��� UNIX-�������� ��) + 5. Теперь удалите этот файл, набрав в редакторе команду :!del TEST + (для ОС Windows) или :!rm TEST (для UNIX-подобных ОС) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.5.3. ���������� ������ ����� + Урок 1.5.3. ВЫБОРОЧНАЯ ЗАПИСЬ СТРОК - ** ����� ��������� ����� �����, ������� ������� v , �������� ������ - � �������� ������� :w ���� ** + ** Чтобы сохранить часть файла, нажмите клавишу v , выделите строки + и наберите команду :w ФАЙЛ ** - 1. ����������� ������� �� ��� ������. + 1. Переместите каретку на эту строку. - 2. ������� ������� v � ����������� ������� ���� � ������ � ����� �������. - �������� ��������, ��� ����� ���������. + 2. Нажмите клавишу v и переместите каретку ниже к строке с пятым пунктом. + Обратите внимание, что текст подсвечен. - 3. ������� ������� � �������� : � ����� ������ �������� :'<,'> . + 3. Нажмите клавишу с символом : и внизу экрана появится :'<,'> . - 4. �������� ������� w TEST (����� TEST - ����, ������� �ݣ �� ����������). - � ��������� ������ ������ ���� :'<,'>w TEST � ������� ������� + 4. Наберите команду w TEST (здесь TEST - файл, который ещё не существует). + В командной строке должно быть :'<,'>w TEST и нажмите клавишу - 5. �� ���� ������� ��������� ������ ����� �������� � ���� TEST. ��������� � - ������� ����� �����, ���������������� �������� :!dir ��� :!ls . - �� �������� ���� ����, �� ����������� �� ��������� �����. -����������. - �� ������� ������� v ����������� ������������ � ���������� �����. ����� - �������� ������ ��������� �������, ����� ����������� �������. - � ����������� ��������� ����� ��������� ����� ��������, ��������, d - ��� ��� ��������. + 5. По этой команде выбранные строки будут записаны в файл TEST. Убедитесь в + наличии этого файла, воспользовавшись командой :!dir или :!ls . + Не удаляйте этот файл, он потребуется на следующем уроке. +Примечание. + По нажатию клавиши v выполняется переключение в визуальный режим. Чтобы + изменить размер выбранной области, нужно переместить каретку. + К выделенному фрагменту можно применить любой оператор, например, d + для его удаления. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.5.4. ���������� � ����������� ������ + Урок 1.5.4. СЧИТЫВАНИЕ И ОБЪЕДИНЕНИЕ ФАЙЛОВ - ** ����� �������� ������������ � ����� �����, �������� :r ���� ** + ** Чтобы вставить содержащийся в файле текст, наберите :r ФАЙЛ ** - 1. ���������� ������� ��� ���� �������. + 1. Установите каретку над этой строкой. -��������! - ����� ���������� ���������� � ������ 2 �� ������� ����� �� ����� 1.5.3. - ����������� ������� ���� �� ������ �� �������� �����. +Внимание! + После выполнения описанного в пункте 2 вы увидите текст из урока 1.5.3. + Переместите каретку вниз по тексту до текущего урока. - 2. ������ �������� ���������� ����� TEST, ��������� ������� :r TEST , ����� - TEST - ��� ������������ �����. + 2. Теперь считайте содержимое файла TEST, используя команду :r TEST , здесь + TEST - это наименование файла. - 3. ��� ��������, ��� ���������� ����� ���� ���������, ����������� ������� - ����� �� ������ � ��������������, ��� ������ ����� ��� ����� 1.5.3. - - �������� � �� ����� TEST. + 3. Для проверки, что содержимое файла было вставлено, переместите каретку + вверх по тексту и удостоверьтесь, что теперь здесь два урока 1.5.3. - + исходный и из файла TEST. -����������. - �������� ����� � ��������� ������� �������. ��������, �� ������� :r !ls - ����� ������� ����� ������� ls � �������� ���� ������� �������. +Примечание. + Вставить можно и результат внешней команды. Например, по команде :r !ls + будет получен вывод команды ls и вставлен ниже позиции каретки. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.5 + РЕЗЮМЕ УРОКА 1.5 - 1. �� ������� :!command ����� ��������� ��������� ������� �������. + 1. По команде :!command будет исполнена указанная внешняя команда. - ��������� �������� �������: + Некоторые полезные примеры: (Windows) (UNIX) - :!dir :!ls - ������� �������� ������ � ��������; - :!del ���� :!rm ���� - ������� ���� � ��������� �������������. + :!dir :!ls - вывести перечень файлов в каталоге; + :!del ФАЙЛ :!rm ФАЙЛ - удалить файл с указанным наименованием. - 2. �� ������� :w ���� , ������� ������������� ���� ����� ������� - � ��������� �������������. + 2. По команде :w ФАЙЛ , текущий редактируемый файл будет записан + с указанным наименованием. - 3. ��������� ������� v , ����������� ������� � :w ���� ����� ��������� - ��������� ���������� ������ � ���� � ��������� �������������. + 3. Используя команды v , перемещение каретки и :w ФАЙЛ можно сохранить + визуально выделенные строки в файл с указанным наименованием. - 4. �� ������� :r ���� ����� �������� ���� � ��������� ������������� - � ��� ���������� �������� ���� ������� �������. + 4. По команде :r ФАЙЛ будет прочитан файл с указанным наименованием + и его содержимое помещено ниже позиции каретки. - 5. �� ������� :r !dir ����� ������� ����� ������� dir � ����ݣ� ���� - ������� �������. + 5. По команде :r !dir будет получен вывод команды dir и помещён ниже + позиции каретки. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.1. ������� ��� �������� ����� + УРОК 1.6.1. КОМАНДЫ ДЛЯ СОЗДАНИЯ СТРОК - ** ����� ������� ����� ������ � ������������� � ����� �������, �������� o ** + ** Чтобы открыть новую строку с переключением в режим вставки, наберите o ** - 1. ����������� ������� ����, � ������ ������ ���������� --->. + 1. Переместите каретку вниз, к первой строке помеченной --->. - 2. ������� ������� o ��� ����, ����� ������� ������ ������ ���� ������� - ������� � ����������� �������� � ����� �������. + 2. Нажмите клавишу o для того, чтобы создать пустую строку НИЖЕ позиции + каретки и переключить редактор в режим вставки. - 3. ������ �������� �����-������ ����� � ������� ������� ��� ������ �� - ������ �������. + 3. Теперь наберите какой-нибудь текст и нажмите клавишу для выхода из + режима вставки. ----> ����� ������� o ���� ����� ������� ����� ������ ������ � ������ �������. +---> После нажатия o ниже будет открыта новая пустая строка в режиме вставки. - 4. ��� �������� ������ ���� ������� �������, �������� ��������� ����� O , - ������ �������� ����� o . ���������� ��� ������� ��� ������ ����. + 4. Для создания строки ВЫШЕ позиции каретки, наберите прописную букву O , + вместо строчной буквы o . Попробуйте это сделать для строки ниже. ----> �������� ����� ������ ��� ����, �������� ���� ������� � ����� SHIFT-O. +---> Создайте новую строку над этой, поместив сюда каретку и нажав SHIFT-O. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.2. ������� ��� ���������� ������ + УРОК 1.6.2. КОМАНДА ДЛЯ ДОБАВЛЕНИЯ ТЕКСТА - ** ����� �������� ����� ����� ������� �������, �������� a ** + ** Чтобы вставить текст после позиции каретки, наберите a ** - 1. ����������� ������� ����, � ������ ������ ������ ���������� --->. - 2. ������� ������� e , ���� ������� �� �������� �� ��������� ������� ����� - "����". + 1. Переместите каретку вниз, в начало первой строки помеченной --->. + 2. Нажмите клавишу e , пока каретка не окажется на последнем символе слова + "стро". - 3. ������� ������� a ��� ���������� ������ ����� �������, ������������ ��� - ��������. + 3. Нажмите клавишу a для добавления текста ПОСЛЕ символа, находящегося под + кареткой. - 4. �������� ����� ��� � ������ ����. ������� ������� ��� ������ �� - ������ �������. + 4. Допишите слово как в строке ниже. Нажмите клавишу для выхода из + режима вставки. - 5. ����������� ������� e ��� �������� � ���������� �������ۣ����� ����� - � ��������� ��������, ��������� � ������� 3 � 4. + 5. Используйте клавишу e для перехода к следующему незавершённому слову + и повторите действия, описанные в пунктах 3 и 4. ----> �� ���� ���� �� ������ ����������� � ������� ������. ----> �� ���� ������ �� ������ ���������������� � ���������� ������. +---> На этой стро вы можете попрактиков в добавле текста. +---> На этой строке вы можете попрактиковаться в добавлении текста. -����������. - �� ������� a , i � A ����� ��������� ������������ � ���� � ��� �� ����� - �������, �������� ������ � ���, ��� ����������� �������. +Примечание. + По команде a , i и A будет выполнено переключение в один и тот же режим + вставки, различие только в том, где вставляются символы. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.3. ��� ���� ������ ������ + Урок 1.6.3. ЕЩЁ ОДИН СПОСОБ ЗАМЕНЫ - ** ����� �������� ��������� �������� � ������, �������� R ** + ** Чтобы заменить несколько символов в строке, наберите R ** - 1. ����������� ������� � ������ ������� ����� xxx � ������ ���������� ---> + 1. Переместите каретку в начало первого слова xxx в строке помеченной ---> - 2. ������ ������� SHIFT-R � ������� �����, ��������� ���� �� ������ ������, - ����� �������� ������� xxx. + 2. Теперь нажмите SHIFT-R и введите число, указанное ниже во второй строке, + чтобы заменить символы xxx. - 3. ������� ������� ��� ������ �� ������ ������. ��������, ��� ������� - ������ �� ��� ����Σ�. + 3. Нажмите клавишу для выхода из режима замены. Заметьте, что остаток + строки не был изменён. - 4. ��������� ��� ���� ��� ������ ���������� ���� xxx. + 4. Повторите эти шаги для замены оставшихся слов xxx. ----> ��� �������� ����� 123 � ������ xxx ����� ����� xxx. ----> ��� �������� ����� 123 � ������ 456 ����� ����� 579. +---> При сложении числа 123 с числом xxx сумма будет xxx. +---> При сложении числа 123 с числом 456 сумма будет 579. -����������. - ����� ������ ����� �� ����� �������, �� ������ ���ģ���� ������ ������� - ������������ ������ � ������. +Примечание. + Режим замены похож на режим вставки, но каждый введённый символ удаляет + существующий символ в строке. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.4. ����������� � ������� ������ + Урок 1.6.4. КОПИРОВАНИЕ И ВСТАВКА ТЕКСТА -** ����� ����������, ����������� �������� y , ����� �������� - ������� p ** +** Чтобы копировать, используйте оператор y , чтобы вставить - команду p ** - 1. ���������� ������� ����� �������� "�)" � ������, ���������� --->. - 2. ����������� �������� � ���������� ����� �������� v � ����������� ������� - ���ң� �� ����� "������". - 3. ������� ������� y ��� ����������� ������������� ������. - 4. ����������� ������� � ����� ��������� ������, ������ ������� j$ . - 5. ������� ������� p ��� ������� ������. ����� �������� ������� a , - ����������� ����� "������" � ������� ������� . - 6. ��������� ���� � 1 �� 4, ������ ���������� ������� ����� ����� "������", - ��������, ���������� � �������� ����� " �����.". + 1. Установите каретку после символов "а)" в строке, помеченной --->. + 2. Переключите редактор в визуальный режим командой v и переместите каретку + вперёд до слова "первый". + 3. Нажмите клавишу y для копирования подсвеченного текста. + 4. Переместите каретку в конец следующей строки, набрав команду j$ . + 5. Нажмите клавишу p для вставки текста. Затем наберите команду a , + напечатайте слово "второй" и нажмите клавишу . + 6. Повторите шаги с 1 по 4, только установите каретку после слова "первый", + выделите, скопируйте и вставьте слово " пункт.". ----> �) ��� ������ �����. - �) +---> а) Это первый пункт. + б) -����������. - ����� ��������������� �������� yw (�������� y � ������ w) ��� - ����������� ������ �����. - �� ������� yy ����� ����������� ����� ������, � �� ������� p ���������. +Примечание. + Можно воспользоваться командой yw (оператор y и объект w) для + копирования одного слова. + По команде yy будет скопирована целая строка, а по команде p вставлена. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.5. ��������� ���������� + Урок 1.6.5. УСТАНОВКА ПАРАМЕТРОВ - ** ����� ��� ������ ��� ������ �� ���������� ������� ��������, - ������� ��������������� ��������� ** + ** Чтобы при поиске или замене не учитывался регистр символов, + задайте соответствующие настройки ** - 1. ������� ����� "������������", ������ ������� /������������ . - ��������� ����� ��������� ���, ������� ������� n . + 1. Найдите слово "игнорировать", набрав команду /игнорировать . + Повторите поиск несколько раз, нажимая клавишу n . - 2. ���������� �������� 'ic' (������������ �������), ������ ������� :set ic + 2. Установите параметр 'ic' (игнорировать регистр), набрав команду :set ic - 3. �ݣ ��������� ��� ��������� ����� ����� "������������", ������� ������� n - ��������, ��� ������ ����� ������� ����� "������������" � "������������". + 3. Ещё несколько раз повторите поиск слова "игнорировать", нажимая клавишу n + Заметьте, что теперь будут найдены слова "Игнорировать" и "ИГНОРИРОВАТЬ". - 4. ���������� ��������� 'hlsearch' � 'incsearch' �������� :set hls is + 4. Установите параметры 'hlsearch' и 'incsearch' командой :set hls is - 5. �������� ������� ������� ������ � ����������, ��� ��������� /������������ + 5. Повторно введите команду поиска и посмотрите, что получится /игнорировать - 6. ��� �������� �ޣ�� �������� ��� ������, ������� ������� :set noic -����������. - ��� ���������� ��������� ����������, �������� ������� :nohlsearch -����������. - ���� ��������� �� ��������� ������� �������� ������ �����������, ����������� - ���� \c � ������� ������, ��������, /������������\c + 6. Для возврата учёта регистра при поиске, введите команду :set noic +Примечание. + Для отключения подсветки совпадений, наберите команду :nohlsearch +Примечание. + Если требуется не учитывать регистр символов только единоразово, используйте + ключ \c в команде поиска, например, /игнорировать\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.6 + РЕЗЮМЕ УРОКА 1.6 - 1. �� ������� o ����� ������� ������ ������ ���� ������ � �������� - � �������� ����� ���������� � ����� ������� - �� ������� O ����� ������� ������ ������ ���� ������ � �������� - � �������� ����� ���������� � ����� ������� - 2. �� ������� a ����������� ������� ������ ����� ������� �������. - �� ������� A ����������� ������� ������ � ����� ������. + 1. По команде o будет создана пустая строка ниже строки с кареткой + и редактор будет переключен в режим вставки + По команде O будет создана пустая строка выше строки с кареткой + и редактор будет переключен в режим вставки + 2. По команде a выполняется вставки текста ПОСЛЕ позиции каретки. + По команде A выполняется вставки текста в конце строки. - 3. �� ������� e ����������� ��������� ������� � ����� �����. - 4. �������� y ������������ ��� ����������� ������, � �� ������� p - ���������� ������� �������������� ������. + 3. По команде e выполняется установка каретки в конце слова. + 4. Оператор y используется для копирования текста, а по команде p + происходит вставка скопированного текста. - 5. ��� ������� ������ SHIFT-R ����������� ������������ � ����� ������, - � ���������� - �������� ������� . + 5. При нажатии клавиш SHIFT-R выполняется переключение в режим замены, + а отключение - нажатием клавиши . - 6. �������� :set xxx ��� ��������� ��������� 'xxx'. - ��� ��������� ��������� (����� ��������� ������ ��� �����ݣ���� ������������): - 'ic' 'ignorecase' ������������� �������� �������� ��� ������ - 'is' 'incsearch' ����������� ��������� ���������� ��� ������ - 'hls' 'hlsearch' ��������� ���� ���������� ��� ������ + 6. Наберите :set xxx для установки параметра 'xxx'. + Вот некоторые параметры (можно указывать полные или сокращённые наименования): + 'ic' 'ignorecase' игнорирование регистра символов при поиске + 'is' 'incsearch' отображение частичных совпадений при поиске + 'hls' 'hlsearch' подсветка всех совпадений при поиске - 7. ��� ������ ���������, �������� ��������� "no" � ��� �������� :set noic + 7. Для сброса параметра, добавьте приставку "no" к его названию :set noic ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.7.1. ���������� ���������� ������� + УРОК 1.7.1. ВСТРОЕННАЯ СПРАВОЧНАЯ СИСТЕМА - ** ����������� ���������� ���������� ������� ** + ** Используйте встроенную справочную систему ** - � ��������� Vim ������� ������ ���������� ���������� �������, � ����� ������ - �� ������������, �������������� ����� �� �ң� ���������: - - ������� ������� (���� ��� ���� �� ����������) - - ������� ������� (���� ��� ���� �� ����������) - - �������� :help + В редакторе Vim имеется мощная встроенная справочная система, и чтобы начать + ей пользоваться, воспользуйтесь одним из трёх вариантов: + - нажмите клавишу (если она есть на клавиатуре) + - нажмите клавишу (если она есть на клавиатуре) + - наберите :help - ������������ � ����������� � ���� ���������� �������, ����� �������� - ������������� � ���, ��� �������� � �������������. + Ознакомьтесь с информацией в окне справочной системы, чтобы получить + представление о том, как работать с документацией. - ������� CTRL-w CTRL-w ��� ����������� ������� �� ������ ���� � ������ ����. - �������� :q , ����� ������� ���� ���������� ������� (����� ������� - ��������� � ���� ����). + Нажмите CTRL-w CTRL-w для перемещения каретки из одного окна в другое окно. + Наберите :q , чтобы закрыть окно справочной системы (когда каретка + находится в этом окне). - ����� ����� �������� ��� ������ ������� ��� �������, ����� ��������������� - �������� ������� :help. ���������� ��������� (�� �������� ������ ): + Можно найти описание для любого понятия или команды, задав соответствующий + аргумент команде :help. Попробуйте следующее (не забудьте нажать ): :help w :help c_CTRL-D :help insert-index :help user-manual ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.7.2. �������� ���������� ���������� ����� + Урок 1.7.2. СОЗДАНИЕ СТАРТОВОГО КОМАНДНОГО ФАЙЛА - ** ������� ��� ����������� Vim ** + ** Включим все возможности Vim ** - �������� Vim ����� ������������ �� ��������� � ���������� Vi, �� ����������� - �� ���� ������������ ��������� ��� ������� ���������. ����� ������������ - ���� ���������� ���������, ���������� ������� ���� "vimrc". + Редактор Vim более функционален по сравнению с редактором Vi, но большинство + из этих возможностей отключены при запуске программы. Чтобы активировать + весь потенциала редактора, необходимо создать файл "vimrc". - 1. �������� ����� ���� "vimrc". ��� ������������ ������� �� ������������ - �������: - :e ~/.vimrc ��� UNIX - :e $VIM/_vimrc ��� MS Windows + 1. Создайте новый файл "vimrc". Его расположение зависит от используемой + системы: + :e ~/.vimrc для UNIX + :e $VIM/_vimrc для MS Windows - 2. ������ �������� � ���� ���� ���������� ���������� ����� "vimrc" + 2. Теперь добавьте в этот файл содержимое шаблонного файла "vimrc" :r $VIMRUNTIME/vimrc_example.vim - 3. �������� ��������� ���� ���� "vimrc" + 3. Запишите созданный вами файл "vimrc" :w - ������ ��� ��������� ������� ��������� Vim ����� �������� ��������� - ����������. ��� ����������� ��� ��������� ����� ���� ��������� � ���� + Теперь при следующем запуске редактора Vim будет включена подсветка + синтаксиса. Все необходимые вам настройки могут быть добавлены в файл "vimrc". - ����� �������� ��������� ����������, �������� :help vimrc-intro + Чтобы получить подробную информацию, наберите :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.7.3. ����������� ������ + УРОК 1.7.3. ПОДСТАНОВКА КОМАНД -** ����������� � ��������� ������ ����������� �������� ������ CTRL-D � ** +** Подстановка в командной строке выполняется нажатием клавиш CTRL-D и ** - 1. ��������� ������������� � ���������� Vi + 1. Отключите совместимость с редактором Vi :set nocp - 2. ����������, ����� ����� ���� � ��������, ������ ������� - :!ls ��� :!dir - 3. �������� ������ ������� ��� �������� ����� �� �������������� :e - 4. ������� ������� CTRL-D , � ����� ������� �������� ������ ��������� Vim - ������������ � ����� "e". - 5. ������� ������� d , � ����� ����������� ������ �������� ������� + 2. Посмотрите, какие файлы есть в каталоге, набрав команду + :!ls или :!dir + 3. Наберите начало команды для открытия файла на редактирование :e + 4. Нажмите клавиши CTRL-D , и будет показан перечень команд редактора Vim + начинающихся с буквы "e". + 5. Нажмите клавиши d , и будет подставлено полное название команды "edit". - 6. ������ ����������� ������ � ������ ������������ ������������� ����� + 6. Теперь напечатайте пробел и начало наименования существующего файла :edit TE - 7. ������� ������� � ����� ����������� ������������ �����, ���� ��� - ����������. + 7. Нажмите клавишу и будет подставлено наименование файла, если оно + уникальное. -����������. - ����������� �������� ��� ��������� ������. ������ ���������� ������ ������� - CTRL-D � ��� ����� �� ������ ���������. ��� �������� ������� - ��� ������� :help . +Примечание. + Подстановка работает для множества команд. Просто попробуйте нажать клавиши + CTRL-D и для любой из команд редактора. Это особенно полезно + для команды :help . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.7 + РЕЗЮМЕ УРОКА 1.7 - 1. ����� ������� ���� ���������� ���������� ������� ���������, �������� - ������� :help ��� ������� ������� , ��� ������� . + 1. Чтобы открыть окно встроенной справочной системы редактора, наберите + команду :help или нажмите клавишу , или клавишу . - 2. ����� ����� ���������� ���������� � �����-���� �������, - �������� :help cmd (������ "cmd" ������� ������������ �������). + 2. Чтобы найти справочную информацию о какой-либо команде, + наберите :help cmd (вместо "cmd" укажите наименование команды). - 3. ����� ����������� ������� � ������ ����, ������� ������� CTRL-w CTRL-w . + 3. Чтобы переместить каретку в другое окно, нажмите клавиши CTRL-w CTRL-w . - 4. ����� ������� ���� ���������� ������� (���� ��� �������), �������� :q . + 4. Чтобы закрыть окна справочной системы (если оно активно), наберите :q . - 5. ����� ��� ������� ������ ����������� ����������� ��� ���������, �������� - ��������� ��������� ���� vimrc. + 5. Чтобы при запуске всегда применялись необходимые вам настройки, создайте + стартовый командный файл vimrc. - 6. ��� ������ �������, ������������ � ������� : , ������� ������� CTRL-D, - ����� ����������� ��������� �������� �����������. ������� ������� - ��� ����������� ������������ ��������. + 6. При наборе команды, начинающейся с символа : , нажмите клавиши CTRL-D, + чтобы просмотреть возможные варианты подстановки. Нажмите клавишу + для подстановки необходимого варианта. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �� ���� ����� ��������� ������ ����� ������� �����ݣ���� ��������� Vim. - ����� �� ������ ������������ �� ������ ������ �������. + На этом можно завершить первую часть занятий посвящённых редактору Vim. + Далее вы можете ознакомиться со второй частью занятий. - ����� ������� ����� ���� ���� ������� ����� ��������� Vim, ����������� ��� - ����, ����� �� ��������� ���������� ��� ��� �������������. ��� ������ �� - ������ �����, ��������� � ��������� Vim ���� �ݣ �����-����� ������. + Целью данного курса было дать краткий обзор редактора Vim, достаточный для + того, чтобы не возникало сложностей при его использовании. Это далеко не + полный обзор, поскольку в редакторе Vim есть ещё много-много команд. - ����� ��������� ���� ��������, ������������ � ������������ ������������, - ������ ������� :help user-manual. + Чтобы расширить свои познания, ознакомьтесь с руководством пользователя, + набрав команду :help user-manual. - ��� ����������� ������ ������������� ����� - "Vim - Vi Improved", ����� Steve Oualline, ������������ New Riders. - ��� ��������� ��������� ��������� Vim � ����� �������� ������� ��������. - � ����� ������� ��������� �������� � �����������. - ��. https://iccf-holland.org/click5.html + Для дальнейшего чтения рекомендуется книга + "Vim - Vi Improved", автор Steve Oualline, издательство New Riders. + Она полностью посвящена редактору Vim и будет особенно полезна новичкам. + В книге имеется множество примеров и иллюстраций. + См. https://iccf-holland.org/click5.html - �ݣ ���� ����� ����� ���������� �������� � ��������� ������ ��������� Vi, - ��� ��������� Vim, ������ ����� ������������� � ��������� - "Learning the Vi Editor", ����� Linda Lamb, - ������������ O'Reilly & Associates Inc. - ��� ������� �����, ����� ������ �ӣ, ��� ������ ����� ������� � ��������� Vi. - ������ ������� ���� ����� �������� ���������� � ��������� Vim. + Ещё одна книга более почтенного возраста и посвящена больше редактору Vi, + чем редактору Vim, однако также рекомендуется к прочтению + "Learning the Vi Editor", автор Linda Lamb, + издательство O'Reilly & Associates Inc. + Это хорошая книга, чтобы узнать всё, что только можно сделать в редакторе Vi. + Шестое издание этой книги включает информацию о редакторе Vim. - ��� ����� ���� ���������� Michael C. Pierce � Robert K. Ware �� Colorado - School of Mines � �ޣ��� ����, ������������ Charles Smith �� Colorado State - University. E-mail: bware@mines.colorado.edu (������ ����������). + Эти уроки были составлены Michael C. Pierce и Robert K. Ware из Colorado + School of Mines с учётом идей, предложенных Charles Smith из Colorado State + University. E-mail: bware@mines.colorado.edu (теперь недоступен). - ��� ������������� � ��������� Vim ����� ���� ���������� Bram Moolenaar + Для использования в редакторе Vim уроки были доработаны Bram Moolenaar - ������ ����̣�, ������� �� ������� ����, 2002, - ������ �̣���, ������� �� ������� ����, 2014, - Restorer, ���������, 2022, + Андрей Киселёв, перевод на русский язык, 2002, + Сергей Алёшин, перевод на русский язык, 2014, + Restorer, редактура, 2022, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.ru.cp1251 b/runtime/tutor/tutor1.ru.cp1251 deleted file mode 100644 index e972b02af0..0000000000 --- a/runtime/tutor/tutor1.ru.cp1251 +++ /dev/null @@ -1,1017 +0,0 @@ -=============================================================================== -������ 1.7 = ����� ���������� �� ������� �� ��������� Vim = -=============================================================================== -= ����� ������ = -=============================================================================== - - ��������� Vim -- ��� ����� ������ ��������� ��������, ������� ��������� - ������, � ��� �� ������ ���������� ������� � ������ ����� ��������. - ������ �� ������� ������� ��������� �� �������, ������� �������� ��� � - �������� ������������ ��������� Vim � �������� ��������� ������ ����������. - �� �������� ���������� ����� �������� ����������� ����� 30 �����, �� ��� - ������� �� ����, ������� ������� �� ��������� ������������ ��������. - - ��������! �������� ������� ������, �� ������ �������� ����� � ���� �����, - ������� ������ ��� ����������, �������� ����� �����. ����� ����� ����� - �������������� �������, ������� ��� �����������. ���� �� ��������������� - �������� "vimtutor" ��� �������� ����� ��������, ������, ����� ��� �������. - - ����� �������, ��� ���� ������� ������������ ��� ������������� ��������. - ��� ��������, ��� �� ������ ��������� ������� ��� ����, ����� ��� ������� - �� �������. ���� �� ������ ���������� ���� �����, �� �� ��������� �������! - ������, ����������, ��� �� �������� ������� , ������� ������� j - ��������� ���, ���, ����� ���� 1.1.1 ��������� ���������� �� ������. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.1. ����������� ������� - -** ����� ���������� ������� � ��������� ������������, ������� ������� h,j,k,l ** - ^ ���������. - k ������� h ����� � ������ ��� ����������� �����. - < h l > ������� l ������ � ������ ��� ����������� ������. - j ������� j ������ �� ������� "����". - v - 1. ����������� ������� � ������ ������������, ���� �� ������� �����������. - - 2. ����������� ������� ������� "����" (j) ��� ������������� ����������� - �������. ������ �� ������, ��� ������� � ���������� �����. - - 3. ��������� ������� "����", �� ���� j , ��������� � ����� 1.1.2. - -�����. - ���� �� �� ������� � ������������ ���������� ������, ������� ������� , - ����� ����������� �������� � ����� ������. ����� ����� ��������� �����. - -����������. - ������� ���������� �������� (�������) ����� ������ ��������. �� ������, ��� - ��������� ����������� ������� ��������� h j k l ������� �������, ����� - ������ ������� ���������������. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.2. ���������� ������ ��������� - - ��������! ����� ����������� ��������� ���� ��������, �������� ���� ���������! - - 1. ������� ������� (����� ���� ���������, ��� ��������� ��������� � - ������ ������). - - 2. �������� :q! - ��� ��������, ��� ���� ������� ��� ������� :q! � ������ ������� <����> - ���������� ���� ������� ������� ���������� ������ ��������� - ��� ���������� ����� ��������� ���������. - - 3. � ����������� ��������� �������� �������� �������, ������� �� ��������� - ���� �������. ��� ����� ���� vimtutor - - 4. ���� ������� � ���, ��� ������ ����� ��������������, ��������� ���� - � 1 �� 3, ����� ��������� ������ � ����� ��������� ��������. - -����������. - �� ������� :q! ����� �������� ����� ��������� ���������. ����� - ��������� ������ �� �������, ��� ��������� ��������� � ����. - - 5. ����������� ������� ���� � ����� 1.1.3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.3. �������������� - �������� ������ - - ** ����� ������� ������ ��� ��������, ������� ������� x ** - - 1. ����������� ������� � ������ ���������� --->. - - 2. ����� ��������� ������, ����������� �������, ���� ��� �� �������� ��� - ��������� ��������. - - 3. ������� ������� x ��� �������� ���������� �������. - - 4. ��������� ���� �� 2 �� 4, ���� ������ �� ����� ����������. - - ----> �� �������� ������ ������ ��� ������ �������. - - 5. ������, ����� ������ ����������, ���������� � ����� 1.1.4. - -����������. - � ���� ���� ������� �� ��������� ����� �� ����������, ������� � �������� - ������. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.4. �������������� - ������� ������ - - ** ����� �������� �����, ������� ������� i ** - - 1. ����������� ������� � ������ ������ ���������� --->. - - 2. ����� ������� ������ ������ ���������� ������, ���������� ������� �� ��� - ������, ����� ������� ������� �������� �����. - - 3. ������� ������� i � �������� �����, ������� ��������� ��������. - - 4. ����� ����������� ������� ���������� �����, ������� ������� - ��� ������������ � ����� ������. - ��������� ���� �� 2 �� 4, ���� ����������� �� ����� ���������� ���������. - - ----> ����� ����� � ������ ��������� . ----> ����� ������ � ���� ������ ��������� �������. - - - 5. ����� ������� ������� ������, ���������� � ����� 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.5. �������������� - ���������� ������ - - ** ����� �������� �����, ������� ������� A ** - - 1. ����������� ������� � ������ ������ ���������� --->. - ������ �������, �� ����� ������� ����������� ������� � ���� ������. - - 2. ������� ������� A � �������� �����, ������� ��������� ��������. - - 3. ����� ���������� ������ ������� ������� ��� �������� � ����� ������. - - 4. ����������� ������� �� ��������� ������, ���������� ---> - � ��������� ���� �� 2 �� 3 ��� ����������� ���� ������. - ----> ����� ������ � ���� ������ ������ - ����� ������ � ���� ������ ��������� �������. ----> ����� ����� �������� ��� - ����� ����� �������� ����� ������. - - 5. ����� ������� ���������� ������, ���������� � ����� 1.1.6. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.1.6. �������������� � ������ ����� - - ** ����� ��������� ���� � ������� ��������, ����������� ������� :wq ** - - ��������! ����� ����������� ��������� ���� ��������, �������� ���� ���������! - - 1. ��������� ������ ��������� Vim, ��� ������� � ����� 1.1.2 - :q! - ���� ���� ������ � ������� ���������, �� ��� ������ ������� ���������: - - 2. � ����������� ��������� �������� ������� ������� vim tutor - ��� vim - ������� ��� ������� ��������� Vim, � tutor - ������������ - ����� ��� ��������������. ������� ����� ����, ������� ����� ��������. - - 3. ���������� � �������� �����, ��� ������� � ���������� ������. - - 4. ��������� ���� ���������� ���� � ��������� ������ ��������� Vim, - ������ ������� :wq - - 5. ���� �� ����� �� vimtutor �� ���� 1, ������������� vimtutor � ���������� - ����� � ������. - - 6. ����� ���� ��� �� ������ � ������ �������������, ��������� ��������� ����. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.1 - - 1. ������� ����� ���������� ���� ��������� �� ���������, ���� ��������� hjkl. - h (�����) j (����) k (�����) l (������) - - 2. ����� ��������� �������� Vim �� ����������� ��������� ��������, �������� - vim ���� - - 3. ����� ��������� ������ ��������� Vim, ��������� ���� �� ���������: - :q! �� ���� ������� �� ����� ��������� ���������; - ��� - :wq �� ���� ������� ����� ��������� ���������. - - 4. ����� ������� ������ ��� ��������, ������� ������� x � ������ ������. - - 5. ����� �������� ����� ����� �������� - i �������� ����������� ����� - ����� �������� ����� � ����� ������ - A �������� ����������� ����� - -����������. - �� ������� ������� ����� ��������� ������������ ��������� � ����� - ������ � ����������� ��������� ����� ����� ��������� �������. - -������ ���������� � ����� 1.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.1. ������� �������� - - ** ����� ������� ����� ��� ��������, ����������� ������� dw ** - - 1. ����������� �������� � ����� ������, ����� ������� . - - 2. ����������� ������� � ������ ���������� --->. - - 3. ���������� ������� �� ������ �����, ������� ������� �������. - - 4. �������� dw ��� �������� ����� �����. - -����������. - ��� ������ ����� d ��� ����������� ������ � ����� ������ ������, � - ��������� ����� ������� ����� ��������� �������, � ������ ������ - w - ���� ���-�� �� ����������, ������� ������� � ������� �������. - ----> ��������� ���� ������� � ���� ����������� �������� �������. - - 5. ��������� ���� 3 � 4, ���� �� ��������� ��� ������, � ���������� � - ����� 1.2.2 - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.2. �٨ ���� ������� �������� - - - ** ����� ������� ����� �� ����� ������, ����������� ������� d$ ** - - 1. ����������� �������� � ����� ������, ����� ������� . - - 2. ����������� ������� � ������ ���������� --->. - - 3. ���������� ������� � ����� ����������� ����������� (����� ������ �����). - - 4. �������� d$ ��� �������� ������� ������. - - ----> ���-�� ������ ��������� ���� ������ ������. ��������� ���� ������ ������. - - - 5. ����� ����� ����������� � ��� ��� ��� ����������, ���������� � ����� 1.2.3. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.3. ��������� � ������� - - ������ �������, ���������� �����, �������� ���������� � ����������� �� - ��������� � �������, � �������� ����������� ���� ��������. - ���, ��������, ������ ������� �������� � ���������� d ���������: - - d ������ - ��� - d - �������� ��������; - ������ - ������� ������ (������� ����), � ������� ����� �������� ��������. - - ������� �������� ��������: - w - �� ������� ������� �� ����� �����, ������� ����������� ������; - e - �� ������� ������� �� ����� �����, �������� ����������� ������; - $ - �� ������� ������� �� ����� ������, ������� ��������� ������. - - ����� �������, ���� ������� de ������� �������� ������ �� ������� ������� - �� ����� �����. - -����������. - ���� � ������ ������, ��� ����� ��������, ������ ������� � ��������, - � ������� ������������ ������, �� ������� ����� ���������� ���, ��� - ������� � ������� ��������. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.4. ���������� �ר����� ��������� � ��������� - - ** ����� ����������� ������� ����������� ����������� ���������� ���, - ������� ����� �������� ��������� ����� ** - - - 1. ���������� ������� �� ������ ������ ���������� --->. - - 2. �������� 2w ��� ����������� ������� ����� � ������ ������� �����. - - 3. �������� 3e ��� ����������� ������� ����� � ����� �������� �����. - - 4. �������� 0 (����) ��� ����������� ������� � ������ ������. - - 5. ��������� ���� 2 � 3 � ���������� ���������� �����. - - ----> ������� ������ �� ����, ����� �� �� ��� ��������������� ���������� �������. - - - 6. ����� ������� ���, ���������� � ����� 1.2.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.5. ���������� �ר����� ��� �������������� �������� - - ** ����� ��������� �������� ��������� ���, ������� ����� ��������� �������� ** - - ��������� ���������� ����� ��������� ������� �������� � �����������, ������� - ����� �������� ����� �������� ���������� �������� ��������. - - d ����� ������ - - 1. ���������� ������� �� ������ ����� �� ��������� ���� � ������ �� ---> - - 2. �������� d2w ��� �������� ���� ������ ���� �� ������ ���� �� ��������� - ����. - - 3. ��������� ���� 1 � 2 � ��������� ������ �������� ��������, ����� ������� - ������ ���� �� ��������� ���� ����� ��������. - - ----> ��� ��� �� ������ ���� �� ��� ������� �� � �� ��� ������ ����. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.6. �������� �� �������� - - ** ����� ������� ������ �������, ����������� ������� dd ** - - ��� ��� ����� ��������� ��������� �������� ���� ������ �������, ��������� - ��������� ������ ��������� ���� �������, � ���������� ��� ����� ������ - ������ ������ �� ������� � ������ d. - - 1. ����������� ������� � ������ ����� ���, ���������� --->. - 2. �������� dd ��� �������� ������. - 3. ������ ����������� ������� � ������ ����� ������, ���������� --->. - 4. �������� 2dd ��� �������� ���� ����� ������. - ----> 1) ����� � ���� �� �������, ----> 2) �, ��� �������� �������� �����! ----> 3) � ����� �� "�����", "�����" - �������! ----> 4) �������� � ����� �� ���� ���������! ----> 5) ��� �������� - ��� �����, ��� �����... ----> 6) � ���� �� �������� � ���� "�" ----> 7) � ����� �� ������� �������� �����. - -������������ ��������� ��� ��������� ����� ������ ����������� � � ������� - �����������, � ������� ��������� �����. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.2.7. ������� ������ - - ** ����� �������� ��������� �������� ���������� �������, ������� ������� u - ����� �������� ������ ��� ���� ������, ������� ������� U ** - - 1. ���������� ������� �� ������ ������, � ������ ���������� ---> - 2. ������� ������� x ��� �������� ������� ���������� �������. - 3. ������ ������� ������� u ��� ������ ��������� ����������� �������. - 4. ��������� ��� ������ � ������, ��������� ������� x . - 5. ������ ������� ������� U , ����� ������� ��� ������ � �������� ���������. - 6. ������� ������� u ��������� ��� ��� ������ ������� U - � ���������� ������. - 7. ������ ������� ������� CTRL-R (�.��. ��������� ������� ������� CTRL, - ������� ������� r) ��������� ��� ��� �������� �������� ������. - - ----> ���������� ������� � ����� ������ � �������� �� �� �������� "������". - - - 8. ��� ����� ������ � �������� �������. - -����� ���������� � ������ ����� 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.2 - - 1. ����� ������� �����, ���������� ������� � ��� ������ � �������� dw - 2. ����� ������� ����� �� ������� ������� �� ����� �����, �������� de - 3. ����� ������� ����� �� ������� ������� �� ����� ������, �������� d$ - 4. ����� ������� ��� ������ �������, �������� dd - - 5. ����� ����������� ������� �� ���� ��� �� ��������� ���������� ��������, - ������� �� �����, ��������, 2w - 6. ������ ������ ���������: - �������� [�����] ������ - ��� - �������� - ����������� ��������, ��������, d ��� ��������; - [�����] - ���������� ����������� ��� �������� ��������� ��������, - ���� �� �������, �� ���� ������; - ������ - �� ��� ������������ ��������, ��������, w (�����), - $ (��, ��� ���� �� ����� ������) � �. �. - - 7. ����� ����������� ������� � ������ ������, ������� ������� 0 (����) - - 8. ����� �������� �������������� ��������, ������� u (�������� ����� u) - ����� �������� ��� ��������� � ������, ������� U (��������� ����� U) - ����� ������� ���������� ���������, ������� CTRL-R -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.3.1. ������� ������� - - ** ����� �������� ��������� �������� �����, �������� ������� p ** - - 1. ����������� ������� � ������ ������ ���������� --->. - - 2. �������� dd , ����� ������� ������, ��� ���� ��� ����� ������������� - �������� � ����������� ������� ��������� Vim. - - 3. ���������� ������� �� ������ ���� ���, � ������� ������� �������� - �������� ������. - - 4. ���������, ��� ��������� � ������ ������ � ������� ������� p ��� ������� - ������ ���� ������� �������. - - 5. ��������� ���� �� 2 �� 4, ���� �� ���������� ��� ������ � ������ �������. - ----> �) � ����� �������� �� ���. ----> �) ����� �� � ����� �������, ----> �) �� ������� ���� �������� ----> �) ��� ���� ����� ������� ������ - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.3.2. ������� ������ - - ** ����� �������� ������ ��� ��������, �������� r � ���������� ������ ** - - 1. ����������� ������� � ������ ������ ���������� --->. - - 2. ���������� ������� ���, ����� ��� ���������� ��� ������ ��������� ��������. - - 3. ������� ������� r � ����� �������� ������, ������������ ������. - - 4. ��������� ���� 2 � 3, ���� ������ ������ �� ����� ��������������� ������. - - ----> � ������ ������ ���� ������ ���0��� � ������ ������� �� ��������! ----> � ������ ������ ���� ������ ���-��� � ������ ������� �� ��������! - - - 5. ������ ���������� � ����� 1.3.3. - -����������. - �������, ��� �� ������ ������� � �������� ������, � �� ������ �������. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.3.3. �������� ��������� - - ** ����� �������� ��������� �����, �������� ������� ce ** - - 1. ����������� ������� � ������ ������ ���������� --->. - - 2. ���������� ������� ��� ������ o � ����� "����". - - 3. �������� ������� ce � ��������� ����� (� ������ ������, �������� "���"). - - 4. ������� ������� � ����������� ������� � ��������� ������ (� ������� - �������, ������� � �������� ���� �������� ��������� �����). - - 5. ��������� ���� 3 � 4 ���� ������ ������ �� ����� ��������������� ������. - ----> ��������� ���� � ���� ������ ������� ��������������. ----> ��������� ���� � ���� ������ ������� ��������������. - -����������. - �������� ��������, ��� �� ������� ce �� ������ ��������� ����� �����, - �� � ���������� ������������ ��������� � ����� �������. - �� ������� cc ����� ���������� �� �� �����, �� ��� ����� ������. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.3.4. �٨ ��������� �������� ������ � ���������� ��������� c - -** � ��������� ��������� ��������� �� �� �������, ��� � � ��������� �������� ** - - 1. �������� ��������� �������� ���������� ��������� ��������. ������ �������: - - c [�����] ������ - - 2. ������� - ��� �� �� �����, ��� � �����: w (�����), $ (����� ������) � �. �. - - 3. ����������� ������� � ������ ������ ���������� --->. - - 4. ���������� ������� �� ������ ������. - - 5. �������� c$ � �������������� ������ ������ ���, ����� ��� ��������� �� - ������, ����� ���� ������� ������� . - ----> ��������� ���� ������ ����� ������� ������� ��� �� ������ ������. ----> ��������� ���� ������ ����� ��������� �������� c$ . - -����������. - ������� ����� �������������� ��� ����������� ��� ������ ������. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.3 - - 1. ����� �������� �����, ������� ��� ������ ��� �����, �������� ������� p . - ����� ����� �������� ����� ������� ������� (���� ���� ������� ������, - �� ��� ����� �������� � ������ ���� ������ � ��������). - - 2. ����� �������� ������ ��� ��������, �������� ������� r � ����� - ���������� ������. - - 3. ��������� ��������� �������� ��������� ������ ������ �� ������� ������� - �� �������� ����� �����������. - ��������, �� ������� ce ����� �������� ����� �� ������� ������� �� ����� - �����, � �� ������� c$ - �� ����� ������. - - 4. ������ ������ ���������: - - c [�����] ������ - - ��� c - �������� ���������; - [�����] - ���������� ���������� �������� (�������������� �����); - ������ - ������ ������, ������� ����� �������. - -������ ���������� � ���������� �����. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.4.1. ���������� � ����� � ������� ������� - - ** ����� �������� ���������� � ����� � ������� �������, ������� CTRL-g . - ����� ����������� ������� � �������� ������ � �����, ������� SHIFT-G ** - - ��������! ���������� ���� ����, ������ ��� ��������� ����� ��������! - - 1. ��������� ������� CTRL , ������� ������� g . ����� ������ �������� - ��������� � ������������� ����� � ������� ������, � ������� ��������� - �������. ��������� ���� ����� ������, �� ����������� �� ���� 3. - - ����������. - ������� ������� ����� ������������ � ������ ������ ���� ���� ���������, - ���� ���������� �������� 'ruler' (��. :help 'ruler'). - - 2. ������� ������� SHIFT-G ��� ����������� ������� �� ��������� ������ �����. - ������ �������� gg ��� ����������� ������� �� ������ ������ �����. - - 3. �������� ����� ������, ������� ��� ������� �� ���� 1, � ������� ������� - SHIFT-G. ������� ����� ���������� � �� ������, ��� ��� ����������, - ����� � ������ ��� ���� ������ ������� CTRL-g. - - 4. ���� �� ��������� �� �������������, ��������� ���� � 1 �� 3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.4.2. ������� ������ - - ** ����� ���-�� �����, �������� ������� / � ����� ������� ������� ����� ** - - 1. � ������ ������ �������� ������ / . �������� ��������, ��� ���� ������ - ����� ������������ ����� ������. ��� ��, ��� � ��� ������ ������� : - - 2. ������ �������� �������� . ��� �� �����, ������� ��������� �����. - - 3. ����� ��������� ����� �������� �����, ������ ������� ������� n . - ����� ������ ��� ����� � �������� �����������, ������� ������� SHIFT-N . - - 4. ���� ��������� ����� ��������� ����� � �������� �����������, ����������� - ������� ? ������ ������� / . - - 5. ����� ��������� ����, ������ ��� ����� �����, ������� ��������� ��� - ������� CTRL-O . ��� �������� �����, ����������� ������� CTRL-I . - ----> "��������" ��� �� ������ ��������� ����� "������"; �������� ��� ������. - -����������. - ���� ����� ��������� ����� �����, �� ����� ����� ��������� �� ������ �����. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.4.3. ����� ������ ������ - - ** ����� ����� ������ ������ ��� (, [ ��� {, �������� ������� % ** - - 1. ��������� ������� �� ����� �� ������ (, [ ��� { � ������ ���������� --->. - - 2. ������ ������� �� ���������� ������� � �������� % . - - 3. ������� ����� ���������� �� ������ ������ ��� ��� ������, �� ������� - ����������� �������. - - 4. �������� % ��� �������� ������� ����� � ������ ������ ������. - - ----> � ���� ( ������ ���� ����� (, ����� [ ] � { ����� } ������. )) - - -����������. - ��� ����� ������ ��� ������� ��������, ����� � ���� ��������� ������! - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.4.4. ������ ������ ���� - - ** ����� "���-��" �������� "���-��", �������� ������� :s/���/���/g ** - - 1. ����������� ������� � ������ ���������� --->. - - 2. �������� :s/�����/����� . �������� �������� �� ��, ��� �� ���� - ������� ����� ������ ������ ������� ���������� ��������� � ������. - - 3. ������ �������� :s/�����/�����/g , ����������� ���� 'g' �������� - ������ �� ���� ������. ����� ��������� ������ ���� ��������� � ������ - ����������. - ----> � ����� � ����������� ��������, � ����� ������ ���������� ����, � ����� - � ������� ����������. - - 4. ����� �������� ��� ��������� �������� ����� � �����-�� ��������� �����, - �������� :#,#s/���/���/g ��� #,# - ����� ��������� � �������� ������ - ���������, � ������� ����� ��������� ������. - �������� :%s/���/���/g ����� �������� ��� ��������� �� ��� �����. - �������� :%s/���/���/gc ����� ��������� ������ ������������� - ����� ������ �������. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.4 - - 1. �� ���������� ���� �������� ����� ���������: - CTRL-g - ����� ���������� � ����� � ������� ������� ������� � ���� ����� - SHIFT-G - ������� �� ��������� ������ ����� - ����� � SHIFT-G - ������� � ������ � ��������� ������� - gg - ������� �� ������ ������ ����� - 2. ��� ����� ������� / � ����������� ������� �����, ����� �������� ����� - ����� ����� ���Ш� �� ������. - ��� ����� ������� ? � ����������� ������� �����, ����� �������� ����� - ����� ����� ����� �� ������. - ����� ������ ������� ����������, ������� n ��� �������� � ���������� - ����� � ��� �� ����������� ������ ��� SHIFT-N ��� ������ � - ��������������� �����������. - ��� ������� ������ CTRL-O ����� ������� � ����������� �����, � ��� - ������� ������ CTRL-I ����� ������� � ����� ���������� �����. - 3. ��� ������� % , ����� ������� �� ����� �� ������ ( ), [ ] ��� { }, - ����� ������� � ������ ������. - 4. ����� �������� ������ ��������� ����� � ������, �������� :s/���/��� - ����� �������� ��� ��������� ����� � ������, �������� :s/���/���/g - ����� �������� � ���������� ��������� �����, �������� :#,#s/���/���/g - ����� �������� ��� ��������� ����� � �����, �������� :%s/���/���/g - ����� ������������� �������������, �������� ���� 'c' :%s/���/���/gc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.5.1. ��� ������� �� ��������� ������� ������� - -** ����� ���� ��������� ������� ��������� ��������, �������� � ��������� :! ** - - 1. �������� ��� �������� ������� : , ����� ���������� ������� � ��������� - ������ ��������� � ������ ����������� �������. - - 2. ������ �������� ������ ! (��������������� ����). �� ���� ������� ����� - ������� ��������� ��������� ������� ������� ��������� ��������. - - 3. ��������, �������� ls ����� ����� ! � ������� . ����� ������� - �������� ������ � ������� ��������. �� ���� ����� ��������� ����� �� �� - �����, ��� ���� �� ������ ������� ls � ����������� ��������� ��������. - ���� � ������� �� �������������� ������� ls, �� �������� ������� :!dir - -����������. - ����� �������� ����� ��������� ����� ������� �������, � ��� ����� � � - ��������� ����������� ���������� ���� �������. - -�����. - ����� ����� �������, ������������ � : , ������ ���� ������ ������� - � ���������� ��� ����� �� ����������� ��������, �� ���������������. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.5.2. ��� �������� ���� - - ** ����� ��������� ���� �� ����� ����������� � ������, �������� :w ���� ** - - 1. �������� :!dir ��� :!ls ��� ��������� ������� ������ � ������� - ��������. ��� �� �������, ����� ������ ������� ������� ������� - - 2. ���������� �������� ��� �����, ������� ��� �� ����������, ��������, TEST. - - 3. ������ �������� :w TEST (����� TEST - ��� ����������� �������� �����). - - 4. �� ���� ������� ����� ��������� �������� ������� ���� ("tutor") ��� ����� - �������� "TEST". ����� ��������� ���, ����� �������� ������� :!dir ��� - :!ls � ����������� ���������� ��������. - -����������. - ���� ��������� ������ ��������� Vim � ����� ��������� ��� ����� � ������ - TEST (�. �. ������� ������� vim TEST ), ���� ���� ����� ������ ������ - �������� � ��� ������, ����� �� ��� ��������. - - 5. ������ ������� ���� ����, ������ � ��������� ������� :!del TEST - (��� �� Windows) ��� :!rm TEST (��� UNIX-�������� ��) - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.5.3. ���������� ������ ����� - - ** ����� ��������� ����� �����, ������� ������� v , �������� ������ - � �������� ������� :w ���� ** - - 1. ����������� ������� �� ��� ������. - - 2. ������� ������� v � ����������� ������� ���� � ������ � ����� �������. - �������� ��������, ��� ����� ���������. - - 3. ������� ������� � �������� : � ����� ������ �������� :'<,'> . - - 4. �������� ������� w TEST (����� TEST - ����, ������� ��� �� ����������). - � ��������� ������ ������ ���� :'<,'>w TEST � ������� ������� - - 5. �� ���� ������� ��������� ������ ����� �������� � ���� TEST. ��������� � - ������� ����� �����, ���������������� �������� :!dir ��� :!ls . - �� �������� ���� ����, �� ����������� �� ��������� �����. -����������. - �� ������� ������� v ����������� ������������ � ���������� �����. ����� - �������� ������ ��������� �������, ����� ����������� �������. - � ����������� ��������� ����� ��������� ����� ��������, ��������, d - ��� ��� ��������. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.5.4. ���������� � ����������� ������ - - ** ����� �������� ������������ � ����� �����, �������� :r ���� ** - - 1. ���������� ������� ��� ���� �������. - -��������! - ����� ���������� ���������� � ������ 2 �� ������� ����� �� ����� 1.5.3. - ����������� ������� ���� �� ������ �� �������� �����. - - 2. ������ �������� ���������� ����� TEST, ��������� ������� :r TEST , ����� - TEST - ��� ������������ �����. - - 3. ��� ��������, ��� ���������� ����� ���� ���������, ����������� ������� - ����� �� ������ � ��������������, ��� ������ ����� ��� ����� 1.5.3. - - �������� � �� ����� TEST. - -����������. - �������� ����� � ��������� ������� �������. ��������, �� ������� :r !ls - ����� ������� ����� ������� ls � �������� ���� ������� �������. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.5 - - 1. �� ������� :!command ����� ��������� ��������� ������� �������. - - ��������� �������� �������: - (Windows) (UNIX) - :!dir :!ls - ������� �������� ������ � ��������; - :!del ���� :!rm ���� - ������� ���� � ��������� �������������. - - 2. �� ������� :w ���� , ������� ������������� ���� ����� ������� - � ��������� �������������. - - 3. ��������� ������� v , ����������� ������� � :w ���� ����� ��������� - ��������� ���������� ������ � ���� � ��������� �������������. - - 4. �� ������� :r ���� ����� �������� ���� � ��������� ������������� - � ��� ���������� �������� ���� ������� �������. - - 5. �� ������� :r !dir ����� ������� ����� ������� dir � ������� ���� - ������� �������. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.1. ������� ��� �������� ����� - - ** ����� ������� ����� ������ � ������������� � ����� �������, �������� o ** - - 1. ����������� ������� ����, � ������ ������ ���������� --->. - - 2. ������� ������� o ��� ����, ����� ������� ������ ������ ���� ������� - ������� � ����������� �������� � ����� �������. - - 3. ������ �������� �����-������ ����� � ������� ������� ��� ������ �� - ������ �������. - ----> ����� ������� o ���� ����� ������� ����� ������ ������ � ������ �������. - - - 4. ��� �������� ������ ���� ������� �������, �������� ��������� ����� O , - ������ �������� ����� o . ���������� ��� ������� ��� ������ ����. - - ----> �������� ����� ������ ��� ����, �������� ���� ������� � ����� SHIFT-O. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.2. ������� ��� ���������� ������ - - ** ����� �������� ����� ����� ������� �������, �������� a ** - - 1. ����������� ������� ����, � ������ ������ ������ ���������� --->. - 2. ������� ������� e , ���� ������� �� �������� �� ��������� ������� ����� - "����". - - 3. ������� ������� a ��� ���������� ������ ����� �������, ������������ ��� - ��������. - - 4. �������� ����� ��� � ������ ����. ������� ������� ��� ������ �� - ������ �������. - - 5. ����������� ������� e ��� �������� � ���������� �������������� ����� - � ��������� ��������, ��������� � ������� 3 � 4. - ----> �� ���� ���� �� ������ ����������� � ������� ������. ----> �� ���� ������ �� ������ ���������������� � ���������� ������. - -����������. - �� ������� a , i � A ����� ��������� ������������ � ���� � ��� �� ����� - �������, �������� ������ � ���, ��� ����������� �������. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.3. �٨ ���� ������ ������ - - ** ����� �������� ��������� �������� � ������, �������� R ** - - 1. ����������� ������� � ������ ������� ����� xxx � ������ ���������� ---> - - 2. ������ ������� SHIFT-R � ������� �����, ��������� ���� �� ������ ������, - ����� �������� ������� xxx. - - 3. ������� ������� ��� ������ �� ������ ������. ��������, ��� ������� - ������ �� ��� �������. - - 4. ��������� ��� ���� ��� ������ ���������� ���� xxx. - ----> ��� �������� ����� 123 � ������ xxx ����� ����� xxx. ----> ��� �������� ����� 123 � ������ 456 ����� ����� 579. - - -����������. - ����� ������ ����� �� ����� �������, �� ������ �������� ������ ������� - ������������ ������ � ������. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.4. ����������� � ������� ������ - -** ����� ����������, ����������� �������� y , ����� �������� - ������� p ** - - 1. ���������� ������� ����� �������� "�)" � ������, ���������� --->. - 2. ����������� �������� � ���������� ����� �������� v � ����������� ������� - ����� �� ����� "������". - 3. ������� ������� y ��� ����������� ������������� ������. - 4. ����������� ������� � ����� ��������� ������, ������ ������� j$ . - 5. ������� ������� p ��� ������� ������. ����� �������� ������� a , - ����������� ����� "������" � ������� ������� . - 6. ��������� ���� � 1 �� 4, ������ ���������� ������� ����� ����� "������", - ��������, ���������� � �������� ����� " �����.". - ----> �) ��� ������ �����. - �) - -����������. - ����� ��������������� �������� yw (�������� y � ������ w) ��� - ����������� ������ �����. - �� ������� yy ����� ����������� ����� ������, � �� ������� p ���������. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.6.5. ��������� ���������� - - ** ����� ��� ������ ��� ������ �� ���������� ������� ��������, - ������� ��������������� ��������� ** - - 1. ������� ����� "������������", ������ ������� /������������ . - ��������� ����� ��������� ���, ������� ������� n . - - 2. ���������� �������� 'ic' (������������ �������), ������ ������� :set ic - - 3. ��� ��������� ��� ��������� ����� ����� "������������", ������� ������� n - ��������, ��� ������ ����� ������� ����� "������������" � "������������". - - 4. ���������� ��������� 'hlsearch' � 'incsearch' �������� :set hls is - - 5. �������� ������� ������� ������ � ����������, ��� ��������� /������������ - - 6. ��� �������� ����� �������� ��� ������, ������� ������� :set noic -����������. - ��� ���������� ��������� ����������, �������� ������� :nohlsearch -����������. - ���� ��������� �� ��������� ������� �������� ������ �����������, ����������� - ���� \c � ������� ������, ��������, /������������\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.6 - - 1. �� ������� o ����� ������� ������ ������ ���� ������ � �������� - � �������� ����� ���������� � ����� ������� - �� ������� O ����� ������� ������ ������ ���� ������ � �������� - � �������� ����� ���������� � ����� ������� - 2. �� ������� a ����������� ������� ������ ����� ������� �������. - �� ������� A ����������� ������� ������ � ����� ������. - - 3. �� ������� e ����������� ��������� ������� � ����� �����. - 4. �������� y ������������ ��� ����������� ������, � �� ������� p - ���������� ������� �������������� ������. - - 5. ��� ������� ������ SHIFT-R ����������� ������������ � ����� ������, - � ���������� - �������� ������� . - - 6. �������� :set xxx ��� ��������� ��������� 'xxx'. - ��� ��������� ��������� (����� ��������� ������ ��� ����������� ������������): - 'ic' 'ignorecase' ������������� �������� �������� ��� ������ - 'is' 'incsearch' ����������� ��������� ���������� ��� ������ - 'hls' 'hlsearch' ��������� ���� ���������� ��� ������ - - 7. ��� ������ ���������, �������� ��������� "no" � ��� �������� :set noic -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.7.1. ���������� ���������� ������� - - ** ����������� ���������� ���������� ������� ** - - � ��������� Vim ������� ������ ���������� ���������� �������, � ����� ������ - �� ������������, �������������� ����� �� ��� ���������: - - ������� ������� (���� ��� ���� �� ����������) - - ������� ������� (���� ��� ���� �� ����������) - - �������� :help - - ������������ � ����������� � ���� ���������� �������, ����� �������� - ������������� � ���, ��� �������� � �������������. - - ������� CTRL-w CTRL-w ��� ����������� ������� �� ������ ���� � ������ ����. - �������� :q , ����� ������� ���� ���������� ������� (����� ������� - ��������� � ���� ����). - - ����� ����� �������� ��� ������ ������� ��� �������, ����� ��������������� - �������� ������� :help. ���������� ��������� (�� �������� ������ ): - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.7.2. �������� ���������� ���������� ����� - - ** ������� ��� ����������� Vim ** - - �������� Vim ����� ������������ �� ��������� � ���������� Vi, �� ����������� - �� ���� ������������ ��������� ��� ������� ���������. ����� ������������ - ���� ���������� ���������, ���������� ������� ���� "vimrc". - - 1. �������� ����� ���� "vimrc". ��� ������������ ������� �� ������������ - �������: - :e ~/.vimrc ��� UNIX - :e $VIM/_vimrc ��� MS Windows - - 2. ������ �������� � ���� ���� ���������� ���������� ����� "vimrc" - :r $VIMRUNTIME/vimrc_example.vim - - 3. �������� ��������� ���� ���� "vimrc" - :w - - ������ ��� ��������� ������� ��������� Vim ����� �������� ��������� - ����������. ��� ����������� ��� ��������� ����� ���� ��������� � ���� - "vimrc". - ����� �������� ��������� ����������, �������� :help vimrc-intro -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���� 1.7.3. ����������� ������ - -** ����������� � ��������� ������ ����������� �������� ������ CTRL-D � ** - - 1. ��������� ������������� � ���������� Vi - :set nocp - 2. ����������, ����� ����� ���� � ��������, ������ ������� - :!ls ��� :!dir - 3. �������� ������ ������� ��� �������� ����� �� �������������� :e - 4. ������� ������� CTRL-D , � ����� ������� �������� ������ ��������� Vim - ������������ � ����� "e". - 5. ������� ������� d , � ����� ����������� ������ �������� ������� - "edit". - 6. ������ ����������� ������ � ������ ������������ ������������� ����� - :edit TE - 7. ������� ������� � ����� ����������� ������������ �����, ���� ��� - ����������. - -����������. - ����������� �������� ��� ��������� ������. ������ ���������� ������ ������� - CTRL-D � ��� ����� �� ������ ���������. ��� �������� ������� - ��� ������� :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������ ����� 1.7 - - - 1. ����� ������� ���� ���������� ���������� ������� ���������, �������� - ������� :help ��� ������� ������� , ��� ������� . - - 2. ����� ����� ���������� ���������� � �����-���� �������, - �������� :help cmd (������ "cmd" ������� ������������ �������). - - 3. ����� ����������� ������� � ������ ����, ������� ������� CTRL-w CTRL-w . - - 4. ����� ������� ���� ���������� ������� (���� ��� �������), �������� :q . - - 5. ����� ��� ������� ������ ����������� ����������� ��� ���������, �������� - ��������� ��������� ���� vimrc. - - 6. ��� ������ �������, ������������ � ������� : , ������� ������� CTRL-D, - ����� ����������� ��������� �������� �����������. ������� ������� - ��� ����������� ������������ ��������. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �� ���� ����� ��������� ������ ����� ������� ����������� ��������� Vim. - ����� �� ������ ������������ �� ������ ������ �������. - - ����� ������� ����� ���� ���� ������� ����� ��������� Vim, ����������� ��� - ����, ����� �� ��������� ���������� ��� ��� �������������. ��� ������ �� - ������ �����, ��������� � ��������� Vim ���� ��� �����-����� ������. - - ����� ��������� ���� ��������, ������������ � ������������ ������������, - ������ ������� :help user-manual. - - ��� ����������� ������ ������������� ����� - "Vim - Vi Improved", ����� Steve Oualline, ������������ New Riders. - ��� ��������� ��������� ��������� Vim � ����� �������� ������� ��������. - � ����� ������� ��������� �������� � �����������. - ��. https://iccf-holland.org/click5.html - - ��� ���� ����� ����� ���������� �������� � ��������� ������ ��������� Vi, - ��� ��������� Vim, ������ ����� ������������� � ��������� - "Learning the Vi Editor", ����� Linda Lamb, - ������������ O'Reilly & Associates Inc. - ��� ������� �����, ����� ������ ��, ��� ������ ����� ������� � ��������� Vi. - ������ ������� ���� ����� �������� ���������� � ��������� Vim. - - ��� ����� ���� ���������� Michael C. Pierce � Robert K. Ware �� Colorado - School of Mines � ������ ����, ������������ Charles Smith �� Colorado State - University. E-mail: bware@mines.colorado.edu (������ ����������). - - ��� ������������� � ��������� Vim ����� ���� ���������� Bram Moolenaar - - ������ ������, ������� �� ������� ����, 2002, - ������ �����, ������� �� ������� ����, 2014, - Restorer, ���������, 2022, -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.ru.utf-8 b/runtime/tutor/tutor1.ru.utf-8 deleted file mode 100644 index c303c25daa..0000000000 --- a/runtime/tutor/tutor1.ru.utf-8 +++ /dev/null @@ -1,1017 +0,0 @@ -=============================================================================== -версия 1.7 = ДОБРО ПОЖАЛОВАТЬ НА ЗАНЯТИЯ ПО РЕДАКТОРУ Vim = -=============================================================================== -= ГЛАВА ПЕРВАЯ = -=============================================================================== - - Программа Vim -- это очень мощный текстовый редактор, имеющий множество - команд, и все их просто невозможно описать в рамках этого учебника. - Данный же учебник призван объяснить те команды, которые позволят вам с - лёгкостью использовать программу Vim в качестве редактора общего назначения. - На освоение материалов этого учебника потребуется около 30 минут, но это - зависит от того, сколько времени вы посвятите практическим занятиям. - - Внимание! Выполняя задания уроков, вы будете изменять текст в этом файле, - поэтому прежде чем продолжить, создайте копию файла. Тогда можно будет - практиковаться столько, сколько это потребуется. Если вы воспользовались - командой "vimtutor" для открытия этого учебника, значит, копия уже создана. - - Важно помнить, что этот учебник предназначен для практического обучения. - Это означает, что вы должны применять команды для того, чтобы как следует - их изучить. Если вы просто прочитаете этот текст, то не запомните команды! - Теперь, убедившись, что не включена клавиша , нажмите клавишу j - несколько раз, так, чтобы урок 1.1.1 полностью поместился на экране. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.1.1. ПЕРЕМЕЩЕНИЕ КАРЕТКИ - -** Чтобы перемещать каретку в указанных направлениях, нажмите клавиши h,j,k,l ** - ^ Подсказка. - k Клавиша h слева и удобна для перемещения влево. - < h l > Клавиша l справа и удобна для перемещения вправо. - j Клавиша j похожа на стрелку "вниз". - v - 1. Перемещайте каретку в разных направлениях, пока не ощутите уверенность. - - 2. Удерживайте нажатой клавишу "вниз" (j) для беспрерывного перемещения - каретки. Теперь вы знаете, как перейти к следующему уроку. - - 3. Используя клавишу "вниз", то есть j , перейдите к уроку 1.1.2. - -Совет. - Если вы не уверены в правильности набранного текста, нажмите клавишу , - чтобы переключить редактор в режим команд. После этого повторите набор. - -Примечание. - Клавиши управления курсором (стрелки) также должны работать. Но учтите, что - выполнять перемещение каретки клавишами h j k l намного быстрее, стоит - только немного потренироваться. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.1.2. ЗАВЕРШЕНИЕ РАБОТЫ ПРОГРАММЫ - - ВНИМАНИЕ! Перед выполнением описанных ниже действий, прочтите урок полностью! - - 1. Нажмите клавишу (чтобы быть уверенным, что программа находится в - режиме команд). - - 2. Наберите :q! - Это означает, что надо набрать три символа :q! и нажать клавишу <ВВОД> - Исполнение этой команды вызовет завершение работы редактора - БЕЗ СОХРАНЕНИЯ любых сделанных изменений. - - 3. В приглашении командной оболочки наберите команду, которой вы открывали - этот учебник. Это может быть vimtutor - - 4. Если уверены в том, что поняли смысл вышесказанного, выполните шаги - с 1 до 3, чтобы завершить работу и снова запустить редактор. - -Примечание. - По команде :q! будут сброшены любые сделанные изменения. Через - несколько уроков вы узнаете, как сохранять изменения в файл. - - 5. Переместите каретку вниз к уроку 1.1.3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.1.3. РЕДАКТИРОВАНИЕ - УДАЛЕНИЕ ТЕКСТА - - ** Чтобы удалить символ под кареткой, нажмите клавишу x ** - - 1. Переместите каретку к строке помеченной --->. - - 2. Чтобы исправить ошибки, перемещайте каретку, пока она не окажется над - удаляемым символом. - - 3. Нажмите клавишу x для удаления требуемого символа. - - 4. Повторите шаги со 2 по 4, пока строка не будет исправлена. - - ----> От тттопота копытт пппыль ппо ппполю леттитт. - - 5. Теперь, когда строка исправлена, переходите к уроку 1.1.4. - -Примечание. - В ходе этих занятий не пытайтесь сразу всё запоминать, учитесь в процессе - работы. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.1.4. РЕДАКТИРОВАНИЕ - ВСТАВКА ТЕКСТА - - ** Чтобы вставить текст, нажмите клавишу i ** - - 1. Переместите каретку к первой строке помеченной --->. - - 2. Чтобы сделать первую строку идентичной второй, установите каретку на тот - символ, ПЕРЕД которым следует вставить текст. - - 3. Нажмите клавишу i и наберите текст, который требуется вставить. - - 4. После исправления каждого ошибочного слова, нажмите клавишу - для переключения в режим команд. - Повторите шаги со 2 по 4, пока предложение не будет исправлено полностью. - - ----> Часть текта в строке бесследно . ----> Часть текста в этой строке бесследно пропало. - - - 5. Когда освоите вставку текста, переходите к уроку 1.1.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.1.5. РЕДАКТИРОВАНИЕ - ДОБАВЛЕНИЕ ТЕКСТА - - ** Чтобы добавить текст, нажмите клавишу A ** - - 1. Переместите каретку к первой строке помеченной --->. - Сейчас неважно, на каком символе расположена каретка в этой строке. - - 2. Нажмите клавишу A и наберите текст, который требуется добавить. - - 3. После добавления текста нажмите клавишу для возврата в режим команд. - - 4. Переместите каретку на следующую строку, помеченную ---> - и повторите шаги со 2 по 3 для исправления этой строки. - ----> Часть текста в этой строке бессле - Часть текста в этой строке бесследно пропало. ----> Здесь также недостаёт час - Здесь также недостаёт части текста. - - 5. Когда освоите добавление текста, переходите к уроку 1.1.6. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - УРОК 1.1.6. РЕДАКТИРОВАНИЕ И ЗАПИСЬ ФАЙЛА - - ** Чтобы сохранить файл и закрыть редактор, используйте команды :wq ** - - ВНИМАНИЕ! Перед выполнением описанных ниже действий, прочтите урок полностью! - - 1. Завершите работу редактора Vim, как указано в уроке 1.1.2 - :q! - Если есть доступ к другому терминалу, то там можете сделать следующее: - - 2. В приглашении командной оболочки введите команду vim tutor - где vim - команда для запуска редактора Vim, а tutor - наименование - файла для редактирования. Укажите такой файл, который можно изменять. - - 3. Вставляйте и удаляйте текст, как описано в предыдущих уроках. - - 4. Сохраните этот изменённый файл и завершите работу программы Vim, - набрав команду :wq - - 5. Если вы вышли из vimtutor на шаге 1, перезапустите vimtutor и переходите - далее к резюме. - - 6. После того как вы прочли и поняли вышесказанное, выполните описанные шаги. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - РЕЗЮМЕ УРОКА 1.1 - - 1. Каретку можно перемещать либо клавишами со стрелками, либо клавишами hjkl. - h (влево) j (вниз) k (вверх) l (вправо) - - 2. Чтобы запустить редактор Vim из приглашения командной оболочки, наберите - vim ФАЙЛ - - 3. Чтобы завершить работу редактора Vim, выполните одно из следующих: - :q! по этой команде не будут сохранены изменения; - или - :wq по этой команде будут сохранены изменения. - - 4. Чтобы удалить символ под кареткой, нажмите клавишу x в режиме команд. - - 5. Чтобы вставить текст перед кареткой - i наберите вставляемый текст - Чтобы добавить текст в конце строки - A наберите добавляемый текст - -Примечание. - По нажатию клавиши будет выполнено переключение редактора в режим - команд с прерыванием обработки любой ранее набранной команды. - -Теперь переходите к уроку 1.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.2.1. КОМАНДЫ УДАЛЕНИЯ - - ** Чтобы удалить слово под кареткой, используйте команду dw ** - - 1. Переключите редактор в режим команд, нажав клавишу . - - 2. Переместите каретку к строке помеченной --->. - - 3. Установите каретку на начало слова, которое следует удалить. - - 4. Наберите dw для удаления этого слова. - -Примечание. - При наборе буквы d она отобразится справа в самой нижней строке, и - программа будет ожидать ввода следующей команды, в данном случае - w - Если что-то не получается, нажмите клавишу и начните сначала. - ----> Несколько слов рафинад в этом предложении автокран излишни. - - 5. Повторите шаги 3 и 4, пока не исправите все ошибки, и переходите к - уроку 1.2.2 - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.2.2. ЕЩЁ ОДНА КОМАНДА УДАЛЕНИЯ - - - ** Чтобы удалить текст до конца строки, используйте команду d$ ** - - 1. Переключите редактор в режим команд, нажав клавишу . - - 2. Переместите каретку к строке помеченной --->. - - 3. Установите каретку в конце корректного предложения (ПОСЛЕ первой точки). - - 4. Наберите d$ для удаления остатка строки. - - ----> Кто-то набрал окончание этой строки дважды. окончание этой строки дважды. - - - 5. Чтобы лучше разобраться в том как это происходит, обратитесь к уроку 1.2.3. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.2.3. ОПЕРАТОРЫ И ОБЪЕКТЫ - - Многие команды, изменяющие текст, являются составными и формируются из - оператора и объекта, к которому применяется этот оператор. - Так, например, формат команды удаления с оператором d следующий: - - d объект - где - d - оператор удаления; - объект - область текста (указаны ниже), к которой будет применён оператор. - - Краткий перечень объектов: - w - от позиции каретки до конца слова, включая последующий пробел; - e - от позиции каретки до конца слова, исключая последующий пробел; - $ - от позиции каретки до конца строки, включая последний символ. - - Таким образом, ввод команды de вызовет удаление текста от позиции каретки - до конца слова. - -Примечание. - Если в режиме команд, без ввода оператор, нажать клавишу с символом, - с которым ассоциирован объект, то каретка будет перемещена так, как - указано в перечне объектов. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.2.4. ПРИМЕНЕНИЕ СЧЁТЧИКА СОВМЕСТНО С ОБЪЕКТАМИ - - ** Чтобы перемещение каретка выполнялось необходимое количество раз, - укажите перед объектом требуемое число ** - - - 1. Установите каретку на начало строки помеченной --->. - - 2. Наберите 2w для перемещения каретки вперёд к началу второго слова. - - 3. Наберите 3e для перемещения каретки вперёд к концу третьего слова. - - 4. Наберите 0 (ноль) для перемещения каретки к началу строки. - - 5. Повторите шаги 2 и 3 с различными значениями чисел. - - ----> Обычная строка из слов, чтобы вы на ней потренировались перемещать каретку. - - - 6. Когда освоите это, переходите к уроку 1.2.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.2.5. ПРИМЕНЕНИЕ СЧЁТЧИКА ДЛЯ МНОЖЕСТВЕННОГО УДАЛЕНИЯ - - ** Чтобы применить оператор несколько раз, укажите число требуемых повторов ** - - Используя приведённые ранее составные команды удаления и перемещения, укажите - перед объектом число повторов выполнения операции удаления. - - d число объект - - 1. Установите каретку на первом слове из прописных букв в строке со ---> - - 2. Наберите d2w для удаления двух идущих друг за другом слов из прописных - букв. - - 3. Повторите шаги 1 и 2 с указанием других числовых значений, чтобы удалить - группы слов из прописных букв одной командой. - - ----> эта АБВ ГД строка ЕЖЗИ КЛ МНО очищена от П РС ТУФ лишних слов. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.2.6. ОПЕРАЦИИ СО СТРОКАМИ - - ** Чтобы удалить строку целиком, используйте команду dd ** - - Так как часто требуется выполнять удаление всей строки целиком, создатели - редактора решили облегчить этот процесс, и предложили для этого просто - дважды нажать на клавишу с буквой d. - - 1. Переместите каретку к строке номер два, помеченной --->. - 2. Наберите dd для удаления строки. - 3. Теперь переместите каретку к строке номер четыре, помеченной --->. - 4. Наберите 2dd для удаления двух строк подряд. - ----> 1) Летом я хожу на стадион, ----> 2) О, как внезапно кончился диван! ----> 3) Я болею за "Зенит", "Зенит" - чемпион! ----> 4) Печально я гляжу на наше поколенье! ----> 5) Его грядущее - иль пусто, иль темно... ----> 6) Я сижу на скамейке в ложе "Б" ----> 7) И играю на большой жестяной трубе. - -Дублирование оператора для обработки целой строки применяется и с другими - операторами, о которых говорится далее. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.2.7. КОМАНДА ОТМЕНЫ - - ** Чтобы отменить результат действия предыдущей команды, нажмите клавишу u - Чтобы отменить правки для всей строки, нажмите клавишу U ** - - 1. Установите каретку на первой ошибке, в строке помеченной ---> - 2. Нажмите клавишу x для удаления первого ошибочного символа. - 3. Теперь нажмите клавишу u для отмены последней выполненной команды. - 4. Исправьте все ошибки в строке, используя команду x . - 5. Теперь нажмите клавишу U , чтобы вернуть всю строку в исходное состояние. - 6. Нажмите клавишу u несколько раз для отмены команды U - и предыдущих команд. - 7. Теперь нажмите клавиши CTRL-R (т. е. удерживая нажатой клавишу CTRL, - нажмите клавишу r) несколько раз для возврата действий команд. - - ----> Испрравьте оошибки в этойй строке и вернитте их сс помощьью "отмены". - - - 8. Это очень нужные и полезные команды. - -Далее переходите к резюме урока 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - РЕЗЮМЕ УРОКА 1.2 - - 1. Чтобы удалить слово, установите каретку в его начало и наберите dw - 2. Чтобы удалить текст от позиции каретки до конца слова, наберите de - 3. Чтобы удалить текст от позиции каретки до конца строки, наберите d$ - 4. Чтобы удалить всю строку целиком, наберите dd - - 5. Чтобы переместить каретку за один раз на некоторое количество объектов, - укажите их число, например, 2w - 6. Формат команд изменения: - оператор [число] объект - где - оператор - необходимые действия, например, d для удаления; - [число] - количество подпадающих под действие оператора объектов, - если не указано, то один объект; - объект - на что воздействует оператор, например, w (слово), - $ (всё, что есть до конца строки) и т. п. - - 7. Чтобы переместить каретку к началу строки, нажмите клавишу 0 (ноль) - - 8. Чтобы отменить предшествующие действия, нажмите u (строчная буква u) - Чтобы отменить все изменения в строке, нажмите U (прописная буква U) - Чтобы вернуть отменённые изменения, нажмите CTRL-R -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.3.1. КОМАНДА ВСТАВКИ - - ** Чтобы вставить последний удалённый текст, наберите команду p ** - - 1. Переместите каретку к первой строке помеченной --->. - - 2. Наберите dd , чтобы удалить строку, при этом она будет автоматически - помещена в специальный регистр редактора Vim. - - 3. Установите каретку на строку ВЫШЕ той, в которой следует вставить - удалённую строку. - - 4. Убедитесь, что программа в режиме команд и нажмите клавишу p для вставки - строки ниже позиции каретки. - - 5. Повторите шаги со 2 по 4, пока не расставите все строки в нужном порядке. - ----> г) И лучше выдумать не мог. ----> б) Когда не в шутку занемог, ----> в) Он уважать себя заставил ----> а) Мой дядя самых честных правил - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.3.2. КОМАНДА ЗАМЕНЫ - - ** Чтобы заменить символ под кареткой, наберите r и заменяющий символ ** - - 1. Переместите каретку к первой строке помеченной --->. - - 2. Установите каретку так, чтобы она находилась над первым ошибочным символом. - - 3. Нажмите клавишу r и затем наберите символ, исправляющий ошибку. - - 4. Повторите шаги 2 и 3, пока первая строка не будет соответствовать второй. - - ----> В момегт набтра этой чтроки кое0кто с трудом попвдал по клваишам! ----> В момент набора этой строки кое-кто с трудом попадал по клавишам! - - - 5. Теперь переходите к уроку 1.3.3. - -Примечание. - Помните, что вы должны учиться в процессе работы, а не просто зубрить. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.3.3. ОПЕРАТОР ИЗМЕНЕНИЯ - - ** Чтобы изменить окончание слова, наберите команду ce ** - - 1. Переместите каретку к первой строке помеченной --->. - - 2. Установите каретку над буквой o в слове "сола". - - 3. Наберите команду ce и исправьте слово (в данном случае, наберите "лов"). - - 4. Нажмите клавишу и переместите каретку к следующей ошибке (к первому - символу, начиная с которого надо изменить окончание слова). - - 5. Повторите шаги 3 и 4 пока первая строка не будет соответствовать второй. - ----> Несколько сола в эьгц строке тпгшцбь редалзкуюиесвх. ----> Несколько слов в этой строке требуют редактирования. - -Примечание. - Обратите внимание, что по команде ce не только удаляется часть слова, - но и происходит переключение редактора в режим вставки. - По команде cc будет выполнятся то же самое, но для целой строки. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - УРОК 1.3.4. ЕЩЁ НЕСКОЛЬКО СПОСОБОВ РАБОТЫ С ОПЕРАТОРОМ ИЗМЕНЕНИЯ c - -** К оператору изменения применимы те же объекты, что и к оператору удаления ** - - 1. Оператор изменения работает аналогично оператору удаления. Формат команды: - - c [число] объект - - 2. Объекты - это то же самое, что и ранее: w (слово), $ (конец строки) и т. п. - - 3. Переместите каретку к первой строке помеченной --->. - - 4. Установите каретку на первой ошибке. - - 5. Наберите c$ и отредактируйте первую строку так, чтобы она совпадала со - второй, после чего нажмите клавишу . - ----> Окончание этой строки нужно сделать похожим как во второй строке. ----> Окончание этой строки нужно исправить командой c$ . - -Примечание. - Клавиша может использоваться для исправления при наборе текста. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - РЕЗЮМЕ УРОКА 1.3 - - 1. Чтобы вставить текст, который был только что удалён, наберите команду p . - Текст будет вставлен ПОСЛЕ позиции каретки (если была удалена строка, - то она будет помещена в строке ниже строки с кареткой). - - 2. Чтобы заменить символ под кареткой, наберите команду r и затем - заменяющий символ. - - 3. Операторы изменения изменяют указанный объект текста от позиции каретки - до конечной точки перемещения. - Например, по команде ce можно изменить текст от позиции каретки до конца - слова, а по команде c$ - до конца строки. - - 4. Формат команд изменения: - - c [число] объект - - где c - оператор изменения; - [число] - количество изменяемых объектов (необязательная часть); - объект - объект текста, который будет изменён. - -Теперь переходите к следующему уроку. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - УРОК 1.4.1. ИНФОРМАЦИЯ О ФАЙЛЕ И ПОЗИЦИЯ КАРЕТКИ - - ** Чтобы получить информацию о файле и позиции каретки, нажмите CTRL-g . - Чтобы переместить каретку к заданной строке в файле, нажмите SHIFT-G ** - - ВНИМАНИЕ! Прочитайте весь урок, прежде чем выполнять любые действия! - - 1. Удерживая клавишу CTRL , нажмите клавишу g . Внизу экрана появится - сообщение с наименованием файла и номером строки, в которой находится - каретка. Запомните этот номер строки, он потребуется на шаге 3. - - Примечание. - Позиция каретки может отображаться в правом нижнем углу окна программы, - если установлен параметр 'ruler' (см. :help 'ruler'). - - 2. Нажмите клавиши SHIFT-G для перемещения каретки на последнюю строку файла. - Теперь наберите gg для перемещения каретки на первую строку файла. - - 3. Наберите номер строки, которой был получен на шаге 1, и нажмите клавиши - SHIFT-G. Каретка будет перемещена в ту строку, где она находилась, - когда в первый раз были нажаты клавиши CTRL-g. - - 4. Если вы запомнили всё вышесказанное, выполните шаги с 1 по 3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.4.2. КОМАНДЫ ПОИСКА - - ** Чтобы что-то найти, наберите команду / и затем введите искомую фразу ** - - 1. В режиме команд наберите символ / . Обратите внимание, что этот символ - будет отображаться внизу экрана. Так же, как и при наборе команды : - - 2. Теперь наберите ошшшибка . Это то слово, которое требуется найти. - - 3. Чтобы повторить поиск искомого слова, просто нажмите клавишу n . - Чтобы искать это слово в обратном направлении, нажмите клавиши SHIFT-N . - - 4. Если требуется сразу выполнить поиск в обратном направлении, используйте - команду ? вместо команды / . - - 5. Чтобы вернуться туда, откуда был начат поиск, нажмите несколько раз - клавиши CTRL-O . Для перехода вперёд, используйте команду CTRL-I . - ----> "ошшшибка" это не способ написания слова "ошибка"; ошшшибка это ошибка. - -Примечание. - Если будет достигнут конец файла, то поиск будет продолжен от начала файла. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.4.3. ПОИСК ПАРНЫХ СКОБОК - - ** Чтобы найти парную скобку для (, [ или {, наберите команду % ** - - 1. Поместите каретку на любой из скобок (, [ или { в строке помеченной --->. - - 2. Теперь нажмите на клавиатуре клавишу с символом % . - - 3. Каретка будет перемещена на парную скобку для той скобки, на которой - установлена каретка. - - 4. Наберите % для возврата каретки назад к первой парной скобке. - - ----> В этой ( строке есть такие (, такие [ ] и { такие } скобки. )) - - -Примечание. - Это очень удобно при отладке программ, когда в коде пропущены скобки! - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.4.4. СПОСОБ ЗАМЕНЫ СЛОВ - - ** Чтобы "что-то" заменить "чем-то", наберите команду :s/что/чем/g ** - - 1. Переместите каретку к строке помеченной --->. - - 2. Наберите :s/уводю/увожу . Обратите внимание на то, что по этой - команде будет замена только первого найденного вхождение в строке. - - 3. Теперь наберите :s/уводю/увожу/g , добавленный флаг 'g' означает - замена во всей строке. Будет выполнена замена всех найденных в строке - совпадений. - ----> Я уводю к отверженным селеньям, я уводю сквозь вековечный стон, я уводю - к забытым поколеньям. - - 4. Чтобы заменить все вхождения искомого слова в каком-то диапазоне строк, - наберите :#,#s/что/чем/g где #,# - номер начальной и конечной строки - диапазона, в котором будет выполнена замена. - Наберите :%s/что/чем/g чтобы заменить все вхождения во всём файле. - Наберите :%s/что/чем/gc чтобы выдавался запрос подтверждения - перед каждой заменой. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - РЕЗЮМЕ УРОКА 1.4 - - 1. По приведённым ниже командам будет выполнено: - CTRL-g - вывод информации о файле и текущей позиции каретки в этом файле - SHIFT-G - переход на последнюю строку файла - номер и SHIFT-G - переход к строке с указанным номером - gg - переход на первую строку файла - 2. При вводе символа / с последующим набором слова, будет выполнен поиск - этого слова ВПЕРЁД по тексту. - При вводе символа ? с последующим набором слова, будет выполнен поиск - этого слова НАЗАД по тексту. - После показа первого совпадения, нажмите n для перехода к следующему - слову в том же направлении поиска или SHIFT-N для поиска в - противоположном направлении. - При нажатии клавиш CTRL-O будет возврат к предыдущему слову, а при - нажатии клавиш CTRL-I будет переход к ранее найденному слову. - 3. При нажатии % , когда каретка на одной из скобок ( ), [ ] или { }, - будет найдена её парная скобка. - 4. Чтобы заменить первое найденное слово в строке, наберите :s/что/чем - Чтобы заменить все найденные слова в строке, наберите :s/что/чем/g - Чтобы заменить в указанными интервале строк, наберите :#,#s/что/чем/g - Чтобы заменить все найденные слова в файле, наберите :%s/что/чем/g - Чтобы запрашивалось подтверждение, добавьте флаг 'c' :%s/что/чем/gc -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.5.1. КАК ВЫЗВАТЬ ИЗ РЕДАКТОРА ВНЕШНЮЮ КОМАНДУ - -** Чтобы была выполнена команда командной оболочки, наберите в редакторе :! ** - - 1. Наберите уже знакомую команду : , чтобы установить каретку в командной - строке редактора и ввести необходимую команду. - - 2. Теперь наберите символ ! (восклицательный знак). По этой команде будет - вызвана указанная следующей внешняя команда командной оболочки. - - 3. Например, наберите ls сразу после ! и нажмите . Будет выведен - перечень файлов в текущем каталоге. То есть будет выполнено точно то же - самое, как если бы ввести команду ls в приглашении командной оболочки. - Если в системе не поддерживается команда ls, то наберите команду :!dir - -Примечание. - Таким способом можно выполнить любую внешнюю команду, в том числе и с - указанием необходимых аргументов этой команды. - -Важно. - После ввода команды, начинающейся с : , должна быть нажата клавиша - В дальнейшем это может не указываться отдельно, но подразумеваться. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.5.2. КАК ЗАПИСАТЬ ФАЙЛ - - ** Чтобы сохранить файл со всеми изменениями в тексте, наберите :w ФАЙЛ ** - - 1. Наберите :!dir или :!ls для получения перечня файлов в текущем - каталоге. Как вы помните, после набора команды нажмите клавишу - - 2. Придумайте название для файла, которое ещё не существует, например, TEST. - - 3. Теперь наберите :w TEST (здесь TEST - это придуманное название файла). - - 4. По этой команде будет полностью сохранён текущий файл ("tutor") под новым - название "TEST". Чтобы проверить это, снова наберите команду :!dir или - :!ls и просмотрите содержимое каталога. - -Примечание. - Если завершить работу редактора Vim и затем запустить его снова с файлом - TEST (т. е. набрать команду vim TEST ), этот файл будет точной копией - учебника в тот момент, когда он был сохранён. - - 5. Теперь удалите этот файл, набрав в редакторе команду :!del TEST - (для ОС Windows) или :!rm TEST (для UNIX-подобных ОС) - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.5.3. ВЫБОРОЧНАЯ ЗАПИСЬ СТРОК - - ** Чтобы сохранить часть файла, нажмите клавишу v , выделите строки - и наберите команду :w ФАЙЛ ** - - 1. Переместите каретку на эту строку. - - 2. Нажмите клавишу v и переместите каретку ниже к строке с пятым пунктом. - Обратите внимание, что текст подсвечен. - - 3. Нажмите клавишу с символом : и внизу экрана появится :'<,'> . - - 4. Наберите команду w TEST (здесь TEST - файл, который ещё не существует). - В командной строке должно быть :'<,'>w TEST и нажмите клавишу - - 5. По этой команде выбранные строки будут записаны в файл TEST. Убедитесь в - наличии этого файла, воспользовавшись командой :!dir или :!ls . - Не удаляйте этот файл, он потребуется на следующем уроке. -Примечание. - По нажатию клавиши v выполняется переключение в визуальный режим. Чтобы - изменить размер выбранной области, нужно переместить каретку. - К выделенному фрагменту можно применить любой оператор, например, d - для его удаления. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.5.4. СЧИТЫВАНИЕ И ОБЪЕДИНЕНИЕ ФАЙЛОВ - - ** Чтобы вставить содержащийся в файле текст, наберите :r ФАЙЛ ** - - 1. Установите каретку над этой строкой. - -Внимание! - После выполнения описанного в пункте 2 вы увидите текст из урока 1.5.3. - Переместите каретку вниз по тексту до текущего урока. - - 2. Теперь считайте содержимое файла TEST, используя команду :r TEST , здесь - TEST - это наименование файла. - - 3. Для проверки, что содержимое файла было вставлено, переместите каретку - вверх по тексту и удостоверьтесь, что теперь здесь два урока 1.5.3. - - исходный и из файла TEST. - -Примечание. - Вставить можно и результат внешней команды. Например, по команде :r !ls - будет получен вывод команды ls и вставлен ниже позиции каретки. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - РЕЗЮМЕ УРОКА 1.5 - - 1. По команде :!command будет исполнена указанная внешняя команда. - - Некоторые полезные примеры: - (Windows) (UNIX) - :!dir :!ls - вывести перечень файлов в каталоге; - :!del ФАЙЛ :!rm ФАЙЛ - удалить файл с указанным наименованием. - - 2. По команде :w ФАЙЛ , текущий редактируемый файл будет записан - с указанным наименованием. - - 3. Используя команды v , перемещение каретки и :w ФАЙЛ можно сохранить - визуально выделенные строки в файл с указанным наименованием. - - 4. По команде :r ФАЙЛ будет прочитан файл с указанным наименованием - и его содержимое помещено ниже позиции каретки. - - 5. По команде :r !dir будет получен вывод команды dir и помещён ниже - позиции каретки. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - УРОК 1.6.1. КОМАНДЫ ДЛЯ СОЗДАНИЯ СТРОК - - ** Чтобы открыть новую строку с переключением в режим вставки, наберите o ** - - 1. Переместите каретку вниз, к первой строке помеченной --->. - - 2. Нажмите клавишу o для того, чтобы создать пустую строку НИЖЕ позиции - каретки и переключить редактор в режим вставки. - - 3. Теперь наберите какой-нибудь текст и нажмите клавишу для выхода из - режима вставки. - ----> После нажатия o ниже будет открыта новая пустая строка в режиме вставки. - - - 4. Для создания строки ВЫШЕ позиции каретки, наберите прописную букву O , - вместо строчной буквы o . Попробуйте это сделать для строки ниже. - - ----> Создайте новую строку над этой, поместив сюда каретку и нажав SHIFT-O. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - УРОК 1.6.2. КОМАНДА ДЛЯ ДОБАВЛЕНИЯ ТЕКСТА - - ** Чтобы вставить текст после позиции каретки, наберите a ** - - 1. Переместите каретку вниз, в начало первой строки помеченной --->. - 2. Нажмите клавишу e , пока каретка не окажется на последнем символе слова - "стро". - - 3. Нажмите клавишу a для добавления текста ПОСЛЕ символа, находящегося под - кареткой. - - 4. Допишите слово как в строке ниже. Нажмите клавишу для выхода из - режима вставки. - - 5. Используйте клавишу e для перехода к следующему незавершённому слову - и повторите действия, описанные в пунктах 3 и 4. - ----> На этой стро вы можете попрактиков в добавле текста. ----> На этой строке вы можете попрактиковаться в добавлении текста. - -Примечание. - По команде a , i и A будет выполнено переключение в один и тот же режим - вставки, различие только в том, где вставляются символы. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.6.3. ЕЩЁ ОДИН СПОСОБ ЗАМЕНЫ - - ** Чтобы заменить несколько символов в строке, наберите R ** - - 1. Переместите каретку в начало первого слова xxx в строке помеченной ---> - - 2. Теперь нажмите SHIFT-R и введите число, указанное ниже во второй строке, - чтобы заменить символы xxx. - - 3. Нажмите клавишу для выхода из режима замены. Заметьте, что остаток - строки не был изменён. - - 4. Повторите эти шаги для замены оставшихся слов xxx. - ----> При сложении числа 123 с числом xxx сумма будет xxx. ----> При сложении числа 123 с числом 456 сумма будет 579. - - -Примечание. - Режим замены похож на режим вставки, но каждый введённый символ удаляет - существующий символ в строке. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.6.4. КОПИРОВАНИЕ И ВСТАВКА ТЕКСТА - -** Чтобы копировать, используйте оператор y , чтобы вставить - команду p ** - - 1. Установите каретку после символов "а)" в строке, помеченной --->. - 2. Переключите редактор в визуальный режим командой v и переместите каретку - вперёд до слова "первый". - 3. Нажмите клавишу y для копирования подсвеченного текста. - 4. Переместите каретку в конец следующей строки, набрав команду j$ . - 5. Нажмите клавишу p для вставки текста. Затем наберите команду a , - напечатайте слово "второй" и нажмите клавишу . - 6. Повторите шаги с 1 по 4, только установите каретку после слова "первый", - выделите, скопируйте и вставьте слово " пункт.". - ----> а) Это первый пункт. - б) - -Примечание. - Можно воспользоваться командой yw (оператор y и объект w) для - копирования одного слова. - По команде yy будет скопирована целая строка, а по команде p вставлена. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.6.5. УСТАНОВКА ПАРАМЕТРОВ - - ** Чтобы при поиске или замене не учитывался регистр символов, - задайте соответствующие настройки ** - - 1. Найдите слово "игнорировать", набрав команду /игнорировать . - Повторите поиск несколько раз, нажимая клавишу n . - - 2. Установите параметр 'ic' (игнорировать регистр), набрав команду :set ic - - 3. Ещё несколько раз повторите поиск слова "игнорировать", нажимая клавишу n - Заметьте, что теперь будут найдены слова "Игнорировать" и "ИГНОРИРОВАТЬ". - - 4. Установите параметры 'hlsearch' и 'incsearch' командой :set hls is - - 5. Повторно введите команду поиска и посмотрите, что получится /игнорировать - - 6. Для возврата учёта регистра при поиске, введите команду :set noic -Примечание. - Для отключения подсветки совпадений, наберите команду :nohlsearch -Примечание. - Если требуется не учитывать регистр символов только единоразово, используйте - ключ \c в команде поиска, например, /игнорировать\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - РЕЗЮМЕ УРОКА 1.6 - - 1. По команде o будет создана пустая строка ниже строки с кареткой - и редактор будет переключен в режим вставки - По команде O будет создана пустая строка выше строки с кареткой - и редактор будет переключен в режим вставки - 2. По команде a выполняется вставки текста ПОСЛЕ позиции каретки. - По команде A выполняется вставки текста в конце строки. - - 3. По команде e выполняется установка каретки в конце слова. - 4. Оператор y используется для копирования текста, а по команде p - происходит вставка скопированного текста. - - 5. При нажатии клавиш SHIFT-R выполняется переключение в режим замены, - а отключение - нажатием клавиши . - - 6. Наберите :set xxx для установки параметра 'xxx'. - Вот некоторые параметры (можно указывать полные или сокращённые наименования): - 'ic' 'ignorecase' игнорирование регистра символов при поиске - 'is' 'incsearch' отображение частичных совпадений при поиске - 'hls' 'hlsearch' подсветка всех совпадений при поиске - - 7. Для сброса параметра, добавьте приставку "no" к его названию :set noic -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - УРОК 1.7.1. ВСТРОЕННАЯ СПРАВОЧНАЯ СИСТЕМА - - ** Используйте встроенную справочную систему ** - - В редакторе Vim имеется мощная встроенная справочная система, и чтобы начать - ей пользоваться, воспользуйтесь одним из трёх вариантов: - - нажмите клавишу (если она есть на клавиатуре) - - нажмите клавишу (если она есть на клавиатуре) - - наберите :help - - Ознакомьтесь с информацией в окне справочной системы, чтобы получить - представление о том, как работать с документацией. - - Нажмите CTRL-w CTRL-w для перемещения каретки из одного окна в другое окно. - Наберите :q , чтобы закрыть окно справочной системы (когда каретка - находится в этом окне). - - Можно найти описание для любого понятия или команды, задав соответствующий - аргумент команде :help. Попробуйте следующее (не забудьте нажать ): - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Урок 1.7.2. СОЗДАНИЕ СТАРТОВОГО КОМАНДНОГО ФАЙЛА - - ** Включим все возможности Vim ** - - Редактор Vim более функционален по сравнению с редактором Vi, но большинство - из этих возможностей отключены при запуске программы. Чтобы активировать - весь потенциала редактора, необходимо создать файл "vimrc". - - 1. Создайте новый файл "vimrc". Его расположение зависит от используемой - системы: - :e ~/.vimrc для UNIX - :e $VIM/_vimrc для MS Windows - - 2. Теперь добавьте в этот файл содержимое шаблонного файла "vimrc" - :r $VIMRUNTIME/vimrc_example.vim - - 3. Запишите созданный вами файл "vimrc" - :w - - Теперь при следующем запуске редактора Vim будет включена подсветка - синтаксиса. Все необходимые вам настройки могут быть добавлены в файл - "vimrc". - Чтобы получить подробную информацию, наберите :help vimrc-intro -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - УРОК 1.7.3. ПОДСТАНОВКА КОМАНД - -** Подстановка в командной строке выполняется нажатием клавиш CTRL-D и ** - - 1. Отключите совместимость с редактором Vi - :set nocp - 2. Посмотрите, какие файлы есть в каталоге, набрав команду - :!ls или :!dir - 3. Наберите начало команды для открытия файла на редактирование :e - 4. Нажмите клавиши CTRL-D , и будет показан перечень команд редактора Vim - начинающихся с буквы "e". - 5. Нажмите клавиши d , и будет подставлено полное название команды - "edit". - 6. Теперь напечатайте пробел и начало наименования существующего файла - :edit TE - 7. Нажмите клавишу и будет подставлено наименование файла, если оно - уникальное. - -Примечание. - Подстановка работает для множества команд. Просто попробуйте нажать клавиши - CTRL-D и для любой из команд редактора. Это особенно полезно - для команды :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - РЕЗЮМЕ УРОКА 1.7 - - - 1. Чтобы открыть окно встроенной справочной системы редактора, наберите - команду :help или нажмите клавишу , или клавишу . - - 2. Чтобы найти справочную информацию о какой-либо команде, - наберите :help cmd (вместо "cmd" укажите наименование команды). - - 3. Чтобы переместить каретку в другое окно, нажмите клавиши CTRL-w CTRL-w . - - 4. Чтобы закрыть окна справочной системы (если оно активно), наберите :q . - - 5. Чтобы при запуске всегда применялись необходимые вам настройки, создайте - стартовый командный файл vimrc. - - 6. При наборе команды, начинающейся с символа : , нажмите клавиши CTRL-D, - чтобы просмотреть возможные варианты подстановки. Нажмите клавишу - для подстановки необходимого варианта. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - На этом можно завершить первую часть занятий посвящённых редактору Vim. - Далее вы можете ознакомиться со второй частью занятий. - - Целью данного курса было дать краткий обзор редактора Vim, достаточный для - того, чтобы не возникало сложностей при его использовании. Это далеко не - полный обзор, поскольку в редакторе Vim есть ещё много-много команд. - - Чтобы расширить свои познания, ознакомьтесь с руководством пользователя, - набрав команду :help user-manual. - - Для дальнейшего чтения рекомендуется книга - "Vim - Vi Improved", автор Steve Oualline, издательство New Riders. - Она полностью посвящена редактору Vim и будет особенно полезна новичкам. - В книге имеется множество примеров и иллюстраций. - См. https://iccf-holland.org/click5.html - - Ещё одна книга более почтенного возраста и посвящена больше редактору Vi, - чем редактору Vim, однако также рекомендуется к прочтению - "Learning the Vi Editor", автор Linda Lamb, - издательство O'Reilly & Associates Inc. - Это хорошая книга, чтобы узнать всё, что только можно сделать в редакторе Vi. - Шестое издание этой книги включает информацию о редакторе Vim. - - Эти уроки были составлены Michael C. Pierce и Robert K. Ware из Colorado - School of Mines с учётом идей, предложенных Charles Smith из Colorado State - University. E-mail: bware@mines.colorado.edu (теперь недоступен). - - Для использования в редакторе Vim уроки были доработаны Bram Moolenaar - - Андрей Киселёв, перевод на русский язык, 2002, - Сергей Алёшин, перевод на русский язык, 2014, - Restorer, редактура, 2022, -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.sk b/runtime/tutor/tutor1.sk index a34cd0ac5e..523a300a01 100644 --- a/runtime/tutor/tutor1.sk +++ b/runtime/tutor/tutor1.sk @@ -2,341 +2,341 @@ = V i t a j t e v o V I M T u t o r i a l i - Verzia 1.7 = =============================================================================== - Vim je ve�mi v�konn� editor, ktor� m� pr�li� ve�a pr�kazov na to aby - mohli byt v�etky pop�san� vo v�uke akou je t�to. T�to v�uka - popisuje dostato�n� mno�stvo pr�kazov nato aby bolo mo�n� pou��va� - Vim ako viac��elov� editor. + Vim je veľmi výkonný editor, ktorý má príliž veľa príkazov na to aby + mohli byt všetky popísané vo výuke akou je táto. Táto výuka + popisuje dostatočné množstvo príkazov nato aby bolo možné používať + Vim ako viacúčelový editor. - Pribli�n� �as potrebn� na prebratie tejto v�uky je 25-30 min�t, - z�vis� na tom, ko�ko je str�ven�ho �asu s presk��avan�m. + Približný čas potrebný na prebratie tejto výuky je 25-30 minút, + závisí na tom, koľko je stráveného času s preskúšavaním. UPOZORNENIE: - Pr�kazy v lekci�ch modifikuj� text. Vytvor k�piu tohto s�boru aby - sa mohlo precvi�ova� na �om (pri �tarte "vimtutor" je toto k�pia). + Príkazy v lekciách modifikujú text. Vytvor kópiu tohto súboru aby + sa mohlo precvičovať na ňom (pri štarte "vimtutor" je toto kópia). - Je d�le�it� zapam�ta� si, �e t�to v�uka je vytvoren� pre v�uku - pou��van�m. To znamen�, �e je potrebn� si pr�kazy vysk��a�, aby bolo - u�enie spr�vne. Ak len �itas text, pr�kazy zabudne�! + Je dôležité zapamätať si, že táto výuka je vytvorená pre výuku + používaním. To znamená, že je potrebné si príkazy vyskúšať, aby bolo + učenie správne. Ak len čitas text, príkazy zabudneš! - Presved� sa, �e Caps-Lock NIEJE stla�en� a stla�t kl�vesu - j nieko�ko kr�t, aby sa kurzor posunul nato�ko, �e lekcia 1.1.1 - celkom zapln� obrazovku. + Presvedč sa, že Caps-Lock NIEJE stlačený a stlačt klávesu + j niekoľko krát, aby sa kurzor posunul natoľko, že lekcia 1.1.1 + celkom zaplní obrazovku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.1.1: POHYB KURZOROM - ** Pre pohyb kurzorum stla� kl�vesy h,j,k,l ako je zn�zornen�. ** + ** Pre pohyb kurzorum stlač klávesy h,j,k,l ako je znázornené. ** ^ - k Funkcia: Kl�vesa h je na�avo a vykon� pohyb do�ava. - < h l > Kl�vesa l je napravo a vykon� pohyb doprava. - j Kl�vesa j vyzer� ako ��pka dole + k Funkcia: Klávesa h je naľavo a vykoná pohyb doľava. + < h l > Klávesa l je napravo a vykoná pohyb doprava. + j Klávesa j vyzerá ako šípka dole v - 1. Pohybuj kurzorom po obrazovke, k�m si na to nezvykne�. + 1. Pohybuj kurzorom po obrazovke, kým si na to nezvykneš. - 2. Dr� stla�en� kl�vesu pre pohyb dole (j), k�m sa jej funkcia nezopakuje. ----> Teraz sa u� vie� pohybova� na nasleduj�cu lekciu. + 2. Drž stlačenú klávesu pre pohyb dole (j), kým sa jej funkcia nezopakuje. +---> Teraz sa už vieš pohybovať na nasledujúcu lekciu. - 3. Pou�it�m kl�vesy pre pohyb dole prejdi na Lekciu 1.1.2. + 3. Použitím klávesy pre pohyb dole prejdi na Lekciu 1.1.2. -Pozn�mka: Ak si niesi ist� t�m �o si nap�sal, stla� - na prechod do norm�lneho m�du. +Poznámka: Ak si niesi istý tým čo si napísal, stlač + na prechod do normálneho módu. -Pozn�mka: Kurzorov� kl�vesy s� tie� funk�n�. Ale pou��van�m hjkl sa bude� - schopn� pohybova� r�chlej�ie, ke� si zvykne� ich pou��va�. Naozaj! +Poznámka: Kurzorové klávesy sú tiež funkčné. Ale používaním hjkl sa budeš + schopný pohybovať rýchlejšie, keď si zvykneš ich používať. Naozaj! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.1.2: ZATV�RANIE VIMU + LEKCIA 1.1.2: ZATVÁRANIE VIMU - !! POZN�MKA: Pred vykonan�m t�chto krokov si pre��taj cel� t�to lekciu !! + !! POZNÁMKA: Pred vykonaním týchto krokov si prečítaj celú túto lekciu !! - 1. Stla� kl�vesu (aby si sa u�ite nach�dzal v norm�lnom m�de) + 1. Stlač klávesu (aby si sa učite nachádzal v normálnom móde) - 2. Nap��: :q! . - T�m ukon��� pr�cu s editorom BEZ ulo�enia zmien, ktor� si vykonal. + 2. Napíš: :q! . + Tým ukončíš prácu s editorom BEZ uloženia zmien, ktoré si vykonal. - 3. Ke� sa dostane� na pr�kazov� riadok, nap�� pr�kaz, ktor�m sa dostane� - spe� do tejto v�uky. To m��e by�: vimtutor + 3. Keď sa dostaneš na príkazový riadok, napíš príkaz, ktorým sa dostaneš + speť do tejto výuky. To môže byť: vimtutor - 4. Ak si si tieto kroky spo�ahlivo zapam�tal, vykonaj kroky 1 a� 3, pre - ukon�enie a znovu spustenie editora. + 4. Ak si si tieto kroky spoľahlivo zapamätal, vykonaj kroky 1 až 3, pre + ukončenie a znovu spustenie editora. -POZN�MKA: :q! neulo�� zmeny, ktor� si vykonal. O nieko�ko lekci� - sa nau��� ako ulo�i� zmeny do s�boru +POZNÁMKA: :q! neuloží zmeny, ktoré si vykonal. O niekoľko lekcií + sa naučíš ako uložiť zmeny do súboru - 5. presu� kurzor dole na lekciu 1.1.3. + 5. presuň kurzor dole na lekciu 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.3: EDIT�CIA TEXTU - MAZANIE + Lekcia 1.1.3: EDITÁCIA TEXTU - MAZANIE -** Stla�enie kl�vesy x v norm�lnom m�de zma�e znak na mieste kurzora. ** +** Stlačenie klávesy x v normálnom móde zmaže znak na mieste kurzora. ** - 1. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. + 1. Presuň kurzor nižšie na riadok označený značkou --->. - 2. Aby si mohol odstr�ni� chyby, pohybuj kurzorom k�m neprejde na znak, - ktor� chce� zmaza�. + 2. Aby si mohol odstrániť chyby, pohybuj kurzorom kým neprejde na znak, + ktorý chceš zmazať. - 3. Stla� kl�vesu x aby sa zmazal nechcen� znak. + 3. Stlač klávesu x aby sa zmazal nechcený znak. - 4. Zopakuj kroky 2 a� 4 a� k�m veta nieje spr�vna. + 4. Zopakuj kroky 2 až 4 až kým veta nieje správna. ----> Kraava skoo�illa ccezz mesiiac. +---> Kraava skoočilla ccezz mesiiac. - 5. Ak je veta spr�vna, prejdi na lekciu 1.1.4. + 5. Ak je veta správna, prejdi na lekciu 1.1.4. -POZN�MKA: Nesk��aj si zapam�ta� obsah tejto v�uky, ale sa u� pou��van�m. +POZNÁMKA: Neskúšaj si zapamätať obsah tejto výuky, ale sa uč používaním. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.4: EDIT�CIA TEXTU - VKLADANIE + Lekcia 1.1.4: EDITÁCIA TEXTU - VKLADANIE - ** Stla�enie kl�vesy i umo��uje vkladanie textu. ** + ** Stlačenie klávesy i umožňuje vkladanie textu. ** - 1. Presu� kurzor ni��ie na prv� riadok za zna�ku --->. + 1. Presuň kurzor nižšie na prvý riadok za značku --->. - 2. Pre upravenie prv�ho riadku do rovnak�ho tvaru ako je druh� riadok, - presu� kurzor na prv� znak za misto, kde m� by� text vlo�en�. + 2. Pre upravenie prvého riadku do rovnakého tvaru ako je druhý riadok, + presuň kurzor na prvý znak za misto, kde má byť text vložený. - 3. Stla� kl�vesu i a nap�� potrebn� text. + 3. Stlač klávesu i a napíš potrebný text. - 4. Po opraven� ka�dej chyby, stla� pre n�vrat do norm�lneho m�du. - Zopakuj kroky 2 a� 4 k�m nieje veta spr�vna. + 4. Po opravení každej chyby, stlač pre návrat do normálneho módu. + Zopakuj kroky 2 až 4 kým nieje veta správna. ----> Tu je text ch�baj�ci tejto. ----> Tu je nejak� text ch�baj�ci od tejto �iary. +---> Tu je text chýbajúci tejto. +---> Tu je nejaký text chýbajúci od tejto čiary. - 5. Ke� sa dostato�ne nau��� vklada� text, prejdi na nasleduj�ce zhrnutie. + 5. Keď sa dostatočne naučíš vkladať text, prejdi na nasledujúce zhrnutie. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.5: EDIT�CIA TEXTU - PRID�VANIE + Lekcia 1.1.5: EDITÁCIA TEXTU - PRIDÁVANIE - ** Stla�enie kl�vesy A umo��uje prid�va� text. ** + ** Stlačenie klávesy A umožňuje pridávať text. ** - 1. Presu� kurozr ni��ie na prv� riadok za zna�kou --->. - Nez�le�� na tom, na ktorom znaku sa kurzor v tom riadku nach�dza. + 1. Presuň kurozr nižšie na prvý riadok za značkou --->. + Nezáleží na tom, na ktorom znaku sa kurzor v tom riadku nachádza. - 2. Stla� kl�vesu A a nap�� potrebn� text. + 2. Stlač klávesu A a napíš potrebný text. - 3. Po pridan� textu stla� kl�vesu pre n�vrat do Norm�lneho m�du. + 3. Po pridaní textu stlač klávesu pre návrat do Normálneho módu. - 4. Presu� kurozr na druh� riadok ozna�en� ---> a zopakuj - kroky 2 a 3 k�m nieje veta spr�vna. + 4. Presuň kurozr na druhý riadok označený ---> a zopakuj + kroky 2 a 3 kým nieje veta správna. ----> Tu je nejak� text ch�baj�ci o - Tu je nejak� text ch�baj�ci od tia�to. ----> Tu tie� ch�ba nej - Tu tie� ch�ba nejak� text. +---> Tu je nejaký text chýbajúci o + Tu je nejaký text chýbajúci od tiaľto. +---> Tu tiež chýba nej + Tu tiež chýba nejaký text. - 5. Ke� sa dostato�ne nau��� prid�va� text, prejdi na lekciu 1.1.6. + 5. Keď sa dostatočne naučíš pridávať text, prejdi na lekciu 1.1.6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.6: EDIT�CIA S�BORU + Lekcia 1.1.6: EDITÁCIA SÚBORU - ** Nap�san�m :wq sa s�bor ulo�� a zavrie ** + ** Napísaním :wq sa súbor uloží a zavrie ** -!! POZN�MKA: Pred vykonan�m t�chto krokov si pre��taj cel� lekciu!! +!! POZNÁMKA: Pred vykonaním týchto krokov si prečítaj celú lekciu!! -1. Opusti t�to v�uku, ako si to urobil v lekcii 1.1.2: :q! +1. Opusti túto výuku, ako si to urobil v lekcii 1.1.2: :q! -2. Do pr�kazov�ho riadku nap�� pr�kaz: vim tutor - 'vim' je pr�kaz, ktor� spust� editor Vim, 'tutor' je meno s�boru, - ktor� chce� editova�. Pou�i tak� s�bor, ktor� m��e� meni�. +2. Do príkazového riadku napíš príkaz: vim tutor + 'vim' je príkaz, ktorý spustí editor Vim, 'tutor' je meno súboru, + ktorý chceš editovať. Použi taký súbor, ktorý môžeš meniť. -3. Vlo� a zma� text tak, ako si sa nau�il v predo�l�ch lekciach. +3. Vlož a zmaž text tak, ako si sa naučil v predošlých lekciach. -4. Ulo� s�bor so zmenami a opusti Vim pr�kazom: :wq +4. Ulož súbor so zmenami a opusti Vim príkazom: :wq -5. Re�tartuj vimtutor a presu� sa dole na nasleduj�ce zhrnutie. +5. Reštartuj vimtutor a presuň sa dole na nasledujúce zhrnutie. -6. Urob tak po pre��tan� predo�l�ch krokov a porozumeniu im. +6. Urob tak po prečítaní predošlých krokov a porozumeniu im. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ZHRNUTIE LEKCIE 1.1 - 1. Kurzor sa pohybuje pou�it�m kl�ves so ��pkami alebo kl�vesmi hjkl. + 1. Kurzor sa pohybuje použitím kláves so šípkami alebo klávesmi hjkl. h (do lava) j (dole) k (hore) l (doprava) - 2. Pre spustenie Vimu (z pr�kazov�ho riadku) nap��: vim FILENAME + 2. Pre spustenie Vimu (z príkazového riadku) napíš: vim FILENAME - 3. Na ukon�enie Vimu nap��: :q! pre zru�enie v�etk�ch zmien - alebo nap��: :wq pre ulo�enie zmien. + 3. Na ukončenie Vimu napíš: :q! pre zrušenie všetkých zmien + alebo napíš: :wq pre uloženie zmien. - 4. Na zmazanie znaku na mieste kurzora nap��: x + 4. Na zmazanie znaku na mieste kurzora napíš: x - 5. Pre vlo�enie textu na mieste kurzora v norm�lnom m�de nap��: - i nap�� vkladan� text vkladanie pred kurzor - A nap�� prid�van� text vkladanie za riadok + 5. Pre vloženie textu na mieste kurzora v normálnom móde napíš: + i napíš vkladaný text vkladanie pred kurzor + A napíš pridávaný text vkladanie za riadok -POZN�MKA: Stla�enie �a premiestn� do norm�lneho m�du alebo zru�� - nejak� nechcen� a �iasto�ne dokon�en� pr�kaz. +POZNÁMKA: Stlačenie ťa premiestní do normálneho módu alebo zruší + nejaký nechcený a čiastočne dokončený príkaz. -Teraz pokra�uj lekciou 1.2. +Teraz pokračuj lekciou 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.1: Mazacie pr�kazy + Lekcia 1.2.1: Mazacie príkazy - ** Nap�sanie pr�kazu dw zma�e znaky do konca slova. ** + ** Napísanie príkazu dw zmaže znaky do konca slova. ** -1. Stla� aby si bol bezpe�ne v norm�lnom m�de. +1. Stlač aby si bol bezpečne v normálnom móde. -2. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. +2. Presuň kurzor nižšie na riadok označený značkou --->. -3. Presu� kurzor na za�iatok slova, ktor� je potrebn� zmaza�. +3. Presuň kurzor na začiatok slova, ktoré je potrebné zmazať. -4. Nap�� dw aby slovo zmizlo. +4. Napíš dw aby slovo zmizlo. -POZN�MKA: P�smeno d sa zobraz� na poslednom riadku obrazovky ke� ho - nap��e�. Vim na teba po�k�, aby si mohol nap�sa� - p�smeno w. Ak vid�� nie�o in� ako d , tak si nap�sal - nespr�vny znak; stla� a za�ni znova. +POZNÁMKA: Písmeno d sa zobrazí na poslednom riadku obrazovky keď ho + napíšeš. Vim na teba počká, aby si mohol napísať + písmeno w. Ak vidíš niečo iné ako d , tak si napísal + nesprávny znak; stlač a začni znova. ----> Tu je nieko�ko slov z�bava, ktor� nie patria list do tejto vety. +---> Tu je niekoľko slov zábava, ktoré nie patria list do tejto vety. -5. Zopakuj kroky 3 a� 4 k�m veta nieje spr�vna a prejdi na lekciu 1.2.2. +5. Zopakuj kroky 3 až 4 kým veta nieje správna a prejdi na lekciu 1.2.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.2: VIAC MAZAC�CH PR�KAZOV + Lekcia 1.2.2: VIAC MAZACÍCH PRÍKAZOV - ** Nap�sanie pr�kazu d$ zma�e znaky do konca riadku ** + ** Napísanie príkazu d$ zmaže znaky do konca riadku ** -1. Stla� aby si bol bezpe�ne v norm�lnom m�de. +1. Stlač aby si bol bezpečne v normálnom móde. -2. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. +2. Presuň kurzor nižšie na riadok označený značkou --->. -3. Presu� kurzor na koniec spr�vnej vety (ZA prv� bodku). +3. Presuň kurzor na koniec správnej vety (ZA prvú bodku). -4. Nap�� d$ aby sa zmazali znaky do konca riadku. +4. Napíš d$ aby sa zmazali znaky do konca riadku. ----> Niekto nap�sal koniec tohto riadku dvakr�t. koniec tohot riadku dvakr�t. +---> Niekto napísal koniec tohto riadku dvakrát. koniec tohot riadku dvakrát. -5. Prejdi na lekciu 1.2.3 pre pochopenie toho �o sa stalo. +5. Prejdi na lekciu 1.2.3 pre pochopenie toho čo sa stalo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.3: OPER�TORY A POHYBY + Lekcia 1.2.3: OPERÁTORY A POHYBY - Ve�a pr�kazov, ktor� menia text s� odvoden� od oper�torov a pohybov. - Form�t pre pr�kaz mazania kl�vesou d je nasledovn�: + Veľa príkazov, ktoré menia text sú odvodené od operátorov a pohybov. + Formát pre príkaz mazania klávesou d je nasledovný: d pohyb kde: - d - je mazac� oper�tor - pohyb - je to �o oper�tor vykon�va (vyp�san� ni��ie) + d - je mazací operátor + pohyb - je to čo operátor vykonáva (vypísané nižšie) - Kr�tky list pohybov: - w - do za�iatku �al�ieho slova, okrem jeho prv�ho p�smena. - e - do konca teraj�ieho slova, vr�tane posledn�ho znaku. - $ - do konca riadku, vr�tane posledn�ho znaku + Krátky list pohybov: + w - do začiatku ďalšieho slova, okrem jeho prvého písmena. + e - do konca terajšieho slova, vrátane posledného znaku. + $ - do konca riadku, vrátane posledného znaku - Tak�e nap�san�m de sa zma�e v�etko od kurzora do konca slova. + Takže napísaním de sa zmaže všetko od kurzora do konca slova. -POZN�MKA: Stla�en�m iba pohybu v norm�lnom m�de bez oper�tora - sa presunie kurzor tak ako je to �pecivikovan�. +POZNÁMKA: Stlačením iba pohybu v normálnom móde bez operátora + sa presunie kurzor tak ako je to špecivikované. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.4: Pou�itie viacn�sobn�ho pohybu + Lekcia 1.2.4: Použitie viacnásobného pohybu - ** Nap�san�m ��sla pred pohyb ho zopakuje zadn� po�et kr�t ** + ** Napísaním čísla pred pohyb ho zopakuje zadný počet krát ** - 1. Presu� kurozr ni��ie na za�iatok riadku ozna�en�ho --->. + 1. Presuň kurozr nižšie na začiatok riadku označeného --->. - 2. Nap�� 2w a kurozr sa presunie o dve slov� vpred. + 2. Napíš 2w a kurozr sa presunie o dve slová vpred. - 3. Nap�� 3e a kurozr sa presunie vpred na koniec tretieho slova. + 3. Napíš 3e a kurozr sa presunie vpred na koniec tretieho slova. - 4. Nap�� 0 (nula) a kurozr sa presunie na za�iatok riadku. + 4. Napíš 0 (nula) a kurozr sa presunie na začiatok riadku. - 5. Zopakuj kroky 2 a 3 s r�znymi ��slami. + 5. Zopakuj kroky 2 a 3 s rôznymi číslami. ----> Toto je riadok so slovami po kotr�ch sa m��ete pohybova�. +---> Toto je riadok so slovami po kotrých sa môžete pohybovať. 6. Prejdi na lekciu 1.2.5. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.5: POU�ITIE VIACN�SOBN�HO MAZANIA PRE HROMADN� MAZANIE + Lekcia 1.2.5: POUŽITIE VIACNÁSOBNÉHO MAZANIA PRE HROMADNÉ MAZANIE - ** Nap�sanie ��sla spolu s oper�torom ho zopakuje zadan� po�et kr�t ** + ** Napísanie čísla spolu s operátorom ho zopakuje zadaný počet krát ** - V kombin�cii oper�torov mazania a pohybu spom�nan�ho vy��ie vlo� po�et - pred pohyb pre docielenie hromadn�ho mazania: - d ��slo pohyb + V kombinácii operátorov mazania a pohybu spomínaného vyššie vlož počet + pred pohyb pre docielenie hromadného mazania: + d číslo pohyb - 1. Presu� kurzor na prv� slovo p�san� VE�K�MI P�SMENAMI - v riadku ozna�enom --->. + 1. Presuň kurzor na prvé slovo písané VEĽKÝMI PÍSMENAMI + v riadku označenom --->. - 2. Nap�� 2dw a zma�e� dve slov� p�san� VE�K�MI P�SMENAMI + 2. Napíš 2dw a zmažeš dve slová písané VEĽKÝMI PÍSMENAMI - 3. Zopakuj kroky 1 a 2 s pou�it�m r�zneho ��sla tak aby si zmazal slov� - p�san� ve�k�mi p�smenami jedn�m pr�kazom. + 3. Zopakuj kroky 1 a 2 s použitím rôzneho čísla tak aby si zmazal slová + písané veľkými písmenami jedným príkazom. ---> Tento ABC DE riadok FGHI JK LMN OP so slovamI je Q RS TUV vycisteny. -POZN�MKA: ��slo medzi oper�torom d a pohybom funguje podobne ako pri - pou�it� s pohybom bez oper�tora. +POZNÁMKA: Číslo medzi operátorom d a pohybom funguje podobne ako pri + použití s pohybom bez operátora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.6: OPER�CIE S RIADKAMI + Lekcia 1.2.6: OPERÁCIE S RIADKAMI - ** Nap�sanie pr�kazu dd zma�e cel� riadok. ** + ** Napísanie príkazu dd zmaže celý riadok. ** -Vzh�adom na frekvenciu mazania cel�ho riadku, sa autori Vimu rozhodli, -�e bude jednoduch�ie maza� cel� riadok nap�san�m dvoch p�smen d. +Vzhľadom na frekvenciu mazania celého riadku, sa autori Vimu rozhodli, +že bude jednoduchšie mazať celý riadok napísaním dvoch písmen d. -1. Presu� kurzor na druh� riadok v texte na spodu. -2. Nap�� dd aby si zmazal riadok. -3. Prejdi na �tvrt� riadok. -4. Nap�� 2dd aby si zmazal dva riadky. +1. Presuň kurzor na druhý riadok v texte na spodu. +2. Napíš dd aby si zmazal riadok. +3. Prejdi na štvrtý riadok. +4. Napíš 2dd aby si zmazal dva riadky. - 1) Ru�e s� �erven�, - 2) Blato je z�bavn�, - 3) Fialky s� modr�, - 4) M�m auto, - 5) Hodinky ukazuj� �as, - 6) Cukor je sladk�, + 1) Ruže sú červené, + 2) Blato je zábavné, + 3) Fialky sú modré, + 4) Mám auto, + 5) Hodinky ukazujú čas, + 6) Cukor je sladký, 7) A to si ty. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.7: PR�KAZ UNDO + Lekcia 1.2.7: PRÍKAZ UNDO -** Stla� u pre vr�tenie posledn�ho pr�kazu, U pre �pravu cel�ho riadku. ** +** Stlač u pre vrátenie posledného príkazu, U pre úpravu celého riadku. ** -1. Presu� kurzor ni��ie na riadok ozna�en� zna�kou ---> a premiestni ho na - prv� chybu. -2. Nap�� x pre zmazanie prv�ho nechcen�ho riadku. -3. Teraz nap�� u ��m vr�t�� sp� posledne vykonan� pr�kaz. -4. Teraz oprav v�etky chyby na riadku pou�it�m pr�kazu x . -5. Teraz nap�� ve�k� U ��m vr�t�� riadok do p�vodn�ho stavu. -6. Teraz nap�� u nieko�ko kr�t, ��m vr�t�� sp� pr�kaz U. -7. Teraz nap�� CTRL-R (dr� kl�vesu CTRL stla�en� k�m stl��a� R) nieko�ko - kr�t, ��m vr�t�� sp� predt�m vr�ten� pr�kazy (undo z undo). +1. Presuň kurzor nižšie na riadok označený značkou ---> a premiestni ho na + prvú chybu. +2. Napíš x pre zmazanie prvého nechceného riadku. +3. Teraz napíš u čím vrátíš späť posledne vykonaný príkaz. +4. Teraz oprav všetky chyby na riadku použitím príkazu x . +5. Teraz napíš veľké U čím vrátíš riadok do pôvodného stavu. +6. Teraz napíš u niekoľko krát, čím vrátíš späť príkaz U. +7. Teraz napíš CTRL-R (drž klávesu CTRL stlačenú kým stláčaš R) niekoľko + krát, čím vrátíš späť predtým vrátené príkazy (undo z undo). ----> Opprav chybby nna toomto riadku a zmee� ich pommocou undo. +---> Opprav chybby nna toomto riadku a zmeeň ich pommocou undo. - 8. Tieto pr�kazy s� �asto pou��van�. Teraz prejdi na zhrnutie lekcie 1.2. + 8. Tieto príkazy sú často používané. Teraz prejdi na zhrnutie lekcie 1.2. @@ -345,243 +345,243 @@ Vzh LEKCIA 1.2 ZHRNUTIE - 1. Pre zmazanie znakov od kurzora do konca slova nap��: dw + 1. Pre zmazanie znakov od kurzora do konca slova napíš: dw - 2. Pre zmazanie znakov od kurzora do konca riadku nap��: d$ + 2. Pre zmazanie znakov od kurzora do konca riadku napíš: d$ - 3. Pre zmazanie cel�ho riadku nap��: dd + 3. Pre zmazanie celého riadku napíš: dd - 4. Pre zopakovanie pohybu, nap�� pred neho ��slo: 2w + 4. Pre zopakovanie pohybu, napíš pred neho číslo: 2w - 5. Form�t pre p�kaz: + 5. Formát pre píkaz: - oper�tor [��slo] pohyb + operátor [číslo] pohyb kde: - oper�tor - �o treba robi�, napr�klad d pre zmazanie - [��slo] - je volite�n� po�et pre opakovanie pohybu - pohyb - pohyb po texte vzh�adom na oper�tor, napr�klad w (slovo), - $ (do konca riadku), at�. + operátor - čo treba robiť, napríklad d pre zmazanie + [číslo] - je voliteľný počet pre opakovanie pohybu + pohyb - pohyb po texte vzhľadom na operátor, napríklad w (slovo), + $ (do konca riadku), atď. - 6. Pre pohyb na za�iatok riadku pou�i nulu: 0 + 6. Pre pohyb na začiatok riadku použi nulu: 0 - 7. Pre vr�tenie sp� predo�lej oper�cie nap��: u (mal� u) - Pre vr�tenie v�etk�ch �prav na riadku nap��: U (ve�k� U) - Pre vr�tenie vr�ten�ch �prav nap��: CTRL-R + 7. Pre vrátenie späť predošlej operácie napíš: u (malé u) + Pre vrátenie všetkých úprav na riadku napíš: U (veľké U) + Pre vrátenie vrátených úprav napíš: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.1: PR�KAZ VLO�I� + Lekcia 1.3.1: PRÍKAZ VLOŽIŤ - ** Nap�sanie pr�kazu p vlo�� psledn� v�maz za kurzor. ** + ** Napísanie príkazu p vloží psledný výmaz za kurzor. ** - 1. Presu� kurzor ni��ie na prv� riadok textu. + 1. Presuň kurzor nižšie na prvý riadok textu. - 2. Nap�� dd ��m zma�e� riadok a ulo��� ho do buffera editora Vim. + 2. Napíš dd čím zmažeš riadok a uložíš ho do buffera editora Vim. - 3. Presu� kurzor vy��ie tam, kam zmazan� riadok patr�. + 3. Presuň kurzor vyššie tam, kam zmazaný riadok patrí. - 4. Ak nap��e� v norm�lnom m�de p zmazan� riadk sa vlo��. + 4. Ak napíšeš v normálnom móde p zmazaný riadk sa vloží. - 5. Zopakuj kroky 2 a� 4, k�m riadky nies� v spr�vnom porad�. + 5. Zopakuj kroky 2 až 4, kým riadky niesú v správnom poradí. ----> d) Tie� sa dok�e� vzdel�va�? ----> b) Fialky s� modr�, ----> c) Inteligencia sa vzdel�va, ----> a) Ru�e s� �erven�, +---> d) Tiež sa dokážeš vzdelávať? +---> b) Fialky sú modré, +---> c) Inteligencia sa vzdeláva, +---> a) Ruže sú červené, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.2: PR�KAZ NAHRADENIA + Lekcia 1.3.2: PRÍKAZ NAHRADENIA - ** Nap�san�m rx sa nahrad� znak na mieste kurzora znakom x . ** + ** Napísaním rx sa nahradí znak na mieste kurzora znakom x . ** - 1. Presu� kurzor ni��ie na prv� riadok textu ozna�en�ho zna�kou --->. + 1. Presuň kurzor nižšie na prví riadok textu označeného značkou --->. - 2. Presu� kurzor na za�iatok prvej chyby. + 2. Presuň kurzor na začiatok prvej chyby. - 3. nap�� r a potom znak, ktor� tam m� by�. + 3. napíš r a potom znak, ktorý tam má byť. - 4. Zopakuj kroky 2 a 3, k�m prv� riadok nieje zhodn� s druh�m. + 4. Zopakuj kroky 2 a 3, kým prvý riadok nieje zhodný s druhým. ----> Ka� bol tento riasok p�aan�, niekro stla�il nespr�bne kl�vesy! ----> Ke� bol tento riadok p�san�, niekto stla�il nespr�vne kl�vesy! +---> Kaď bol tento riasok píaaný, niekro stlašil nesprábne klávesy! +---> Keď bol tento riadok písaný, niekto stlačil nesprávne klávesy! 5. Teraz prejdi na lekciu 1.3.2. -POZN�MKA: Pam�taj si, �e nau�i� sa m��e� len pou��vanim, nie pam�tan�m. +POZNÁMKA: Pamätaj si, že naučiť sa môžeš len používanim, nie pamätaním. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.3: PR�KAZ �PRAVY + Lekcia 1.3.3: PRÍKAZ ÚPRAVY - ** Ak chce� zmeni� �as� slova do konca slova, nap�� ce . ** + ** Ak chceš zmeniť časť slova do konca slova, napíš ce . ** - 1. Presu� kurzor ni��ie na prv� riadok ozna�en� zna�kou --->. + 1. Presuň kurzor nižšie na prvý riadok označený značkou --->. - 2. Umiestni kurzor na p�smeno o v slove rosfpl. + 2. Umiestni kurzor na písmeno o v slove rosfpl. - 3. Nap�� ce a oprav slovo (v tomto pr�pade nap�� 'iadok'.) + 3. Napíš ce a oprav slovo (v tomto prípade napíš 'iadok'.) - 4. Stla� a prejdi na �al�� znak, ktor� treba zmeni�. + 4. Stlač a prejdi na ďalší znak, ktorý treba zmeniť. - 5. Zopakuj kroky 3 a 4, k�m prv� veta nieje rovnak� ako druh�. + 5. Zopakuj kroky 3 a 4, kým prvá veta nieje rovnaká ako druhá. ----> Tento rosfpl m� nieko�ko skic, ktor� je pirewvb� zmeni� piy�u��n pr�kazu. ----> Tento riadok m� nieko�ko slov, ktor� je potrebn� zmeni� pou�it�m pr�kazu. +---> Tento rosfpl má niekoľko skic, ktoré je pirewvbí zmeniť piyťučán príkazu. +---> Tento riadok má niekoľko slov, ktoré je potrebné zmeniť použitím príkazu. -Pozn�mka, �e ce zma�e slovo a nastav� vkladac� m�d. +Poznámka, že ce zmaže slovo a nastaví vkladací mód. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.4: VIAC ZMIEN POU�IT�M c + Lekcia 1.3.4: VIAC ZMIEN POUŽITÍM c - ** Pr�kaz pre �pravy sa pou��va s rovnak�mi pohybmi ako pre mazanie ** + ** Príkaz pre úpravy sa používa s rovnakými pohybmi ako pre mazanie ** - 1. Pr�kaz pre �pravy pracuje rovnako ako pre mazanie. Form�t je: + 1. Príkaz pre úpravy pracuje rovnako ako pre mazanie. Formát je: - c [��slo] pohyb + c [číslo] pohyb - 2. Pohyby s� rovnak�, ako napr�klad w (slovo) a $ (koniec riadku). + 2. Pohyby sú rovnaké, ako napríklad w (slovo) a $ (koniec riadku). - 3. Presu� kurzor ni��ie na prv� riadok ozna�en� zna�kou --->. + 3. Presuň kurzor nižšie na prvý riadok označený značkou --->. - 4. Presu� kurzor na prv� chybu. + 4. Presuň kurzor na prvú chybu. - 5. nap�� c$ aby si mohol upravi� zvy�ok riadku pod�a druh�ho - a stla� . + 5. napíš c$ aby si mohol upraviť zvyšok riadku podľa druhého + a stlač . ---> Koniec tohto riadku potrebuje pomoc, aby bol ako druhy. ----> Koniec tohto riadku potrebuje opravi� pou�it�m pr�kazu c$ . +---> Koniec tohto riadku potrebuje opraviť použitím príkazu c$ . -POZN�MKA: M��e� pou�i� kl�vesu backspace na �pravu zmien po�as p�sania. +POZNÁMKA: Môžeš použiť klávesu backspace na úpravu zmien počas písania. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 1.3 ZHRNUTIE - 1. Na vlo�enie textu, ktor� u� bol zmazan�, nap�� p . To vlo�� zmazan� - text ZA kurzor (ak bol riadok zmazan� prejde na riadok pod kurzorom). + 1. Na vloženie textu, ktorý už bol zmazaný, napíš p . To vloží zmazaný + text ZA kurzor (ak bol riadok zmazaný prejde na riadok pod kurzorom). - 2. Pre naradenie znaku na mieste kurzora, nap�� r a potom znak, ktor� - nahrad� p�vodn� znak. + 2. Pre naradenie znaku na mieste kurzora, napíš r a potom znak, ktorý + nahradí pôvodný znak. - 3. Pr�kaz na upravenie umo��uje zmeni� od kurzora a� po miesto, ktor� - ur�uje pohyb. napr. Nap�� ce ��m zmn�� text od poz�cie - kurzora do konca slova, c$ zmen� text do konca riadku. + 3. Príkaz na upravenie umožňuje zmeniť od kurzora až po miesto, ktoré + určuje pohyb. napr. Napíš ce čím zmníš text od pozície + kurzora do konca slova, c$ zmení text do konca riadku. - 4. Form�t pre nahradenie je: + 4. Formát pre nahradenie je: - c [��slo] pohyb + c [číslo] pohyb -Teraz prejdi na nalseduj�cu lekciu. +Teraz prejdi na nalsedujúcu lekciu. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.1: POZ�CIA A STATUS S�BORU + Lekcia 1.4.1: POZÍCIA A STATUS SÚBORU - ** Stla� CTRL-g pre zobrazenie svojej poz�cie v s�bore a statusu s�boru. - Nap�� G pre presun na riadok v s�bore. ** + ** Stlač CTRL-g pre zobrazenie svojej pozície v súbore a statusu súboru. + Napíš G pre presun na riadok v súbore. ** - Pozn�mka: Pre��taj si cel� t�to lekciu sk�r ako za�ne� vykon�va� kroky!! + Poznámka: Prečítaj si celú túto lekciu skôr ako začneš vykonávať kroky!! - 1. Dr� stla�en� kl�vesu Ctrl a stla� g . Toto naz�vame CTRL-G. - Na spodu obrazovky sa zobraz� spr�va s n�zvom s�boru a poz�ciou - v s�bore. Zapam�tajsi si ��slo riadku pre pou�itie v kroku 3. + 1. Drž stlačenú klávesu Ctrl a stlač g . Toto nazývame CTRL-G. + Na spodu obrazovky sa zobrazí správa s názvom súboru a pozíciou + v súbore. Zapamätajsi si číslo riadku pre použitie v kroku 3. - 2. Stla� G ��m sa dostane� na spodok s�boru. - Nap�� gg ��m sa dostane� na za�iatok s�boru. + 2. Stlač G čím sa dostaneš na spodok súboru. + Napíš gg čím sa dostaneš na začiatok súboru. - 3. Nap�� ��slo riadku na ktorom si sa nach�dzal a stla� G. To �a - vr�ti na riadok, na ktorom si prv� kr�t stla�il CTRL-G. + 3. Napíš číslo riadku na ktorom si sa nachádzal a stlač G. To ťa + vráti na riadok, na ktorom si prvý krát stlačil CTRL-G. - 4. Ak sa c�t�� schopn� vykona� teto kroky, vykonaj kroky 1 a� 3. + 4. Ak sa cítíš schopný vykonať teto kroky, vykonaj kroky 1 až 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.2: PR�KAZ VYH�AD�VANIA + Lekcia 1.4.2: PRÍKAZ VYHĽADÁVANIA - ** Nap�� / nasledovan� re�azcom pre vyh�adanie pr�slu�n�ho re�azca. ** + ** Napíš / nasledované reťazcom pre vyhľadanie príslušného reťazca. ** - 1. Nap�� znak / v norm�lnom m�de. Pozn�mka, �e tento znak sa spolu - s kurzorom zobraz� v dolnej �asti obrazovky s : pr�kazom. + 1. Napíš znak / v normálnom móde. Poznámka, že tento znak sa spolu + s kurzorom zobrazí v dolnej časti obrazovky s : príkazom. - 2. Teraz nap�� 'errroor' . To je slovo, ktor� chce� vyh�ada�. + 2. Teraz napíš 'errroor' . To je slovo, ktoré chceš vyhľadať. - 3. Pre vyh�adanie �al�ieho v�skytu rovnak�ho re�azca, stla� jednoducho n. - Pre vyh�adanie �al�ieho v�skytu rovnak�ho re�azca opa�n�m smerom, + 3. Pre vyhľadanie ďalšieho výskytu rovnakého reťazca, stlač jednoducho n. + Pre vyhľadanie ďalšieho výskytu rovnakého reťazca opačným smerom, N. - 4. Ak chce� vyh�ada� re�azec v sp�tnom smere, pou�� pr�kaz ? miesto - pr�kazu /. + 4. Ak chceš vyhľadať reťazec v spätnom smere, použí príkaz ? miesto + príkazu /. - 5. Pre n�vrat na miesto z ktor�ho si pri�iel stla� CTRL-O (dr� stla�en� - kl�vesu Ctrl po�as stla�enia kl�vesy o). Zopakuj pre �al�� n�vrat - sp�. CTRL-I ide vpred. + 5. Pre návrat na miesto z ktorého si prišiel stlač CTRL-O (drž stlačenú + klávesu Ctrl počas stlačenia klávesy o). Zopakuj pre ďalší návrat + späť. CTRL-I ide vpred. -POZN�MKA: "errroor" nieje sp�sob hl�skovania error; errroor je error. -POZN�MKA: Ke� vyh�ad�vanie dosiahne koniec tohto s�boru, bude pokra�ova� na - za�iatku, dokia� nieje resetovan� nastavenie 'wrapscan' . +POZNÁMKA: "errroor" nieje spôsob hláskovania error; errroor je error. +POZNÁMKA: Keď vyhľadávanie dosiahne koniec tohto súboru, bude pokračovať na + začiatku, dokiaľ nieje resetované nastavenie 'wrapscan' . ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.3: VYH�AD�VANIE ZODPOVEDAJ�CICH Z�TAVORIEK + Lekcia 1.4.3: VYHĽADÁVANIE ZODPOVEDAJÚCICH ZÁTAVORIEK - ** Nap�� % pre vyh�adanie pr�slu�n�ho znaku ),], alebo } . ** + ** Napíš % pre vyhľadanie príslušného znaku ),], alebo } . ** - 1. Premiestni kurzor na hocak� zo znakov (, [, alebo { v riadku ni��ie - ozna�en�ho zna�kou --->. + 1. Premiestni kurzor na hocaký zo znakov (, [, alebo { v riadku nižšie + označeného značkou --->. - 2. Teraz nap�� znak % . + 2. Teraz napíš znak % . - 3. Kurzor sa premiestni na zodpovedaj�cu z�tvorku. + 3. Kurzor sa premiestni na zodpovedajúcu zátvorku. - 4. Nap�� % pre presun kurzoru sp� na otv�raj�cu z�tvorku. + 4. Napíš % pre presun kurzoru späť na otvárajúcu zátvorku. - 5. Presu� kurzor na in� zo znakov (,),[,],{ alebo } a v�imni si - �o % vykon�va. + 5. Presuň kurzor na iný zo znakov (,),[,],{ alebo } a všimni si + čo % vykonáva. ----> Toto ( je testovac� riadok s ('s, ['s ] a {'s } v riadku. )) +---> Toto ( je testovací riadok s ('s, ['s ] a {'s } v riadku. )) -Pozn�mka: Toto je ve�mi v�hodn� pou��� pri laden� programu s ch�baj�cimi - uzatv�raj�cimi z�tvorkami! +Poznámka: Toto je veľmi výhodné použíť pri ladení programu s chýbajúcimi + uzatvárajúcimi zátvorkami! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.4: PR�KAZ NAHRADENIA + Lekcia 1.4.4: PRÍKAZ NAHRADENIA - ** Nap�� :s/star�/nov�/g pre nahradenie slova 'star�' za slovo 'nov�'. ** + ** Napíš :s/starý/nový/g pre nahradenie slova 'starý' za slovo 'nový'. ** - 1. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. + 1. Presuň kurzor nižšie na riadok označený značkou --->. - 2. Nap�� :s/thee/the . Poznamka, �e tento pr�kaz zmen� len prv� - v�skyt "thee" v riadku. + 2. Napíš :s/thee/the . Poznamka, že tento príkaz zmení len prvý + výskyt "thee" v riadku. - 3. Teraz nap�� :s/thee/the/g �o znamen� celkov� nahradenie v riadku. - Toto nahrad� v�etky v�skyty v riadku. + 3. Teraz napíš :s/thee/the/g čo znamená celkové nahradenie v riadku. + Toto nahradí všetky výskyty v riadku. ---> Thee best time to see thee flowers in thee spring. - 4. Pre zmenu v�etk�ch v�skytov dan�ho re�azca medzi dvomi ridakami, - nap�� :#,#s/star�/nov�/g kde #,# s� ��sla dvoch riadkov, v rozsahu - ktor�ch sa nahradenie vykon�. - nap�� :%s/star�/nov�/g pre zmenu v�etk�ch v�skytov v celom riadku - nap�� :%s/star�/nov�/gc n�jde v�etky v�skyty v celom s�bore, - s ot�zkou �i nahradi� alebo nie + 4. Pre zmenu všetkých výskytov daného reťazca medzi dvomi ridakami, + napíš :#,#s/starý/nový/g kde #,# sú čísla dvoch riadkov, v rozsahu + ktorých sa nahradenie vykoná. + napíš :%s/starý/nový/g pre zmenu všetkých výskytov v celom riadku + napíš :%s/starý/nový/gc nájde všetky výskyty v celom súbore, + s otázkou či nahradiť alebo nie @@ -589,291 +589,291 @@ Pozn LEKCIA 1.4 ZHRNUTIE - 1. CTRL-g vyp��e tvoju poz�ciu v s�bore a status s�boru. - G �a premiestni na koniec riadku. - ��slo G �a premiestni na riadok s ��slom. - gg �a presunie na prv� riadok + 1. CTRL-g vypíše tvoju pozíciu v súbore a status súboru. + G ťa premiestni na koniec riadku. + číslo G ťa premiestni na riadok s číslom. + gg ťa presunie na prvý riadok - 2. Nap�sanie / nasledovan� re�azcom vyh�ad� re�azec smerom DOPREDU. - Nap�sanie ? nasledovan� re�azcom vyh�ada re�azec smerom DOZADU. - Nap�sanie n po vyh�ad�van�, vyh�ad� nasleduj�ci v�skyt re�azca - v rovnakom smere, pri�om N vyh�ad� v opa�nom smere. - CTRL-O �a vr�ti sp� na star�iu poz�ciu, CTRL-I na nov�iu poz�ciu. + 2. Napísanie / nasledované reťazcom vyhľadá reťazec smerom DOPREDU. + Napísanie ? nasledované reťazcom vyhľada reťazec smerom DOZADU. + Napísanie n po vyhľadávaní, vyhľadá nasledujúci výskyt reťazca + v rovnakom smere, pričom N vyhľadá v opačnom smere. + CTRL-O ťa vráti späť na staršiu pozíciu, CTRL-I na novšiu pozíciu. - 3. Nap�sanie % ke� kurzor je na (,),[,],{, alebo } n�jde zodpovdaj�cu - p�rnu z�tvorku. + 3. Napísanie % keď kurzor je na (,),[,],{, alebo } nájde zodpovdajúcu + párnu zátvorku. - 4. Pre nahradenie nov�ho za prv� star� v riadku nap�� :s/star�/nov� - Pre nahradenie nov�ho za v�etky star� v riadku nap�� :s/star�/nov�/g - Pre nahradenie re�azcov medzi dvoma riadkami 3 nap�� :#,#/star�/nov�/g - Pre nahradenie v�etk�ch v�skytov v s�bore nap�� :%s/star�/nov�/g - Pre potvrdenie ka�d�ho nahradenia pridaj 'c' :%s/star�/nov�/gc + 4. Pre nahradenie nového za prvý starý v riadku napíš :s/starý/nový + Pre nahradenie nového za všetky staré v riadku napíš :s/starý/nový/g + Pre nahradenie reťazcov medzi dvoma riadkami 3 napíš :#,#/starý/nový/g + Pre nahradenie všetkých výskytov v súbore napíš :%s/starý/nový/g + Pre potvrdenie každého nahradenia pridaj 'c' :%s/starý/nový/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.1: AKO SPUSTI� VONKAJ�� PR�KAZ + Lekcia 1.5.1: AKO SPUSTIŤ VONKAJŠÍ PRÍKAZ - ** Nap�� pr�kaz :! nasledovan� vonkaj��m pr�kazom pre spustenie pr�kazu ** + ** Napíš príkaz :! nasledovaný vonkajším príkazom pre spustenie príkazu ** - 1. Nap�� obvykl� p�kaz : ktor� nastav� kurzor na spodok obrazovky. - To umo�n� nap�sa� pr�kaz. + 1. Napíš obvyklý píkaz : ktorý nastaví kurzor na spodok obrazovky. + To umožní napísať príkaz. - 2. Teraz nap�� ! (v�kri�n�k). To umo�n� spusti� hociak� vonkaj�� pr�kaz - z pr�kazov�ho riadku. + 2. Teraz napíš ! (výkričník). To umožní spustiť hociaký vonkajší príkaz + z príkazového riadku. - 3. Ako pr�klad nap�� ls za ! a stla� . Tento pr�kaz - zobraz� obsah tvojho adres�ra rovnako ako na pr�kazovom riadku. - Alebo pou�i :!dir ak ls nefunguje. + 3. Ako príklad napíš ls za ! a stlač . Tento príkaz + zobrazí obsah tvojho adresára rovnako ako na príkazovom riadku. + Alebo použi :!dir ak ls nefunguje. -Pozn�mka: Takto je mo�n� spusti� hociak� vonkaj�� pr�kaz s argumentami. -Pozn�mka: V�etky pr�kazy : musia by� dokon�en� stla�en�m +Poznámka: Takto je možné spustiť hociaký vonkajší príkaz s argumentami. +Poznámka: Všetky príkazy : musia byť dokončené stlačením ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.2: VIAC O UKLADAN� S�BOROV + Lekcia 1.5.2: VIAC O UKLADANÍ SÚBOROV - ** Pre ulo�enie zmien v s�bore, nap�� :w FILENAME. ** + ** Pre uloženie zmien v súbore, napíš :w FILENAME. ** - 1. Nap�� :!dir alebo :!ls pre v�pis aktu�lneho adres�ra. - U� vie�, �e mus�� za t�mto stla�i� . + 1. Napíš :!dir alebo :!ls pre výpis aktuálneho adresára. + Už vieš, že musíš za týmto stlačiť . - 2. Vyber n�zov s�boru, ktor� e�te neexistuje, ako napr. TEST. + 2. Vyber názov súboru, ktorý ešte neexistuje, ako napr. TEST. - 3. Teraz nap��: :w TEST (kde TEST je n�zov vybrat�ho s�boru.) + 3. Teraz napíš: :w TEST (kde TEST je názov vybratého súboru.) - 4. To ulo�� cel� s�bor (Vim Tutor) pod n�zovm TEST. - Pre overenie nap�� :!dir , ��m zobraz�� obsah adres�ra. + 4. To uloží celý súbor (Vim Tutor) pod názovm TEST. + Pre overenie napíš :!dir , čím zobrazíš obsah adresára. -Pozn�mka: �e ak ukon��� pr�cu s editorom Vim a znovu ho spust�� pr�kazom - vim TEST, s�bor bude k�pia v�uky, ke� si ho ulo�il. +Poznámka: že ak ukončíš prácu s editorom Vim a znovu ho spustíš príkazom + vim TEST, súbor bude kópia výuky, keď si ho uložil. - 5. Teraz odstr�� s�bor nap�san�m (MS-DOS): :!del TEST + 5. Teraz odstráň súbor napísaním (MS-DOS): :!del TEST alebo (Unix): :!rm TEST ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.3: V�BER TEXTU PRE ULO�ENIE + Lekcia 1.5.3: VÝBER TEXTU PRE ULOŽENIE - ** Pre ulo�enie �asti s�boru, nap�� v pohyb :w FILENAME ** + ** Pre uloženie časti súboru, napíš v pohyb :w FILENAME ** - 1. Presu� kurozr na tento riadok. + 1. Presuň kurozr na tento riadok. - 2. Stla� v a presu� kurozr na piatu polo�ku dole. Pozn�mka, �e - tento text je vyzna�en� (highlighted). + 2. Stlač v a presuň kurozr na piatu položku dole. Poznámka, že + tento text je vyznačený (highlighted). - 3. Stla� kl�vesu : . V spodnej �asti okna sa objav� :'<,'>. + 3. Stlač klávesu : . V spodnej časti okna sa objaví :'<,'>. - 4. Nap�� w TEST , kde TEST je meno s�boru, ktor� zatial neexistuje. - Skontroluj, e vid�� :'<,'>w TEST predt�m ne� stla��� Enter. + 4. Napíš w TEST , kde TEST je meno súboru, ktorý zatial neexistuje. + Skontroluj, e vidíš :'<,'>w TEST predtým než stlačíš Enter. - 5. Vim zap��e ozna�en� riadky do s�boru TEST. Pou�i :!dir alebo :!ls - pre overenie. Zatial ho e�te nema�! Pou�ijeme ho v �al�ej lekcii. + 5. Vim zapíše označené riadky do súboru TEST. Použi :!dir alebo :!ls + pre overenie. Zatial ho ešte nemaž! Použijeme ho v ďalšej lekcii. -POZN�MKA: Stla�en�m kl�vesy v sa spust� vizu�lne ozna�ovanie. - M��e� pohybova� kurzorom pre upresnenie vyzna�en�ho textu. - Potom m��e� pou�i� oper�tor pre vykonanie nejakej akcie - s textom. Napr�klad d zma�e vyzna�en� text. +POZNÁMKA: Stlačením klávesy v sa spustí vizuálne označovanie. + Môžeš pohybovať kurzorom pre upresnenie vyznačeného textu. + Potom môžeš použiť operátor pre vykonanie nejakej akcie + s textom. Napríklad d zmaže vyznačený text. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.4: V�BER A ZLU�OVANIE S�BOROV + Lekcia 1.5.4: VÝBER A ZLUČOVANIE SÚBOROV - ** Pre vlo�enie obsahu s�boru, nap�� :r FILENAME ** + ** Pre vloženie obsahu súboru, napíš :r FILENAME ** 1. Premiestni kurzor nad tento riadok. -POZN�MKA: Po vykonan� kroku 2 uvid�� text z lekcie 1.5.3. Potom sa presu� - dole, aby si videl t�to lekciu. +POZNÁMKA: Po vykonaní kroku 2 uvidíš text z lekcie 1.5.3. Potom sa presuň + dole, aby si videl túto lekciu. - 3. Teraz vlo� s�bor TEST pou�it�m pr�kazu :r TEST kde TEST je n�zov - s�boru. S�bor, ktor� si pou�il je umiestnen� pod riadkom s kurzorom. + 3. Teraz vlož súbor TEST použitím príkazu :r TEST kde TEST je názov + súboru. Súbor, ktorý si použil je umiestnený pod riadkom s kurzorom. -POZN�MKA: M��e� tie� na��ta� v�stup vonkaj�ieho pr�kazu. Napr�klad :r !ls - na��ta v�stup pr�kazu ls a umiestni ho za poz�ciu kurzora. +POZNÁMKA: Môžeš tiež načítať výstup vonkajšieho príkazu. Napríklad :r !ls + načíta výstup príkazu ls a umiestni ho za pozíciu kurzora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 1.5 ZHRNUTIE - 1. :!pr�kaz spust� vonkaj�� pr�kaz. + 1. :!príkaz spustí vonkajší príkaz. - Niektor� vyu�ite�n� pr�klady s�: + Niektoré využiteľné príklady sú: (MS_DOS) (UNIX) - :!dir :!ls - zobraz� obsah adres�ra - :!del FILENAME :!rm FILENAME - odstr�ni s�bor FILENAME + :!dir :!ls - zobrazí obsah adresára + :!del FILENAME :!rm FILENAME - odstráni súbor FILENAME - 2. :w FILENAME ulo�� aktu�lny s�bor na disk pod menom FILENAME. + 2. :w FILENAME uloží aktuálny súbor na disk pod menom FILENAME. - 3. v pohyb :w FILENAME ulo�� vizu�lne ozna�en� riadky do - s�boru FILENAME. + 3. v pohyb :w FILENAME uloží vizuálne označené riadky do + súboru FILENAME. - 4. :r FILENAME vyberie z disku s�bor FILENAME a vlo�� ho do aktu�lneho - s�boru za poz�ciou kurzora. + 4. :r FILENAME vyberie z disku súbor FILENAME a vloží ho do aktuálneho + súboru za pozíciou kurzora. - 5. :r !dir na��ta v�stup z pr�kazu dir a vlo�� ho za poz�ciu kurzora. + 5. :r !dir načíta výstup z príkazu dir a vloží ho za pozíciu kurzora. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.1: PR�KAZ OTVORI� + Lekcia 1.6.1: PRÍKAZ OTVORIŤ -** Nap�� o pre vlo�enie riadku pod kurzor a prepnutie do vkladacieho m�du ** +** Napíš o pre vloženie riadku pod kurzor a prepnutie do vkladacieho módu ** - 1. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. + 1. Presuň kurzor nižšie na riadok označený značkou --->. - 2. Nap�� o (mal� p�smeno) pre vlo�enie �ist�ho riadku pod kurzorm - a prepnutie do vkladacieho m�du. + 2. Napíš o (malé písmeno) pre vloženie čistého riadku pod kurzorm + a prepnutie do vkladacieho módu. - 3. Teraz skop�ruj riadok ozna�en� ---> a stla� pre ukon�enie - vkladacieho m�du. + 3. Teraz skopíruj riadok označený ---> a stlač pre ukončenie + vkladacieho módu. ----> Po nap�san� o sa kurzor premiestn� na vlo�en� riadok do vkladacieho - m�du. +---> Po napísaní o sa kurzor premiestní na vložený riadok do vkladacieho + módu. - 4. Pre otvorenie riadku nad kurzorom, jednotucho nap�� ve�k� O , - namiesto mal�ho o. Vysk��aj si to na riadku dole. + 4. Pre otvorenie riadku nad kurzorom, jednotucho napíš veľké O , + namiesto malého o. Vyskúšaj si to na riadku dole. ----> Vlo� riadok nad t�mto nap�san�m O, ke� kurzor je na tomto riadku. +---> Vlož riadok nad týmto napísaním O, keď kurzor je na tomto riadku. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.2: PR�KAZ PRIDA� + Lekcia 1.6.2: PRÍKAZ PRIDAŤ - ** Nap�� a pre vlo�enie textu ZA kurzor. ** + ** Napíš a pre vloženie textu ZA kurzor. ** - 1. Presu� kurzor ni��ie na koniec prv�ho riadku ozna�en�ho zna�kou ---> + 1. Presuň kurzor nižšie na koniec prvého riadku označeného značkou ---> - 2. Stla� kl�vesu e dokia� kurozr nieje na konci riadku. + 2. Stlač klávesu e dokiaľ kurozr nieje na konci riadku. - 3. Nap�� a (mal� p�smeno) pre pridanie textu ZA kurzorom. + 3. Napíš a (malé písmeno) pre pridanie textu ZA kurzorom. - 4. Dokon�� slovo tak ako je to v druhom riadku. Stla� pre - opustenie vkladacieho m�du. + 4. Dokončí slovo tak ako je to v druhom riadku. Stlaš pre + opustenie vkladacieho módu. - 5. Pou�i e na presun na �al�ie nedokon�en� slovo a zopakuj kroky 3 a 4. + 5. Použi e na presun na ďalšie nedokončené slovo a zopakuj kroky 3 a 4. ----> Tento ri ti dovo�uje n�cv pri�van testu na koniec riadku. ----> Tento riadok ti dovo�uje n�cvik prid�vania textu na koniec riadku. +---> Tento ri ti dovoľuje nácv priávan testu na koniec riadku. +---> Tento riadok ti dovoľuje nácvik pridávania textu na koniec riadku. -POZN�MKA: a, i, A �tartuj� rovnak� vkladac� m�d, jedin� rozidel je, kde - sa znaky vkladaj�. +POZNÁMKA: a, i, A štartujú rovnaký vkladací mód, jediný rozidel je, kde + sa znaky vkladajú. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.3: IN� SPOSOB NAHRADZOVANIA + Lekcia 1.6.3: INÝ SPOSOB NAHRADZOVANIA - ** Nap�� ve�k� R pre nahradenie viac ako jedn�ho znaku. ** + ** Napíš veľké R pre nahradenie viac ako jedného znaku. ** - 1. Presu� kurzor ni��ie na prv� riadok ozna�en� zna�kou --->. Premiestni - kurzor na za�iatok prv�ho v�skytu xxx. + 1. Presuň kurzor nižšie na prvý riadok označený značkou --->. Premiestni + kurzor na začiatok prvého výskytu xxx. - 2. Teraz nap�� R a nap�� ��slo uveden� v druhom riadku, tak�e - sa n�m nahrad� p�vodn� xxx. + 2. Teraz napíš R a napíš číslo uvedené v druhom riadku, takže + sa ním nahradí pôvodné xxx. - 3. Stla� pre opustenie nahradzovacieho m�du. Pozn�mka, �e zvy�ok - riadku zostane nezmenen�. + 3. Stlač pre opustenie nahradzovacieho módu. Poznámka, že zvyšok + riadku zostane nezmenený. - 4. Zopakuj tieto kroky pre nahradenie zvy�n�ch xxx. + 4. Zopakuj tieto kroky pre nahradenie zvyšných xxx. ----> Pridan�m 123 ku xxx dostane� xxx. ----> Pridan�m 123 ku 456 dostane� 579. +---> Pridaním 123 ku xxx dostaneš xxx. +---> Pridaním 123 ku 456 dostaneš 579. -POZN�MKA: Nahradzovac� m�d je ako vkladac� m�d, ale ka�d� nap�san� znak - zma�e existuj�ci znak. +POZNÁMKA: Nahradzovací mód je ako vkladací mód, ale každý napísaný znak + zmaže existujúci znak. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lekcia 1.6.4: Copy Paste textu - ** pou�� oper�tor y pre copy textku a p pre jeho paste ** + ** použí operátor y pre copy textku a p pre jeho paste ** - 1. Cho� ni��ie na riadok ozna�en� ---> a umiestni kurozr za "a)". + 1. Choď nižšie na riadok označený ---> a umiestni kurozr za "a)". - 2. Na�tartuj vizu�lny m�d pou�it�m v a presu� kurozr pred "first". + 2. Naštartuj vizuálny mód použitím v a presuň kurozr pred "first". - 3. Nap�� y pre vystrihnutie (copy) ozna�en�ho textu. + 3. Napíš y pre vystrihnutie (copy) označeného textu. - 4. Presu� kurozr na koniec �al�ieho riadku: j$ + 4. Presuň kurozr na koniec ďalšieho riadku: j$ - 5. Nap�� p pre vlo�nie (paste) textu. Potom nap��: a druha . + 5. Napíš p pre vložnie (paste) textu. Potom napíš: a druha . - 6. Pou�i vizu�lny m�d pre ozna�enie "polo�ka.", vystrihni to - pou�it�m y, presu� sa na koniec nasleduj�ceho riadku pou�it�m j$ - a vlo� sem text pou�it�m p. + 6. Použi vizuálny mód pre označenie "položka.", vystrihni to + použitím y, presuň sa na koniec nasledujúceho riadku použitím j$ + a vlož sem text použitím p. ----> a) toto je prv� polo�ka +---> a) toto je prvá položka ---> b) -POZN�MKA: M��e� pou�i� tie� y ako oper�tor; yw vystrihne jedno slovo. +POZNÁMKA: Môžeš použiť tiež y ako operátor; yw vystrihne jedno slovo. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.5: NASTAVENIE MO�NOST� + Lekcia 1.6.5: NASTAVENIE MOŽNOSTÍ -** Nastav mo�nosti, tak�e vyh�ad�vanie alebo nahradzovanie ignoruje - rozli�ovanie ** +** Nastav možnosti, takže vyhľadávanie alebo nahradzovanie ignoruje + rozlišovanie ** - 1. Vyh�adaj re�azec 'ignore' nap�san�m: + 1. Vyhľadaj reťazec 'ignore' napísaním: /ignore - Zopakuj vyh�ad�vanie nieko�ko kr�t stla�en�m kl�vesy n . + Zopakuj vyhľadávanie niekoľko krát stlačením klávesy n . - 2. Nastav mo�nos� 'ic' (Ignore case) nap�san�m pr�kazu: + 2. Nastav možnosť 'ic' (Ignore case) napísaním príkazu: :set ic - 3. Teraz vyh�adaj re�azec 'ingore' znova stla�en�m kl�vesy n - Pozn�mka, �e teraz s� vyh�adan� aj Ignore a IGNORE. + 3. Teraz vyhľadaj reťazec 'ingore' znova stlačením klávesy n + Poznámka, že teraz sú vyhľadané aj Ignore a IGNORE. - 4. Nastav mo�nos�i 'hlsearch' a 'incsearch': + 4. Nastav možnosťi 'hlsearch' a 'incsearch': :set hls is - 5. Teraz spusti vyh�ad�vac� pr�kaz znovu, a pozri �o sa stalo: + 5. Teraz spusti vyhľadávací príkaz znovu, a pozri čo sa stalo: /ignore - 6. Pre opetovn� zapnutie rozly�ovania ve�k�ch a mal�ch p�smen - nap��: :set noic + 6. Pre opetovné zapnutie rozlyšovania veľkých a malých písmen + napíš: :set noic -POZN�MKA: Na odstr�nenie zv�raznenia v�razov nap��: :nohlsearch -POZN�MKA: Ak chce� nerozly�ova� ve�kos� p�smen len pre jedno - pou�itie vyh�ad�vacieho pr�kazu, pou�i \c: /ignore\c +POZNÁMKA: Na odstránenie zvýraznenia výrazov napíš: :nohlsearch +POZNÁMKA: Ak chceš nerozlyšovať veľkosť písmen len pre jedno + použitie vyhľadávacieho príkazu, použi \c: /ignore\c ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 1.6 ZHRNUTIE - 1. Nap�� o pre otvorenie riadku pod kurzorom a �tart vkladacieho m�du. - Nap�� O pre otvorenie riadku nad kurzorom. + 1. Napíš o pre otvorenie riadku pod kurzorom a štart vkladacieho módu. + Napíš O pre otvorenie riadku nad kurzorom. - 2. Nap�� a pre vkladanie textu ZA kurzor. - Nap�� A pre vkladanie textu za koncom riadku. + 2. Napíš a pre vkladanie textu ZA kurzor. + Napíš A pre vkladanie textu za koncom riadku. - 3. Pr�kaz e presunie kurozr na koniec slova + 3. Príkaz e presunie kurozr na koniec slova - 4. Oper�tor y vystrihne (skop�ruje) text, p ho vlo��. + 4. Operátor y vystrihne (skopíruje) text, p ho vloží. - 5. Nap�sanie ve�k�ho R prepne do nahradzovacieho m�du, k�m nieje - stla�en� . + 5. Napísanie veľkého R prepne do nahradzovacieho módu, kým nieje + stlačené . - 6. Nap�sanie ":set xxx" nastav� mo�nos� "xxx". Niektor� nastavenia s�: - 'ic' 'ignorecase' ignoruje ve�k� a mal� p�smen� po�as vyh�ad�vania. - 'is' 'incsearch' zobrazuje �iasto�n� re�azce vyh�ad�van�ho re�azca. - 'hls' 'hlsearch' vyzna�� v�etky vyh�ad�van� re�azce. - M��e� pou�i� hociktor� z dlh�ch a kr�tkych n�zvov mo�nost�. + 6. Napísanie ":set xxx" nastaví možnosť "xxx". Niektoré nastavenia sú: + 'ic' 'ignorecase' ignoruje veľké a malé písmená počas vyhľadávania. + 'is' 'incsearch' zobrazuje čiastočné reťazce vyhľadávaného reťazca. + 'hls' 'hlsearch' vyznačí všetky vyhľadávané reťazce. + Môžeš použiť hociktorý z dlhých a krátkych názvov možností. - 7. Vlo� "no" pred nastavenie pre jeho vypnutie: :set noic + 7. Vlož "no" pred nastavenie pre jeho vypnutie: :set noic @@ -882,23 +882,23 @@ POZN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.7.1: Z�SKANIE N�POVEDY + LEKCIA 1.7.1: ZÍSKANIE NÁPOVEDY - ** Pou��vaj on-line syst�m n�povedy ** + ** Používaj on-line systém nápovedy ** - Vim m� obsiahly on-line syst�m n�povedy. Pre od�tartovanie, vysk��aj jeden - z t�chto troch: - - stla� kl�vesu (ak nejak� m�) - - stla� kl�vesu (ak nejak� m�) - - nap�� :help + Vim má obsiahly on-line systém nápovedy. Pre odštartovanie, vyskúšaj jeden + z týchto troch: + - stlač klávesu (ak nejakú máš) + - stlač klávesu (ak nejakú máš) + - napíš :help - ��taj text v okne n�povedy pre z�skanie predstavy ako n�poveda funguje. - Nap�� CTRL-W CTRL-W pre skok z jedn�ho okna do druh�ho. - Nap�� :q ��m zatvor�� okno n�povedy. + Čítaj text v okne nápovedy pre získanie predstavy ako nápoveda funguje. + Napíš CTRL-W CTRL-W pre skok z jedného okna do druhého. + Napíš :q čím zatvoríš okno nápovedy. - M��e� n�js� help ku hociakej t�me pridan�m argumentu ku pr�kazu ":help". - Vysk��aj tieto (nezabudni stla�i� ): + Môžeš nájsť help ku hociakej téme pridaním argumentu ku príkazu ":help". + Vyskúšaj tieto (nezabudni stlačiť ): :help w :help c_CTRL-D @@ -907,102 +907,102 @@ POZN ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.7.2: VYTVORENIE �TARTOVACIEHO SKRIPTU + LEKCIA 1.7.2: VYTVORENIE ŠTARTOVACIEHO SKRIPTU ** Zapni funkcie editora Vim ** - Vim m� omnoho viac funkcii ne� Vi, ale ve�ina z nich je implicitne - vypnut�. Pre pou��vanie viac Vim funkcii vytvor "vimrc" s�bor. + Vim má omnoho viac funkcii než Vi, ale večšina z nich je implicitne + vypnutá. Pre používanie viac Vim funkcii vytvor "vimrc" súbor. - 1. Za�ni editova� "vimrc" s�bor, to z�vis� na pou�itom syst�me: + 1. Začni editovať "vimrc" súbor, to závisí na použitom systéme: :e ~/.vimrc pre Unix :e ~/_vimrc pre MS-Windows - 2. Teraz si pre��taj text pr�kladu "vimrc" s�boru: + 2. Teraz si prečítaj text príkladu "vimrc" súboru: :r $VIMRUNTIME/vimrc_example.vim - 3. Ulo� s�bor: + 3. Ulož súbor: :w - Pri nasleduj�com �tarte editora Vim sa pou�ije zv�raz�ovanie syntaxe. - Do "vimrc" s�boru m��e� prida� v�etky svoje uprednost�ovan� nastavenia. - Pre viac inform�cii nap�� :help vimrc-intro + Pri nasledujúcom štarte editora Vim sa použije zvýrazňovanie syntaxe. + Do "vimrc" súboru môžeš pridať všetky svoje uprednostňované nastavenia. + Pre viac informácii napíš :help vimrc-intro ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.7.3: DOKON�ENIE + LEKCIA 1.7.3: DOKONČENIE - ** Dokon�i pr�kaz na pr�kazovom riadku pou�it�m CTRL-D a ** + ** Dokonči príkaz na príkazovom riadku použitím CTRL-D a ** - 1. Uisti sa, �e Vim nieje v kompatibilnom m�de: :set nocp + 1. Uisti sa, že Vim nieje v kompatibilnom móde: :set nocp - 2. Pozri sa ak� s�bory sa nach�dzaj� v adres�ri: :!ls alebo :!dir + 2. Pozri sa aké súbory sa nachádzajú v adresári: :!ls alebo :!dir - 3. Nap�� za�iatok pr�kazu: :e + 3. Napíš začiatok príkazu: :e - 4. Stla� CTRL-D a Vim zobraz� zoznam pr�kazov za��naj�cich "e". + 4. Stlač CTRL-D a Vim zobrazí zoznam príkazov začínajúcich "e". - 5. Stla� a Vim dokon�� meno pr�kazu na ":edit". + 5. Stlač a Vim dokončí meno príkazu na ":edit". - 6. Teraz pridaj medzern�k a za�iatok mena existuj�ceho s�boru: + 6. Teraz pridaj medzerník a začiatok mena existujúceho súboru: :edit FIL - 7. Stla� . Vim dokon�� meno (ak je jedine�n�). + 7. Stlač . Vim dokončí meno (ak je jedinečné). -POZN�MKA: Dokon�ovanie funguje pre ve�a pr�kazov. Vysk��aj stla�enie - CTRL-D a . �peci�lne je to u�ito�n� pre pr�kaz :help. +POZNÁMKA: Dokončovanie funguje pre veľa príkazov. Vyskúšaj stlačenie + CTRL-D a . Špeciálne je to užitočné pre príkaz :help. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKCIA 1.7 ZHRNUTIE - 1. Nap�� :help alebo stla� alebo pre otvorenie okna n�povedy. + 1. Napíš :help alebo stlač alebo pre otvorenie okna nápovedy. - 2. Nap�� :help pr�kaz pre vyh�adanie n�povedy ku pr�kazu pr�kaz. + 2. Napíš :help príkaz pre vyhľadanie nápovedy ku príkazu príkaz. - 3. Nap�� CTRL-W CTRL-W na presko�enie do in�ho okna. + 3. Napíš CTRL-W CTRL-W na preskočenie do iného okna. - 4. Nap�� :q pre zatvorenie okna n�povedy + 4. Napíš :q pre zatvorenie okna nápovedy - 5. Vytvor �tartovac� skript vimrc pre udr�anie uprednost�ovan�ch nastaven�. + 5. Vytvor štartovací skript vimrc pre udržanie uprednostňovaných nastavení. - 6. Po�as p�sania pr�kazu : stla� CTRL-D pre zobrazenie dokon�en�. - Stla� pre pou�itie jedn�ho z dokon�en�. + 6. Počas písania príkazu : stlač CTRL-D pre zobrazenie dokončení. + Stlač pre použitie jedného z dokončení. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Toto vymedzuje v�uku Vimu. Toto je ur�en� pre strucn� preh�ad o editore - Vim, �plne posta�uj�ce pre �ahk� a obstojn� pou��vanie tohto editora. - T�to v�uka je �aleko od kompletnosti, preto�e Vim m� omnoho viacej pr�kazov. - Ako �al�ie si pre��taj u��vat�sk� manu�l: ":help user-manual". + Toto vymedzuje výuku Vimu. Toto je určené pre strucný prehľad o editore + Vim, úplne postačujúce pre ľahké a obstojné používanie tohto editora. + Táto výuka je ďaleko od kompletnosti, pretože Vim má omnoho viacej príkazov. + Ako ďalšie si prečítaj užívatľský manuál: ":help user-manual". - Pre �al�ie ��tanie a �t�dium je odpor��an� kniha: + Pre ďalšie čítanie a štúdium je odporúčaná kniha: Vim - Vi Improved - od Steve Oualline - Vydavate�: New Riders - Prv� kniha ur�en� pre Vim. �peci�lne vhodn� pre za�iato�n�kov. - Obsahuje mno�stvo pr�kladov a obr�zkov. + Vydavateľ: New Riders + Prvá kniha určená pre Vim. Špeciálne vhodná pre začiatočníkov. + Obsahuje množstvo príkladov a obrázkov. Pozri na https://iccf-holland.org/click5.html - T�to kniha je star�ia a je viac o Vi ako o Vim, ale je tie� odpor��an�: + Táto kniha je staršia a je viac o Vi ako o Vim, ale je tiež odporúčaná: Learning the Vi Editor - od Linda Lamb - Vydavate�: O'Reilly & Associates Inc. - Je to dobr� kniha pre z�skanie vedomost� o pr�ci s editorom Vi. - �ieste vydanie obsahuje tie� inform�cie o editore Vim. + Vydavateľ: O'Reilly & Associates Inc. + Je to dobrá kniha pre získanie vedomostí o práci s editorom Vi. + Šieste vydanie obsahuje tiež informácie o editore Vim. - T�to v�uka bola nap�san� autormi Michael C. Pierce a Robert K. Ware, - Colorado School of Mines s pou�it�m my�lienok dodan�mi od Charles Smith, + Táto výuka bola napísaná autormi Michael C. Pierce a Robert K. Ware, + Colorado School of Mines s použitím myšlienok dodanými od Charles Smith, Colorado State University. E-mail: bware@mines.colorado.edu. - Modifikovan� pre Vim od Bram Moolenaar. + Modifikované pre Vim od Bram Moolenaar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Preklad do Sloven�iny: �ubo� �elko + Preklad do Slovenčiny: Ľuboš Čelko e-mail: celbos@inmail.sk Last Change: 2006 Apr 18 encoding: iso8859-2 diff --git a/runtime/tutor/tutor1.sk.cp1250 b/runtime/tutor/tutor1.sk.cp1250 deleted file mode 100644 index 1e6543e5c0..0000000000 --- a/runtime/tutor/tutor1.sk.cp1250 +++ /dev/null @@ -1,1008 +0,0 @@ -=============================================================================== -= V i t a j t e v o V I M T u t o r i a l i - Verzia 1.7 = -=============================================================================== - - Vim je ve�mi v�konn� editor, ktor� m� pr�li� ve�a pr�kazov na to aby - mohli byt v�etky pop�san� vo v�uke akou je t�to. T�to v�uka - popisuje dostato�n� mno�stvo pr�kazov nato aby bolo mo�n� pou��va� - Vim ako viac��elov� editor. - - Pribli�n� �as potrebn� na prebratie tejto v�uky je 25-30 min�t, - z�vis� na tom, ko�ko je str�ven�ho �asu s presk��avan�m. - - UPOZORNENIE: - Pr�kazy v lekci�ch modifikuj� text. Vytvor k�piu tohto s�boru aby - sa mohlo precvi�ova� na �om (pri �tarte "vimtutor" je toto k�pia). - - Je d�le�it� zapam�ta� si, �e t�to v�uka je vytvoren� pre v�uku - pou��van�m. To znamen�, �e je potrebn� si pr�kazy vysk��a�, aby bolo - u�enie spr�vne. Ak len �itas text, pr�kazy zabudne�! - - Presved� sa, �e Caps-Lock NIEJE stla�en� a stla�t kl�vesu - j nieko�ko kr�t, aby sa kurzor posunul nato�ko, �e lekcia 1.1.1 - celkom zapln� obrazovku. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.1: POHYB KURZOROM - - - ** Pre pohyb kurzorum stla� kl�vesy h,j,k,l ako je zn�zornen�. ** - ^ - k Funkcia: Kl�vesa h je na�avo a vykon� pohyb do�ava. - < h l > Kl�vesa l je napravo a vykon� pohyb doprava. - j Kl�vesa j vyzer� ako ��pka dole - v - 1. Pohybuj kurzorom po obrazovke, k�m si na to nezvykne�. - - 2. Dr� stla�en� kl�vesu pre pohyb dole (j), k�m sa jej funkcia nezopakuje. ----> Teraz sa u� vie� pohybova� na nasleduj�cu lekciu. - - 3. Pou�it�m kl�vesy pre pohyb dole prejdi na Lekciu 1.1.2. - -Pozn�mka: Ak si niesi ist� t�m �o si nap�sal, stla� - na prechod do norm�lneho m�du. - -Pozn�mka: Kurzorov� kl�vesy s� tie� funk�n�. Ale pou��van�m hjkl sa bude� - schopn� pohybova� r�chlej�ie, ke� si zvykne� ich pou��va�. Naozaj! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.1.2: ZATV�RANIE VIMU - - - !! POZN�MKA: Pred vykonan�m t�chto krokov si pre��taj cel� t�to lekciu !! - - 1. Stla� kl�vesu (aby si sa u�ite nach�dzal v norm�lnom m�de) - - 2. Nap�: :q! . - T�m ukon�� pr�cu s editorom BEZ ulo�enia zmien, ktor� si vykonal. - - 3. Ke� sa dostane� na pr�kazov� riadok, nap� pr�kaz, ktor�m sa dostane� - spe� do tejto v�uky. To m��e by�: vimtutor - - 4. Ak si si tieto kroky spo�ahlivo zapam�tal, vykonaj kroky 1 a� 3, pre - ukon�enie a znovu spustenie editora. - -POZN�MKA: :q! neulo�� zmeny, ktor� si vykonal. O nieko�ko lekci� - sa nau�� ako ulo�i� zmeny do s�boru - - 5. presu� kurzor dole na lekciu 1.1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.3: EDIT�CIA TEXTU - MAZANIE - - -** Stla�enie kl�vesy x v norm�lnom m�de zma�e znak na mieste kurzora. ** - - 1. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. - - 2. Aby si mohol odstr�ni� chyby, pohybuj kurzorom k�m neprejde na znak, - ktor� chce� zmaza�. - - 3. Stla� kl�vesu x aby sa zmazal nechcen� znak. - - 4. Zopakuj kroky 2 a� 4 a� k�m veta nieje spr�vna. - ----> Kraava skoo�illa ccezz mesiiac. - - 5. Ak je veta spr�vna, prejdi na lekciu 1.1.4. - -POZN�MKA: Nesk��aj si zapam�ta� obsah tejto v�uky, ale sa u� pou��van�m. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.4: EDIT�CIA TEXTU - VKLADANIE - - - ** Stla�enie kl�vesy i umo��uje vkladanie textu. ** - - 1. Presu� kurzor ni��ie na prv� riadok za zna�ku --->. - - 2. Pre upravenie prv�ho riadku do rovnak�ho tvaru ako je druh� riadok, - presu� kurzor na prv� znak za misto, kde m� by� text vlo�en�. - - 3. Stla� kl�vesu i a nap� potrebn� text. - - 4. Po opraven� ka�dej chyby, stla� pre n�vrat do norm�lneho m�du. - Zopakuj kroky 2 a� 4 k�m nieje veta spr�vna. - ----> Tu je text ch�baj�ci tejto. ----> Tu je nejak� text ch�baj�ci od tejto �iary. - - 5. Ke� sa dostato�ne nau�� vklada� text, prejdi na nasleduj�ce zhrnutie. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.5: EDIT�CIA TEXTU - PRID�VANIE - - - ** Stla�enie kl�vesy A umo��uje prid�va� text. ** - - 1. Presu� kurozr ni��ie na prv� riadok za zna�kou --->. - Nez�le�� na tom, na ktorom znaku sa kurzor v tom riadku nach�dza. - - 2. Stla� kl�vesu A a nap� potrebn� text. - - 3. Po pridan� textu stla� kl�vesu pre n�vrat do Norm�lneho m�du. - - 4. Presu� kurozr na druh� riadok ozna�en� ---> a zopakuj - kroky 2 a 3 k�m nieje veta spr�vna. - ----> Tu je nejak� text ch�baj�ci o - Tu je nejak� text ch�baj�ci od tia�to. ----> Tu tie� ch�ba nej - Tu tie� ch�ba nejak� text. - - 5. Ke� sa dostato�ne nau�� prid�va� text, prejdi na lekciu 1.1.6. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.6: EDIT�CIA S�BORU - - - ** Nap�san�m :wq sa s�bor ulo�� a zavrie ** - -!! POZN�MKA: Pred vykonan�m t�chto krokov si pre��taj cel� lekciu!! - -1. Opusti t�to v�uku, ako si to urobil v lekcii 1.1.2: :q! - -2. Do pr�kazov�ho riadku nap� pr�kaz: vim tutor - 'vim' je pr�kaz, ktor� spust� editor Vim, 'tutor' je meno s�boru, - ktor� chce� editova�. Pou�i tak� s�bor, ktor� m��e� meni�. - -3. Vlo� a zma� text tak, ako si sa nau�il v predo�l�ch lekciach. - -4. Ulo� s�bor so zmenami a opusti Vim pr�kazom: :wq - -5. Re�tartuj vimtutor a presu� sa dole na nasleduj�ce zhrnutie. - -6. Urob tak po pre��tan� predo�l�ch krokov a porozumeniu im. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZHRNUTIE LEKCIE 1.1 - - - 1. Kurzor sa pohybuje pou�it�m kl�ves so ��pkami alebo kl�vesmi hjkl. - h (do lava) j (dole) k (hore) l (doprava) - - 2. Pre spustenie Vimu (z pr�kazov�ho riadku) nap�: vim FILENAME - - 3. Na ukon�enie Vimu nap�: :q! pre zru�enie v�etk�ch zmien - alebo nap�: :wq pre ulo�enie zmien. - - 4. Na zmazanie znaku na mieste kurzora nap�: x - - 5. Pre vlo�enie textu na mieste kurzora v norm�lnom m�de nap�: - i nap� vkladan� text vkladanie pred kurzor - A nap� prid�van� text vkladanie za riadok - -POZN�MKA: Stla�enie �a premiestn� do norm�lneho m�du alebo zru�� - nejak� nechcen� a �iasto�ne dokon�en� pr�kaz. - -Teraz pokra�uj lekciou 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.1: Mazacie pr�kazy - - - ** Nap�sanie pr�kazu dw zma�e znaky do konca slova. ** - -1. Stla� aby si bol bezpe�ne v norm�lnom m�de. - -2. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. - -3. Presu� kurzor na za�iatok slova, ktor� je potrebn� zmaza�. - -4. Nap� dw aby slovo zmizlo. - -POZN�MKA: P�smeno d sa zobraz� na poslednom riadku obrazovky ke� ho - nap�e�. Vim na teba po�k�, aby si mohol nap�sa� - p�smeno w. Ak vid� nie�o in� ako d , tak si nap�sal - nespr�vny znak; stla� a za�ni znova. - ----> Tu je nieko�ko slov z�bava, ktor� nie patria list do tejto vety. - -5. Zopakuj kroky 3 a� 4 k�m veta nieje spr�vna a prejdi na lekciu 1.2.2. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.2: VIAC MAZAC�CH PR�KAZOV - - - ** Nap�sanie pr�kazu d$ zma�e znaky do konca riadku ** - -1. Stla� aby si bol bezpe�ne v norm�lnom m�de. - -2. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. - -3. Presu� kurzor na koniec spr�vnej vety (ZA prv� bodku). - -4. Nap� d$ aby sa zmazali znaky do konca riadku. - ----> Niekto nap�sal koniec tohto riadku dvakr�t. koniec tohot riadku dvakr�t. - - -5. Prejdi na lekciu 1.2.3 pre pochopenie toho �o sa stalo. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.3: OPER�TORY A POHYBY - - Ve�a pr�kazov, ktor� menia text s� odvoden� od oper�torov a pohybov. - Form�t pre pr�kaz mazania kl�vesou d je nasledovn�: - - d pohyb - - kde: - d - je mazac� oper�tor - pohyb - je to �o oper�tor vykon�va (vyp�san� ni��ie) - - Kr�tky list pohybov: - w - do za�iatku �al�ieho slova, okrem jeho prv�ho p�smena. - e - do konca teraj�ieho slova, vr�tane posledn�ho znaku. - $ - do konca riadku, vr�tane posledn�ho znaku - - Tak�e nap�san�m de sa zma�e v�etko od kurzora do konca slova. - -POZN�MKA: Stla�en�m iba pohybu v norm�lnom m�de bez oper�tora - sa presunie kurzor tak ako je to �pecivikovan�. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.4: Pou�itie viacn�sobn�ho pohybu - - - ** Nap�san�m ��sla pred pohyb ho zopakuje zadn� po�et kr�t ** - - 1. Presu� kurozr ni��ie na za�iatok riadku ozna�en�ho --->. - - 2. Nap� 2w a kurozr sa presunie o dve slov� vpred. - - 3. Nap� 3e a kurozr sa presunie vpred na koniec tretieho slova. - - 4. Nap� 0 (nula) a kurozr sa presunie na za�iatok riadku. - - 5. Zopakuj kroky 2 a 3 s r�znymi ��slami. - ----> Toto je riadok so slovami po kotr�ch sa m��ete pohybova�. - - 6. Prejdi na lekciu 1.2.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.5: POU�ITIE VIACN�SOBN�HO MAZANIA PRE HROMADN� MAZANIE - - - ** Nap�sanie ��sla spolu s oper�torom ho zopakuje zadan� po�et kr�t ** - - V kombin�cii oper�torov mazania a pohybu spom�nan�ho vy��ie vlo� po�et - pred pohyb pre docielenie hromadn�ho mazania: - d ��slo pohyb - - 1. Presu� kurzor na prv� slovo p�san� VE�K�MI P�SMENAMI - v riadku ozna�enom --->. - - 2. Nap� 2dw a zma�e� dve slov� p�san� VE�K�MI P�SMENAMI - - 3. Zopakuj kroky 1 a 2 s pou�it�m r�zneho ��sla tak aby si zmazal slov� - p�san� ve�k�mi p�smenami jedn�m pr�kazom. - ----> Tento ABC DE riadok FGHI JK LMN OP so slovamI je Q RS TUV vycisteny. - -POZN�MKA: ��slo medzi oper�torom d a pohybom funguje podobne ako pri - pou�it� s pohybom bez oper�tora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.6: OPER�CIE S RIADKAMI - - - ** Nap�sanie pr�kazu dd zma�e cel� riadok. ** - -Vzh�adom na frekvenciu mazania cel�ho riadku, sa autori Vimu rozhodli, -�e bude jednoduch�ie maza� cel� riadok nap�san�m dvoch p�smen d. - -1. Presu� kurzor na druh� riadok v texte na spodu. -2. Nap� dd aby si zmazal riadok. -3. Prejdi na �tvrt� riadok. -4. Nap� 2dd aby si zmazal dva riadky. - - 1) Ru�e s� �erven�, - 2) Blato je z�bavn�, - 3) Fialky s� modr�, - 4) M�m auto, - 5) Hodinky ukazuj� �as, - 6) Cukor je sladk�, - 7) A to si ty. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.7: PR�KAZ UNDO - - -** Stla� u pre vr�tenie posledn�ho pr�kazu, U pre �pravu cel�ho riadku. ** - -1. Presu� kurzor ni��ie na riadok ozna�en� zna�kou ---> a premiestni ho na - prv� chybu. -2. Nap� x pre zmazanie prv�ho nechcen�ho riadku. -3. Teraz nap� u ��m vr�t� sp� posledne vykonan� pr�kaz. -4. Teraz oprav v�etky chyby na riadku pou�it�m pr�kazu x . -5. Teraz nap� ve�k� U ��m vr�t� riadok do p�vodn�ho stavu. -6. Teraz nap� u nieko�ko kr�t, ��m vr�t� sp� pr�kaz U. -7. Teraz nap� CTRL-R (dr� kl�vesu CTRL stla�en� k�m stl��a� R) nieko�ko - kr�t, ��m vr�t� sp� predt�m vr�ten� pr�kazy (undo z undo). - ----> Opprav chybby nna toomto riadku a zmee� ich pommocou undo. - - 8. Tieto pr�kazy s� �asto pou��van�. Teraz prejdi na zhrnutie lekcie 1.2. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.2 ZHRNUTIE - - - 1. Pre zmazanie znakov od kurzora do konca slova nap�: dw - - 2. Pre zmazanie znakov od kurzora do konca riadku nap�: d$ - - 3. Pre zmazanie cel�ho riadku nap�: dd - - 4. Pre zopakovanie pohybu, nap� pred neho ��slo: 2w - - 5. Form�t pre p�kaz: - - oper�tor [��slo] pohyb - kde: - oper�tor - �o treba robi�, napr�klad d pre zmazanie - [��slo] - je volite�n� po�et pre opakovanie pohybu - pohyb - pohyb po texte vzh�adom na oper�tor, napr�klad w (slovo), - $ (do konca riadku), at�. - - 6. Pre pohyb na za�iatok riadku pou�i nulu: 0 - - 7. Pre vr�tenie sp� predo�lej oper�cie nap�: u (mal� u) - Pre vr�tenie v�etk�ch �prav na riadku nap�: U (ve�k� U) - Pre vr�tenie vr�ten�ch �prav nap�: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.1: PR�KAZ VLO�I� - - - ** Nap�sanie pr�kazu p vlo�� psledn� v�maz za kurzor. ** - - 1. Presu� kurzor ni��ie na prv� riadok textu. - - 2. Nap� dd ��m zma�e� riadok a ulo�� ho do buffera editora Vim. - - 3. Presu� kurzor vy��ie tam, kam zmazan� riadok patr�. - - 4. Ak nap�e� v norm�lnom m�de p zmazan� riadk sa vlo��. - - 5. Zopakuj kroky 2 a� 4, k�m riadky nies� v spr�vnom porad�. - ----> d) Tie� sa dok�e� vzdel�va�? ----> b) Fialky s� modr�, ----> c) Inteligencia sa vzdel�va, ----> a) Ru�e s� �erven�, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.2: PR�KAZ NAHRADENIA - - - ** Nap�san�m rx sa nahrad� znak na mieste kurzora znakom x . ** - - 1. Presu� kurzor ni��ie na prv� riadok textu ozna�en�ho zna�kou --->. - - 2. Presu� kurzor na za�iatok prvej chyby. - - 3. nap� r a potom znak, ktor� tam m� by�. - - 4. Zopakuj kroky 2 a 3, k�m prv� riadok nieje zhodn� s druh�m. - ----> Ka� bol tento riasok p�aan�, niekro stla�il nespr�bne kl�vesy! ----> Ke� bol tento riadok p�san�, niekto stla�il nespr�vne kl�vesy! - - 5. Teraz prejdi na lekciu 1.3.2. - -POZN�MKA: Pam�taj si, �e nau�i� sa m��e� len pou��vanim, nie pam�tan�m. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.3: PR�KAZ �PRAVY - - - ** Ak chce� zmeni� �as� slova do konca slova, nap� ce . ** - - 1. Presu� kurzor ni��ie na prv� riadok ozna�en� zna�kou --->. - - 2. Umiestni kurzor na p�smeno o v slove rosfpl. - - 3. Nap� ce a oprav slovo (v tomto pr�pade nap� 'iadok'.) - - 4. Stla� a prejdi na �al�� znak, ktor� treba zmeni�. - - 5. Zopakuj kroky 3 a 4, k�m prv� veta nieje rovnak� ako druh�. - ----> Tento rosfpl m� nieko�ko skic, ktor� je pirewvb� zmeni� piy�u��n pr�kazu. ----> Tento riadok m� nieko�ko slov, ktor� je potrebn� zmeni� pou�it�m pr�kazu. - -Pozn�mka, �e ce zma�e slovo a nastav� vkladac� m�d. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.4: VIAC ZMIEN POU�IT�M c - - - ** Pr�kaz pre �pravy sa pou��va s rovnak�mi pohybmi ako pre mazanie ** - - 1. Pr�kaz pre �pravy pracuje rovnako ako pre mazanie. Form�t je: - - c [��slo] pohyb - - 2. Pohyby s� rovnak�, ako napr�klad w (slovo) a $ (koniec riadku). - - 3. Presu� kurzor ni��ie na prv� riadok ozna�en� zna�kou --->. - - 4. Presu� kurzor na prv� chybu. - - 5. nap� c$ aby si mohol upravi� zvy�ok riadku pod�a druh�ho - a stla� . - ----> Koniec tohto riadku potrebuje pomoc, aby bol ako druhy. ----> Koniec tohto riadku potrebuje opravi� pou�it�m pr�kazu c$ . - -POZN�MKA: M��e� pou�i� kl�vesu backspace na �pravu zmien po�as p�sania. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.3 ZHRNUTIE - - - 1. Na vlo�enie textu, ktor� u� bol zmazan�, nap� p . To vlo�� zmazan� - text ZA kurzor (ak bol riadok zmazan� prejde na riadok pod kurzorom). - - 2. Pre naradenie znaku na mieste kurzora, nap� r a potom znak, ktor� - nahrad� p�vodn� znak. - - 3. Pr�kaz na upravenie umo��uje zmeni� od kurzora a� po miesto, ktor� - ur�uje pohyb. napr. Nap� ce ��m zmn� text od poz�cie - kurzora do konca slova, c$ zmen� text do konca riadku. - - 4. Form�t pre nahradenie je: - - c [��slo] pohyb - - -Teraz prejdi na nalseduj�cu lekciu. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.1: POZ�CIA A STATUS S�BORU - - - ** Stla� CTRL-g pre zobrazenie svojej poz�cie v s�bore a statusu s�boru. - Nap� G pre presun na riadok v s�bore. ** - - Pozn�mka: Pre��taj si cel� t�to lekciu sk�r ako za�ne� vykon�va� kroky!! - - 1. Dr� stla�en� kl�vesu Ctrl a stla� g . Toto naz�vame CTRL-G. - Na spodu obrazovky sa zobraz� spr�va s n�zvom s�boru a poz�ciou - v s�bore. Zapam�tajsi si ��slo riadku pre pou�itie v kroku 3. - - 2. Stla� G ��m sa dostane� na spodok s�boru. - Nap� gg ��m sa dostane� na za�iatok s�boru. - - 3. Nap� ��slo riadku na ktorom si sa nach�dzal a stla� G. To �a - vr�ti na riadok, na ktorom si prv� kr�t stla�il CTRL-G. - - 4. Ak sa c�t� schopn� vykona� teto kroky, vykonaj kroky 1 a� 3. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.2: PR�KAZ VYH�AD�VANIA - - - ** Nap� / nasledovan� re�azcom pre vyh�adanie pr�slu�n�ho re�azca. ** - - 1. Nap� znak / v norm�lnom m�de. Pozn�mka, �e tento znak sa spolu - s kurzorom zobraz� v dolnej �asti obrazovky s : pr�kazom. - - 2. Teraz nap� 'errroor' . To je slovo, ktor� chce� vyh�ada�. - - 3. Pre vyh�adanie �al�ieho v�skytu rovnak�ho re�azca, stla� jednoducho n. - Pre vyh�adanie �al�ieho v�skytu rovnak�ho re�azca opa�n�m smerom, - N. - - 4. Ak chce� vyh�ada� re�azec v sp�tnom smere, pou�� pr�kaz ? miesto - pr�kazu /. - - 5. Pre n�vrat na miesto z ktor�ho si pri�iel stla� CTRL-O (dr� stla�en� - kl�vesu Ctrl po�as stla�enia kl�vesy o). Zopakuj pre �al�� n�vrat - sp�. CTRL-I ide vpred. - -POZN�MKA: "errroor" nieje sp�sob hl�skovania error; errroor je error. -POZN�MKA: Ke� vyh�ad�vanie dosiahne koniec tohto s�boru, bude pokra�ova� na - za�iatku, dokia� nieje resetovan� nastavenie 'wrapscan' . - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.3: VYH�AD�VANIE ZODPOVEDAJ�CICH Z�TAVORIEK - - - ** Nap� % pre vyh�adanie pr�slu�n�ho znaku ),], alebo } . ** - - 1. Premiestni kurzor na hocak� zo znakov (, [, alebo { v riadku ni��ie - ozna�en�ho zna�kou --->. - - 2. Teraz nap� znak % . - - 3. Kurzor sa premiestni na zodpovedaj�cu z�tvorku. - - 4. Nap� % pre presun kurzoru sp� na otv�raj�cu z�tvorku. - - 5. Presu� kurzor na in� zo znakov (,),[,],{ alebo } a v�imni si - �o % vykon�va. - ----> Toto ( je testovac� riadok s ('s, ['s ] a {'s } v riadku. )) - -Pozn�mka: Toto je ve�mi v�hodn� pou�� pri laden� programu s ch�baj�cimi - uzatv�raj�cimi z�tvorkami! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.4: PR�KAZ NAHRADENIA - - - ** Nap� :s/star�/nov�/g pre nahradenie slova 'star�' za slovo 'nov�'. ** - - 1. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. - - 2. Nap� :s/thee/the . Poznamka, �e tento pr�kaz zmen� len prv� - v�skyt "thee" v riadku. - - 3. Teraz nap� :s/thee/the/g �o znamen� celkov� nahradenie v riadku. - Toto nahrad� v�etky v�skyty v riadku. - ----> Thee best time to see thee flowers in thee spring. - - 4. Pre zmenu v�etk�ch v�skytov dan�ho re�azca medzi dvomi ridakami, - nap� :#,#s/star�/nov�/g kde #,# s� ��sla dvoch riadkov, v rozsahu - ktor�ch sa nahradenie vykon�. - nap� :%s/star�/nov�/g pre zmenu v�etk�ch v�skytov v celom riadku - nap� :%s/star�/nov�/gc n�jde v�etky v�skyty v celom s�bore, - s ot�zkou �i nahradi� alebo nie - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.4 ZHRNUTIE - - - 1. CTRL-g vyp�e tvoju poz�ciu v s�bore a status s�boru. - G �a premiestni na koniec riadku. - ��slo G �a premiestni na riadok s ��slom. - gg �a presunie na prv� riadok - - 2. Nap�sanie / nasledovan� re�azcom vyh�ad� re�azec smerom DOPREDU. - Nap�sanie ? nasledovan� re�azcom vyh�ada re�azec smerom DOZADU. - Nap�sanie n po vyh�ad�van�, vyh�ad� nasleduj�ci v�skyt re�azca - v rovnakom smere, pri�om N vyh�ad� v opa�nom smere. - CTRL-O �a vr�ti sp� na star�iu poz�ciu, CTRL-I na nov�iu poz�ciu. - - 3. Nap�sanie % ke� kurzor je na (,),[,],{, alebo } n�jde zodpovdaj�cu - p�rnu z�tvorku. - - 4. Pre nahradenie nov�ho za prv� star� v riadku nap� :s/star�/nov� - Pre nahradenie nov�ho za v�etky star� v riadku nap� :s/star�/nov�/g - Pre nahradenie re�azcov medzi dvoma riadkami 3 nap� :#,#/star�/nov�/g - Pre nahradenie v�etk�ch v�skytov v s�bore nap� :%s/star�/nov�/g - Pre potvrdenie ka�d�ho nahradenia pridaj 'c' :%s/star�/nov�/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.1: AKO SPUSTI� VONKAJ�� PR�KAZ - - - ** Nap� pr�kaz :! nasledovan� vonkaj��m pr�kazom pre spustenie pr�kazu ** - - 1. Nap� obvykl� p�kaz : ktor� nastav� kurzor na spodok obrazovky. - To umo�n� nap�sa� pr�kaz. - - 2. Teraz nap� ! (v�kri�n�k). To umo�n� spusti� hociak� vonkaj�� pr�kaz - z pr�kazov�ho riadku. - - 3. Ako pr�klad nap� ls za ! a stla� . Tento pr�kaz - zobraz� obsah tvojho adres�ra rovnako ako na pr�kazovom riadku. - Alebo pou�i :!dir ak ls nefunguje. - -Pozn�mka: Takto je mo�n� spusti� hociak� vonkaj�� pr�kaz s argumentami. -Pozn�mka: V�etky pr�kazy : musia by� dokon�en� stla�en�m - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.2: VIAC O UKLADAN� S�BOROV - - - ** Pre ulo�enie zmien v s�bore, nap� :w FILENAME. ** - - 1. Nap� :!dir alebo :!ls pre v�pis aktu�lneho adres�ra. - U� vie�, �e mus� za t�mto stla�i� . - - 2. Vyber n�zov s�boru, ktor� e�te neexistuje, ako napr. TEST. - - 3. Teraz nap�: :w TEST (kde TEST je n�zov vybrat�ho s�boru.) - - 4. To ulo�� cel� s�bor (Vim Tutor) pod n�zovm TEST. - Pre overenie nap� :!dir , ��m zobraz� obsah adres�ra. - -Pozn�mka: �e ak ukon�� pr�cu s editorom Vim a znovu ho spust� pr�kazom - vim TEST, s�bor bude k�pia v�uky, ke� si ho ulo�il. - - 5. Teraz odstr�� s�bor nap�san�m (MS-DOS): :!del TEST - alebo (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.3: V�BER TEXTU PRE ULO�ENIE - - - ** Pre ulo�enie �asti s�boru, nap� v pohyb :w FILENAME ** - - 1. Presu� kurozr na tento riadok. - - 2. Stla� v a presu� kurozr na piatu polo�ku dole. Pozn�mka, �e - tento text je vyzna�en� (highlighted). - - 3. Stla� kl�vesu : . V spodnej �asti okna sa objav� :'<,'>. - - 4. Nap� w TEST , kde TEST je meno s�boru, ktor� zatial neexistuje. - Skontroluj, e vid� :'<,'>w TEST predt�m ne� stla�� Enter. - - 5. Vim zap�e ozna�en� riadky do s�boru TEST. Pou�i :!dir alebo :!ls - pre overenie. Zatial ho e�te nema�! Pou�ijeme ho v �al�ej lekcii. - -POZN�MKA: Stla�en�m kl�vesy v sa spust� vizu�lne ozna�ovanie. - M��e� pohybova� kurzorom pre upresnenie vyzna�en�ho textu. - Potom m��e� pou�i� oper�tor pre vykonanie nejakej akcie - s textom. Napr�klad d zma�e vyzna�en� text. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.4: V�BER A ZLU�OVANIE S�BOROV - - - ** Pre vlo�enie obsahu s�boru, nap� :r FILENAME ** - - 1. Premiestni kurzor nad tento riadok. - -POZN�MKA: Po vykonan� kroku 2 uvid� text z lekcie 1.5.3. Potom sa presu� - dole, aby si videl t�to lekciu. - - 3. Teraz vlo� s�bor TEST pou�it�m pr�kazu :r TEST kde TEST je n�zov - s�boru. S�bor, ktor� si pou�il je umiestnen� pod riadkom s kurzorom. - -POZN�MKA: M��e� tie� na��ta� v�stup vonkaj�ieho pr�kazu. Napr�klad :r !ls - na��ta v�stup pr�kazu ls a umiestni ho za poz�ciu kurzora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.5 ZHRNUTIE - - - 1. :!pr�kaz spust� vonkaj�� pr�kaz. - - Niektor� vyu�ite�n� pr�klady s�: - (MS_DOS) (UNIX) - :!dir :!ls - zobraz� obsah adres�ra - :!del FILENAME :!rm FILENAME - odstr�ni s�bor FILENAME - - 2. :w FILENAME ulo�� aktu�lny s�bor na disk pod menom FILENAME. - - 3. v pohyb :w FILENAME ulo�� vizu�lne ozna�en� riadky do - s�boru FILENAME. - - 4. :r FILENAME vyberie z disku s�bor FILENAME a vlo�� ho do aktu�lneho - s�boru za poz�ciou kurzora. - - 5. :r !dir na��ta v�stup z pr�kazu dir a vlo�� ho za poz�ciu kurzora. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.1: PR�KAZ OTVORI� - - -** Nap� o pre vlo�enie riadku pod kurzor a prepnutie do vkladacieho m�du ** - - 1. Presu� kurzor ni��ie na riadok ozna�en� zna�kou --->. - - 2. Nap� o (mal� p�smeno) pre vlo�enie �ist�ho riadku pod kurzorm - a prepnutie do vkladacieho m�du. - - 3. Teraz skop�ruj riadok ozna�en� ---> a stla� pre ukon�enie - vkladacieho m�du. - ----> Po nap�san� o sa kurzor premiestn� na vlo�en� riadok do vkladacieho - m�du. - - 4. Pre otvorenie riadku nad kurzorom, jednotucho nap� ve�k� O , - namiesto mal�ho o. Vysk��aj si to na riadku dole. - ----> Vlo� riadok nad t�mto nap�san�m O, ke� kurzor je na tomto riadku. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.2: PR�KAZ PRIDA� - - - ** Nap� a pre vlo�enie textu ZA kurzor. ** - - 1. Presu� kurzor ni��ie na koniec prv�ho riadku ozna�en�ho zna�kou ---> - - 2. Stla� kl�vesu e dokia� kurozr nieje na konci riadku. - - 3. Nap� a (mal� p�smeno) pre pridanie textu ZA kurzorom. - - 4. Dokon�� slovo tak ako je to v druhom riadku. Stla� pre - opustenie vkladacieho m�du. - - 5. Pou�i e na presun na �al�ie nedokon�en� slovo a zopakuj kroky 3 a 4. - ----> Tento ri ti dovo�uje n�cv pri�van testu na koniec riadku. ----> Tento riadok ti dovo�uje n�cvik prid�vania textu na koniec riadku. - -POZN�MKA: a, i, A �tartuj� rovnak� vkladac� m�d, jedin� rozidel je, kde - sa znaky vkladaj�. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.3: IN� SPOSOB NAHRADZOVANIA - - - ** Nap� ve�k� R pre nahradenie viac ako jedn�ho znaku. ** - - 1. Presu� kurzor ni��ie na prv� riadok ozna�en� zna�kou --->. Premiestni - kurzor na za�iatok prv�ho v�skytu xxx. - - 2. Teraz nap� R a nap� ��slo uveden� v druhom riadku, tak�e - sa n�m nahrad� p�vodn� xxx. - - 3. Stla� pre opustenie nahradzovacieho m�du. Pozn�mka, �e zvy�ok - riadku zostane nezmenen�. - - 4. Zopakuj tieto kroky pre nahradenie zvy�n�ch xxx. - ----> Pridan�m 123 ku xxx dostane� xxx. ----> Pridan�m 123 ku 456 dostane� 579. - -POZN�MKA: Nahradzovac� m�d je ako vkladac� m�d, ale ka�d� nap�san� znak - zma�e existuj�ci znak. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lekcia 1.6.4: Copy Paste textu - - ** pou�� oper�tor y pre copy textku a p pre jeho paste ** - - 1. Cho� ni��ie na riadok ozna�en� ---> a umiestni kurozr za "a)". - - 2. Na�tartuj vizu�lny m�d pou�it�m v a presu� kurozr pred "first". - - 3. Nap� y pre vystrihnutie (copy) ozna�en�ho textu. - - 4. Presu� kurozr na koniec �al�ieho riadku: j$ - - 5. Nap� p pre vlo�nie (paste) textu. Potom nap�: a druha . - - 6. Pou�i vizu�lny m�d pre ozna�enie "polo�ka.", vystrihni to - pou�it�m y, presu� sa na koniec nasleduj�ceho riadku pou�it�m j$ - a vlo� sem text pou�it�m p. - ----> a) toto je prv� polo�ka ----> b) - -POZN�MKA: M��e� pou�i� tie� y ako oper�tor; yw vystrihne jedno slovo. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.5: NASTAVENIE MO�NOST� - - -** Nastav mo�nosti, tak�e vyh�ad�vanie alebo nahradzovanie ignoruje - rozli�ovanie ** - - - 1. Vyh�adaj re�azec 'ignore' nap�san�m: - /ignore - Zopakuj vyh�ad�vanie nieko�ko kr�t stla�en�m kl�vesy n . - - 2. Nastav mo�nos� 'ic' (Ignore case) nap�san�m pr�kazu: - :set ic - - 3. Teraz vyh�adaj re�azec 'ingore' znova stla�en�m kl�vesy n - Pozn�mka, �e teraz s� vyh�adan� aj Ignore a IGNORE. - - 4. Nastav mo�nos�i 'hlsearch' a 'incsearch': - :set hls is - - 5. Teraz spusti vyh�ad�vac� pr�kaz znovu, a pozri �o sa stalo: - /ignore - - 6. Pre opetovn� zapnutie rozly�ovania ve�k�ch a mal�ch p�smen - nap�: :set noic - -POZN�MKA: Na odstr�nenie zv�raznenia v�razov nap�: :nohlsearch -POZN�MKA: Ak chce� nerozly�ova� ve�kos� p�smen len pre jedno - pou�itie vyh�ad�vacieho pr�kazu, pou�i \c: /ignore\c - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.6 ZHRNUTIE - - - 1. Nap� o pre otvorenie riadku pod kurzorom a �tart vkladacieho m�du. - Nap� O pre otvorenie riadku nad kurzorom. - - 2. Nap� a pre vkladanie textu ZA kurzor. - Nap� A pre vkladanie textu za koncom riadku. - - 3. Pr�kaz e presunie kurozr na koniec slova - - 4. Oper�tor y vystrihne (skop�ruje) text, p ho vlo��. - - 5. Nap�sanie ve�k�ho R prepne do nahradzovacieho m�du, k�m nieje - stla�en� . - - 6. Nap�sanie ":set xxx" nastav� mo�nos� "xxx". Niektor� nastavenia s�: - 'ic' 'ignorecase' ignoruje ve�k� a mal� p�smen� po�as vyh�ad�vania. - 'is' 'incsearch' zobrazuje �iasto�n� re�azce vyh�ad�van�ho re�azca. - 'hls' 'hlsearch' vyzna�� v�etky vyh�ad�van� re�azce. - M��e� pou�i� hociktor� z dlh�ch a kr�tkych n�zvov mo�nost�. - - 7. Vlo� "no" pred nastavenie pre jeho vypnutie: :set noic - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.7.1: Z�SKANIE N�POVEDY - - - ** Pou��vaj on-line syst�m n�povedy ** - - Vim m� obsiahly on-line syst�m n�povedy. Pre od�tartovanie, vysk��aj jeden - z t�chto troch: - - stla� kl�vesu (ak nejak� m�) - - stla� kl�vesu (ak nejak� m�) - - nap� :help - - ��taj text v okne n�povedy pre z�skanie predstavy ako n�poveda funguje. - Nap� CTRL-W CTRL-W pre skok z jedn�ho okna do druh�ho. - Nap� :q ��m zatvor� okno n�povedy. - - M��e� n�js� help ku hociakej t�me pridan�m argumentu ku pr�kazu ":help". - Vysk��aj tieto (nezabudni stla�i� ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.7.2: VYTVORENIE �TARTOVACIEHO SKRIPTU - - ** Zapni funkcie editora Vim ** - - Vim m� omnoho viac funkcii ne� Vi, ale ve�ina z nich je implicitne - vypnut�. Pre pou��vanie viac Vim funkcii vytvor "vimrc" s�bor. - - 1. Za�ni editova� "vimrc" s�bor, to z�vis� na pou�itom syst�me: - :e ~/.vimrc pre Unix - :e ~/_vimrc pre MS-Windows - - 2. Teraz si pre��taj text pr�kladu "vimrc" s�boru: - - :r $VIMRUNTIME/vimrc_example.vim - - 3. Ulo� s�bor: - :w - - Pri nasleduj�com �tarte editora Vim sa pou�ije zv�raz�ovanie syntaxe. - Do "vimrc" s�boru m��e� prida� v�etky svoje uprednost�ovan� nastavenia. - Pre viac inform�cii nap� :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - LEKCIA 1.7.3: DOKON�ENIE - - ** Dokon�i pr�kaz na pr�kazovom riadku pou�it�m CTRL-D a ** - - 1. Uisti sa, �e Vim nieje v kompatibilnom m�de: :set nocp - - 2. Pozri sa ak� s�bory sa nach�dzaj� v adres�ri: :!ls alebo :!dir - - 3. Nap� za�iatok pr�kazu: :e - - 4. Stla� CTRL-D a Vim zobraz� zoznam pr�kazov za��naj�cich "e". - - 5. Stla� a Vim dokon�� meno pr�kazu na ":edit". - - 6. Teraz pridaj medzern�k a za�iatok mena existuj�ceho s�boru: - :edit FIL - - 7. Stla� . Vim dokon�� meno (ak je jedine�n�). - -POZN�MKA: Dokon�ovanie funguje pre ve�a pr�kazov. Vysk��aj stla�enie - CTRL-D a . �peci�lne je to u�ito�n� pre pr�kaz :help. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - LEKCIA 1.7 ZHRNUTIE - - 1. Nap� :help alebo stla� alebo pre otvorenie okna n�povedy. - - 2. Nap� :help pr�kaz pre vyh�adanie n�povedy ku pr�kazu pr�kaz. - - 3. Nap� CTRL-W CTRL-W na presko�enie do in�ho okna. - - 4. Nap� :q pre zatvorenie okna n�povedy - - 5. Vytvor �tartovac� skript vimrc pre udr�anie uprednost�ovan�ch nastaven�. - - 6. Po�as p�sania pr�kazu : stla� CTRL-D pre zobrazenie dokon�en�. - Stla� pre pou�itie jedn�ho z dokon�en�. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - Toto vymedzuje v�uku Vimu. Toto je ur�en� pre strucn� preh�ad o editore - Vim, �plne posta�uj�ce pre �ahk� a obstojn� pou��vanie tohto editora. - T�to v�uka je �aleko od kompletnosti, preto�e Vim m� omnoho viacej pr�kazov. - Ako �al�ie si pre��taj u��vat�sk� manu�l: ":help user-manual". - - Pre �al�ie ��tanie a �t�dium je odpor��an� kniha: - Vim - Vi Improved - od Steve Oualline - Vydavate�: New Riders - Prv� kniha ur�en� pre Vim. �peci�lne vhodn� pre za�iato�n�kov. - Obsahuje mno�stvo pr�kladov a obr�zkov. - Pozri na https://iccf-holland.org/click5.html - - T�to kniha je star�ia a je viac o Vi ako o Vim, ale je tie� odpor��an�: - Learning the Vi Editor - od Linda Lamb - Vydavate�: O'Reilly & Associates Inc. - Je to dobr� kniha pre z�skanie vedomost� o pr�ci s editorom Vi. - �ieste vydanie obsahuje tie� inform�cie o editore Vim. - - T�to v�uka bola nap�san� autormi Michael C. Pierce a Robert K. Ware, - Colorado School of Mines s pou�it�m my�lienok dodan�mi od Charles Smith, - Colorado State University. E-mail: bware@mines.colorado.edu. - - Modifikovan� pre Vim od Bram Moolenaar. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Preklad do Sloven�iny: �ubo� �elko - e-mail: celbos@inmail.sk - Last Change: 2006 Apr 18 - encoding: iso8859-2 diff --git a/runtime/tutor/tutor1.sk.utf-8 b/runtime/tutor/tutor1.sk.utf-8 deleted file mode 100644 index 523a300a01..0000000000 --- a/runtime/tutor/tutor1.sk.utf-8 +++ /dev/null @@ -1,1008 +0,0 @@ -=============================================================================== -= V i t a j t e v o V I M T u t o r i a l i - Verzia 1.7 = -=============================================================================== - - Vim je veľmi výkonný editor, ktorý má príliž veľa príkazov na to aby - mohli byt všetky popísané vo výuke akou je táto. Táto výuka - popisuje dostatočné množstvo príkazov nato aby bolo možné používať - Vim ako viacúčelový editor. - - Približný čas potrebný na prebratie tejto výuky je 25-30 minút, - závisí na tom, koľko je stráveného času s preskúšavaním. - - UPOZORNENIE: - Príkazy v lekciách modifikujú text. Vytvor kópiu tohto súboru aby - sa mohlo precvičovať na ňom (pri štarte "vimtutor" je toto kópia). - - Je dôležité zapamätať si, že táto výuka je vytvorená pre výuku - používaním. To znamená, že je potrebné si príkazy vyskúšať, aby bolo - učenie správne. Ak len čitas text, príkazy zabudneš! - - Presvedč sa, že Caps-Lock NIEJE stlačený a stlačt klávesu - j niekoľko krát, aby sa kurzor posunul natoľko, že lekcia 1.1.1 - celkom zaplní obrazovku. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.1: POHYB KURZOROM - - - ** Pre pohyb kurzorum stlač klávesy h,j,k,l ako je znázornené. ** - ^ - k Funkcia: Klávesa h je naľavo a vykoná pohyb doľava. - < h l > Klávesa l je napravo a vykoná pohyb doprava. - j Klávesa j vyzerá ako šípka dole - v - 1. Pohybuj kurzorom po obrazovke, kým si na to nezvykneš. - - 2. Drž stlačenú klávesu pre pohyb dole (j), kým sa jej funkcia nezopakuje. ----> Teraz sa už vieš pohybovať na nasledujúcu lekciu. - - 3. Použitím klávesy pre pohyb dole prejdi na Lekciu 1.1.2. - -Poznámka: Ak si niesi istý tým čo si napísal, stlač - na prechod do normálneho módu. - -Poznámka: Kurzorové klávesy sú tiež funkčné. Ale používaním hjkl sa budeš - schopný pohybovať rýchlejšie, keď si zvykneš ich používať. Naozaj! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.1.2: ZATVÁRANIE VIMU - - - !! POZNÁMKA: Pred vykonaním týchto krokov si prečítaj celú túto lekciu !! - - 1. Stlač klávesu (aby si sa učite nachádzal v normálnom móde) - - 2. Napíš: :q! . - Tým ukončíš prácu s editorom BEZ uloženia zmien, ktoré si vykonal. - - 3. Keď sa dostaneš na príkazový riadok, napíš príkaz, ktorým sa dostaneš - speť do tejto výuky. To môže byť: vimtutor - - 4. Ak si si tieto kroky spoľahlivo zapamätal, vykonaj kroky 1 až 3, pre - ukončenie a znovu spustenie editora. - -POZNÁMKA: :q! neuloží zmeny, ktoré si vykonal. O niekoľko lekcií - sa naučíš ako uložiť zmeny do súboru - - 5. presuň kurzor dole na lekciu 1.1.3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.3: EDITÁCIA TEXTU - MAZANIE - - -** Stlačenie klávesy x v normálnom móde zmaže znak na mieste kurzora. ** - - 1. Presuň kurzor nižšie na riadok označený značkou --->. - - 2. Aby si mohol odstrániť chyby, pohybuj kurzorom kým neprejde na znak, - ktorý chceš zmazať. - - 3. Stlač klávesu x aby sa zmazal nechcený znak. - - 4. Zopakuj kroky 2 až 4 až kým veta nieje správna. - ----> Kraava skoočilla ccezz mesiiac. - - 5. Ak je veta správna, prejdi na lekciu 1.1.4. - -POZNÁMKA: Neskúšaj si zapamätať obsah tejto výuky, ale sa uč používaním. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.4: EDITÁCIA TEXTU - VKLADANIE - - - ** Stlačenie klávesy i umožňuje vkladanie textu. ** - - 1. Presuň kurzor nižšie na prvý riadok za značku --->. - - 2. Pre upravenie prvého riadku do rovnakého tvaru ako je druhý riadok, - presuň kurzor na prvý znak za misto, kde má byť text vložený. - - 3. Stlač klávesu i a napíš potrebný text. - - 4. Po opravení každej chyby, stlač pre návrat do normálneho módu. - Zopakuj kroky 2 až 4 kým nieje veta správna. - ----> Tu je text chýbajúci tejto. ----> Tu je nejaký text chýbajúci od tejto čiary. - - 5. Keď sa dostatočne naučíš vkladať text, prejdi na nasledujúce zhrnutie. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.5: EDITÁCIA TEXTU - PRIDÁVANIE - - - ** Stlačenie klávesy A umožňuje pridávať text. ** - - 1. Presuň kurozr nižšie na prvý riadok za značkou --->. - Nezáleží na tom, na ktorom znaku sa kurzor v tom riadku nachádza. - - 2. Stlač klávesu A a napíš potrebný text. - - 3. Po pridaní textu stlač klávesu pre návrat do Normálneho módu. - - 4. Presuň kurozr na druhý riadok označený ---> a zopakuj - kroky 2 a 3 kým nieje veta správna. - ----> Tu je nejaký text chýbajúci o - Tu je nejaký text chýbajúci od tiaľto. ----> Tu tiež chýba nej - Tu tiež chýba nejaký text. - - 5. Keď sa dostatočne naučíš pridávať text, prejdi na lekciu 1.1.6. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.1.6: EDITÁCIA SÚBORU - - - ** Napísaním :wq sa súbor uloží a zavrie ** - -!! POZNÁMKA: Pred vykonaním týchto krokov si prečítaj celú lekciu!! - -1. Opusti túto výuku, ako si to urobil v lekcii 1.1.2: :q! - -2. Do príkazového riadku napíš príkaz: vim tutor - 'vim' je príkaz, ktorý spustí editor Vim, 'tutor' je meno súboru, - ktorý chceš editovať. Použi taký súbor, ktorý môžeš meniť. - -3. Vlož a zmaž text tak, ako si sa naučil v predošlých lekciach. - -4. Ulož súbor so zmenami a opusti Vim príkazom: :wq - -5. Reštartuj vimtutor a presuň sa dole na nasledujúce zhrnutie. - -6. Urob tak po prečítaní predošlých krokov a porozumeniu im. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ZHRNUTIE LEKCIE 1.1 - - - 1. Kurzor sa pohybuje použitím kláves so šípkami alebo klávesmi hjkl. - h (do lava) j (dole) k (hore) l (doprava) - - 2. Pre spustenie Vimu (z príkazového riadku) napíš: vim FILENAME - - 3. Na ukončenie Vimu napíš: :q! pre zrušenie všetkých zmien - alebo napíš: :wq pre uloženie zmien. - - 4. Na zmazanie znaku na mieste kurzora napíš: x - - 5. Pre vloženie textu na mieste kurzora v normálnom móde napíš: - i napíš vkladaný text vkladanie pred kurzor - A napíš pridávaný text vkladanie za riadok - -POZNÁMKA: Stlačenie ťa premiestní do normálneho módu alebo zruší - nejaký nechcený a čiastočne dokončený príkaz. - -Teraz pokračuj lekciou 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.1: Mazacie príkazy - - - ** Napísanie príkazu dw zmaže znaky do konca slova. ** - -1. Stlač aby si bol bezpečne v normálnom móde. - -2. Presuň kurzor nižšie na riadok označený značkou --->. - -3. Presuň kurzor na začiatok slova, ktoré je potrebné zmazať. - -4. Napíš dw aby slovo zmizlo. - -POZNÁMKA: Písmeno d sa zobrazí na poslednom riadku obrazovky keď ho - napíšeš. Vim na teba počká, aby si mohol napísať - písmeno w. Ak vidíš niečo iné ako d , tak si napísal - nesprávny znak; stlač a začni znova. - ----> Tu je niekoľko slov zábava, ktoré nie patria list do tejto vety. - -5. Zopakuj kroky 3 až 4 kým veta nieje správna a prejdi na lekciu 1.2.2. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.2: VIAC MAZACÍCH PRÍKAZOV - - - ** Napísanie príkazu d$ zmaže znaky do konca riadku ** - -1. Stlač aby si bol bezpečne v normálnom móde. - -2. Presuň kurzor nižšie na riadok označený značkou --->. - -3. Presuň kurzor na koniec správnej vety (ZA prvú bodku). - -4. Napíš d$ aby sa zmazali znaky do konca riadku. - ----> Niekto napísal koniec tohto riadku dvakrát. koniec tohot riadku dvakrát. - - -5. Prejdi na lekciu 1.2.3 pre pochopenie toho čo sa stalo. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.3: OPERÁTORY A POHYBY - - Veľa príkazov, ktoré menia text sú odvodené od operátorov a pohybov. - Formát pre príkaz mazania klávesou d je nasledovný: - - d pohyb - - kde: - d - je mazací operátor - pohyb - je to čo operátor vykonáva (vypísané nižšie) - - Krátky list pohybov: - w - do začiatku ďalšieho slova, okrem jeho prvého písmena. - e - do konca terajšieho slova, vrátane posledného znaku. - $ - do konca riadku, vrátane posledného znaku - - Takže napísaním de sa zmaže všetko od kurzora do konca slova. - -POZNÁMKA: Stlačením iba pohybu v normálnom móde bez operátora - sa presunie kurzor tak ako je to špecivikované. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.4: Použitie viacnásobného pohybu - - - ** Napísaním čísla pred pohyb ho zopakuje zadný počet krát ** - - 1. Presuň kurozr nižšie na začiatok riadku označeného --->. - - 2. Napíš 2w a kurozr sa presunie o dve slová vpred. - - 3. Napíš 3e a kurozr sa presunie vpred na koniec tretieho slova. - - 4. Napíš 0 (nula) a kurozr sa presunie na začiatok riadku. - - 5. Zopakuj kroky 2 a 3 s rôznymi číslami. - ----> Toto je riadok so slovami po kotrých sa môžete pohybovať. - - 6. Prejdi na lekciu 1.2.5. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.5: POUŽITIE VIACNÁSOBNÉHO MAZANIA PRE HROMADNÉ MAZANIE - - - ** Napísanie čísla spolu s operátorom ho zopakuje zadaný počet krát ** - - V kombinácii operátorov mazania a pohybu spomínaného vyššie vlož počet - pred pohyb pre docielenie hromadného mazania: - d číslo pohyb - - 1. Presuň kurzor na prvé slovo písané VEĽKÝMI PÍSMENAMI - v riadku označenom --->. - - 2. Napíš 2dw a zmažeš dve slová písané VEĽKÝMI PÍSMENAMI - - 3. Zopakuj kroky 1 a 2 s použitím rôzneho čísla tak aby si zmazal slová - písané veľkými písmenami jedným príkazom. - ----> Tento ABC DE riadok FGHI JK LMN OP so slovamI je Q RS TUV vycisteny. - -POZNÁMKA: Číslo medzi operátorom d a pohybom funguje podobne ako pri - použití s pohybom bez operátora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.6: OPERÁCIE S RIADKAMI - - - ** Napísanie príkazu dd zmaže celý riadok. ** - -Vzhľadom na frekvenciu mazania celého riadku, sa autori Vimu rozhodli, -že bude jednoduchšie mazať celý riadok napísaním dvoch písmen d. - -1. Presuň kurzor na druhý riadok v texte na spodu. -2. Napíš dd aby si zmazal riadok. -3. Prejdi na štvrtý riadok. -4. Napíš 2dd aby si zmazal dva riadky. - - 1) Ruže sú červené, - 2) Blato je zábavné, - 3) Fialky sú modré, - 4) Mám auto, - 5) Hodinky ukazujú čas, - 6) Cukor je sladký, - 7) A to si ty. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.2.7: PRÍKAZ UNDO - - -** Stlač u pre vrátenie posledného príkazu, U pre úpravu celého riadku. ** - -1. Presuň kurzor nižšie na riadok označený značkou ---> a premiestni ho na - prvú chybu. -2. Napíš x pre zmazanie prvého nechceného riadku. -3. Teraz napíš u čím vrátíš späť posledne vykonaný príkaz. -4. Teraz oprav všetky chyby na riadku použitím príkazu x . -5. Teraz napíš veľké U čím vrátíš riadok do pôvodného stavu. -6. Teraz napíš u niekoľko krát, čím vrátíš späť príkaz U. -7. Teraz napíš CTRL-R (drž klávesu CTRL stlačenú kým stláčaš R) niekoľko - krát, čím vrátíš späť predtým vrátené príkazy (undo z undo). - ----> Opprav chybby nna toomto riadku a zmeeň ich pommocou undo. - - 8. Tieto príkazy sú často používané. Teraz prejdi na zhrnutie lekcie 1.2. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.2 ZHRNUTIE - - - 1. Pre zmazanie znakov od kurzora do konca slova napíš: dw - - 2. Pre zmazanie znakov od kurzora do konca riadku napíš: d$ - - 3. Pre zmazanie celého riadku napíš: dd - - 4. Pre zopakovanie pohybu, napíš pred neho číslo: 2w - - 5. Formát pre píkaz: - - operátor [číslo] pohyb - kde: - operátor - čo treba robiť, napríklad d pre zmazanie - [číslo] - je voliteľný počet pre opakovanie pohybu - pohyb - pohyb po texte vzhľadom na operátor, napríklad w (slovo), - $ (do konca riadku), atď. - - 6. Pre pohyb na začiatok riadku použi nulu: 0 - - 7. Pre vrátenie späť predošlej operácie napíš: u (malé u) - Pre vrátenie všetkých úprav na riadku napíš: U (veľké U) - Pre vrátenie vrátených úprav napíš: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.1: PRÍKAZ VLOŽIŤ - - - ** Napísanie príkazu p vloží psledný výmaz za kurzor. ** - - 1. Presuň kurzor nižšie na prvý riadok textu. - - 2. Napíš dd čím zmažeš riadok a uložíš ho do buffera editora Vim. - - 3. Presuň kurzor vyššie tam, kam zmazaný riadok patrí. - - 4. Ak napíšeš v normálnom móde p zmazaný riadk sa vloží. - - 5. Zopakuj kroky 2 až 4, kým riadky niesú v správnom poradí. - ----> d) Tiež sa dokážeš vzdelávať? ----> b) Fialky sú modré, ----> c) Inteligencia sa vzdeláva, ----> a) Ruže sú červené, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.2: PRÍKAZ NAHRADENIA - - - ** Napísaním rx sa nahradí znak na mieste kurzora znakom x . ** - - 1. Presuň kurzor nižšie na prví riadok textu označeného značkou --->. - - 2. Presuň kurzor na začiatok prvej chyby. - - 3. napíš r a potom znak, ktorý tam má byť. - - 4. Zopakuj kroky 2 a 3, kým prvý riadok nieje zhodný s druhým. - ----> Kaď bol tento riasok píaaný, niekro stlašil nesprábne klávesy! ----> Keď bol tento riadok písaný, niekto stlačil nesprávne klávesy! - - 5. Teraz prejdi na lekciu 1.3.2. - -POZNÁMKA: Pamätaj si, že naučiť sa môžeš len používanim, nie pamätaním. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.3: PRÍKAZ ÚPRAVY - - - ** Ak chceš zmeniť časť slova do konca slova, napíš ce . ** - - 1. Presuň kurzor nižšie na prvý riadok označený značkou --->. - - 2. Umiestni kurzor na písmeno o v slove rosfpl. - - 3. Napíš ce a oprav slovo (v tomto prípade napíš 'iadok'.) - - 4. Stlač a prejdi na ďalší znak, ktorý treba zmeniť. - - 5. Zopakuj kroky 3 a 4, kým prvá veta nieje rovnaká ako druhá. - ----> Tento rosfpl má niekoľko skic, ktoré je pirewvbí zmeniť piyťučán príkazu. ----> Tento riadok má niekoľko slov, ktoré je potrebné zmeniť použitím príkazu. - -Poznámka, že ce zmaže slovo a nastaví vkladací mód. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.3.4: VIAC ZMIEN POUŽITÍM c - - - ** Príkaz pre úpravy sa používa s rovnakými pohybmi ako pre mazanie ** - - 1. Príkaz pre úpravy pracuje rovnako ako pre mazanie. Formát je: - - c [číslo] pohyb - - 2. Pohyby sú rovnaké, ako napríklad w (slovo) a $ (koniec riadku). - - 3. Presuň kurzor nižšie na prvý riadok označený značkou --->. - - 4. Presuň kurzor na prvú chybu. - - 5. napíš c$ aby si mohol upraviť zvyšok riadku podľa druhého - a stlač . - ----> Koniec tohto riadku potrebuje pomoc, aby bol ako druhy. ----> Koniec tohto riadku potrebuje opraviť použitím príkazu c$ . - -POZNÁMKA: Môžeš použiť klávesu backspace na úpravu zmien počas písania. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.3 ZHRNUTIE - - - 1. Na vloženie textu, ktorý už bol zmazaný, napíš p . To vloží zmazaný - text ZA kurzor (ak bol riadok zmazaný prejde na riadok pod kurzorom). - - 2. Pre naradenie znaku na mieste kurzora, napíš r a potom znak, ktorý - nahradí pôvodný znak. - - 3. Príkaz na upravenie umožňuje zmeniť od kurzora až po miesto, ktoré - určuje pohyb. napr. Napíš ce čím zmníš text od pozície - kurzora do konca slova, c$ zmení text do konca riadku. - - 4. Formát pre nahradenie je: - - c [číslo] pohyb - - -Teraz prejdi na nalsedujúcu lekciu. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.1: POZÍCIA A STATUS SÚBORU - - - ** Stlač CTRL-g pre zobrazenie svojej pozície v súbore a statusu súboru. - Napíš G pre presun na riadok v súbore. ** - - Poznámka: Prečítaj si celú túto lekciu skôr ako začneš vykonávať kroky!! - - 1. Drž stlačenú klávesu Ctrl a stlač g . Toto nazývame CTRL-G. - Na spodu obrazovky sa zobrazí správa s názvom súboru a pozíciou - v súbore. Zapamätajsi si číslo riadku pre použitie v kroku 3. - - 2. Stlač G čím sa dostaneš na spodok súboru. - Napíš gg čím sa dostaneš na začiatok súboru. - - 3. Napíš číslo riadku na ktorom si sa nachádzal a stlač G. To ťa - vráti na riadok, na ktorom si prvý krát stlačil CTRL-G. - - 4. Ak sa cítíš schopný vykonať teto kroky, vykonaj kroky 1 až 3. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.2: PRÍKAZ VYHĽADÁVANIA - - - ** Napíš / nasledované reťazcom pre vyhľadanie príslušného reťazca. ** - - 1. Napíš znak / v normálnom móde. Poznámka, že tento znak sa spolu - s kurzorom zobrazí v dolnej časti obrazovky s : príkazom. - - 2. Teraz napíš 'errroor' . To je slovo, ktoré chceš vyhľadať. - - 3. Pre vyhľadanie ďalšieho výskytu rovnakého reťazca, stlač jednoducho n. - Pre vyhľadanie ďalšieho výskytu rovnakého reťazca opačným smerom, - N. - - 4. Ak chceš vyhľadať reťazec v spätnom smere, použí príkaz ? miesto - príkazu /. - - 5. Pre návrat na miesto z ktorého si prišiel stlač CTRL-O (drž stlačenú - klávesu Ctrl počas stlačenia klávesy o). Zopakuj pre ďalší návrat - späť. CTRL-I ide vpred. - -POZNÁMKA: "errroor" nieje spôsob hláskovania error; errroor je error. -POZNÁMKA: Keď vyhľadávanie dosiahne koniec tohto súboru, bude pokračovať na - začiatku, dokiaľ nieje resetované nastavenie 'wrapscan' . - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.3: VYHĽADÁVANIE ZODPOVEDAJÚCICH ZÁTAVORIEK - - - ** Napíš % pre vyhľadanie príslušného znaku ),], alebo } . ** - - 1. Premiestni kurzor na hocaký zo znakov (, [, alebo { v riadku nižšie - označeného značkou --->. - - 2. Teraz napíš znak % . - - 3. Kurzor sa premiestni na zodpovedajúcu zátvorku. - - 4. Napíš % pre presun kurzoru späť na otvárajúcu zátvorku. - - 5. Presuň kurzor na iný zo znakov (,),[,],{ alebo } a všimni si - čo % vykonáva. - ----> Toto ( je testovací riadok s ('s, ['s ] a {'s } v riadku. )) - -Poznámka: Toto je veľmi výhodné použíť pri ladení programu s chýbajúcimi - uzatvárajúcimi zátvorkami! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.4.4: PRÍKAZ NAHRADENIA - - - ** Napíš :s/starý/nový/g pre nahradenie slova 'starý' za slovo 'nový'. ** - - 1. Presuň kurzor nižšie na riadok označený značkou --->. - - 2. Napíš :s/thee/the . Poznamka, že tento príkaz zmení len prvý - výskyt "thee" v riadku. - - 3. Teraz napíš :s/thee/the/g čo znamená celkové nahradenie v riadku. - Toto nahradí všetky výskyty v riadku. - ----> Thee best time to see thee flowers in thee spring. - - 4. Pre zmenu všetkých výskytov daného reťazca medzi dvomi ridakami, - napíš :#,#s/starý/nový/g kde #,# sú čísla dvoch riadkov, v rozsahu - ktorých sa nahradenie vykoná. - napíš :%s/starý/nový/g pre zmenu všetkých výskytov v celom riadku - napíš :%s/starý/nový/gc nájde všetky výskyty v celom súbore, - s otázkou či nahradiť alebo nie - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.4 ZHRNUTIE - - - 1. CTRL-g vypíše tvoju pozíciu v súbore a status súboru. - G ťa premiestni na koniec riadku. - číslo G ťa premiestni na riadok s číslom. - gg ťa presunie na prvý riadok - - 2. Napísanie / nasledované reťazcom vyhľadá reťazec smerom DOPREDU. - Napísanie ? nasledované reťazcom vyhľada reťazec smerom DOZADU. - Napísanie n po vyhľadávaní, vyhľadá nasledujúci výskyt reťazca - v rovnakom smere, pričom N vyhľadá v opačnom smere. - CTRL-O ťa vráti späť na staršiu pozíciu, CTRL-I na novšiu pozíciu. - - 3. Napísanie % keď kurzor je na (,),[,],{, alebo } nájde zodpovdajúcu - párnu zátvorku. - - 4. Pre nahradenie nového za prvý starý v riadku napíš :s/starý/nový - Pre nahradenie nového za všetky staré v riadku napíš :s/starý/nový/g - Pre nahradenie reťazcov medzi dvoma riadkami 3 napíš :#,#/starý/nový/g - Pre nahradenie všetkých výskytov v súbore napíš :%s/starý/nový/g - Pre potvrdenie každého nahradenia pridaj 'c' :%s/starý/nový/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.1: AKO SPUSTIŤ VONKAJŠÍ PRÍKAZ - - - ** Napíš príkaz :! nasledovaný vonkajším príkazom pre spustenie príkazu ** - - 1. Napíš obvyklý píkaz : ktorý nastaví kurzor na spodok obrazovky. - To umožní napísať príkaz. - - 2. Teraz napíš ! (výkričník). To umožní spustiť hociaký vonkajší príkaz - z príkazového riadku. - - 3. Ako príklad napíš ls za ! a stlač . Tento príkaz - zobrazí obsah tvojho adresára rovnako ako na príkazovom riadku. - Alebo použi :!dir ak ls nefunguje. - -Poznámka: Takto je možné spustiť hociaký vonkajší príkaz s argumentami. -Poznámka: Všetky príkazy : musia byť dokončené stlačením - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.2: VIAC O UKLADANÍ SÚBOROV - - - ** Pre uloženie zmien v súbore, napíš :w FILENAME. ** - - 1. Napíš :!dir alebo :!ls pre výpis aktuálneho adresára. - Už vieš, že musíš za týmto stlačiť . - - 2. Vyber názov súboru, ktorý ešte neexistuje, ako napr. TEST. - - 3. Teraz napíš: :w TEST (kde TEST je názov vybratého súboru.) - - 4. To uloží celý súbor (Vim Tutor) pod názovm TEST. - Pre overenie napíš :!dir , čím zobrazíš obsah adresára. - -Poznámka: že ak ukončíš prácu s editorom Vim a znovu ho spustíš príkazom - vim TEST, súbor bude kópia výuky, keď si ho uložil. - - 5. Teraz odstráň súbor napísaním (MS-DOS): :!del TEST - alebo (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.3: VÝBER TEXTU PRE ULOŽENIE - - - ** Pre uloženie časti súboru, napíš v pohyb :w FILENAME ** - - 1. Presuň kurozr na tento riadok. - - 2. Stlač v a presuň kurozr na piatu položku dole. Poznámka, že - tento text je vyznačený (highlighted). - - 3. Stlač klávesu : . V spodnej časti okna sa objaví :'<,'>. - - 4. Napíš w TEST , kde TEST je meno súboru, ktorý zatial neexistuje. - Skontroluj, e vidíš :'<,'>w TEST predtým než stlačíš Enter. - - 5. Vim zapíše označené riadky do súboru TEST. Použi :!dir alebo :!ls - pre overenie. Zatial ho ešte nemaž! Použijeme ho v ďalšej lekcii. - -POZNÁMKA: Stlačením klávesy v sa spustí vizuálne označovanie. - Môžeš pohybovať kurzorom pre upresnenie vyznačeného textu. - Potom môžeš použiť operátor pre vykonanie nejakej akcie - s textom. Napríklad d zmaže vyznačený text. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.5.4: VÝBER A ZLUČOVANIE SÚBOROV - - - ** Pre vloženie obsahu súboru, napíš :r FILENAME ** - - 1. Premiestni kurzor nad tento riadok. - -POZNÁMKA: Po vykonaní kroku 2 uvidíš text z lekcie 1.5.3. Potom sa presuň - dole, aby si videl túto lekciu. - - 3. Teraz vlož súbor TEST použitím príkazu :r TEST kde TEST je názov - súboru. Súbor, ktorý si použil je umiestnený pod riadkom s kurzorom. - -POZNÁMKA: Môžeš tiež načítať výstup vonkajšieho príkazu. Napríklad :r !ls - načíta výstup príkazu ls a umiestni ho za pozíciu kurzora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.5 ZHRNUTIE - - - 1. :!príkaz spustí vonkajší príkaz. - - Niektoré využiteľné príklady sú: - (MS_DOS) (UNIX) - :!dir :!ls - zobrazí obsah adresára - :!del FILENAME :!rm FILENAME - odstráni súbor FILENAME - - 2. :w FILENAME uloží aktuálny súbor na disk pod menom FILENAME. - - 3. v pohyb :w FILENAME uloží vizuálne označené riadky do - súboru FILENAME. - - 4. :r FILENAME vyberie z disku súbor FILENAME a vloží ho do aktuálneho - súboru za pozíciou kurzora. - - 5. :r !dir načíta výstup z príkazu dir a vloží ho za pozíciu kurzora. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.1: PRÍKAZ OTVORIŤ - - -** Napíš o pre vloženie riadku pod kurzor a prepnutie do vkladacieho módu ** - - 1. Presuň kurzor nižšie na riadok označený značkou --->. - - 2. Napíš o (malé písmeno) pre vloženie čistého riadku pod kurzorm - a prepnutie do vkladacieho módu. - - 3. Teraz skopíruj riadok označený ---> a stlač pre ukončenie - vkladacieho módu. - ----> Po napísaní o sa kurzor premiestní na vložený riadok do vkladacieho - módu. - - 4. Pre otvorenie riadku nad kurzorom, jednotucho napíš veľké O , - namiesto malého o. Vyskúšaj si to na riadku dole. - ----> Vlož riadok nad týmto napísaním O, keď kurzor je na tomto riadku. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.2: PRÍKAZ PRIDAŤ - - - ** Napíš a pre vloženie textu ZA kurzor. ** - - 1. Presuň kurzor nižšie na koniec prvého riadku označeného značkou ---> - - 2. Stlač klávesu e dokiaľ kurozr nieje na konci riadku. - - 3. Napíš a (malé písmeno) pre pridanie textu ZA kurzorom. - - 4. Dokončí slovo tak ako je to v druhom riadku. Stlaš pre - opustenie vkladacieho módu. - - 5. Použi e na presun na ďalšie nedokončené slovo a zopakuj kroky 3 a 4. - ----> Tento ri ti dovoľuje nácv priávan testu na koniec riadku. ----> Tento riadok ti dovoľuje nácvik pridávania textu na koniec riadku. - -POZNÁMKA: a, i, A štartujú rovnaký vkladací mód, jediný rozidel je, kde - sa znaky vkladajú. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.3: INÝ SPOSOB NAHRADZOVANIA - - - ** Napíš veľké R pre nahradenie viac ako jedného znaku. ** - - 1. Presuň kurzor nižšie na prvý riadok označený značkou --->. Premiestni - kurzor na začiatok prvého výskytu xxx. - - 2. Teraz napíš R a napíš číslo uvedené v druhom riadku, takže - sa ním nahradí pôvodné xxx. - - 3. Stlač pre opustenie nahradzovacieho módu. Poznámka, že zvyšok - riadku zostane nezmenený. - - 4. Zopakuj tieto kroky pre nahradenie zvyšných xxx. - ----> Pridaním 123 ku xxx dostaneš xxx. ----> Pridaním 123 ku 456 dostaneš 579. - -POZNÁMKA: Nahradzovací mód je ako vkladací mód, ale každý napísaný znak - zmaže existujúci znak. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lekcia 1.6.4: Copy Paste textu - - ** použí operátor y pre copy textku a p pre jeho paste ** - - 1. Choď nižšie na riadok označený ---> a umiestni kurozr za "a)". - - 2. Naštartuj vizuálny mód použitím v a presuň kurozr pred "first". - - 3. Napíš y pre vystrihnutie (copy) označeného textu. - - 4. Presuň kurozr na koniec ďalšieho riadku: j$ - - 5. Napíš p pre vložnie (paste) textu. Potom napíš: a druha . - - 6. Použi vizuálny mód pre označenie "položka.", vystrihni to - použitím y, presuň sa na koniec nasledujúceho riadku použitím j$ - a vlož sem text použitím p. - ----> a) toto je prvá položka ----> b) - -POZNÁMKA: Môžeš použiť tiež y ako operátor; yw vystrihne jedno slovo. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcia 1.6.5: NASTAVENIE MOŽNOSTÍ - - -** Nastav možnosti, takže vyhľadávanie alebo nahradzovanie ignoruje - rozlišovanie ** - - - 1. Vyhľadaj reťazec 'ignore' napísaním: - /ignore - Zopakuj vyhľadávanie niekoľko krát stlačením klávesy n . - - 2. Nastav možnosť 'ic' (Ignore case) napísaním príkazu: - :set ic - - 3. Teraz vyhľadaj reťazec 'ingore' znova stlačením klávesy n - Poznámka, že teraz sú vyhľadané aj Ignore a IGNORE. - - 4. Nastav možnosťi 'hlsearch' a 'incsearch': - :set hls is - - 5. Teraz spusti vyhľadávací príkaz znovu, a pozri čo sa stalo: - /ignore - - 6. Pre opetovné zapnutie rozlyšovania veľkých a malých písmen - napíš: :set noic - -POZNÁMKA: Na odstránenie zvýraznenia výrazov napíš: :nohlsearch -POZNÁMKA: Ak chceš nerozlyšovať veľkosť písmen len pre jedno - použitie vyhľadávacieho príkazu, použi \c: /ignore\c - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.6 ZHRNUTIE - - - 1. Napíš o pre otvorenie riadku pod kurzorom a štart vkladacieho módu. - Napíš O pre otvorenie riadku nad kurzorom. - - 2. Napíš a pre vkladanie textu ZA kurzor. - Napíš A pre vkladanie textu za koncom riadku. - - 3. Príkaz e presunie kurozr na koniec slova - - 4. Operátor y vystrihne (skopíruje) text, p ho vloží. - - 5. Napísanie veľkého R prepne do nahradzovacieho módu, kým nieje - stlačené . - - 6. Napísanie ":set xxx" nastaví možnosť "xxx". Niektoré nastavenia sú: - 'ic' 'ignorecase' ignoruje veľké a malé písmená počas vyhľadávania. - 'is' 'incsearch' zobrazuje čiastočné reťazce vyhľadávaného reťazca. - 'hls' 'hlsearch' vyznačí všetky vyhľadávané reťazce. - Môžeš použiť hociktorý z dlhých a krátkych názvov možností. - - 7. Vlož "no" pred nastavenie pre jeho vypnutie: :set noic - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.7.1: ZÍSKANIE NÁPOVEDY - - - ** Používaj on-line systém nápovedy ** - - Vim má obsiahly on-line systém nápovedy. Pre odštartovanie, vyskúšaj jeden - z týchto troch: - - stlač klávesu (ak nejakú máš) - - stlač klávesu (ak nejakú máš) - - napíš :help - - Čítaj text v okne nápovedy pre získanie predstavy ako nápoveda funguje. - Napíš CTRL-W CTRL-W pre skok z jedného okna do druhého. - Napíš :q čím zatvoríš okno nápovedy. - - Môžeš nájsť help ku hociakej téme pridaním argumentu ku príkazu ":help". - Vyskúšaj tieto (nezabudni stlačiť ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKCIA 1.7.2: VYTVORENIE ŠTARTOVACIEHO SKRIPTU - - ** Zapni funkcie editora Vim ** - - Vim má omnoho viac funkcii než Vi, ale večšina z nich je implicitne - vypnutá. Pre používanie viac Vim funkcii vytvor "vimrc" súbor. - - 1. Začni editovať "vimrc" súbor, to závisí na použitom systéme: - :e ~/.vimrc pre Unix - :e ~/_vimrc pre MS-Windows - - 2. Teraz si prečítaj text príkladu "vimrc" súboru: - - :r $VIMRUNTIME/vimrc_example.vim - - 3. Ulož súbor: - :w - - Pri nasledujúcom štarte editora Vim sa použije zvýrazňovanie syntaxe. - Do "vimrc" súboru môžeš pridať všetky svoje uprednostňované nastavenia. - Pre viac informácii napíš :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - LEKCIA 1.7.3: DOKONČENIE - - ** Dokonči príkaz na príkazovom riadku použitím CTRL-D a ** - - 1. Uisti sa, že Vim nieje v kompatibilnom móde: :set nocp - - 2. Pozri sa aké súbory sa nachádzajú v adresári: :!ls alebo :!dir - - 3. Napíš začiatok príkazu: :e - - 4. Stlač CTRL-D a Vim zobrazí zoznam príkazov začínajúcich "e". - - 5. Stlač a Vim dokončí meno príkazu na ":edit". - - 6. Teraz pridaj medzerník a začiatok mena existujúceho súboru: - :edit FIL - - 7. Stlač . Vim dokončí meno (ak je jedinečné). - -POZNÁMKA: Dokončovanie funguje pre veľa príkazov. Vyskúšaj stlačenie - CTRL-D a . Špeciálne je to užitočné pre príkaz :help. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - LEKCIA 1.7 ZHRNUTIE - - 1. Napíš :help alebo stlač alebo pre otvorenie okna nápovedy. - - 2. Napíš :help príkaz pre vyhľadanie nápovedy ku príkazu príkaz. - - 3. Napíš CTRL-W CTRL-W na preskočenie do iného okna. - - 4. Napíš :q pre zatvorenie okna nápovedy - - 5. Vytvor štartovací skript vimrc pre udržanie uprednostňovaných nastavení. - - 6. Počas písania príkazu : stlač CTRL-D pre zobrazenie dokončení. - Stlač pre použitie jedného z dokončení. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - - - Toto vymedzuje výuku Vimu. Toto je určené pre strucný prehľad o editore - Vim, úplne postačujúce pre ľahké a obstojné používanie tohto editora. - Táto výuka je ďaleko od kompletnosti, pretože Vim má omnoho viacej príkazov. - Ako ďalšie si prečítaj užívatľský manuál: ":help user-manual". - - Pre ďalšie čítanie a štúdium je odporúčaná kniha: - Vim - Vi Improved - od Steve Oualline - Vydavateľ: New Riders - Prvá kniha určená pre Vim. Špeciálne vhodná pre začiatočníkov. - Obsahuje množstvo príkladov a obrázkov. - Pozri na https://iccf-holland.org/click5.html - - Táto kniha je staršia a je viac o Vi ako o Vim, ale je tiež odporúčaná: - Learning the Vi Editor - od Linda Lamb - Vydavateľ: O'Reilly & Associates Inc. - Je to dobrá kniha pre získanie vedomostí o práci s editorom Vi. - Šieste vydanie obsahuje tiež informácie o editore Vim. - - Táto výuka bola napísaná autormi Michael C. Pierce a Robert K. Ware, - Colorado School of Mines s použitím myšlienok dodanými od Charles Smith, - Colorado State University. E-mail: bware@mines.colorado.edu. - - Modifikované pre Vim od Bram Moolenaar. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Preklad do Slovenčiny: Ľuboš Čelko - e-mail: celbos@inmail.sk - Last Change: 2006 Apr 18 - encoding: iso8859-2 diff --git a/runtime/tutor/tutor1.sr.utf-8 b/runtime/tutor/tutor1.sr similarity index 100% rename from runtime/tutor/tutor1.sr.utf-8 rename to runtime/tutor/tutor1.sr diff --git a/runtime/tutor/tutor1.sr.cp1250 b/runtime/tutor/tutor1.sr.cp1250 deleted file mode 100644 index 40a19f0bcd..0000000000 --- a/runtime/tutor/tutor1.sr.cp1250 +++ /dev/null @@ -1,971 +0,0 @@ -=============================================================================== -= D o b r o d o � l i u VIM p r i r u � n i k - Verzija 1.7 = -=============================================================================== - - Vim je mo�an editor sa mnogo komandi, suvi�e da bismo ih ovde sve - opisali. Priru�nik je zami�ljen da opi�e dovoljno komandi da biste - mogli lagodno da koristite Vim kao editor op�te namene. - - Pribli�no vreme potrebno za uspe�an zavr�etak priru�nika je izme�u - 25 i 30 minuta, u zavisnosti od vremena potro�enog na ve�bu. - - UPOZORENJE: - Komande u lekcijama �e menjati tekst. Iskopirajte ovaj fajl i - ve�bajte na kopiji (ako ste pokrenuli "vimtutor" ovo je ve� kopija). - - Va�no je upamtiti da je ovaj priru�nik zami�ljen za aktivnu ve�bu. - To zna�i da morate upotrebljavati komande o kojima �itate da biste - ih nau�ili. Ako samo �itate tekst, zaboravi�ete komande! - - Ako je Caps Lock uklju�en ISKLJU�ITE ga. Pritisnite taster j dovoljno - puta da lekcija 1.1.1 cela stane na ekran. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.1: POMERANJE KURSORA - - - ** Za pomeranje kursora, pritiskajte tastere h,j,k,l kako je prikazano ** - ^ - k Savet: h je s leve strane i pomera kursor u levo. - < h l > l je s desne strane i pomera kursor u desno. - j j izgleda kao strelica nani�e. - v - 1. Pomerajte kursor po ekranu dok se ne naviknete na komande. - - 2. Pritisnite taster (j) dok ne po�ne da se ponavlja. - Sada znate kako da do�ete do naredne lekcije. - - 3. Koriste�i taster j pre�ite na lekciju 1.1.2. - -NAPOMENA: Ako niste sigurni �ta ste zapravo pritisnuli, pritisnite - za prelazak u Normal mod i poku�ajte ponovo. - -NAPOMENA: Strelice tako�e pomeraju kursor, ali kori��enje tastera hjkl je - znatno br�e, kad se jednom naviknete na njih. Zaista! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.2: IZLAZAK IZ VIM-a - - - !! UPOZORENJE: Pre izvo�enja bilo kog koraka, pro�itajte celu lekciju!! - - 1. Pritisnite (editor je sada u Normal modu). - - 2. Otkucajte: :q! . - Ovime se izlazi iz editora, sa GUBITKOM svih izmena. - - 3. Kada se pojavi komandni prompt, unesite komandu koja je pokrenula - ovaj priru�nik: vimtutor - - 4. Ako ste upamtili ove korake, izvr�ite ih redom od 1 do 3 da biste - iza�li iz editora i ponovo ga pokrenuli. - -NAPOMENA: :q! poni�tava sve izmene koje ste napravili. - U narednim lekcijama nau�i�ete kako da sa�uvate izmene. - - 5. Pomerite kursor na lekciju 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.3: IZMENA TEKSTA - BRISANJE - - - ** Pritisnite x za brisanje znaka pod kursorom. ** - - 1. Pomerite kursor na red ozna�en sa --->. - - 2. Da biste ispravili gre�ke, pomerajte kursor dok se - ne na�e na slovu koje treba izbrisati. - - 3. Pritisnite taster x da izbri�ete ne�eljeno slovo. - - 4. Ponavljajte korake od 2 do 4 dok ne ispravite sve gre�ke. - ----> RRRibaa riibi grizzze rrreepp. - - 5. Kad ispravite red, pre�ite na lekciju 1.1.4. - -NAPOMENA: Dok koristite priru�nik, nemojte u�iti komande napamet, - ve� ve�bajte njihovu primenu. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.4: IZMENA TEKSTA - UBACIVANJE - - - ** Pritisnite i za ubacivanje teksta ispred kursora. ** - - 1. Pomerite kursor na prvi slede�i red ozna�en sa --->. - - 2. Da biste tekst prvog reda izjedna�ili s tekstom drugog, namestite - kursor na prvi znak POSLE kog �ete ubaciti potreban tekst. - - 3. Pritisnite i pa unesite potrebne dopune. - - 4. Po ispravci svake gre�ke pritisnite da se vratite u Normal mod. - Ponovite korake od 2 do 4 da biste ispravili celu re�enicu. - ----> Do teka neoje v red. ----> Deo teksta nedostaje iz ovog reda. - - 5. Pre�ite na slede�u lekciju. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.5: IZMENA TEKSTA - DODAVANJE - - - ** Pritisnite A za dodavanje teksta. ** - - 1. Pomerite kursor na prvi slede�i red ozna�en sa --->. - Nije va�no gde se nalazi kursor u tom redu. - - 2. Pritisnite A i unesite dodatni tekst. - - 3. Po�to ste dodali tekst, pritisnite za povratak u - Normal mod. - - 4. Pomerite kursor na drugi red ozna�en sa ---> i ponavljajte - korake 2 i 3 dok ne ispravite tekst. - ----> Deo teksta nedostaje u - Deo teksta nedostaje u ovom redu. ----> Deo teksta nedostaje - Deo teksta nedostaje i ovde. - - 5. Pre�ite na lekciju 1.1.6. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.1.6: IZMENA FAJLA - - - ** Upotrebite :wq za snimanje teksta i izlazak iz editora. ** - - !! UPOZORENJE: Pre izvo�enja bilo kog koraka, pro�itajte celu lekciju!! - - 1. Iza�ite iz editora kao u lekciji 1.1.2: :q! - - 2. Na komandnom promptu unesite slede�u komandu: vim tutor - 'vim' je komanda za pokretanja Vim editora, 'tutor' je ime fajla koji - �elite da menjate. Koristite fajl koji imate pravo da menjate. - - 3. Ubacujte i bri�ite tekst kao u prethodnim lekcijama. - - 4. Snimite izmenjeni tekst i iza�ite iz Vim-a: :wq - - 5. Ponovo pokrenite vimtutor i pro�itajte rezime koji sledi. - - 6. Po�to pro�itate korake iznad i u potpunosti ih razumete: - izvr�ite ih. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - REZIME lekcije 1.1 - - - 1. Kursor se pomera strelicama ili pomo�u tastera hjkl . - h (levo) j (dole) k (gore) l (desno) - - 2. Za pokretanje Vim-a iz shell-a: vim IME_FAJLA - - 3. Izlaz: :q! sve promene su izgubljene. - ILI: :wq promene su sa�uvane. - - 4. Brisanje znaka na kome se nalazi kursor: x - - 5. Ubacivanja ili dodavanje teksta: - i unesite tekst unos ispred kursora - A unesite tekst dodavanje na kraju reda - -NAPOMENA: Pritiskom na prebacujete Vim u Normal mod i - prekidate ne�eljenu ili delimi�no izvr�enu komandu. - -Nastavite sa lekcijom 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.1: NAREDBE BRISANJA - - - ** Otkucajte dw za brisanje re�i. ** - - 1. Pritisnite da biste bili sigurni da ste u Normal modu. - - 2. Pomerite kursor na red ozna�en sa --->. - - 3. Pomerite kursor na po�etak re�i koju treba izbrisati. - - 4. Otkucajte dw da biste uklonili re�. - -NAPOMENA: Slovo d �e se pojaviti na dnu ekrana kad ga otkucate. Vim �eka - da otkucate w . Ako je prikazano neko drugo slovo, pogre�ili ste u - kucanju; pritisnite i poku�ajte ponovo. (Ako se ne pojavi - ni�ta, mo�da je isklju�ena opcija 'showcmd': vidi lekciju 1.6.5.) - ----> Neke re�i sme�no ne pripadaju na papir ovoj re�enici. - - 5. Ponavljajte korake 3 i 4 dok ne ispravite re�enicu, pa - pre�ite na lekciju 1.2.2. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.2: JO� BRISANJA - - - ** Otkucajte d$ za brisanje znakova do kraja reda. ** - - 1. Pritisnite da biste bili sigurni da ste u Normal modu. - - 2. Pomerite kursor na red ozna�en sa --->. - - 3. Pomerite kursor do kraja ispravnog dela re�enice - (POSLE prve . ). - - 4. Otkucajte d$ za brisanje ostatka reda. - ----> Neko je uneo kraj ovog reda dvaput. kraj ovog reda dvaput. - - 5. Pre�ite na lekciju 1.2.3 za podrobnije obja�njenje. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.3: O OPERATORIMA I POKRETIMA - - - Mnoge komande za izmenu teksta sastoje se od operatora i pokreta. - Oblik komande brisanja sa d operatorom je slede�i: - - d pokret - - Pri �emu je: - d - operator brisanja. - pokret - ono na �emu �e se operacija izvr�avati (opisano u nastavku). - - Kratak spisak pokreta: - w - sve do po�etka slede�e re�i, NE UKLJU�UJU�I prvo slovo. - e - sve do kraja teku�e re�i, UKLJU�UJU�I poslednje slovo. - $ - sve do kraje reda, UKLJU�UJU�I poslednje slovo. - - Kucanjem de brisa�e se tekst od kursora do kraja re�i. - -NAPOMENA: Pritiskom samo na taster pokreta dok ste u Normal modu, bez - operatora, kursor se pomera kao �to je opisano. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.4: KORI��ENJE BROJANJA ZA POKRETE - - - ** Uno�enjem nekog broja pre pokreta, pokret se izvr�ava taj broj puta. ** - - 1. Pomerite kursor na red ozna�en sa --->. - - 2. Otkucajte 2w da pomerite kursor dve re�i napred. - - 3. Otkucajte 3e da pomerite kursor na kraj tre�e re�i napred. - - 4. Otkucajte 0 (nulu) da pomerite kursor na po�etak reda. - - 5. Ponovite korake 2 i 3 s nekim drugim brojevima. - ----> Re�enica sa re�ima po kojoj mo�ete pomerati kursor. - - 6. Pre�ite na lekciju 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.5: KORI��ENJE BROJANJA ZA VE�E BRISANJE - - - ** Uno�enje nekog broja s operatorom ponavlja operator taj broj puta. ** - - U kombinaciji operatora brisanja s pokretima spomenutim iznad - mo�ete uneti broj pre pokreta da biste izbrisali vi�e znakova: - - d broj pokret - - 1. Pomerite kursor na prvo slovo u re�i s VELIKIM SLOVIMA u redu - ozna�enom sa --->. - - 2. Otkucajte d2w da izbri�ete dve re�i sa VELIKIM SLOVIMA - - 3. Ponovite korake 1 i 2 sa razli�itim brojevima da izbri�ete - uzastopne re�i sa VELIKIM SLOVIMA kori��enjem samo jedne komande. - ----> ovaj ABC�� D�E red FGHI JK LMN OP s re�ima je RS� TUVZ� ispravljen. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.6: OPERACIJE NAD REDOVIMA - - - ** Otkucajte dd za brisanje celog reda. ** - - Zbog u�estalosti brisanja celih redova, autori Vi-ja odlu�ili su da - je lak�e brisati redove ako se otkuca d dvaput. - - 1. Pomerite kursor na drugi red u donjoj strofi. - 2. Otkucajte dd da ga izbri�ete. - 3. Pomerite kursor na �etvrti red. - 4. Otkucajte 2dd da biste izbrisali dva reda. - ----> 1) Sedlo mi je od marame, ----> 2) blato na sve strane, ----> 3) uzda od kanapa, ----> 4) auto mi je ovde, ----> 5) satovi pokazuju vreme, ----> 6) a bi� mi je od o�ina ----> 7) prebijena �tapa. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.2.7: PONI�TAVANJE PROMENA - - - ** Pritisnite u za poni�tavanje poslednje komande, U za ceo red. ** - - 1. Pomerite kursor na red ozna�en sa ---> i postavite ga na mesto - prve gre�ke. - 2. Otkucajte x da izbri�ete prvi ne�eljeni znak. - 3. Otkucajte u da poni�tite poslednju izvr�enu komandu. - 4. Sad ispravite sve gre�ke u redu koriste�i komandu x . - 5. Otkucajte veliko U da biste vratili sadr�aj reda u prvobitno - stanje. - 6. Onda otkucajte u nekoliko puta da biste poni�tili U - i prethodne komande. - 7. Sad otkucajte CTRL-R (dr�e�i CTRL dok pritiskate R) - nekoliko puta da biste vratili izmene (poni�tili poni�tavanja). - ----> Iiisspravite gre�ke uu ovvom redu ii pooni�titeee ih. - - 8. Ovo su veoma korisne komande. Pre�ite na rezime lekcije 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - REZIME lekcije 1.2 - - - 1. Brisanje od kursora do slede�e re�i: dw - 2. Brisanje od kursora do kraja reda: d$ - 3. Brisanje celog reda: dd - - 4. Za ponavljanje pokreta prethodno unesite broj: 2w - 5. Oblik komande za izmenu: - operator [broj] pokret - gde je: - operator - �ta uraditi, recimo d za brisanje - [broj] - neobavezan broj ponavljanja pokreta - pokret - kretanje po tekstu na kome se radi, - kao �to je: w (re�), $ (kraj reda), itd. - - 6. Pomeranje kursora na po�etak reda: 0 - - 7. Za poni�tavanje prethodnih izmena, pritisnite: u (malo u) - Za poni�tavanje svih promena u redu, pritisnite: U (veliko U) - Za vra�anja promena, otkucajte: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.1: KOMANDA POSTAVLJANJA - - - ** Otkucajte p da postavite prethodno izbrisan tekst iza kursora. ** - - 1. Pomerite kursor na prvi slede�i red ozna�en sa --->. - - 2. Otkucajte dd da izbri�ete red i smestite ga u Vim registar. - - 3. Pomerite kursor na red c), IZNAD mesta gde treba postaviti izbrisan red. - - 4. Otkucajte p da postavite red ispod kursora. - - 5. Ponavljajte korake 2 do 4 da biste postavili sve linije u pravilnom - redosledu. - ----> d) prebijena �tapa. ----> b) uzda od kanapa, ----> c) a bi� mi je od o�ina ----> a) Sedlo mi je od marame, - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.2: KOMANDA ZAMENE - - - ** Otkucajte rx da zamenite znak ispod kursora slovom x . ** - - 1. Pomerite kursor na prvi slede�i red ozna�en sa --->. - - 2. Pomerite kursor tako da se nalazi na prvoj gre�ci. - - 3. Otkucajte r i onda znak koji treba da tu stoji. - - 4. Ponavljajte korake 2 i 3 sve dok prvi red ne bude - isti kao drugi. - ----> Kedi ju ovej red uga�en, nako je protresao pusta�ne testere! ----> Kada je ovaj red uno�en, neko je pritiskao pogre�ne tastere! - - 5. Pre�ite na lekciju 1.3.3. - -NAPOMENA: Setite se da treba da u�ite ve�banjem, ne pam�enjem. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.3: OPERATOR IZMENE - - - ** Za izmenu teksta do kraja re�i, otkucajte ce .** - - 1. Pomerite kursor na prvi slede�i red ozna�en sa --->. - - 2. Postavite kursor na a u rakdur. - - 3. Otkucajte ce i ispravite re� (u ovom slu�aju otkucajte ed ). - - 4. Pritisnite i pomerite kursor na slede�i znak koji - treba ispraviti. - - 5. Ponavljajte korake 3 i 4 sve dok prva re�enica ne bude ista - kao druga. - ----> Ovaj rakdur ima nekoliko rejga koje treflja isprpikati operagrom izmene. ----> Ovaj red ima nekoliko re�i koje treba ispraviti operatorom izmene. - -Uo�ite da ce bri�e re� i postavlja editor u Insert mod. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.3.4: DALJE IZMENE UPOTREBOM c - - - ** Komanda izmene se koristi sa istim pokretima kao i brisanje. ** - - 1. Operator izmene se koristi na isti na�in kao i operator brisanja: - - c [broj] pokret - - 2. Pokreti su isti, recimo: w (re�) i $ (kraj reda). - - 3. Pomerite kursor na prvi slede�i red ozna�en sa --->. - - 4. Pomerite kursor na prvu gre�ku. - - 5. Otkucajte c$ i unesite ostatak reda tako da bude isti kao - drugi red, pa pritisnite . - ----> Kraj ovog reda treba izmeniti tako da izgleda kao red ispod. ----> Kraj ovog reda treba ispraviti kori��enjem c$ komande. - -NAPOMENA: Za ispravljanje gre�aka mo�ete koristiti Backspace . -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - REZIME lekcije 1.3 - - - 1. Za postavljanje teksta koji ste upravo izbrisali, pritisnite p . Ovo - postavlja tekst IZA kursora (ako je bio izbrisan jedan ili vi�e redova - sadr�aj �e do�i na red ispod kursora). - - 2. Za zamenu znaka na kome se nalazi kursor, pritisnite r i onda - �eljeni znak. - - 3. Operator izmene dozvoljava promenu teksta od kursora do pozicije gde - se zavr�ava pokret. Primera radi, kucajte ce za izmenu od kursora do - kraja re�i, ili c$ za izmenu od kursora do kraja reda. - - 4. Oblik operacije izmene je: - - c [broj] pokret - -Pre�ite na narednu lekciju. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.1: POZICIJA KURSORA I STATUS FAJLA - - ** Pritisnite CTRL-G za prikaz pozicije kursora u tekstu i status fajla. - Pritisnite G za pomeranje kursora na neki red u tekstu. ** - -NAPOMENA: Pro�itajte celu lekciju pre izvo�enja bilo kog koraka!! - - 1. Dr�ite taster CTRL i pritisnite g . Ovo zovemo CTRL-G. - Editor �e na dnu ekrana ispisati poruku sa imenom fajla i pozicijom - kursora u tekstu. Zapamtite broj reda za 3. korak. - -NAPOMENA: U donjem desnom uglu mo�e se videti poziciju kursora ako je - uklju�ena opcija 'ruler' (vidi :help ruler ili lekciju 1.6.5.) - - 2. Pritisnite G za pomeranje kursora na kraj teksta. - Pritisnite 1G ili gg za pomranje kursora na po�etak teksta. - - 3. Otkucajte broj reda na kome ste malopre bili i onda G . Kursor - �e se vratiti na red na kome je bio kad ste otkucali CTRL-G. - - 4. Ako ste spremni, izvr�ite korake od 1 do 3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.2: KOMANDE PRETRA�IVANJA - - ** Otkucajte / i onda izraz koji �elite da potra�ite. ** - - 1. U Normal modu otkucajte znak / . Primietite da se znak pojavio - zajedno sa kursorom na dnu ekrana kao i kod komande : . - - 2. Sada otkucajte 'grrre�ka' . (Bez razmaka i navodnika.) - To je re� koju tra�ite. - - 3. Za ponovno tra�enje istog izraza, otkucajte n . - Za tra�enje istog izraza u suprotnom smeru, otkucajte N . - - 4. Za tra�enje izraza unatrag, koristite ? umesto / . - - 5. Za povratak na prethodnu poziciju otkucajte CTRL-O (dr�ite CTRL dok - pritiskate O ). Ponavljajte za ranije pozicije. CTRL-I ide napred. - ----> "grrre�ka" je pogre�no; umesto grrre�ka treba da stoji gre�ka. - -NAPOMENA: Ako pretraga do�e do kraja teksta tra�enje �e se nastaviti od - njegovog po�etka osim ako je opcija 'wrapscan' isklju�ena. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.3: TRA�ENJE PARA ZAGRADE - - - ** Otkucajte % za nala�enje para ), ] ili } . ** - - 1. Postavite kursor na bilo koju od ( , [ ili { - otvorenih zagrada u redu ozna�enom sa --->. - - 2. Otkucajte znak % . - - 3. Kursor �e se pomeriti na odgovaraju�u zatvorenu zagradu. - - 4. Otkucajte % da pomerite kursor na prvu zagradu u paru. - - 5. Pomerite kursor na neku od (,),[,],{ ili } i ponovite komandu % . - ----> Red ( testiranja obi�nih ( [ uglastih ] i { viti�astih } zagrada.)) - - -NAPOMENA: Vrlo korisno u ispravljanju koda sa rasparenim zagradama! - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.4.4: KOMANDA ZAMENE - - - ** Otkucajte :s/staro/novo/g da zamenite 'staro' za 'novo'. ** - - 1. Pomerite kursor na red ozna�en sa --->. - - 2. Otkucajte :s/rdi/ri/ . Primetite da ova komanda zamenjuje - samo prvo "rdi" u redu. - - 3. Otkucajte :s/rdi/ri/g . Dodavanje opcije g zna�i da �e se komanda - izvr�iti u celom redu, zamenom svih pojava niza "rdi". - ----> rdiba rdibi grdize rep. - - 4. Za zamenu svih izraza izme�u neka dva reda, - otkucajte :#,#s/staro/novo/g gde su #,# krajnji brojevi redova u opsegu - u kome �e se obaviti zamena. - Otkucajte :%s/staro/novo/g za zamenu svih izraza u celom tekstu. - Otkucajte :%s/staro/novo/gc za nala�enje svih izraza u tekstu i - potvrdu zamene. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - REZIME lekcije 1.4 - - - 1. CTRL-G prikazuje poziciju kursora u tekstu i status fajla. - G pomera kursor na kraj teksta. - broj G pomera kursor na navedeni red. - gg pomera kursor na prvi red teksta. - - 2. Kucanjem / sa izrazom taj izraz se tra�i UNAPRED. - Kucanjem ? sa izrazom taj izraz se tra�i UNAZAD. - Posle komande tra�enja koristite n za nala�enje izraza u istom - smeru, a N za nala�enje u suprotnom smeru. - CTRL-O vra�a kursor na prethodnu poziciju, a CTRL-I na narednu. - - 3. Kucanjem % kad je kursor na zagradi on se pomera na njen par. - - 4. Za zamenu prvog izraza staro za izraz novo :s/staro/novo/ - Za zamenu svih izraza u celom redu :s/staro/novo/g - Za zamenu svih izraza u opsegu linija #,# :#,#s/staro/novo/g - Za zamenu u celom tekstu :%s/staro/novo/g - Za potvrdu svake zamene dodajte 'c' :%s/staro/novo/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.1: IZVR�AVANJE SPOLJA�NJIH KOMANDI - - - ** Otkucajte :! pa spolja�nju komandu koju �elite da izvr�ite. ** - - 1. Otkucajte poznatu komandu : da biste namestili kursor na dno - ekrana. Time omogu�avate unos komande u komandnoj liniji editora. - - 2. Otkucajte znak ! (uzvi�nik). Ovime omogu�avate - izvr�avanje bilo koje spolja�nje komande. - - 3. Kao primer otkucajte ls posle ! i pritisnite . Ovo �e - prikazati sadr�aj direktorijuma, kao da ste na komandnom promptu. - Otkucajte :!dir ako :!ls ne radi. - -NAPOMENA: Na ovaj na�in mogu�e je izvr�iti bilo koju spolja�nju komandu, - zajedno sa njenim argumentima. - -NAPOMENA: Sve : komande se izvr�avaju po�to pritisnete . - U daljem tekstu to ne�emo uvek napominjati. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.2: VI�E O SNIMANJU FAJLOVA - - ** Za snimanje promena, otkucajte :w IME_FAJLA . ** - - 1. Otkucajte :!dir ili :!ls za pregled sadr�aja direktorijuma. - Ve� znate da morate pritisnuti posle toga. - - 2. Izaberite ime fajla koji jo� ne postoji, npr. TEST. - - 3. Otkucajte: :w TEST (gde je TEST ime koje ste izabrali.) - - 4. Time �ete snimiti ceo fajl (Vim Tutor) pod imenom TEST. - Za proveru, otkucajte opet :!dir ili :!ls za pregled - sadr�aja direktorijuma. - -NAPOMENA: Ako biste napustili Vim i ponovo ga pokrenuli sa vim TEST , - tekst bi bio ta�na kopija ovog fajla u trenutku kad ste - ga snimili. - - 5. Izbri�ite fajl tako �to �ete otkucati (MS-DOS): :!del TEST - ili (Unix): :!rm TEST - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.3: SNIMANJE OZNA�ENOG TEKSTA - - - ** Da biste snimili deo teksta, otkucajte v pokret :w IME_FAJLA ** - - 1. Pomerite kursor na ovu liniju. - - 2. Pritisnite v i pomerite kursor pet redova ispod. Primetite da je - tekst ozna�en inverzno. - - 3. Pritisnite : . Na dnu ekrana pojavi�e se :'<,'> . - - 4. Otkucajte w TEST , gde je TEST ime fajla koji jo� ne postoji. - Proverite da zaista pi�e :'<,'>w TEST pre nego �to pritisnete . - - 5. Vim �e snimiti ozna�eni tekst u TEST. Proverite sa :!dir ili !ls . - Nemojte jo� brisati fajl! Koristi�emo ga u narednoj lekciji. - -NAPOMENA: Komanda v zapo�inje vizuelno ozna�avanje. Mo�ete pomerati kursor - i tako menjati veli�inu ozna�enog teksta. Onda mo�ete upotrebiti - operatore nad tekstom. Na primer, d �e izbrisati ozna�eni tekst. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.5.4: U�ITAVANJE FAJLA U TEKST - - - ** Za ubacivanje sadr�aja fajla, otkucajte :r IME_FAJLA ** - - 1. Postavite kursor iznad ove linije. - -NAPOMENA: Po�to izvr�ite 2. korak vide�ete tekst iz lekcije 1.5.3. Tada - pomerite kursor DOLE da biste ponovo videli ovu lekciju. - - 2. U�itajte fajl TEST koriste�i komandu :r TEST gde je TEST ime fajla - koje ste koristili u prethodnoj lekciji. Sadr�aj u�itanog fajla je - uba�en ispod kursora. - - 3. Da biste proverili da je fajl u�itan, vratite kursor unazad i - primetite dve kopije lekcije 1.5.3, originalnu i onu iz fajla. - -NAPOMENA: Tako�e mo�ete u�itati izlaz spolja�nje komande. Na primer, - :r !ls �e u�itati izlaz komande ls i postaviti ga ispod - kursora. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - REZIME lekcije 1.5 - - - 1. :!komanda izvr�ava spolja�nju komandu. - - Korisni primeri: - (MS-DOS) (Unix) - :!dir :!ls - pregled sadr�aja direktorijuma. - :!del FAJL :!rm FAJL - bri�e fajl FAJL. - - 2. :w FAJL zapisuje trenutni tekst na disk pod imenom FAJL. - - 3. v pokret :w IME_FAJLA snima vizuelno ozna�ene redove u fajl - IME_FAJLA. - - 4. :r IME_FAJLA u�itava fajl IME_FAJLA sa diska i stavlja - njegov sadr�aj ispod kursora. - - 5. :r !dir u�itava izlaz komande dir i postavlja ga ispod kursora. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.1: KOMANDA OTVORI - - - ** Pritisnite o da biste otvorili red ispod kursora - i pre�li u Insert mod. ** - - 1. Pomerite kursor na slede�i red ozna�en sa --->. - - 2. Otkucajte malo o da biste otvorili novi red ISPOD kursora - i pre�li u Insert mod. - - 3. Otkucajte neki tekst i onda pritisnite da biste iza�li - iz Insert moda. - ----> Kad pritisnete o kursor prelazi u novootvoreni red u Insert modu. - - 4. Za otvaranje reda IZNAD kursora, umesto malog otkucajte veliko O . - Isprobajte na donjem redu ozna�enom sa --->. - ----> Otvorite red iznad ovog kucanjem velikog O dok je kursor u ovom redu. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.2: KOMANDA DODAJ - - - ** Otkucajte a za dodavanje teksta IZA kursora. ** - - 1. Pomerite kursor na po�etak slede�eg reda ozna�enog sa --->. - - 2. Kucajte e dok kursor ne do�e na kraj re�i re . - - 3. Otkucajte a (malo) da biste dodali tekst IZA kursora. - - 4. Dopunite re� kao �to je u redu ispod. Pritisnite za izlazak - iz Insert moda. - - 5. Sa e pre�ite na narednu nepotpunu re� i ponovite korake 3 i 4. - ----> Ovaj re omogu�ava ve dodav teksta u nekom redu. ----> Ovaj red omogu�ava ve�banje dodavanja teksta u nekom redu. - -NAPOMENA: Komande a, i, i A aktiviraju isti Insert mod, jedina - razlika je u poziciji od koje �e se tekst ubacivati. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.3: DRUGI NA�IN ZAMENE - - - ** Otkucajte veliko R da biste zamenili vi�e od jednog znaka. ** - - 1. Pomerite kursor na prvi slede�i red ozna�en sa --->. - Pomerite kursor na po�etak prvog xxx . - - 2. Pritisnite R i otkucajte broj koji je red ispod, - tako da zameni xxx . - - 3. Pritisnite za izlazak iz Replace moda. - Primetite da je ostatak reda ostao nepromenjen. - - 4. Ponovite korake da biste zamenili drugo xxx. - ----> Dodavanje 123 na xxx daje xxx. ----> Dodavanje 123 na 456 daje 579. - -NAPOMENA: Replace mod je kao Insert mod, s tom razlikom �to svaki - uneti znak bri�e ve� postoje�i. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.4: KOPIRANJE I LEPLJENJE TEKSTA - - - ** Koristite operator y za kopiranje a p za lepljenje teksta. ** - - 1. Pomerite kursor na red sa ---> i postavite kursor posle "a)". - - 2. Aktivirajte Visual mod sa v i pomerite kursor sve do ispred "prvi". - - 3. Pritisnite y da biste kopirali ozna�eni tekst u interni bafer. - - 4. Pomerite kursor do kraja slede�eg reda: j$ - - 5. Pritisnite p da biste zalepili tekst. Onda otkucajte: a drugi . - - 6. Upotrebite Visual mod da ozna�ite " red.", kopirajte sa y , kursor - pomerite na kraj slede�eg reda sa j$ i tamo zalepite tekst sa p . - ----> a) ovo je prvi red. - b) - -NAPOMENA: tako�e mo�ete koristiti y kao operator; yw kopira jednu re�. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.6.5: POSTAVLJANJE OPCIJA - - - ** Postavite opciju tako da tra�enje i zamena ignori�u veli�inu slova ** - - 1. Potra�ite re� 'razlika': /razlika - Ponovite nekoliko puta pritiskom na n . - - 2. Aktivirajte opciju 'ic' (Ignore case): :set ic - - 3. Ponovo potra�ite re� 'razlika' pritiskom na n - Primetite da su sada prona�eni i RAZLIKA i Razlika. - - 4. Aktivirajte opcije 'hlsearch' i 'incsearch': :set hls is - - 5. Ponovo otkucajte komandu tra�enja i uo�ite razlike: /razlika - - 6. Za deaktiviranje opcije ic kucajte: :set noic - -NAPOMENA: Za neozna�avanje prona�enih izraza otkucajte: :nohlsearch -NAPOMENA: Ako �elite da ne razlikujete veli�inu slova u samo jednoj komandi - tra�enja, dodajte \c u izraz: /razlika\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - REZIME lekcije 1.6 - - 1. Pritisnite o za otvaranje reda ISPOD kursora i prelazak u Insert mod. - Pritisnite O za otvaranje reda IZNAD kursora. - - 2. Pritisnite a za unos teksta IZA kursora. - Pritisnite A za unos teksta na kraju reda. - - 3. Komanda e pomera kursor na kraj re�i. - - 4. Operator y kopira tekst, p ga lepi. - - 5. Kucanje velikog R aktivira Replace mod dok ne pritisnete . - - 6. Kucanje ":set xxx" aktivira opciju "xxx". Neke opcije su: - 'ic' 'ignorecase' ne razlikuje velika/mala slova pri tra�enju - 'is' 'incsearch' prikazuje prona�en tekst dok kucate izraz - 'hls' 'hlsearch' ozna�ava inverzno sve prona�ene izraze - Mo�ete koristite dugo ili kratko ime opcije. - - 7. Ispred imena opcije stavite "no" da je deaktivirate: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.1: DOBIJANJE POMO�I - - - ** Koristite on-line sistem za pomo� ** - - Vim ima detaljan on-line sistem za pomo�. Za po�etak, poku�ajte ne�to - od slede�eg: - - pritisnite taster (ako ga imate na tastaturi) - - pritisnite taster (ako ga imate na tastaturi) - - otkucajte :help - - Pro�itajte tekst u prozoru pomo�i da biste nau�ili pomo� radi. - Kucanjem CTRL-W CTRL-W prelazite iz jednog prozora u drugi. - Otkucajte :q da zatvorite prozor pomo�i. - - Pomo� o prakti�no bilo kojoj temi mo�ete dobiti dodavanjem argumenta - komandi ":help". Poku�ajte ovo (ne zaboravite na kraju): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.2: PRAVLJENJE STARTNOG SKRIPTA - - - ** Aktivirajte mogu�nosti editora ** - - Vim ima mnogo vi�e mogu�nosti nego Vi, ali ve�ina nije automatski - aktivirana. Za dodatne mogu�nosti napravite "vimrc" fajl. - - 1. Otvorite "vimrc" fajl. Ovo zavisi od va�eg sistema: - :e ~/.vimrc za Unix - :e ~/_vimrc za MS-Windows - - 2. Onda u�itajte primer sadr�aja "vimrc" fajla: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Snimite fajl sa: - :w - - Slede�i put kada pokrenete Vim, bojenje sintakse teksta bi�e - aktivirano. Sva svoja pode�avanja mo�ete dodati u "vimrc" fajl. - Za vi�e informacija otkucajte :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lekcija 1.7.3: AUTOMATSKO DOVR�AVANJE - - - ** Dovr�avanje komandne linije sa CTRL-D i ** - - 1. Podesite Vim da ne bude u Vi-kompatibilnom modu: :set nocp - - 2. Pogledajte koji fajlovi postoje u direktorijumu: :!ls ili :!dir - - 3. Otkucajte po�etak komande: :e - - 4. Otkucajte CTRL-D i Vim �e prikazati spisak komandi koje po�inju sa "e". - - 5. Pritisnite i Vim �e dopuniti ime komande u ":edit". - - 6. Dodajte razmak i po�etak imena postoje�eg fajla: :edit FA - - 7. Pritisnite . Vim �e dopuniti ime fajla (ako je jedinstveno). - -NAPOMENA: Mogu�e je dopuniti mnoge komande. Samo probajte CTRL-D i . - Naro�ito je korisno za :help komande. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - REZIME lekcije 1.7 - - - 1. Otkucajte :help ili pritisnite ili za pomo�. - - 2. Otkucajte :help komanda biste dobili pomo� za tu komandu. - - 3. Otkucajte CTRL-W CTRL-W za prelazak u drugi prozor. - - 4. Otkucajte :q da zatvorite prozor pomo�i. - - 5. Napravite vimrc startni skript za aktiviranje pode�avanja koja - vam odgovaraju. - - 6. Dok kucate neku od : komandi, pritisnite CTRL-D da biste videli mogu�e - vrednosti. Pritisnite da odaberete jednu od njih. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ovim je priru�nik zavr�en. Njegov cilj je bio kratak pregled Vim editora, - koliko da omogu�i njegovo relativno jednostavno kori��enje. Priru�nik nije - potpun, jer Vim ima mnogo vi�e komandi. Kao slede�e, pro�itajte priru�nik: - ":help user-manual". - - Za dalje �itanje i u�enje, preporu�ujemo knjigu: - Vim - Vi Improved - by Steve Oualline - Izdava�: New Riders - Prva knjiga potpuno posve�ena Vim-u. Naro�ito korisna za po�etnike. - Ima mno�tvo primera i slika. - Vidite https://iccf-holland.org/click5.html - - Slede�a knjiga je starija i vi�e govori o Vi-u nego o Vim-u, ali je tako�e - preporu�ujemo: - Learning the Vi Editor - by Linda Lamb - Izdava�: O'Reilly & Associates Inc. - Dobra knjiga iz koje mo�ete saznati skoro sve �to mo�ete raditi u Vi-ju. - �esto izdanje ima i informacija o Vim-u. - - Ovaj priru�nik su napisali: Michael C. Pierce i Robert K. Ware, - Colorado School of Mines koriste�i ideje Charlesa Smitha, - Colorado State University. E-mail: bware@mines.colorado.edu. - - Prilago�avanje za Vim uradio je Bram Moolenaar. - - Prevod na srpski: Ivan Nejgebauer - Verzija 1.0, maj/juni 2014. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.sv b/runtime/tutor/tutor1.sv index ab439910a1..10104c87ca 100644 --- a/runtime/tutor/tutor1.sv +++ b/runtime/tutor/tutor1.sv @@ -1,94 +1,94 @@ =============================================================================== -= V � l k o m m e n t i l l h a n d l e d n i n g e n i V i m - Ver. 1.5 = += V ä l k o m m e n t i l l h a n d l e d n i n g e n i V i m - Ver. 1.5 = =============================================================================== - Vim �r en v�ldigt kraftfull redigerare som har m�nga kommandon, alltf�r - m�nga att f�rklara i en handledning som denna. Den h�r handledningen �r - gjord f�r att f�rklara tillr�ckligt m�nga kommandon s� att du enkelt ska - kunna anv�nda Vim som en redigerare f�r alla �ndam�l. + Vim är en väldigt kraftfull redigerare som har många kommandon, alltför + många att förklara i en handledning som denna. Den här handledningen är + gjord för att förklara tillräckligt många kommandon så att du enkelt ska + kunna använda Vim som en redigerare för alla ändamål. - Den ber�knade tiden f�r att slutf�ra denna handledning �r 25-30 minuter, - beroende p� hur mycket tid som l�ggs ned p� experimentering. + Den beräknade tiden för att slutföra denna handledning är 25-30 minuter, + beroende på hur mycket tid som läggs ned på experimentering. - Kommandona i lektionerna kommer att modifiera texten. G�r en kopia av den - h�r filen att �va p� (om du startade "vimtutor �r det h�r redan en kopia). + Kommandona i lektionerna kommer att modifiera texten. Gör en kopia av den + här filen att öva på (om du startade "vimtutor är det här redan en kopia). - Det �r viktigt att komma ih�g att den h�r handledningen �r konstruerad - att l�ra vid anv�ndning. Det betyder att du m�ste k�ra kommandona f�r att - l�ra dig dem ordentligt. Om du bara l�ser texten s� kommer du att gl�mma + Det är viktigt att komma ihåg att den här handledningen är konstruerad + att lära vid användning. Det betyder att du måste köra kommandona för att + lära dig dem ordentligt. Om du bara läser texten så kommer du att glömma kommandona! - F�rs�kra dig nu om att din Caps-Lock tangent INTE �r aktiv och tryck p� - j-tangenten tillr�ckligt m�nga g�nger f�r att f�rflytta mark�ren s� att - Lektion 1.1.1 fyller sk�rmen helt. + Försäkra dig nu om att din Caps-Lock tangent INTE är aktiv och tryck på + j-tangenten tillräckligt många gånger för att förflytta markören så att + Lektion 1.1.1 fyller skärmen helt. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.1: FLYTTA MARK�REN + Lektion 1.1.1: FLYTTA MARKÖREN - ** F�r att flytta mark�ren, tryck p� tangenterna h,j,k,l som indikerat. ** + ** För att flytta markören, tryck på tangenterna h,j,k,l som indikerat. ** ^ k Tips: - < h l > h-tangenten �r till v�nster och flyttar till v�nster. - j l-tangenten �r till h�ger och flyttar till h�ger. + < h l > h-tangenten är till vänster och flyttar till vänster. + j l-tangenten är till höger och flyttar till höger. v j-tangenten ser ut som en pil ned. - 1. Flytta runt mark�ren p� sk�rmen tills du k�nner dig bekv�m. + 1. Flytta runt markören på skärmen tills du känner dig bekväm. - 2. H�ll ned tangenten pil ned (j) tills att den repeterar. ----> Nu vet du hur du tar dig till n�sta lektion. + 2. Håll ned tangenten pil ned (j) tills att den repeterar. +---> Nu vet du hur du tar dig till nästa lektion. - 3. Flytta till Lektion 1.1.2, med hj�lp av ned tangenten. + 3. Flytta till Lektion 1.1.2, med hjälp av ned tangenten. -Notera: Om du �r os�ker p� n�gonting du skrev, tryck f�r att placera dig - dig i Normal-l�ge. Skriv sedan om kommandot. +Notera: Om du är osäker på någonting du skrev, tryck för att placera dig + dig i Normal-läge. Skriv sedan om kommandot. -Notera: Piltangenterna borde ocks� fungera. Men om du anv�nder hjkl s� kommer - du att kunna flytta omkring mycket snabbare, n�r du v�l vant dig vid +Notera: Piltangenterna borde också fungera. Men om du använder hjkl så kommer + du att kunna flytta omkring mycket snabbare, när du väl vant dig vid det. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1.2: STARTA OCH AVSLUTA VIM - !! NOTERA: Innan du utf�r n�gon av punkterna nedan, l�s hela lektionen!! + !! NOTERA: Innan du utför någon av punkterna nedan, läs hela lektionen!! - 1. Tryck -tangenten (f�r att se till att du �r i Normal-l�ge). + 1. Tryck -tangenten (för att se till att du är i Normal-läge). 2. Skriv: :q! . ----> Detta avslutar redigeraren UTAN att spara n�gra �ndringar du gjort. - Om du vill spara �ndringarna och avsluta skriv: +---> Detta avslutar redigeraren UTAN att spara några ändringar du gjort. + Om du vill spara ändringarna och avsluta skriv: :wq - 3. N�r du ser skal-prompten, skriv kommandot som tog dig in i den h�r + 3. När du ser skal-prompten, skriv kommandot som tog dig in i den här handledningen. Det kan vara: vimtutor - Normalt vill du anv�nda: vim tutor + Normalt vill du använda: vim tutor ----> 'vim' betyder �ppna redigeraren vim, 'tutor' �r filen du vill redigera. +---> 'vim' betyder öppna redigeraren vim, 'tutor' är filen du vill redigera. - 4. Om du har memorerat dessa steg och k�nner dig sj�lvs�ker, k�r d� stegen - 1 till 3 f�r att avsluta och starta om redigeraren. Flytta sedan ned - mark�ren till Lektion 1.1.3. + 4. Om du har memorerat dessa steg och känner dig självsäker, kör då stegen + 1 till 3 för att avsluta och starta om redigeraren. Flytta sedan ned + markören till Lektion 1.1.3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.1.3: TEXT REDIGERING - BORTTAGNING -** N�r du �r i Normal-l�ge tryck x f�r att ta bort tecknet under mark�ren. ** +** När du är i Normal-läge tryck x för att ta bort tecknet under markören. ** - 1. Flytta mark�ren till raden nedan med markeringen --->. + 1. Flytta markören till raden nedan med markeringen --->. - 2. F�r att r�tta felen, flytta mark�ren tills den st�r p� tecknet som ska + 2. För att rätta felen, flytta markören tills den står på tecknet som ska tas bort. fix the errors, move the cursor until it is on top of the - 3. Tryck p� x-tangenten f�r att ta bort det felaktiga tecknet. + 3. Tryck på x-tangenten för att ta bort det felaktiga tecknet. - 4. Upprepa steg 2 till 4 tills meningen �r korrekt. + 4. Upprepa steg 2 till 4 tills meningen är korrekt. ----> Kkon hoppadee �vverr m��nen. +---> Kkon hoppadee övverr måånen. - 5. Nu n�r raden �r korrekt, g� till Lektion 1.1.4. + 5. Nu när raden är korrekt, gå till Lektion 1.1.4. -NOTERA: N�r du g�r igenom den h�r handledningen, f�rs�k inte att memorera, l�r - genom anv�ndning. +NOTERA: När du går igenom den här handledningen, försök inte att memorera, lär + genom användning. @@ -96,22 +96,22 @@ NOTERA: N Lektion 1.1.4: TEXT REDIGERING - INFOGNING - ** N�r du �r i Normal-l�ge tryck i f�r att infoga text. ** + ** När du är i Normal-läge tryck i för att infoga text. ** - 1. Flytta mark�ren till den f�rsta raden nedan med markeringen --->. + 1. Flytta markören till den första raden nedan med markeringen --->. - 2. F�r att g�ra den f�rsta raden likadan som den andra, flytta mark�ren till - det f�rsta tecknet EFTER d�r text ska infogas. + 2. För att göra den första raden likadan som den andra, flytta markören till + det första tecknet EFTER där text ska infogas. 3. Tryck i och skriv in det som saknas. - 4. N�r du r�ttat ett fel tryck f�r att �terg� till Normal-l�ge. - Upprepa steg 2 till 4 f�r att r�tta meningen. + 4. När du rättat ett fel tryck för att återgå till Normal-läge. + Upprepa steg 2 till 4 för att rätta meningen. ----> Det sakns h�r . ----> Det saknas lite text fr�n den h�r raden. +---> Det sakns här . +---> Det saknas lite text från den här raden. - 5. N�r du k�nner dig bekv�m med att infoga text, g� till sammanfattningen + 5. När du känner dig bekväm med att infoga text, gå till sammanfattningen nedan. @@ -120,45 +120,45 @@ NOTERA: N LEKTION 1.1 SAMMANFATTNING - 1. Mark�ren flyttas genom att anv�nda piltangenterna eller hjkl-tangenterna. - h (v�nster) j (ned) k (upp) l (h�ger) + 1. Markören flyttas genom att använda piltangenterna eller hjkl-tangenterna. + h (vänster) j (ned) k (upp) l (höger) - 2. F�r att starta Vim (fr�n %-prompten) skriv: vim FILNAMN + 2. För att starta Vim (från %-prompten) skriv: vim FILNAMN - 3. F�r att avsluta Vim skriv: :q! f�r att kasta �ndringar. - ELLER skriv: :wq f�r att spara �ndringar. + 3. För att avsluta Vim skriv: :q! för att kasta ändringar. + ELLER skriv: :wq för att spara ändringar. - 4. F�r att ta bort tecknet under mark�ren i Normal-l�ge skriv: x + 4. För att ta bort tecknet under markören i Normal-läge skriv: x - 5. F�r att infoga text vid mark�ren i Normal-l�ge skriv: + 5. För att infoga text vid markören i Normal-läge skriv: i skriv in text -NOTERA: Genom att trycka kommer du att placeras i Normal-l�ge eller - avbryta ett delvis f�rdigskrivet kommando. +NOTERA: Genom att trycka kommer du att placeras i Normal-läge eller + avbryta ett delvis färdigskrivet kommando. -Forts�tt nu med Lektion 1.2. +Fortsätt nu med Lektion 1.2. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.2.1: BORTTAGNINGSKOMMANDON - ** Skriv dw f�r att radera till slutet av ett ord. ** + ** Skriv dw för att radera till slutet av ett ord. ** - 1. Tryck f�r att f�rs�kra dig om att du �r i Normal-l�ge. + 1. Tryck för att försäkra dig om att du är i Normal-läge. - 2. Flytta mark�ren till raden nedan markerad --->. + 2. Flytta markören till raden nedan markerad --->. - 3. Flytta mark�ren till b�rjan av ett ord som m�ste raderas. + 3. Flytta markören till början av ett ord som måste raderas. - 4. Skriv dw f�r att radera ordet. + 4. Skriv dw för att radera ordet. - NOTERA: Bokst�verna dw kommer att synas p� den sista raden p� sk�rmen n�r - du skriver dem. Om du skrev n�got fel, tryck och b�rja om. + NOTERA: Bokstäverna dw kommer att synas på den sista raden på skärmen när + du skriver dem. Om du skrev något fel, tryck och börja om. ----> Det �r ett n�gra ord roliga att som inte h�r hemma i den h�r meningen. +---> Det är ett några ord roliga att som inte hör hemma i den här meningen. - 5. Upprepa stegen 3 och 4 tills meningen �r korrekt och g� till Lektion 1.2.2. + 5. Upprepa stegen 3 och 4 tills meningen är korrekt och gå till Lektion 1.2.2. @@ -166,20 +166,20 @@ Forts Lektion 1.2.2: FLER BORTTAGNINGSKOMMANDON - ** Skriv d$ f�r att radera till slutet p� raden. ** + ** Skriv d$ för att radera till slutet på raden. ** - 1. Tryck f�r att f�rs�kra dig om att du �r i Normal-l�ge. + 1. Tryck för att försäkra dig om att du är i Normal-läge. - 2. Flytta mark�ren till raden nedan markerad --->. + 2. Flytta markören till raden nedan markerad --->. - 3. Flytta mark�ren till slutet p� den r�tta raden (EFTER den f�rsta . ). + 3. Flytta markören till slutet på den rätta raden (EFTER den första . ). - 4. Skriv d$ f�r att radera till slutet p� raden. + 4. Skriv d$ för att radera till slutet på raden. ----> N�gon skrev slutet p� den h�r raden tv� g�nger. den h�r raden tv� g�nger. +---> Någon skrev slutet på den här raden två gånger. den här raden två gånger. - 5. G� vidare till Lektion 1.2.3 f�r att f�rst� vad det �r som h�nder. + 5. Gå vidare till Lektion 1.2.3 för att förstå vad det är som händer. @@ -189,21 +189,21 @@ Forts Lesson 1.2.3: KOMMANDON OCH OBJEKT - Syntaxen f�r d raderingskommandot �r f�ljande: + Syntaxen för d raderingskommandot är följande: [nummer] d objekt ELLER d [nummer] objekt Var: - nummer - �r antalet upprepningar av kommandot (valfritt, standard=1). - d - �r kommandot f�r att radera. - objekt - �r vad kommandot kommer att operera p� (listade nedan). + nummer - är antalet upprepningar av kommandot (valfritt, standard=1). + d - är kommandot för att radera. + objekt - är vad kommandot kommer att operera på (listade nedan). - En kort lista �ver objekt: - w - fr�n mark�ren till slutet av ordet, inklusive blanksteget. - e - fr�n mark�ren till slutet av ordet, EJ inklusive blanksteget. - $ - fr�n mark�ren till slutet p� raden. + En kort lista över objekt: + w - från markören till slutet av ordet, inklusive blanksteget. + e - från markören till slutet av ordet, EJ inklusive blanksteget. + $ - från markören till slutet på raden. -NOTERA: F�r den �ventyrslystne, genom att bara trycka p� objektet i - Normal-l�ge (utan kommando) s� kommer mark�ren att flyttas som +NOTERA: För den äventyrslystne, genom att bara trycka på objektet i + Normal-läge (utan kommando) så kommer markören att flyttas som angivet i objektlistan. @@ -213,16 +213,16 @@ NOTERA: F Lektion 1.2.4: ETT UNDANTAG TILL 'KOMMANDO-OBJEKT' - ** Skriv dd f�r att radera hela raden. ** + ** Skriv dd för att radera hela raden. ** - P� grund av hur vanligt det �r att ta bort hela rader, valde upphovsmannen - till Vi att det skulle vara enklare att bara trycka d tv� g�nger i rad f�r + På grund av hur vanligt det är att ta bort hela rader, valde upphovsmannen + till Vi att det skulle vara enklare att bara trycka d två gånger i rad för att ta bort en rad. - 1. Flytta mark�ren till den andra raden i frasen nedan. - 2. Skriv dd f�r att radera raden. - 3. Flytta nu till den fj�rde raden. - 4. Skriv 2dd (kom ih�g: nummer-kommando-objekt) f�r att radera de tv� + 1. Flytta markören till den andra raden i frasen nedan. + 2. Skriv dd för att radera raden. + 3. Flytta nu till den fjärde raden. + 4. Skriv 2dd (kom ihåg: nummer-kommando-objekt) för att radera de två raderna. 1) Roses are red, @@ -235,24 +235,24 @@ NOTERA: F ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.5: �NGRA-KOMMANDOT + Lektion 1.2.5: ÅNGRA-KOMMANDOT -** Skriv u f�r att �ngra det senaste kommandona, U f�r att fixa en hel rad. ** +** Skriv u för att ångra det senaste kommandona, U för att fixa en hel rad. ** - 1. Flytta mark�ren till slutet av raden nedan markerad ---> och placera den - p� det f�rsta felet. - 2. Skriv x f�r att radera den f�rsta felaktiga tecknet. - 3. Skriv nu u f�r att �ngra det senaste k�rda kommandot. - 4. R�tta den h�r g�ngen alla felen p� raden med x-kommandot. - 5. Skriv nu U f�r att �terst�lla raden till dess ursprungliga utseende. - 6. Skriv nu u n�gra g�nger f�r att �ngra U och tidigare kommandon. - 7. Tryck nu CTRL-R (h�ll inne CTRL samtidigt som du trycker R) n�gra g�nger - f�r att upprepa kommandona (�ngra �ngringarna). + 1. Flytta markören till slutet av raden nedan markerad ---> och placera den + på det första felet. + 2. Skriv x för att radera den första felaktiga tecknet. + 3. Skriv nu u för att ångra det senaste körda kommandot. + 4. Rätta den här gången alla felen på raden med x-kommandot. + 5. Skriv nu U för att återställa raden till dess ursprungliga utseende. + 6. Skriv nu u några gånger för att ångra U och tidigare kommandon. + 7. Tryck nu CTRL-R (håll inne CTRL samtidigt som du trycker R) några gånger + för att upprepa kommandona (ångra ångringarna). ----> Fiixa felen pp� deen h��r meningen och �terskapa dem med �ngra. +---> Fiixa felen ppå deen häär meningen och återskapa dem med ångra. - 8. Det h�r �r v�ldigt anv�ndbara kommandon. G� nu vidare till + 8. Det här är väldigt användbara kommandon. Gå nu vidare till Lektion 1.2 Sammanfattning. @@ -262,116 +262,116 @@ NOTERA: F LEKTION 1.2 SAMMANFATTNING - 1. F�r att radera fr�n mark�ren till slutet av ett ord skriv: dw + 1. För att radera från markören till slutet av ett ord skriv: dw - 2. F�r att radera fr�n mark�ren till slutet av en rad skriv: d$ + 2. För att radera från markören till slutet av en rad skriv: d$ - 3. F�r att radera en hel rad skriv: dd + 3. För att radera en hel rad skriv: dd - 4. Syntaxen f�r ett kommando i Normal-l�ge �r: + 4. Syntaxen för ett kommando i Normal-läge är: [nummer] kommando objekt ELLER kommando [nummer] objekt - d�r: - nummer - �r hur m�nga g�nger kommandot kommandot ska repeteras - kommando - �r vad som ska g�ras, t.ex. d f�r att radera - objekt - �r vad kommandot ska operera p�, som t.ex. w (ord), + där: + nummer - är hur många gånger kommandot kommandot ska repeteras + kommando - är vad som ska göras, t.ex. d för att radera + objekt - är vad kommandot ska operera på, som t.ex. w (ord), $ (till slutet av raden), etc. - 5. F�r att �ngra tidigare kommandon, skriv: u (litet u) - F�r att �ngra alla tidigare �ndringar p� en rad skriv: U (stort U) - F�r att �ngra �ngringar tryck: CTRL-R + 5. För att ångra tidigare kommandon, skriv: u (litet u) + För att ångra alla tidigare ändringar på en rad skriv: U (stort U) + För att ångra ångringar tryck: CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Lektion 1.3.1: KLISTRA IN-KOMMANDOT - ** Skriv p f�r att klistra in den senaste raderingen efter mark�ren. ** + ** Skriv p för att klistra in den senaste raderingen efter markören. ** - 1. Flytta mark�ren till den f�rsta raden i listan nedan. + 1. Flytta markören till den första raden i listan nedan. - 2. Skriv dd f�r att radera raden och lagra den i Vims buffert. + 2. Skriv dd för att radera raden och lagra den i Vims buffert. - 3. Flytta mark�ren till raden OVANF�R d�r den raderade raden borde vara. + 3. Flytta markören till raden OVANFÖR där den raderade raden borde vara. - 4. N�r du �r i Normal-l�ge, skriv p f�r att byta ut raden. + 4. När du är i Normal-läge, skriv p för att byta ut raden. - 5. Repetera stegen 2 till 4 f�r att klistra in alla rader i r�tt ordning. + 5. Repetera stegen 2 till 4 för att klistra in alla rader i rätt ordning. - d) Kan du l�ra dig ocks�? - b) Violetter �r bl�, - c) Intelligens f�s genom l�rdom, - a) Rosor �r r�da, + d) Kan du lära dig också? + b) Violetter är blå, + c) Intelligens fås genom lärdom, + a) Rosor är röda, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.2: ERS�TT-KOMMANDOT + Lesson 1.3.2: ERSÄTT-KOMMANDOT - ** Skriv r och ett tecken f�r att ers�tta tecknet under mark�ren. ** + ** Skriv r och ett tecken för att ersätta tecknet under markören. ** - 1. Flytta mark�ren till den f�rsta raden nedan markerad --->. + 1. Flytta markören till den första raden nedan markerad --->. - 2. Flytta mark�ren s� att den st�r p� det f�rsta felet. + 2. Flytta markören så att den står på det första felet. - 3. Skriv r och sedan det tecken som borde ers�tta felet. + 3. Skriv r och sedan det tecken som borde ersätta felet. - 4. Repetera steg 2 och 3 tills den f�rsta raden �r korrekt. + 4. Repetera steg 2 och 3 tills den första raden är korrekt. ----> N�r drn h�r ruden skrevs, trickte n�gon p� fil knappar! ----> N�r den h�r raden skrevs, tryckte n�gon p� fel knappar! +---> När drn här ruden skrevs, trickte någon på fil knappar! +---> När den här raden skrevs, tryckte någon på fel knappar! - 5. G� nu vidare till Lektion 1.3.2. + 5. Gå nu vidare till Lektion 1.3.2. -NOTERA: Kom ih�g att du skall l�ra dig genom anv�ndning, inte genom memorering. +NOTERA: Kom ihåg att du skall lära dig genom användning, inte genom memorering. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.3: �NDRA-KOMMANDOT + Lektion 1.3.3: ÄNDRA-KOMMANDOT - ** F�r att �ndra en del eller ett helt ord, skriv cw . ** + ** För att ändra en del eller ett helt ord, skriv cw . ** - 1. Flytta mark�ren till den f�rsta redan nedan markerad --->. + 1. Flytta markören till den första redan nedan markerad --->. - 2. Placera mark�ren p� d i rdrtn. + 2. Placera markören på d i rdrtn. - 3. Skriv cw och det r�tta ordet (i det h�r fallet, skriv "aden".) + 3. Skriv cw och det rätta ordet (i det här fallet, skriv "aden".) - 4. Tryck och flytta mark�ren till n�sta fel (det f�rsta tecknet som - ska �ndras.) + 4. Tryck och flytta markören till nästa fel (det första tecknet som + ska ändras.) - 5. Repetera steg 3 och 4 tills den f�rsta raden �r likadan som den andra. + 5. Repetera steg 3 och 4 tills den första raden är likadan som den andra. ----> Den h�r rdrtn har n�gra otf som brhotrt �ndras mrf �ndra-komjendit. ----> Den h�r raden har n�gra ord som beh�ver �ndras med �ndra-kommandot. +---> Den här rdrtn har några otf som brhotrt ändras mrf ändra-komjendit. +---> Den här raden har några ord som behöver ändras med ändra-kommandot. -Notera att cw inte bara �ndrar ordet, utan �ven placerar dig i infogningsl�ge. +Notera att cw inte bara ändrar ordet, utan även placerar dig i infogningsläge. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.4: FLER �NDRINGAR MED c + Lektion 1.3.4: FLER ÄNDRINGAR MED c - ** �ndra-kommandot anv�nds p� samma objekt som radera. ** + ** Ändra-kommandot används på samma objekt som radera. ** - 1. �ndra-kommandot fungerar p� samma s�tt som radera. Syntaxen �r: + 1. Ändra-kommandot fungerar på samma sätt som radera. Syntaxen är: [nummer] c objekt ELLER c [nummer] objekt - 2. Objekten �r ocks� de samma, som t.ex. w (ord), $ (slutet av raden), etc. + 2. Objekten är också de samma, som t.ex. w (ord), $ (slutet av raden), etc. - 3. Flytta till den f�rsta raden nedan markerad -->. + 3. Flytta till den första raden nedan markerad -->. - 4. Flytta mark�ren till det f�rsta felet. + 4. Flytta markören till det första felet. - 5. Skriv c$ f�r att g�ra resten av raden likadan som den andra och tryck + 5. Skriv c$ för att göra resten av raden likadan som den andra och tryck . ----> Slutet p� den h�r raden beh�ver hj�lp med att f� den att likna den andra. ----> Slutet p� den h�r raden beh�ver r�ttas till med c$-kommandot. +---> Slutet på den här raden behöver hjälp med att få den att likna den andra. +---> Slutet på den här raden behöver rättas till med c$-kommandot. @@ -379,22 +379,22 @@ Notera att cw inte bara LEKTION 1.3 SAMMANFATTNING - 1. F�r att ers�tta text som redan har blivit raderad, skriv p . - Detta klistrar in den raderade texten EFTER mark�ren (om en rad raderades - kommer den att hamna p� raden under mark�ren. + 1. För att ersätta text som redan har blivit raderad, skriv p . + Detta klistrar in den raderade texten EFTER markören (om en rad raderades + kommer den att hamna på raden under markören. - 2. F�r att ers�tta tecknet under mark�ren, skriv r och sedan tecknet som - kommer att ers�tta orginalet. + 2. För att ersätta tecknet under markören, skriv r och sedan tecknet som + kommer att ersätta orginalet. - 3. �ndra-kommandot l�ter dig �ndra det angivna objektet fr�n mark�ren till - slutet p� objektet. eg. Skriv cw f�r att �ndra fr�n mark�ren till slutet - p� ordet, c$ f�r att �ndra till slutet p� en rad. + 3. Ändra-kommandot låter dig ändra det angivna objektet från markören till + slutet på objektet. eg. Skriv cw för att ändra från markören till slutet + på ordet, c$ för att ändra till slutet på en rad. - 4. Syntaxen f�r �ndra-kommandot �r: + 4. Syntaxen för ändra-kommandot är: [nummer] c objekt ELLER c [nummer] objekt -G� nu till n�sta lektion. +Gå nu till nästa lektion. @@ -402,64 +402,64 @@ G Lektion 1.4.1: POSITION OCH FILSTATUS - ** Tryck CTRL-g f�r att visa din position i filen och filstatusen. - Tryck SHIFT-G f�r att flytta till en rad i filen. ** + ** Tryck CTRL-g för att visa din position i filen och filstatusen. + Tryck SHIFT-G för att flytta till en rad i filen. ** - Notera: L�sa hela den lektion innan du utf�r n�got av stegen!! + Notera: Läsa hela den lektion innan du utför något av stegen!! - 1. H�ll ned Ctrl-tangenten och tryck g . En statusrad med filnamn och raden - du befinner dig p� kommer att synas. Kom ih�g radnummret till Steg 3. + 1. Håll ned Ctrl-tangenten och tryck g . En statusrad med filnamn och raden + du befinner dig på kommer att synas. Kom ihåg radnummret till Steg 3. - 2. Tryck shift-G f�r att flytta mark�ren till slutet p� filen. + 2. Tryck shift-G för att flytta markören till slutet på filen. - 3. Skriv in nummret p� raden du var p� och tryck sedan shift-G. Detta kommer - att ta dig tillbaka till raden du var p� n�r du f�rst tryckte Ctrl-g. - (N�r du skriver in nummren, kommer de INTE att visas p� sk�rmen.) + 3. Skriv in nummret på raden du var på och tryck sedan shift-G. Detta kommer + att ta dig tillbaka till raden du var på när du först tryckte Ctrl-g. + (När du skriver in nummren, kommer de INTE att visas på skärmen.) - 4. Om du k�nner dig s�ker p� det h�r, utf�r steg 1 till 3. + 4. Om du känner dig säker på det här, utför steg 1 till 3. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.2: S�K-KOMMANDOT + Lektion 1.4.2: SÖK-KOMMANDOT - ** Skriv / f�ljt av en fras f�r att s�ka efter frasen. ** + ** Skriv / följt av en fras för att söka efter frasen. ** - 1. I Normal-l�ge skriv /-tecknet. Notera att det och mark�ren blir synlig - l�ngst ned p� sk�rmen precis som med :-kommandot. + 1. I Normal-läge skriv /-tecknet. Notera att det och markören blir synlig + längst ned på skärmen precis som med :-kommandot. - 2. Skriv nu "feeel" . Det h�r �r ordet du vill s�ka efter. + 2. Skriv nu "feeel" . Det här är ordet du vill söka efter. - 3. F�r att s�ka efter samma fras igen, tryck helt enkelt n . - F�r att s�ka efter samma fras igen i motsatt riktning, tryck Shift-N . + 3. För att söka efter samma fras igen, tryck helt enkelt n . + För att söka efter samma fras igen i motsatt riktning, tryck Shift-N . - 4. Om du vill s�ka efter en fras bak�t i filen, anv�nd kommandot ? ist�llet - f�r /. + 4. Om du vill söka efter en fras bakåt i filen, använd kommandot ? istället + för /. ----> "feeel" �r inte r�tt s�tt att stava fel: feeel �r ett fel. +---> "feeel" är inte rätt sätt att stava fel: feeel är ett fel. -Notera: N�r s�kningen n�r slutet p� filen kommer den att forts�tta vid b�rjan. +Notera: När sökningen når slutet på filen kommer den att fortsätta vid början. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.3: S�KNING EFTER MATCHANDE PARENTESER + Lektion 1.4.3: SÖKNING EFTER MATCHANDE PARENTESER - ** Skriv % f�r att hitta en matchande ),], or } . ** + ** Skriv % för att hitta en matchande ),], or } . ** - 1. Placera mark�ren p� n�gon av (, [, or { p� raden nedan markerad --->. + 1. Placera markören på någon av (, [, or { på raden nedan markerad --->. 2. Skriv nu %-tecknet. - 3. Mark�ren borde vara p� den matchande parentesen eller hakparentesen. + 3. Markören borde vara på den matchande parentesen eller hakparentesen. - 4. Skriv % f�r att flytta mark�ren tillbaka till den f�rsta hakparentesen + 4. Skriv % för att flytta markören tillbaka till den första hakparentesen (med matchning). ----> Det ( h�r �r en testrad med (, [ ] och { } i den. )) +---> Det ( här är en testrad med (, [ ] och { } i den. )) -Notera: Det h�r �r v�ldigt anv�ndbart vid avlusning av ett program med icke +Notera: Det här är väldigt användbart vid avlusning av ett program med icke matchande parenteser! @@ -468,24 +468,24 @@ Notera: Det h ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.4: ETT S�TT ATT �NDRA FEL + Lektion 1.4.4: ETT SÄTT ATT ÄNDRA FEL - ** Skriv :s/gammalt/nytt/g f�r att ers�tta "gammalt" med "nytt". ** + ** Skriv :s/gammalt/nytt/g för att ersätta "gammalt" med "nytt". ** - 1. Flytta mark�ren till raden nedan markerad --->. + 1. Flytta markören till raden nedan markerad --->. - 2. Skriv :s/denn/den . Notera att det h�r kommandot bara �ndrar den - f�rsta f�rekomsten p� raden. + 2. Skriv :s/denn/den . Notera att det här kommandot bara ändrar den + första förekomsten på raden. - 3. Skriv nu :s/denn/den/g vilket betyder ers�tt globalt p� raden. - Det �ndrar alla f�rekomster p� raden. + 3. Skriv nu :s/denn/den/g vilket betyder ersätt globalt på raden. + Det ändrar alla förekomster på raden. ----> denn b�sta tiden att se blommor blomma �r denn p� v�ren. +---> denn bästa tiden att se blommor blomma är denn på våren. - 4. F�r att �ndra alla f�rekomster av en teckenstr�ng mellan tv� rader, - skriv :#,#s/gammalt/nytt/g d�r #,# �r de tv� radernas radnummer. - Skriv :%s/gammtl/nytt/g f�r att �ndra varje f�rekomst i hela filen. + 4. För att ändra alla förekomster av en teckensträng mellan två rader, + skriv :#,#s/gammalt/nytt/g där #,# är de två radernas radnummer. + Skriv :%s/gammtl/nytt/g för att ändra varje förekomst i hela filen. @@ -495,44 +495,44 @@ Notera: Det h 1. Ctrl-g visar din position i filen och filstatusen. - Shift-G flyttar till slutet av filen. Ett radnummer f�ljt Shift-G + Shift-G flyttar till slutet av filen. Ett radnummer följt Shift-G flyttar till det radnummret. - 2. Skriver man / f�ljt av en fras s�ks det FRAMM�T efter frasen. - Skriver man ? f�ljt av en fras s�ks det BAK�T efter frasen. - Efter en s�kning skriv n f�r att hitta n�sta f�rekomst i samma riktning - eller Shift-N f�r att s�ka i den motsatta riktningen. + 2. Skriver man / följt av en fras söks det FRAMMÅT efter frasen. + Skriver man ? följt av en fras söks det BAKÅT efter frasen. + Efter en sökning skriv n för att hitta nästa förekomst i samma riktning + eller Shift-N för att söka i den motsatta riktningen. - 3. Skriver man % n�r mark�ren �r p� ett (,),[,],{, eller } hittas dess + 3. Skriver man % när markören är på ett (,),[,],{, eller } hittas dess matchande par. - 4. F�r att ers�tta den f�rsta gammalt med nytt p� en rad skriv :s/gammlt/nytt - F�r att ers�tta alla gammlt med nytt p� en rad skriv :s/gammlt/nytt/g - F�r att ers�tta fraser mellan rad # och rad # skriv :#,#s/gammlt/nytt/g - F�r att ers�tta alla f�rekomster i filen skriv :%s/gammlt/nytt/g - F�r att bekr�fta varje g�ng l�gg till "c" :%s/gammlt/nytt/gc + 4. För att ersätta den första gammalt med nytt på en rad skriv :s/gammlt/nytt + För att ersätta alla gammlt med nytt på en rad skriv :s/gammlt/nytt/g + För att ersätta fraser mellan rad # och rad # skriv :#,#s/gammlt/nytt/g + För att ersätta alla förekomster i filen skriv :%s/gammlt/nytt/g + För att bekräfta varje gång lägg till "c" :%s/gammlt/nytt/gc ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.1: HUR MAN K�R ETT EXTERNT KOMMANDO + Lektion 1.5.1: HUR MAN KÖR ETT EXTERNT KOMMANDO - ** Skriv :! f�ljt av ett externt kommando f�r att k�ra det kommandot. ** + ** Skriv :! följt av ett externt kommando för att köra det kommandot. ** - 1. Skriv det v�lbekanta kommandot : f�r att placera mark�ren l�ngst ned - p� sk�rmen p� sk�rmen. Detta l�ter dig skriva in ett kommando. + 1. Skriv det välbekanta kommandot : för att placera markören längst ned + på skärmen på skärmen. Detta låter dig skriva in ett kommando. - 2. Skriv nu ! (utropstecken). Detta l�ter dig k�ra ett godtyckligt externt + 2. Skriv nu ! (utropstecken). Detta låter dig köra ett godtyckligt externt skalkommando. 3. Som ett exempel skriv ls efter ! och tryck sedan . Detta kommer - att visa dig en listning av din katalog, precis som om du k�rt det vid - skalprompten. Anv�nd :!dir om ls inte fungerar. + att visa dig en listning av din katalog, precis som om du kört det vid + skalprompten. Använd :!dir om ls inte fungerar. -Notera: Det �r m�jligt att k�ra vilket externt kommando som helst p� det h�r - s�ttet. +Notera: Det är möjligt att köra vilket externt kommando som helst på det här + sättet. -Notera: Alla :-kommandon m�ste avslutas med att trycka p� +Notera: Alla :-kommandon måste avslutas med att trycka på @@ -541,20 +541,20 @@ Notera: Alla :-kommandon m Lektion 1.5.2: MER OM ATT SPARA FILER - ** F�r att spara �ndringar gjorda i en fil, skriv :w FILNAMN. ** + ** För att spara ändringar gjorda i en fil, skriv :w FILNAMN. ** - 1. Skriv :!dir eller :!ls f�r att f� en listning av din katalog. - Du vet redan att du m�ste trycka efter det h�r. + 1. Skriv :!dir eller :!ls för att få en listning av din katalog. + Du vet redan att du måste trycka efter det här. - 2. V�lj ett filnamn som inte redan existerar, som t.ex. TEST. + 2. Välj ett filnamn som inte redan existerar, som t.ex. TEST. - 3. Skriv nu: :w TEST (d�r TEST �r filnamnet du valt.) + 3. Skriv nu: :w TEST (där TEST är filnamnet du valt.) - 4. Det h�r sparar hela filen (Vim handledningen) under namnet TEST. - F�r att verifiera detta, skriv :!dir igen f�r att se din katalog + 4. Det här sparar hela filen (Vim handledningen) under namnet TEST. + För att verifiera detta, skriv :!dir igen för att se din katalog -Notera: Om du skulle avsluta Vim och sedan �ppna igen med filnamnet TEST s� - skulle filen vara en exakt kopia av handledningen n�r du sparade den. +Notera: Om du skulle avsluta Vim och sedan öppna igen med filnamnet TEST så + skulle filen vara en exakt kopia av handledningen när du sparade den. 5. Ta nu bort filen genom att skriva (MS-DOS): :!del TEST eller (Unix): :!rm TEST @@ -564,47 +564,47 @@ Notera: Om du skulle avsluta Vim och sedan Lektion 1.5.3: ETT SELEKTIVT SPARA-KOMMANDO - ** F�r att spara en del av en fil, skriv :#,# w FILNAMN ** + ** För att spara en del av en fil, skriv :#,# w FILNAMN ** - 1. �nnu en g�ng, skriv :!dir eller :!ls f�r att f� en listning av din - katalog och v�lj ett passande filnamn som t.ex. TEST. + 1. Ännu en gång, skriv :!dir eller :!ls för att få en listning av din + katalog och välj ett passande filnamn som t.ex. TEST. - 2. Flytta mark�ren h�gst upp p� den h�r sidan och tryck Ctrl-g f�r att f� - reda p� radnumret p� den raden. KOM IH�G DET NUMMRET! + 2. Flytta markören högst upp på den här sidan och tryck Ctrl-g för att få + reda på radnumret på den raden. KOM IHÅG DET NUMMRET! - 3. Flytta nu l�ngst ned p� sidan och skriv Ctrl-g igen. - KOM IH�G DET RADNUMMRET OCKS�! + 3. Flytta nu längst ned på sidan och skriv Ctrl-g igen. + KOM IHÅG DET RADNUMMRET OCKSÅ! - 4. F�r att BARA spara en sektion till en fil, skriv :#,# w TEST - d�r #,# �r de tv� nummren du kom ih�g (toppen, botten) och TEST �r + 4. För att BARA spara en sektion till en fil, skriv :#,# w TEST + där #,# är de två nummren du kom ihåg (toppen, botten) och TEST är ditt filnamn. - 5. �nnu en g�ng, kolla s� att filen �r d�r med :!dir men radera den INTE. + 5. Ännu en gång, kolla så att filen är där med :!dir men radera den INTE. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.4: TA EMOT OCH F�RENA FILER + Lektion 1.5.4: TA EMOT OCH FÖRENA FILER - ** F�r att infoga inneh�llet av en fil, skriv :r FILNAMN ** + ** För att infoga innehållet av en fil, skriv :r FILNAMN ** - 1. Skriv :!dir f�r att f�rs�kra dig om att TEST-filen fr�n tidigare - fortfarande �r kvar. + 1. Skriv :!dir för att försäkra dig om att TEST-filen från tidigare + fortfarande är kvar. - 2. Placera mark�ren h�gst upp p� den h�r sidan. + 2. Placera markören högst upp på den här sidan. -NOTERA: Efter att du k�rt Steg 3 kommer du att se Lektion 1.5.3. - Flytta d� NED till den h�r lektionen igen. +NOTERA: Efter att du kört Steg 3 kommer du att se Lektion 1.5.3. + Flytta då NED till den här lektionen igen. - 3. Ta nu emot din TEST-fil med kommandot :r TEST d�r TEST �r namnet p� + 3. Ta nu emot din TEST-fil med kommandot :r TEST där TEST är namnet på filen. -NOTERA: Filen du tar emot placeras d�r mark�ren �r placerad. +NOTERA: Filen du tar emot placeras där markören är placerad. - 4. F�r att verifiera att filen togs emot, g� tillbaka och notera att det nu - finns tv� kopior av Lektion 1.5.3, orginalet och filversionen. + 4. För att verifiera att filen togs emot, gå tillbaka och notera att det nu + finns två kopior av Lektion 1.5.3, orginalet och filversionen. @@ -612,9 +612,9 @@ NOTERA: Filen du tar emot placeras d LEKTION 1.5 SAMMANFATTNING - 1. :!kommando k�r ett externt kommando. + 1. :!kommando kör ett externt kommando. - N�gra anv�ndbara exempel �r: + Några användbara exempel är: (MS-DOS) (Unix) :!dir :!ls - visar en kataloglistning. :!del FILNAMN :!rm FILNAMN - tar bort filen FILNAMN. @@ -624,7 +624,7 @@ NOTERA: Filen du tar emot placeras d 3. :#,#w FILNAMN sparar raderna # till # i filen FILNAMN. 4. :r FILNAMN tar emot filen FILNAMN och infogar den i den aktuella filen - efter mark�ren. + efter markören. @@ -632,119 +632,119 @@ NOTERA: Filen du tar emot placeras d ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.1: �PPNA-KOMMANDOT + Lektion 1.6.1: ÖPPNA-KOMMANDOT - ** Skriv o f�r att �ppna en rad under mark�ren och placera dig i - Infoga-l�ge. ** + ** Skriv o för att öppna en rad under markören och placera dig i + Infoga-läge. ** - 1. Flytta mark�ren till raden nedan markerad --->. + 1. Flytta markören till raden nedan markerad --->. - 2. Skriv o (litet o) f�r att �ppna upp en rad NEDANF�R mark�ren och placera + 2. Skriv o (litet o) för att öppna upp en rad NEDANFÖR markören och placera dig i Infoga-mode. - 3. Kopiera nu raden markerad ---> och tryck f�r att avsluta - Infoga-l�get. + 3. Kopiera nu raden markerad ---> och tryck för att avsluta + Infoga-läget. ----> Efter du skrivit o placerad mark�ren p� en �ppen rad i Infoga-l�ge. +---> Efter du skrivit o placerad markören på en öppen rad i Infoga-läge. - 4. F�r att �ppna upp en rad OVANF�R mark�ren, skriv ett stort O , ist�llet - f�r ett litet o. Pr�va detta p� raden nedan. -�ppna upp en rad ovanf�r denna genom att trycka Shift-O n�r mark�ren st�r h�r. + 4. För att öppna upp en rad OVANFÖR markören, skriv ett stort O , istället + för ett litet o. Pröva detta på raden nedan. +Öppna upp en rad ovanför denna genom att trycka Shift-O när markören står här. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.2: L�GG TILL-KOMMANDOT + Lektion 1.6.2: LÄGG TILL-KOMMANDOT - ** Skriv a f�r att infoga text EFTER mark�ren. ** + ** Skriv a för att infoga text EFTER markören. ** - 1. Flytta mark�ren till slutet av den f�rsta raden nedan markerad ---> genom - att skriv $ i Normal-l�ge. + 1. Flytta markören till slutet av den första raden nedan markerad ---> genom + att skriv $ i Normal-läge. - 2. Skriv ett a (litet a) f�r att l�gga till text EFTER tecknet under - mark�ren. (Stort A l�gger till i slutet av raden.) + 2. Skriv ett a (litet a) för att lägga till text EFTER tecknet under + markören. (Stort A lägger till i slutet av raden.) -Notera: Detta undviker att beh�va skriva i , det sista tecknet, texten att - infoga, , h�gerpil, och slutligen, x, bara f�r att l�gga till i - slutet p� en rad! +Notera: Detta undviker att behöva skriva i , det sista tecknet, texten att + infoga, , högerpil, och slutligen, x, bara för att lägga till i + slutet på en rad! - 3. G�r nu f�rdigt den f�rsta raden. Notera ocks� att l�gga till �r likadant - som Infoga-l�ge, enda skillnaden �r positionen d�r texten blir infogad. + 3. Gör nu färdigt den första raden. Notera också att lägga till är likadant + som Infoga-läge, enda skillnaden är positionen där texten blir infogad. ----> H�r kan du tr�na ----> H�r kan du tr�na p� att l�gga till text i slutet p� en rad. +---> Här kan du träna +---> Här kan du träna på att lägga till text i slutet på en rad. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.3: EN ANNAN VERSION AV ERS�TT + Lektion 1.6.3: EN ANNAN VERSION AV ERSÄTT - ** Skriv ett stort R f�r att ers�tta fler �n ett tecken. ** + ** Skriv ett stort R för att ersätta fler än ett tecken. ** - 1. Flytta mark�ren till den f�rsta raden nedan markerad --->. + 1. Flytta markören till den första raden nedan markerad --->. - 2. Placera mark�ren vid b�rjan av det f�rsta ordet som �r annorlunda j�mf�rt + 2. Placera markören vid början av det första ordet som är annorlunda jämfört med den andra raden markerad ---> (ordet "sista"). - 3. Skriv nu R och ers�tt resten av texten p� den f�rsta raden genom att - skriva �ver den gamla texten s� att den f�rsta raden blir likadan som + 3. Skriv nu R och ersätt resten av texten på den första raden genom att + skriva över den gamla texten så att den första raden blir likadan som den andra. ----> F�r att f� den f�rsta raden lika som den sista, anv�nd tangenterna. ----> F�r att f� den f�rsta raden lika som den andra, skriv R och den nya texten. +---> För att få den första raden lika som den sista, använd tangenterna. +---> För att få den första raden lika som den andra, skriv R och den nya texten. - 4. Notera att n�r du trycker f�r att avsluta, s� blir eventuell - of�r�ndrad text kvar. + 4. Notera att när du trycker för att avsluta, så blir eventuell + oförändrad text kvar. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.4: S�TT FLAGGOR + Lektion 1.6.4: SÄTT FLAGGOR - ** S�tt en flagga s� att en s�kning eller ers�ttning ignorerar storlek ** + ** Sätt en flagga så att en sökning eller ersättning ignorerar storlek ** - 1. S�k efter "ignore" genom att skriva: + 1. Sök efter "ignore" genom att skriva: /ignore - Repetera flera g�nger genom att trycka p� n-tangenten + Repetera flera gånger genom att trycka på n-tangenten - 2. S�tt 'ic' (Ignore Case) flaggan genom att skriva: + 2. Sätt 'ic' (Ignore Case) flaggan genom att skriva: :set ic - 3. S�k nu efter "ignore" igen genom att trycka: n + 3. Sök nu efter "ignore" igen genom att trycka: n Repeat search several more times by hitting the n key - 4. S�tt 'hlsearch' and 'incsearch' flaggorna: + 4. Sätt 'hlsearch' and 'incsearch' flaggorna: :set hls is - 5. Skriv nu in s�k-kommandot igen, och se vad som h�nder: + 5. Skriv nu in sök-kommandot igen, och se vad som händer: /ignore - 6. F�r att ta bort framh�vningen av tr�ffar, skriv + 6. För att ta bort framhävningen av träffar, skriv :nohlsearch ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LEKTION 1.6 SAMMANFATTNING - 1. Genom att skriva o �pnnas en rad NEDANF�R mark�ren och mark�ren placeras - p� den �ppna raden i Infoga-l�ge. - Genom att skriva ett stort O �ppnas raden OVANF�R raden som mark�ren �r - p�. + 1. Genom att skriva o öpnnas en rad NEDANFÖR markören och markören placeras + på den öppna raden i Infoga-läge. + Genom att skriva ett stort O öppnas raden OVANFÖR raden som markören är + på. - 2. Skriv ett a f�r att infoga text EFTER tecknet som mark�ren st�r p�. - Genom att skriva ett stort A l�ggs text automatiskt till i slutet p� + 2. Skriv ett a för att infoga text EFTER tecknet som markören står på. + Genom att skriva ett stort A läggs text automatiskt till i slutet på raden. - 3. Genom att skriva ett stort R hamnar du i Ers�tt-l�ge till trycks - f�r att avsluta. + 3. Genom att skriva ett stort R hamnar du i Ersätt-läge till trycks + för att avsluta. - 4. Genom att skriva ":set xxx" s�tts flaggan "xxx" + 4. Genom att skriva ":set xxx" sätts flaggan "xxx" @@ -755,21 +755,21 @@ Notera: Detta undviker att beh ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKTION 1.7: ON-LINE HJ�LP-KOMMANDON + LEKTION 1.7: ON-LINE HJÄLP-KOMMANDON - ** Anv�nd on-line hj�lpsystemet ** + ** Använd on-line hjälpsystemet ** - Vim har ett omfattande on-line hj�lpsystem. F�r att komma ig�ng pr�va ett av + Vim har ett omfattande on-line hjälpsystem. För att komma igång pröva ett av dessa tre: - - tryck tangenten (om du har n�gon) - - tryck tangenten (om du har n�gon) + - tryck tangenten (om du har någon) + - tryck tangenten (om du har någon) - skriv :help - Skriv :q f�r att str�nga hj�lpf�nstret. + Skriv :q för att stränga hjälpfönstret. - Du kan hitta hj�lp om n�stan allting, genom att ge ett argument till - ":help" kommandot. Pr�va dessa (gl�m inte att trycka ): + Du kan hitta hjälp om nästan allting, genom att ge ett argument till + ":help" kommandot. Pröva dessa (glöm inte att trycka ): :help w :help c_ + Modifierad för Vim av Bram Moolenaar. + Översatt av Johan Svedberg ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.sv.utf-8 b/runtime/tutor/tutor1.sv.utf-8 deleted file mode 100644 index 10104c87ca..0000000000 --- a/runtime/tutor/tutor1.sv.utf-8 +++ /dev/null @@ -1,830 +0,0 @@ -=============================================================================== -= V ä l k o m m e n t i l l h a n d l e d n i n g e n i V i m - Ver. 1.5 = -=============================================================================== - - Vim är en väldigt kraftfull redigerare som har många kommandon, alltför - många att förklara i en handledning som denna. Den här handledningen är - gjord för att förklara tillräckligt många kommandon så att du enkelt ska - kunna använda Vim som en redigerare för alla ändamål. - - Den beräknade tiden för att slutföra denna handledning är 25-30 minuter, - beroende på hur mycket tid som läggs ned på experimentering. - - Kommandona i lektionerna kommer att modifiera texten. Gör en kopia av den - här filen att öva på (om du startade "vimtutor är det här redan en kopia). - - Det är viktigt att komma ihåg att den här handledningen är konstruerad - att lära vid användning. Det betyder att du måste köra kommandona för att - lära dig dem ordentligt. Om du bara läser texten så kommer du att glömma - kommandona! - - Försäkra dig nu om att din Caps-Lock tangent INTE är aktiv och tryck på - j-tangenten tillräckligt många gånger för att förflytta markören så att - Lektion 1.1.1 fyller skärmen helt. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.1: FLYTTA MARKÖREN - - - ** För att flytta markören, tryck på tangenterna h,j,k,l som indikerat. ** - ^ - k Tips: - < h l > h-tangenten är till vänster och flyttar till vänster. - j l-tangenten är till höger och flyttar till höger. - v j-tangenten ser ut som en pil ned. - 1. Flytta runt markören på skärmen tills du känner dig bekväm. - - 2. Håll ned tangenten pil ned (j) tills att den repeterar. ----> Nu vet du hur du tar dig till nästa lektion. - - 3. Flytta till Lektion 1.1.2, med hjälp av ned tangenten. - -Notera: Om du är osäker på någonting du skrev, tryck för att placera dig - dig i Normal-läge. Skriv sedan om kommandot. - -Notera: Piltangenterna borde också fungera. Men om du använder hjkl så kommer - du att kunna flytta omkring mycket snabbare, när du väl vant dig vid - det. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.2: STARTA OCH AVSLUTA VIM - - - !! NOTERA: Innan du utför någon av punkterna nedan, läs hela lektionen!! - - 1. Tryck -tangenten (för att se till att du är i Normal-läge). - - 2. Skriv: :q! . - ----> Detta avslutar redigeraren UTAN att spara några ändringar du gjort. - Om du vill spara ändringarna och avsluta skriv: - :wq - - 3. När du ser skal-prompten, skriv kommandot som tog dig in i den här - handledningen. Det kan vara: vimtutor - Normalt vill du använda: vim tutor - ----> 'vim' betyder öppna redigeraren vim, 'tutor' är filen du vill redigera. - - 4. Om du har memorerat dessa steg och känner dig självsäker, kör då stegen - 1 till 3 för att avsluta och starta om redigeraren. Flytta sedan ned - markören till Lektion 1.1.3. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.3: TEXT REDIGERING - BORTTAGNING - - -** När du är i Normal-läge tryck x för att ta bort tecknet under markören. ** - - 1. Flytta markören till raden nedan med markeringen --->. - - 2. För att rätta felen, flytta markören tills den står på tecknet som ska - tas bort. fix the errors, move the cursor until it is on top of the - - 3. Tryck på x-tangenten för att ta bort det felaktiga tecknet. - - 4. Upprepa steg 2 till 4 tills meningen är korrekt. - ----> Kkon hoppadee övverr måånen. - - 5. Nu när raden är korrekt, gå till Lektion 1.1.4. - -NOTERA: När du går igenom den här handledningen, försök inte att memorera, lär - genom användning. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.1.4: TEXT REDIGERING - INFOGNING - - - ** När du är i Normal-läge tryck i för att infoga text. ** - - 1. Flytta markören till den första raden nedan med markeringen --->. - - 2. För att göra den första raden likadan som den andra, flytta markören till - det första tecknet EFTER där text ska infogas. - - 3. Tryck i och skriv in det som saknas. - - 4. När du rättat ett fel tryck för att återgå till Normal-läge. - Upprepa steg 2 till 4 för att rätta meningen. - ----> Det sakns här . ----> Det saknas lite text från den här raden. - - 5. När du känner dig bekväm med att infoga text, gå till sammanfattningen - nedan. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKTION 1.1 SAMMANFATTNING - - - 1. Markören flyttas genom att använda piltangenterna eller hjkl-tangenterna. - h (vänster) j (ned) k (upp) l (höger) - - 2. För att starta Vim (från %-prompten) skriv: vim FILNAMN - - 3. För att avsluta Vim skriv: :q! för att kasta ändringar. - ELLER skriv: :wq för att spara ändringar. - - 4. För att ta bort tecknet under markören i Normal-läge skriv: x - - 5. För att infoga text vid markören i Normal-läge skriv: - i skriv in text - -NOTERA: Genom att trycka kommer du att placeras i Normal-läge eller - avbryta ett delvis färdigskrivet kommando. - -Fortsätt nu med Lektion 1.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.1: BORTTAGNINGSKOMMANDON - - - ** Skriv dw för att radera till slutet av ett ord. ** - - 1. Tryck för att försäkra dig om att du är i Normal-läge. - - 2. Flytta markören till raden nedan markerad --->. - - 3. Flytta markören till början av ett ord som måste raderas. - - 4. Skriv dw för att radera ordet. - - NOTERA: Bokstäverna dw kommer att synas på den sista raden på skärmen när - du skriver dem. Om du skrev något fel, tryck och börja om. - ----> Det är ett några ord roliga att som inte hör hemma i den här meningen. - - 5. Upprepa stegen 3 och 4 tills meningen är korrekt och gå till Lektion 1.2.2. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.2: FLER BORTTAGNINGSKOMMANDON - - - ** Skriv d$ för att radera till slutet på raden. ** - - 1. Tryck för att försäkra dig om att du är i Normal-läge. - - 2. Flytta markören till raden nedan markerad --->. - - 3. Flytta markören till slutet på den rätta raden (EFTER den första . ). - - 4. Skriv d$ för att radera till slutet på raden. - ----> Någon skrev slutet på den här raden två gånger. den här raden två gånger. - - - 5. Gå vidare till Lektion 1.2.3 för att förstå vad det är som händer. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.3: KOMMANDON OCH OBJEKT - - - Syntaxen för d raderingskommandot är följande: - - [nummer] d objekt ELLER d [nummer] objekt - Var: - nummer - är antalet upprepningar av kommandot (valfritt, standard=1). - d - är kommandot för att radera. - objekt - är vad kommandot kommer att operera på (listade nedan). - - En kort lista över objekt: - w - från markören till slutet av ordet, inklusive blanksteget. - e - från markören till slutet av ordet, EJ inklusive blanksteget. - $ - från markören till slutet på raden. - -NOTERA: För den äventyrslystne, genom att bara trycka på objektet i - Normal-läge (utan kommando) så kommer markören att flyttas som - angivet i objektlistan. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.4: ETT UNDANTAG TILL 'KOMMANDO-OBJEKT' - - - ** Skriv dd för att radera hela raden. ** - - På grund av hur vanligt det är att ta bort hela rader, valde upphovsmannen - till Vi att det skulle vara enklare att bara trycka d två gånger i rad för - att ta bort en rad. - - 1. Flytta markören till den andra raden i frasen nedan. - 2. Skriv dd för att radera raden. - 3. Flytta nu till den fjärde raden. - 4. Skriv 2dd (kom ihåg: nummer-kommando-objekt) för att radera de två - raderna. - - 1) Roses are red, - 2) Mud is fun, - 3) Violets are blue, - 4) I have a car, - 5) Clocks tell time, - 6) Sugar is sweet - 7) And so are you. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.2.5: ÅNGRA-KOMMANDOT - - -** Skriv u för att ångra det senaste kommandona, U för att fixa en hel rad. ** - - 1. Flytta markören till slutet av raden nedan markerad ---> och placera den - på det första felet. - 2. Skriv x för att radera den första felaktiga tecknet. - 3. Skriv nu u för att ångra det senaste körda kommandot. - 4. Rätta den här gången alla felen på raden med x-kommandot. - 5. Skriv nu U för att återställa raden till dess ursprungliga utseende. - 6. Skriv nu u några gånger för att ångra U och tidigare kommandon. - 7. Tryck nu CTRL-R (håll inne CTRL samtidigt som du trycker R) några gånger - för att upprepa kommandona (ångra ångringarna). - ----> Fiixa felen ppå deen häär meningen och återskapa dem med ångra. - - 8. Det här är väldigt användbara kommandon. Gå nu vidare till - Lektion 1.2 Sammanfattning. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKTION 1.2 SAMMANFATTNING - - - 1. För att radera från markören till slutet av ett ord skriv: dw - - 2. För att radera från markören till slutet av en rad skriv: d$ - - 3. För att radera en hel rad skriv: dd - - 4. Syntaxen för ett kommando i Normal-läge är: - - [nummer] kommando objekt ELLER kommando [nummer] objekt - där: - nummer - är hur många gånger kommandot kommandot ska repeteras - kommando - är vad som ska göras, t.ex. d för att radera - objekt - är vad kommandot ska operera på, som t.ex. w (ord), - $ (till slutet av raden), etc. - - 5. För att ångra tidigare kommandon, skriv: u (litet u) - För att ångra alla tidigare ändringar på en rad skriv: U (stort U) - För att ångra ångringar tryck: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.1: KLISTRA IN-KOMMANDOT - - - ** Skriv p för att klistra in den senaste raderingen efter markören. ** - - 1. Flytta markören till den första raden i listan nedan. - - 2. Skriv dd för att radera raden och lagra den i Vims buffert. - - 3. Flytta markören till raden OVANFÖR där den raderade raden borde vara. - - 4. När du är i Normal-läge, skriv p för att byta ut raden. - - 5. Repetera stegen 2 till 4 för att klistra in alla rader i rätt ordning. - - d) Kan du lära dig också? - b) Violetter är blå, - c) Intelligens fås genom lärdom, - a) Rosor är röda, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.2: ERSÄTT-KOMMANDOT - - - ** Skriv r och ett tecken för att ersätta tecknet under markören. ** - - 1. Flytta markören till den första raden nedan markerad --->. - - 2. Flytta markören så att den står på det första felet. - - 3. Skriv r och sedan det tecken som borde ersätta felet. - - 4. Repetera steg 2 och 3 tills den första raden är korrekt. - ----> När drn här ruden skrevs, trickte någon på fil knappar! ----> När den här raden skrevs, tryckte någon på fel knappar! - - 5. Gå nu vidare till Lektion 1.3.2. - -NOTERA: Kom ihåg att du skall lära dig genom användning, inte genom memorering. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.3: ÄNDRA-KOMMANDOT - - - ** För att ändra en del eller ett helt ord, skriv cw . ** - - 1. Flytta markören till den första redan nedan markerad --->. - - 2. Placera markören på d i rdrtn. - - 3. Skriv cw och det rätta ordet (i det här fallet, skriv "aden".) - - 4. Tryck och flytta markören till nästa fel (det första tecknet som - ska ändras.) - - 5. Repetera steg 3 och 4 tills den första raden är likadan som den andra. - ----> Den här rdrtn har några otf som brhotrt ändras mrf ändra-komjendit. ----> Den här raden har några ord som behöver ändras med ändra-kommandot. - -Notera att cw inte bara ändrar ordet, utan även placerar dig i infogningsläge. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.3.4: FLER ÄNDRINGAR MED c - - - ** Ändra-kommandot används på samma objekt som radera. ** - - 1. Ändra-kommandot fungerar på samma sätt som radera. Syntaxen är: - - [nummer] c objekt ELLER c [nummer] objekt - - 2. Objekten är också de samma, som t.ex. w (ord), $ (slutet av raden), etc. - - 3. Flytta till den första raden nedan markerad -->. - - 4. Flytta markören till det första felet. - - 5. Skriv c$ för att göra resten av raden likadan som den andra och tryck - . - ----> Slutet på den här raden behöver hjälp med att få den att likna den andra. ----> Slutet på den här raden behöver rättas till med c$-kommandot. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKTION 1.3 SAMMANFATTNING - - - 1. För att ersätta text som redan har blivit raderad, skriv p . - Detta klistrar in den raderade texten EFTER markören (om en rad raderades - kommer den att hamna på raden under markören. - - 2. För att ersätta tecknet under markören, skriv r och sedan tecknet som - kommer att ersätta orginalet. - - 3. Ändra-kommandot låter dig ändra det angivna objektet från markören till - slutet på objektet. eg. Skriv cw för att ändra från markören till slutet - på ordet, c$ för att ändra till slutet på en rad. - - 4. Syntaxen för ändra-kommandot är: - - [nummer] c objekt ELLER c [nummer] objekt - -Gå nu till nästa lektion. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.1: POSITION OCH FILSTATUS - - - ** Tryck CTRL-g för att visa din position i filen och filstatusen. - Tryck SHIFT-G för att flytta till en rad i filen. ** - - Notera: Läsa hela den lektion innan du utför något av stegen!! - - 1. Håll ned Ctrl-tangenten och tryck g . En statusrad med filnamn och raden - du befinner dig på kommer att synas. Kom ihåg radnummret till Steg 3. - - 2. Tryck shift-G för att flytta markören till slutet på filen. - - 3. Skriv in nummret på raden du var på och tryck sedan shift-G. Detta kommer - att ta dig tillbaka till raden du var på när du först tryckte Ctrl-g. - (När du skriver in nummren, kommer de INTE att visas på skärmen.) - - 4. Om du känner dig säker på det här, utför steg 1 till 3. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.2: SÖK-KOMMANDOT - - - ** Skriv / följt av en fras för att söka efter frasen. ** - - 1. I Normal-läge skriv /-tecknet. Notera att det och markören blir synlig - längst ned på skärmen precis som med :-kommandot. - - 2. Skriv nu "feeel" . Det här är ordet du vill söka efter. - - 3. För att söka efter samma fras igen, tryck helt enkelt n . - För att söka efter samma fras igen i motsatt riktning, tryck Shift-N . - - 4. Om du vill söka efter en fras bakåt i filen, använd kommandot ? istället - för /. - ----> "feeel" är inte rätt sätt att stava fel: feeel är ett fel. - -Notera: När sökningen når slutet på filen kommer den att fortsätta vid början. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.3: SÖKNING EFTER MATCHANDE PARENTESER - - - ** Skriv % för att hitta en matchande ),], or } . ** - - 1. Placera markören på någon av (, [, or { på raden nedan markerad --->. - - 2. Skriv nu %-tecknet. - - 3. Markören borde vara på den matchande parentesen eller hakparentesen. - - 4. Skriv % för att flytta markören tillbaka till den första hakparentesen - (med matchning). - ----> Det ( här är en testrad med (, [ ] och { } i den. )) - -Notera: Det här är väldigt användbart vid avlusning av ett program med icke - matchande parenteser! - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.4.4: ETT SÄTT ATT ÄNDRA FEL - - - ** Skriv :s/gammalt/nytt/g för att ersätta "gammalt" med "nytt". ** - - 1. Flytta markören till raden nedan markerad --->. - - 2. Skriv :s/denn/den . Notera att det här kommandot bara ändrar den - första förekomsten på raden. - - 3. Skriv nu :s/denn/den/g vilket betyder ersätt globalt på raden. - Det ändrar alla förekomster på raden. - ----> denn bästa tiden att se blommor blomma är denn på våren. - - 4. För att ändra alla förekomster av en teckensträng mellan två rader, - skriv :#,#s/gammalt/nytt/g där #,# är de två radernas radnummer. - Skriv :%s/gammtl/nytt/g för att ändra varje förekomst i hela filen. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKTION 1.4 SAMMANFATTNING - - - 1. Ctrl-g visar din position i filen och filstatusen. - Shift-G flyttar till slutet av filen. Ett radnummer följt Shift-G - flyttar till det radnummret. - - 2. Skriver man / följt av en fras söks det FRAMMÅT efter frasen. - Skriver man ? följt av en fras söks det BAKÅT efter frasen. - Efter en sökning skriv n för att hitta nästa förekomst i samma riktning - eller Shift-N för att söka i den motsatta riktningen. - - 3. Skriver man % när markören är på ett (,),[,],{, eller } hittas dess - matchande par. - - 4. För att ersätta den första gammalt med nytt på en rad skriv :s/gammlt/nytt - För att ersätta alla gammlt med nytt på en rad skriv :s/gammlt/nytt/g - För att ersätta fraser mellan rad # och rad # skriv :#,#s/gammlt/nytt/g - För att ersätta alla förekomster i filen skriv :%s/gammlt/nytt/g - För att bekräfta varje gång lägg till "c" :%s/gammlt/nytt/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.1: HUR MAN KÖR ETT EXTERNT KOMMANDO - - - ** Skriv :! följt av ett externt kommando för att köra det kommandot. ** - - 1. Skriv det välbekanta kommandot : för att placera markören längst ned - på skärmen på skärmen. Detta låter dig skriva in ett kommando. - - 2. Skriv nu ! (utropstecken). Detta låter dig köra ett godtyckligt externt - skalkommando. - - 3. Som ett exempel skriv ls efter ! och tryck sedan . Detta kommer - att visa dig en listning av din katalog, precis som om du kört det vid - skalprompten. Använd :!dir om ls inte fungerar. - -Notera: Det är möjligt att köra vilket externt kommando som helst på det här - sättet. - -Notera: Alla :-kommandon måste avslutas med att trycka på - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.2: MER OM ATT SPARA FILER - - - ** För att spara ändringar gjorda i en fil, skriv :w FILNAMN. ** - - 1. Skriv :!dir eller :!ls för att få en listning av din katalog. - Du vet redan att du måste trycka efter det här. - - 2. Välj ett filnamn som inte redan existerar, som t.ex. TEST. - - 3. Skriv nu: :w TEST (där TEST är filnamnet du valt.) - - 4. Det här sparar hela filen (Vim handledningen) under namnet TEST. - För att verifiera detta, skriv :!dir igen för att se din katalog - -Notera: Om du skulle avsluta Vim och sedan öppna igen med filnamnet TEST så - skulle filen vara en exakt kopia av handledningen när du sparade den. - - 5. Ta nu bort filen genom att skriva (MS-DOS): :!del TEST - eller (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.3: ETT SELEKTIVT SPARA-KOMMANDO - - - ** För att spara en del av en fil, skriv :#,# w FILNAMN ** - - 1. Ännu en gång, skriv :!dir eller :!ls för att få en listning av din - katalog och välj ett passande filnamn som t.ex. TEST. - - 2. Flytta markören högst upp på den här sidan och tryck Ctrl-g för att få - reda på radnumret på den raden. KOM IHÅG DET NUMMRET! - - 3. Flytta nu längst ned på sidan och skriv Ctrl-g igen. - KOM IHÅG DET RADNUMMRET OCKSÅ! - - 4. För att BARA spara en sektion till en fil, skriv :#,# w TEST - där #,# är de två nummren du kom ihåg (toppen, botten) och TEST är - ditt filnamn. - - 5. Ännu en gång, kolla så att filen är där med :!dir men radera den INTE. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.5.4: TA EMOT OCH FÖRENA FILER - - - ** För att infoga innehållet av en fil, skriv :r FILNAMN ** - - 1. Skriv :!dir för att försäkra dig om att TEST-filen från tidigare - fortfarande är kvar. - - 2. Placera markören högst upp på den här sidan. - -NOTERA: Efter att du kört Steg 3 kommer du att se Lektion 1.5.3. - Flytta då NED till den här lektionen igen. - - 3. Ta nu emot din TEST-fil med kommandot :r TEST där TEST är namnet på - filen. - -NOTERA: Filen du tar emot placeras där markören är placerad. - - 4. För att verifiera att filen togs emot, gå tillbaka och notera att det nu - finns två kopior av Lektion 1.5.3, orginalet och filversionen. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKTION 1.5 SAMMANFATTNING - - - 1. :!kommando kör ett externt kommando. - - Några användbara exempel är: - (MS-DOS) (Unix) - :!dir :!ls - visar en kataloglistning. - :!del FILNAMN :!rm FILNAMN - tar bort filen FILNAMN. - - 2. :w FILNAMN sparar den aktuella Vim-filen med namnet FILNAMN. - - 3. :#,#w FILNAMN sparar raderna # till # i filen FILNAMN. - - 4. :r FILNAMN tar emot filen FILNAMN och infogar den i den aktuella filen - efter markören. - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.1: ÖPPNA-KOMMANDOT - - - ** Skriv o för att öppna en rad under markören och placera dig i - Infoga-läge. ** - - 1. Flytta markören till raden nedan markerad --->. - - 2. Skriv o (litet o) för att öppna upp en rad NEDANFÖR markören och placera - dig i Infoga-mode. - - 3. Kopiera nu raden markerad ---> och tryck för att avsluta - Infoga-läget. - ----> Efter du skrivit o placerad markören på en öppen rad i Infoga-läge. - - 4. För att öppna upp en rad OVANFÖR markören, skriv ett stort O , istället - för ett litet o. Pröva detta på raden nedan. -Öppna upp en rad ovanför denna genom att trycka Shift-O när markören står här. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.2: LÄGG TILL-KOMMANDOT - - - ** Skriv a för att infoga text EFTER markören. ** - - 1. Flytta markören till slutet av den första raden nedan markerad ---> genom - att skriv $ i Normal-läge. - - 2. Skriv ett a (litet a) för att lägga till text EFTER tecknet under - markören. (Stort A lägger till i slutet av raden.) - -Notera: Detta undviker att behöva skriva i , det sista tecknet, texten att - infoga, , högerpil, och slutligen, x, bara för att lägga till i - slutet på en rad! - - 3. Gör nu färdigt den första raden. Notera också att lägga till är likadant - som Infoga-läge, enda skillnaden är positionen där texten blir infogad. - ----> Här kan du träna ----> Här kan du träna på att lägga till text i slutet på en rad. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.3: EN ANNAN VERSION AV ERSÄTT - - - ** Skriv ett stort R för att ersätta fler än ett tecken. ** - - 1. Flytta markören till den första raden nedan markerad --->. - - 2. Placera markören vid början av det första ordet som är annorlunda jämfört - med den andra raden markerad ---> (ordet "sista"). - - 3. Skriv nu R och ersätt resten av texten på den första raden genom att - skriva över den gamla texten så att den första raden blir likadan som - den andra. - ----> För att få den första raden lika som den sista, använd tangenterna. ----> För att få den första raden lika som den andra, skriv R och den nya texten. - - 4. Notera att när du trycker för att avsluta, så blir eventuell - oförändrad text kvar. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lektion 1.6.4: SÄTT FLAGGOR - - ** Sätt en flagga så att en sökning eller ersättning ignorerar storlek ** - - 1. Sök efter "ignore" genom att skriva: - /ignore - Repetera flera gånger genom att trycka på n-tangenten - - 2. Sätt 'ic' (Ignore Case) flaggan genom att skriva: - :set ic - - 3. Sök nu efter "ignore" igen genom att trycka: n - Repeat search several more times by hitting the n key - - 4. Sätt 'hlsearch' and 'incsearch' flaggorna: - :set hls is - - 5. Skriv nu in sök-kommandot igen, och se vad som händer: - /ignore - - 6. För att ta bort framhävningen av träffar, skriv - :nohlsearch -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKTION 1.6 SAMMANFATTNING - - - 1. Genom att skriva o öpnnas en rad NEDANFÖR markören och markören placeras - på den öppna raden i Infoga-läge. - Genom att skriva ett stort O öppnas raden OVANFÖR raden som markören är - på. - - 2. Skriv ett a för att infoga text EFTER tecknet som markören står på. - Genom att skriva ett stort A läggs text automatiskt till i slutet på - raden. - - 3. Genom att skriva ett stort R hamnar du i Ersätt-läge till trycks - för att avsluta. - - 4. Genom att skriva ":set xxx" sätts flaggan "xxx" - - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - LEKTION 1.7: ON-LINE HJÄLP-KOMMANDON - - - ** Använd on-line hjälpsystemet ** - - Vim har ett omfattande on-line hjälpsystem. För att komma igång pröva ett av - dessa tre: - - tryck tangenten (om du har någon) - - tryck tangenten (om du har någon) - - skriv :help - - Skriv :q för att stränga hjälpfönstret. - - Du kan hitta hjälp om nästan allting, genom att ge ett argument till - ":help" kommandot. Pröva dessa (glöm inte att trycka ): - - :help w - :help c_ - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.tr.utf-8 b/runtime/tutor/tutor1.tr similarity index 100% rename from runtime/tutor/tutor1.tr.utf-8 rename to runtime/tutor/tutor1.tr diff --git a/runtime/tutor/tutor1.tr.iso9 b/runtime/tutor/tutor1.tr.iso9 deleted file mode 100644 index 16be720664..0000000000 --- a/runtime/tutor/tutor1.tr.iso9 +++ /dev/null @@ -1,987 +0,0 @@ -================================================================================ -= V I M T u t o r ' a h o � g e l d i n i z ! -- S�r�m 1.7 = -================================================================================ - - Vim, b�yle bir e�itmen ile a��klanmas� gereken �ok fazla komut bar�nd�ran, - olduk�a kuvvetli bir metin d�zenleyicidir. Bu e�itmen Vim'i �ok ama�l� bir - d�zenleyici olarak kolayl�kla kullanabilece�iniz yeterli say�da komutu - a��klamak i�in tasarlanm��t�r. - - E�itmeni tamamlama s�resi yapaca��n�z denemelere ba�l� olarak 25-30 - dakikad�r. - - D�KKAT: - Derslerdeki komutlar bu metni de�i�tirecektir. �zerinde �al��mak i�in - bu dosyan�n bir kopyas�n� al�n (e�er "vimtutor" uygulamas�n� - �al��t�rd�ysan�z zaten bir kopyas�n� alm�� oldunuz). - - Bu e�itmenin kullanarak ��retmek i�in tasarland���n� unutmamak �nemlidir. - Bu �u anlama gelir; komutlar� ��renmek i�in do�ru bir �ekilde �al��t�rma- - n�z gerekir. E�er sadece yaz�lanlar� okursan�z komutlar� unutursunuz. - - �imdi Caps Lock d��menizin bas�l� olmad���na emin olun ve Ders 1.1.1'in - ekran� tamamen doldurmas� i�in j d��mesine yeterli miktarda bas�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.1.1: �MLEC� HAREKET ETT�RMEK - - -�evirmen Notu: T�m derslerde g�rd���n�zde bu d��meye bas�n. - - ** �mleci hareket ettirmek i�in h,j,k,l d��melerine bas�n. ** - ^ - k �pucu: h d��mesi soldad�r ve sola do�ru hareket eder. - < h l > l d��mesi sa�dad�r ve sa�a do�ru hareket eder. - j j d��mesi a�a�� do�ru bir oka benzer. - v - - 1. �mleci kendinizi rahat hissedinceye dek ekranda dola�t�r�n. - - 2. j d��mesine bas�n ve ekran�n a�a��ya kayd���n� g�r�n. - - 3. A�a�� d��mesini kullanarak, Ders 1.1.2'ye ge�in. - - NOT: E�er yazd���n�z bir �eyden emin de�ilseniz Normal kipe ge�mek i�in - d��mesine bas�n. Daha sonra istedi�iniz komutu yeniden yaz�n. - - NOT: Ok d��meleri de ayn� i�e yarar. Ancak hjkl d��melerini kullanarak �ok - daha h�zl� hareket edebilirsiniz. Ger�ekten. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.1.2: V�M'DEN �IKI� - - - !! NOT: A�a��daki ad�mlar� yapmadan �nce, bu dersi tamamen okuyun. - - 1. Normal kipte oldu�unuzdan emin olmak i�in d��mesine bas�n. - - 2. :q! yaz�n ve 'a bas�n'. - Bu d�zenleyiciden ��kar ve yapt���n�z de�i�iklikleri KAYDETMEZ. - - 3. vimtutor yazarak yeniden bu belgeyi a��n. - - 4. E�er bu ad�mlar� ezberlediyseniz ve kendinizden eminseniz, 1'den 3'e - kadar olan ad�mlar� yeniden uygulay�n. - - NOT: :q! , yapt���n�z t�m de�i�iklikleri atar. Birka� ders sonra, - de�i�iklikleri dosyaya kaydetmeyi ��reneceksiniz. - - 5. �mleci Ders 1.1.3'e ta��y�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.1.3: MET�N D�ZENLEME - MET�N S�LME - - - ** Normal kipteyken imlecin alt�ndaki karakteri silmek i�in x'e bas�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� sat�ra g�t�r�n. - - 2. D�zeltmeler i�in imleci silinmesi gereken karakterin �zerine getirin. - - 3. �stenmeyen karakteri silmek i�in x d��mesine bas�n. - - 4. T�mce d�zelene kadar 2'den 4'e kadar olan ad�mlar� tekrar edin. - ----> �inek ayy�n �zzerinden attlad�. - - 5. �imdi sat�r d�zeldi; Ders 1.1.4'e ge�in. - - NOT: Bu e�itmende ilerledik�e ezberlemeye �al��may�n, deneyerek ��renin. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.1.4: MET�N D�ZENLEME - MET�N G�RME - - - ** Normal kipteyken metin eklemek i�in i'ye bas�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� �LK sat�ra g�t�r�n. - - 2. �lk sat�r� ikincisinin ayn�s� gibi yapmak i�in, imleci eklenmesi - gereken metinden sonraki ilk karakterin �zerine g�t�r�n. - - 3. i'ye bas�n ve gerekli eklemeleri yap�n. - - 4. D�zeltilen her hatadan sonra d��mesine basarak Normal kipe d�n�n. - T�mceyi d�zeltmek i�in 2'den 4'e kadar olan ad�mlar� tekrar edin. - ----> Bu metinde eksk. ----> Bu metinde bir �ey eksik. - - 5. Art�k yapabildi�inizi d���n�yorsan�z bir sonraki b�l�me ge�in. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.1.5: MET�N D�ZENLEME - MET�N EKLEME - - - ** Metin eklemek i�in A d��mesine bas�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� �LK sat�ra g�t�r�n. �mlecin hangi - karakterin �zerinde oldu�u �nemli de�ildir. - - 2. A'ya bas�n ve gerekli eklemeleri yap�n. - - 3. Metin eklemeyi bitirdi�inizde 'ye bas�n ve Normal kipe d�n�n. - - 4. �mleci a�a��da ---> ile imlenmi� �K�NC� sat�ra g�t�r�n ve ikinci ve - ���nc� ad�mlar� tekrarlayarak t�mceyi d�zeltin. - ----> Bu sat�rda baz� met - Bu sat�rda baz� metinler eksik. ----> Bu sat�rda da baz� metinl - Bu sat�rda da baz� metinler eksik gibi g�r�n�yor. - - 5. Art�k rahat�a metin ekleyebildi�inizi d���n�yorsan�z Ders 1.1.6'ya ge�in. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.1.6: DOSYA D�ZENLEME - - - ** :wq yazmak a��k olan dosyay� kaydeder ve Vim'den ��kar. - - !! NOT: A�a��daki ad�mlar� uygulamadan �nce t�m bu b�l�m� iyice okuyun! - - 1. Bu e�itmeni Ders 1.1.2'de yapt���n�z gibi :q! yazarak kapat�n. Veya ba�ka - bir u�birime eri�iminiz varsa orada yap�n. - - 2. Komut istemi ekran�nda �u komutu girin: vim tutor . 'vim', Vim - d�zenleyicisini a�mak i�in kullanaca��n�z komut olup 'tutor' da - d�zenlemek istedi�iniz dosyan�n ad�d�r. De�i�tirilebilen bir dosya - kullan�n. - - 3. Daha �nceki derslerde ��rendi�iniz gibi metin girip/ekleyip silin. - - 4. :wq yazarak de�i�iklikleri kaydedin ve Vim'den ��k�n. - - 5. E�er vimtutor'dan birinci ad�mda ��kt�ysan�z yeniden a��n ve a�a��daki - �zet b�l�me gelin. - - 6. Yukar�daki ad�mlar� okuduktan ve anlad�ktan sonra YAPIN. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.1: �ZET - - - 1. �mle� ok d��meleri veya hjkl d��meleri kullan�larak hareket ettirilir. - - h (sol) / j (a�a��) / k (yukar�) / l (sa�) - - 2. Vim'i komut isteminden ba�latmak i�in: - - vim - veya - vim DOSYA_ADI kullan�n. - - 3. Vim'den ��kmak i�in �nce 'ye bas�p sonra: - - :q! (de�i�iklikleri kaydetmeden ��kar) - :wq (de�i�iklikleri kaydedip ��kar) komutlar�n� kullan�n. - - 4. �mlecin �zerinde oldu�u karakteri silmek i�in x d��mesine bas�n. - - 5. Metin girmek veya eklemek i�in: - - i metin girin imle�ten �nce girer - A metin girin sat�rdan sonra ekler - - NOT: d��mesine basmak sizi Normal kipe geri d�nd�r�r veya istenmeyen - veya yar�m yaz�lm�� bir komutu iptal eder. - - �imdi Ders 1.2 ile bu e�itmeni s�rd�r�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.2.1: S�LME KOMUTLARI - - - ** Bir s�zc��� silmek i�in dw yaz�n. ** - - 1. Normal kipte oldu�unuzdan emin olmak i�in d��mesine bas�n. - - 2. �mleci a�a��da ---> ile imlenmi� sat�ra g�t�r�n. - - 3. �mleci silinmesi gereken s�zc���n ba��na g�t�r�n. - - 4. S�zc��� silmek i�in dw yaz�n. - - NOT: d harfi siz yazd�k�a ekran�n son sat�r�nda g�r�lecektir. Vim sizin w - yazman�z� bekleyecektir. E�er d'den ba�ka bir �ey g�r�rseniz yanl�� - yazm��s�n�z demektir, d��mesine bas�n ve ba�tan ba�lay�n. - ----> Bu sat�rda �erez t�mceye ait olmayan leblebi s�zc�kler var. - - 5. T�mce d�zelene kadar ad�m 3 ve 4'� tekrar edin ve Ders 1.2.2'ye ge�in. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.2.2: DAHA FAZLA S�LME KOMUTLARI - - - ** Sat�r� sonuna kadar silmek i�in d$ yaz�n. ** - - 1. Normal kipte oldu�unuzdan emin olmak i�in d��mesine bas�n. - - 2. �mleci a�a��da ---> ile imlenmi� sat�ra g�t�r�n. - - 3. �mleci do�ru olan sat�r�n sonuna g�t�r�n. (Birinci noktadan SONRAK�) - - 4. Sat�r� en sona kadar silmek i�in d$ yaz�n. $ imini yazmak i�in: - - T�rk�e Q klavyede 4, - T�rk�e F klavyede 4 ikililerini kullan�n. - ----> Birileri bu sat�r�n sonunu iki defa yazm��. sat�r�n sonunu iki - defa yazm��. - - 5. Neler oldu�unu anlamak i�in Ders 1.2.3'e gidin. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.2.3: ��LE�LER VE HAREKETLER - - - Metin de�i�tiren bir�ok komut i�le�ler ve eklerden olu�ur. Bir d i�leci - i�eren silme komutu i�in kullan�lan bi�im a�a��daki gibidir: - - d hareket - - Burada: - - d - silme i�lecidir. - hareket - i�lecin neyi i�letece�idir (a�a��da listelenmi�tir). - - Hareketlerin k�sa bir listesi i�in: - - w - bir sonraki s�zc���n ba�lang�c�na kadar, ilk karakteri DAH�L OLMADAN - e - �u anki s�zc���n sonuna kadar, son karakteri DAH�L OLARAK - $ - sat�r�n sonuna kadar, son karakteri DAH�L OLARAK - - Demeli ki, de komutunu girmek imle�ten s�zc���n sonuna kadar siler. - - NOT: Normal kipte hi�bir hareket olmadan yaln�zca i�leci girmek imleci - yukar�da belirtildi�i gibi hareket ettirir. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.2.4: B�R HAREKET �LE B�RL�KTE SAYIM KULLANMAK - - - ** Bir hareketten �nce say� kullanmak o hareketi say�ca tekrarlat�r. ** - - 1. �mleci a�a��da ---> ile imlenmi� sat�r�n BA�INA g�t�r�n. - - 2. 2w yazarak imleci iki s�zc�k ileriye ta��y�n. - - 3. 3e yazarak imleci �� s�zc�k ilerideki s�zc���n sonuna ta��y�n. - - 4. 0 yazarak imleci sat�r�n ba��na ta��y�n. - - 5. �kinci ve ���nc� ad�mlar� de�i�ik say�lar kullanarak tekrarlay�n. - ----> Bu �zerinde hoplay�p z�playabilece�iniz na�izane bir sat�r. - - 6. Ders 1.2.5'e ge�in. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.2.5: B�R SAYIM KULLANARAK DAHA FAZLA S�LME ��LEM� - - - ** Bir i�le� ile birlikte say� kullanmak i�leci o kadar tekrarlat�r. ** - - Yukar�da s�z� edilen silme i�leci ve hareketinin aras�na say� ekleyerek - yap�lan i�lemi o say� kadar tekrarlatabilirsiniz. - - d [say�] hareket - - 1. �mleci a�a��da ---> ile imlenen sat�rdaki ilk B�Y�K HARFTEN olu�an - s�zc���n ba��na getirin. - - 2. d2w yazarak iki B�Y�K HARFL� s�zc��� silin. - - 3. Birinci ve ikinci ad�mlar� ba�ka bir say� kullanarak B�Y�K - HARFL� s�zc�kleri tek bir komutta silmek i�in yeniden uygulay�n. - ----> Bu ABC �DE sat�rdaki FG� HI� JKLM NO� PRS�T s�zc�kler U� VY temizlenmi�tir. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.2.6: SATIRLARDA ��LEM YAPMA - - - ** B�t�n bir sat�r� silmek i�in dd yaz�n. ** - - B�t�n bir sat�r silme i�lemi �ok s�k kullan�ld���ndan dolay�, Vi - tasar�mc�lar� bir sat�r� tamamen silmek i�in iki d yazman�n daha kolay - oldu�una karar vermi�ler. - - 1. �mleci a�a��daki t�mceci�in ikinci sat�r�na g�t�r�n. - - 2. Sat�r� silmek i�in dd yaz�n. - - 3. �imdi de d�rd�nc� sat�ra gidin. - - 4. �ki sat�r� birden silmek i�in 2dd yaz�n. - ----> 1) G�ller k�rm�z�d�r, ----> 2) �amur e�lenceli, ----> 3) Menek�eler mavi, ----> 4) Bir arabam var, ----> 5) Saat zaman� s�yler, ----> 6) �eker tatl�d�r ----> 7) Ve sen de �ylesin - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.2.7: GER� AL KOMUTU - - - ** Komutu geri almak i�in u, b�t�n bir sat�r� d�zeltmek i�in U yaz�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� sat�rda ve ilk hatan�n �zerine koyun. - - 2. �lk istenmeyen karakteri silmek i�in x yaz�n. - - 3. �imdi son �al��t�r�lan komutu geri almak i�in u yaz�n. - - 4. Bu sefer x komutunu kullanarak sat�rdaki t�m hatalar� d�zeltin. - - 5. �imdi sat�r� ilk haline �evirmek i�in b�y�k U yaz�n. - - 6. �imdi U ve daha �nceki komutlar� geri almak i�in birka� defa u yaz�n. - - 7. Birka� defa R ('yi bas�l� tutarken R ye bas�n) yazarak - geri almalar� da geri al�n. - ----> Buu sat��rdaki hatalar� d��zeltinn ve sonra koomutu geri alll�n. - - 8. Bunlar son derece kullan��l� komutlard�r. �imdi Ders 1.2 �zete ge�in. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.2: �ZET - - - 1. �mle�ten itibaren bir s�zc��� silmek i�in dw yaz�n. - - 2. �mle�ten itibaren bir s�zc���n sonuna kadar silmek i�in de yaz�n. - - 3. �mle�ten itibaren bir sat�r� silmek i�in d$ yaz�n. - - 4. B�t�n bir sat�r� silmek i�in dd yaz�n. - - 5. Bir hareketi yenilemek i�in �n�ne say� tak�s� getirin, 2w gibi. - - 6. Normal kipte bir komut bi�imi ��yledir: - - i�le� [say�] hareket - - burada: - i�le� - ne yap�laca��, silmek i�in d �rne�inde oldu�u gibi - [say�] - komutun ka� kere tekrar edece�ini g�steren iste�e ba�l� say� - hareket - i�lecin nice davranaca��; w (s�zc�k), e (s�zc�k sonu), - $ (sat�r sonu) gibi - - 7. Bir sat�r�n ba��na gelmek i�in s�f�r (0) kullan�n. - - 8. �nceki hareketleri geri almak i�in u (k���k u) yaz�n. - Bir sat�rdaki t�m de�i�iklikleri geri almak i�in U (b�y�k U) yaz�n. - Geri almalar� geri almak i�in R kullan�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.3.1: KOY KOMUTU - - - ** Son yapt���n�z silmeyi imle�ten sonraya yerle�tirmek i�in p yaz�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� t�mceci�e g�t�r�n. - - 2. Sat�r� silip Vim'in arabelle�ine yerle�tirmek i�in dd yaz�n. - - 3. �mleci, silinmi� sat�r� nereye yerle�tirmek istiyorsan�z, o sat�r�n - �ZER�NE g�t�r�n. - - 4. Normal kipteyken sat�r� yerle�tirmek i�in p yaz�n. - - 5. T�m sat�rlar� do�ru s�raya koymak i�in 2'den 4'e kadar olan ad�mlar� - tekrar edin. - ----> d) Sen de ��rendin mi? ----> b) Menek�eler mavidir, ----> c) Ak�l ��renilir, ----> a) G�ller k�rm�z�d�r, - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.3.2: DE���T�R KOMUTU - - - ** �mlecin alt�ndaki karakteri ba�kas� ile de�i�tirmek i�in rx yap�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� �LK sat�ra g�t�r�n. - - 2. �mleci sat�rdaki ilk hatan�n �zerine g�t�r�n. - - 3. Hatay� d�zeltmek i�in �nce r ard�ndan da do�ru karakteri yaz�n. - - 4. �lk sat�r d�zelene kadar ad�m 2 ve 3'� tekrar edin. - ----> Bu sat�v yaz�l�vken, bivileri yaml�� d��metere basm��. ----> Bu sat�r yaz�l�rken, birileri yanl�� d��melere basm��. - - 5. Ders 1.3.3'ye ge�in. - - NOT: Unutmay�n, ezberleyerek de�il deneyerek ��renin. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.3.3: DE���T�R ��LEC� - - - ** Bir s�zc��� imle�ten s�zc�k sonuna kadar de�i�tirmek i�in ce yap�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� �LK sat�ra g�t�r�n. - - 2. �mleci "sutar" daki u'nun �zerine yerle�tirin. - - 3. �nce ce ard�ndan do�ru harfleri girin (bu durumda 'at�r'). - - 4. d��mesine bas�n ve de�i�mesi gereken bir sonraki karaktere gidin. - - 5. �lk c�mle ikincisiyle ayn� olana kadar ad�m 3 ve 4'� tekrar edin. - ----> Bu sutar de�i�tir komutu ile de�i�neli gereken birka� m�zg�� i�eriyor. ----> Bu sat�r de�i�tir komutu ile de�i�mesi gereken birka� s�zc�k i�eriyor. - - ce'nin sadece s�zc��� de�i�tirmedi�ini, ayn� zamanda sizi EKLE kipine - ald���na da dikkat edin. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.3.4: c'Y� KULLANARAK DAHA FAZLA DE���T�RME - - - ** De�i�tir i�leci sil komutu ile ayn� hareketlerle kullan�l�r. ** - - 1. De�i�tir i�leci sil ile ayn� yolla �al���r. Bi�im ��yledir: - - c [say�] hareket - - 2. Hareketler de ayn�d�r. �rne�in w (s�zc�k), $ (sat�r sonu) gibi. - - 3. �mleci a�a��da ---> ile imlenmi� �LK sat�ra g�t�r�n. - - 4. �mleci ilk hataya g�t�r�n. - - 5. Sat�r�n geri kalan k�sm�n� ikincisi gibi yapmak i�in c$ yaz�n ve daha - sonra d��mesine bas�n. - ----> Bu sat�r�n sonu d�zeltilmek i�in biraz yard�ma ihtiya� duyuyor. ----> Bu sat�r�n sonu d�zeltilmek i�in c$ komutu kullan�larak yard�ma ihtiya� - duyuyor. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.3: �ZET - - - 1. Silinmi� olan bir metni geri yerle�tirmek i�in p yaz�n. Bu silinmi� - metni imle�ten hemen SONRA geri yerle�tirir (e�er bir sat�r silinmi�se - hemen imlecin alt�ndaki sat�ra yerle�tirilecektir). - - 2. �mlecin alt�ndaki karakteri de�i�tirmek i�in �nce r ard�ndan da - yazmak istedi�iniz karakteri yaz�n. - - 3. De�i�tir i�leci belirlenen nesneyi, imle�ten hareketin sonuna kadar - de�i�tirme imkan� verir. �rne�in, bir s�zc��� imle�ten s�zc�k sonuna - kadar de�i�tirmek i�in cw, bir sat�r�n tamam�n� de�i�tirmek i�inse c$ - yaz�n. - - 4. De�i�tir i�in bi�im ��yledir: - - c [say�] hareket - - �imdi bir sonraki derse ge�in. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.4.1: �MLE� KONUMU VE DOSYA DURUMU - - -** G dosya i�erisindeki konumunuzu ve dosya durumunu g�sterir. Dosya - i�erisindeki bir sat�ra gitmek i�in G yaz�n. ** - - NOT: Ad�mlardan herhangi birini yapmadan �nce dersin tamam�n� okuyun! - - 1. d��mesini bas�l� tutun ve g'ye bas�n. Biz buna G diyoruz. - Dosyan�n sonunda dosya ad�n� ve bulundu�unuz konumu g�steren bir durum - sat�r� g�r�necektir. Ad�m 3 i�in sat�r numaras�n� unutmay�n. - - NOT: �mle� konumunu ekran�n sa� alt k��esinde g�rebilirsiniz. Bu 'ruler' - se�ene�i etkin oldu�unda g�r�l�r (bilgi i�in :help 'ruler' yaz�n). - - 2. Dosyan�n sonuna gitmek i�in G'ye bas�n. Dosyan�n ba��na gitmek i�in - gg komutunu kullan�n. - - 3. Daha �nce bulundu�unuz sat�r numaras�n� yaz�n ve daha sonra G'ye - bas�n. Bu sizi ilk g'ye bast���n�z sat�ra geri g�t�recektir. - - 4. Yapabilece�inizi d���nd���n�zde, ad�m 1'den 3'e kadar yap�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.4.2: ARAMA KOMUTU - - - ** Bir s�zc�k �be�ini aramak i�in / ve aranacak �be�i girin. ** - - 1. Normal kipteyken / yaz�n. / karakterinin ve imlecin ekran�n sonunda - g�r�nd���ne dikkat edin. - - 2. 'hatttaa' yaz�p 'a bas�n. Bu sizin aramak istedi�iniz s�zc�kt�r. - - 3. Ayn� s�zc�k �be�ini tekrar aramak i�in n yaz�n. - Ayn� s�zc�k �be�ini z�t y�nde aramak i�in N yaz�n. - - 4. E�er z�t y�ne do�ru bir arama yapmak istiyorsan�z / komutu yerine ? - komutunu kullan�n. - ----> "hatttaa" hatay� yazman�n do�ru yolu de�il; hatttaa bir hata. - -Not: Arama dosyan�n sonuna ula�t���nda dosyan�n ba��ndan s�recektir. Bunu - devre d��� b�rakmak i�in 'wrapscan' se�ene�ini s�f�rlay�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.4.3: UYAN AYRA�LAR ARAMASI - - - ** Uyan bir (, [ veya { bulmak i�in % yaz�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� sat�rda bir (, [ veya { imine g�t�r�n. - - 2. �imdi % karakterini yaz�n. - - 3. �mle� uyan ayrac�n �zerine gider. - - 4. Uyan ilk parantezin �zerine geri d�nmek i�in yine % yaz�n. - - 5. �mleci ba�ka bir (), [] veya {} �zerine g�t�r�n ve % i�lecinin neler - yapt���n� g�zlemleyin. - ----> Bu i�erisinde ( )'ler, ['ler ] ve {'ler } bulunan bir sat�rd�r. - - NOT: Bu i�erisinde e�i olmayan ayra�lar bulunan bir program�n hatalar�n� - ay�klamak i�in son derece yararl�d�r. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.4.4: BUL/DE���T�R KOMUTU - - - ** 'eski' yerine 'yeni' yerle�tirmek i�in :s/eski/yeni/g yaz�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� sat�ra g�t�r�n. - - 2. :s/buu/bu yaz�p 'a bas�n. Bu komutun sadece sat�rdaki ilk - uyan kar��la�may� d�zeltti�ine dikkat edin. - - 3. �imdi sat�rdaki t�m de�i�iklikleri bir anda yapmak i�in :s/buu/bu/g - yazarak t�m "buu" olu�umlar�n� de�i�tirin. - ----> Buu birinci, buu ikinci, buu ���nc� b�l�m. - - 4. �ki sat�r aras�ndaki t�m karakter katar� olu�umlar�n� de�i�tirmek i�in: - - :#,#s/eski/yeni/g yaz�n. #,# burada de�i�ikli�in yap�laca�� aral���n - sat�r numaralar�d�r. - :%s/eski/yeni/g yaz�n. Bu t�m dosyadaki her olu�umu de�i�tirir. - :%s/eski/yeni/gc yaz�n. Bu t�m dosyadaki her olu�umu de�i�tirir ancak - her birini de�i�tirmeden �nce bize sorar. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.4: �ZET - - - 1. G sizin dosyadaki konumunuzu ve dosya durumunu g�sterir. - G dosyan�n sonuna gider. - [say�] G belirtilen sat�r numaras�na gider. - gg ilk sat�ra gider. - - 2. S�zc�k �be�inden �nce / yazmak, �LER� y�nde o �be�i arat�r. - S�zc�k �be�inden �nce ? yazmak, GER� y�nde o �be�i arat�r. - Aramadan sonra, ayn� y�ndeki bir sonraki kar��la�may� bulmak i�in n, - veya z�t y�ndekini bulmak i�in N yaz�n. - O sizi eski konumlara, I daha yeni konumlara g�t�r�r. - - 3. �mle� bir (), [], {} ayrac� �zerindeyken % yazmak, uyan di�er e� - ayrac� bulur. - - 4. Sat�rdaki ilk 'eski'yi 'yeni' ile de�i�tirmek i�in :s/eski/yeni, - Sat�rdaki t�m 'eski'leri 'yeni' ile de�i�tirmek i�in :s/eski/yeni/g, - �ki sat�r aras�ndaki �bekleri de�i�tirmek i�in :#,#s/eski/yeni/g, - Dosyadaki t�m kar��la�malar� de�i�tirmek i�in :%s/eski/yeni/g yaz�n. - Her seferinde onay sormas� i�in :%s/eski/yeni/gc kullan�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.5.1: BIR DI� KOMUT �ALI�TIRMAK - - - ** Bir d�� komutu �al��t�rmak i�in :! ve ard�ndan d�� komutu yaz�n. ** - - 1. �mleci ekran�n alt�na g�t�rmek i�in : komutunu yaz�n. Bu size bir komut - yazma imkan� verir. - - 2. �imdi ! (�nlem) karakterini yaz�n. Bu size bir d�� komut �al��t�rma - olana�� verir. - - 3. �rnek olarak ! karakterini takiben ls yaz�n ve 'a bas�n. Bu size - o anda bulundu�unuz dizindeki dosyalar� g�sterecektir. Veya ls - �al��mazsa :!dir komutunu kullan�n. - - NOT: Herhangi bir d�� komutu bu yolla �al��t�rmak m�mk�nd�r. - - NOT: T�m : komutlar�ndan sonra d��mesine bas�lmal�d�r. Bundan - sonra bunu her zaman an�msatmayaca��z. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.5.2: DOSYA YAZMAYA DEVAM - - - ** Dosyaya yap�lan de�i�ikli�i kaydetmek i�in :w DOSYA_ADI yaz�n. ** - - 1. Bulundu�unuz dizini listelemek i�in :!dir veya :!ls yaz�n. - Komuttan sonra d��mesine basaca��n�z� zaten biliyorsunuz. - - 2. Mevcut olmayan bir dosya ad� se�in, �rne�in DENEME. - - 3. �imdi :w DENEME yaz�n (DENEME sizin se�ti�iniz dosya ad�d�r). - - 4. Bu t�m dosyay� (Vim Tutor) DENEME isminde ba�ka bir dosyaya yazar. - Bunu do�rulamak i�in, :!ls veya :!dir yaz�n ve yeniden bulundu�unuz - dizini listeleyin. - - NOT: E�er Vim'den ��k�p kaydetti�iniz DENEME dosyas�n� a�arsan�z, bunun - kaydetti�iniz vimtutor'un ger�ek bir kopyas� oldu�unu g�r�rs�n�z. - - 5. �imdi dosyay� �u komutlar� vererek silin: - Windows: :!del DENEME - Unix (macOS, Linux, Haiku): :!rm DENEME - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.5.3: YAZMA ���N MET�N SE�ME - - - ** Dosyan�n bir b�l�m�n� kaydetmek i�in, v hareket :w DOSYA_ADI yaz�n. ** - - 1. �mleci bu sat�r�n �zerine getirin. - - 2. v d��mesine basarak imleci a�a��daki be�inci ad�ma ta��y�n. Metnin - se�ildi�ine dikkat edin. - - 3. : karakterini yaz�n. Ekran�n alt k�sm�nda :'<'> ��kacakt�r. - - 4. w DENEME yaz�n; DENEME burada hen�z var olmayan bir dosyad�r. - d��mesine basmadan �nce :'<'>w DENEME g�rd���n�zden emin olun. - - 5. Vim se�ilen sat�rlar� DENEME dosyas�na yazacakt�r. :!ls veya :!dir ile - bakarak dosyay� g�r�n. Hen�z silmeyin; bir sonraki derste kullanaca��z. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.5.4: DOSYALARI B�RLE�T�RME VE B�L�M EKLEME - - - ** Bir dosyan�n i�eri�ini eklemek i�in :r DOSYA_ADI yaz�n. ** - - 1. �mleci bu sat�r�n hemen bir �st�ne koyun. - - NOT: �kinci ad�mdan sonra Ders 1.5.3'�n metnini g�receksiniz. - Sonras�nda A�A�I d��mesi ile bu derse geri gelin. - - 2. �imdi :r DENEME komutunu kullanarak DENEME dosyas�n� bu dosyan�n i�ine - getirin. Getirdi�iniz dosya imlecin hemen alt�na yerle�tirilir. - - 3. Dosyan�n getirildi�ini do�rulamak i�in YUKARI d��mesini kullanarak - Ders 1.5.3'�n iki adet kopyas� oldu�unu g�r�n, �zg�n s�r�m� ve kopyas�. - - NOT: Bu komutu kullanarak bir d�� komutun ��kt�s�n� da dosyan�n i�ine - koyabilirsiniz. �rne�in :r !ls yazmak ls komutunun verece�i ��kt�y� - dosyan�n i�inde hemen imlecin alt�ndaki sat�ra koyar. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.5: �ZET - - - 1. :!komut bir d�� komut �al��t�r�r. - Baz� yararl� �rnekler: - (MS-DOS) (Unix) - :!dir :!ls - bir dizini listeler. - :!del DOSYA :!rm DOSYA - DOSYA'y� siler. - - 2. :w DOSYA_ADI o anki Vim dosyas�n� diske DOSYA_ADI ile kaydeder. - - 3. v hareket :w DOSYA_ADI se�ilmi� sat�r aral���n� DOSYA_ADI ile kaydeder. - - 4. :r DOSYA_ADI imlecin alt�ndan ba�layarak DOSYA_ADI isimli dosyan�n - i�eri�ini ekler. - - 5. :r !dir veya !ls bu iki komutun (dosyalar� listeleme) i�eriklerini - okur ve dosyan�n i�ine yerle�tirir. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.6.1: A� KOMUTU - - - ** �mlecin a�a��s�na sat�r a�mak ve EKLE kipine ge�mek i�in o yaz�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� sat�ra g�t�r�n. - - 2. �mlecin a�a��s�na bir sat�r a�mak ve EKLE kipine ge�mek i�in o - (k���k harfle) yaz�n. - - 3. �imdi herhangi bir metin girin ve EKLE kipinden ��kmak i�in - d��mesine bas�n. - ----> o yazd�ktan sonra imle� EKLE kipinde a��lan sat�r�n �zerine gider. - - 4. �mlecin �zerinde bir sat�r a�mak i�in, yaln�zca b�y�k O yaz�n. Bunu - a�a��daki sat�rda deneyin. - ----> Bu sat�r�n �zerine bir sat�r a�mak i�in imle� bu sat�rdayken O yaz�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.6.2: EKLE KOMUTU - - - ** �mle�ten sonra metin eklemek i�in a yaz�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� sat�ra g�t�r�n. - - 2. �mle� sat�r�n sonuna gelinceye dek e d��mesine bas�n. - - 3. �mle�ten SONRA metin eklemek i�in a yaz�n. - - 4. �imdi ilk sat�r� ikincisi gibi tamamlay�n. EKLE kipinden ��kmak i�in - d��mesine bas�n. - - 5. e d��mesini kullanarak bir sonraki yar�m s�zc��e gidin ve ad�m 3 ve 4'� - tekrarlay�n. - ----> Bu sat� �al��abilirsiniz. �al� met ekl ----> Bu sat�rda �al��abilirsiniz. �al���rken metin eklemeyi kullan�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.6.3: B�R BA�KA DE���T�R KOMUTU - - - ** Birden fazla karakter de�i�tirmek i�in b�y�k R yaz�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� �LK sat�ra g�t�r�n. �mleci ilk xxx'in - ba��na getirin. - - 2. �imdi R d��mesine bas�n ve ikinci sat�rdaki say�y� ilk sat�rdaki xxx'in - yerine yaz�n. - - 3. d��mesine basarak DE���T�R kipinden ��k�n. Sat�r�n geri kalan�n�n - de�i�medi�ini g�zlemleyin. - - 4. Kalan xxx'i de de�i�tirmek i�in ad�mlar� tekrarlay�n. - ----> 123 say�s�na xxx eklemek size yyy toplam�n� verir. ----> 123 say�s�na 456 eklemek size 579 toplam�n� verir. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.6.4: MET�N KOPYALA VE YAPI�TIR - - - ** y i�lecini kullanarak metin kopyalay�n ve p kullanarak yap��t�r�n. ** - - 1. �mleci a�a��da ---> ile imlenmi� sat�ra getirin, "a)"n�n ard�na koyun. - - 2. v ile G�RSEL kipe ge�in ve imleci "ilk" s�zc���n�n �ncesine getirin. - - 3. y d��mesine basarak se�ili metni kopyalay�n. - - 4. �mleci bir sonraki sat�r�n sonuna j$ ile getirin. - - 5. p d��mesine basarak metni yap��t�r�n. Akabinde d��mesine bas�n. - - 6. G�RSEL kipe ge�erek "�ge" s�zc���n� se�in, y ile kopyalay�n, j$ ile - ikinci sat�r�n sonuna gidin ve p ile s�zc��� yap��t�r�n. - ----> a) Bu ilk �ge ----> b) - - NOT: y komutunu bir i�le� olarak da kullanabilirsiniz; yw komutu yaln�zca - bir s�zc��� kopyalar. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.6.5: SET KOMUTU - - - ** Arama veya de�i�tirme i�lemlerinin b�y�k/k���k harf durumunu g�rmezden - gelmesi i�in SET komutunu kullan�n. - - 1. 'yoksay' s�zc���n� aramak i�in /ignore yaz�n. Bunu n d��mesine basarak - birka� kez yenileyin. - - 2. :set ic yazarak 'ic' (B�Y�K/k���k harf yoksay) ayar�n� se�in. - - 3. Yeniden n d��mesine basarak 'yoksay' s�zc���n� aramay� s�rd�r�n. Art�k - YOKSAY ve yoksay �rneklerinin de bulundu�unu g�zlemleyin. - - 4. :set hls is yazarak 'hlsearch' ve 'incsearch' ayarlar�n� se�in. - - 5. /ignore yazarak arama komutunu tekrar verin ve ne olaca��n� g�r�n. - - 6. B�Y�K/k���k harf ayr�ms�z arama ayar�n� kapatmak i�in :set noic yaz�n. - - NOT: Sonu�lar�n ekranda vurgulanmas�n� istemiyorsan�z :nohlsearch yaz�n. - NOT: E�er yaln�zca bir arama i�lemi i�in B�Y�K/k���k harf ayr�ms�z arama - yapmak istiyorsan�z /ignore\c komutunu kullan�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - DERS 1.6 �ZET - - - 1. o komutu imlecin alt�nda bir sat�r a�ar ve imleci bu a��lm�� sat�ra - EKLE kipinde yerle�tirir. - O komutu imlecin �zerinde bir sat�r a�ar. - - 2. a komutu imle�ten sonra metin giri�ine olanak verir. - A komutu ge�erli sat�r�n sonuna giderek metin giri�ine olanak verir. - - 3. e komutu imleci bir s�zc���n sonuna ta��r. - - 4. y i�leci metni kopyalar, p i�leci yap��t�r�r. - - 5. R komutu DE���T�R kipine girer ve 'ye bas�lana kadar kal�r. - - 6. ":set xxx" yazmak "xxx" se�ene�ini ayarlar. Baz� se�enekler: - 'ic' 'ignorecase' B�Y�K/k���k harf ayr�m�n� arama yaparken kapat�r. - 'is' 'incsearch' Bir arama metninin t�m uyan k�s�mlar�n� g�sterir. - 'hls' 'hlsearch' Uyan sonu�lar�n �zerini vurgular. - Ayarlama yaparken ister k�sa ister uzun s�r�mleri kullanabilirsiniz. - - 7. Bir ayar� kapatmak i�in "no" ekleyin, �rne�in :set noic. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.7.1: YARDIM KAYNAKLARI - - - ** �evrimi�i yard�m sistemini kullan�n ** - - Vim geni� bir �evrimi�i yard�m sistemine sahiptir. Ba�lamak i�in �u ���n� - deneyebilirsiniz: - - - (e�er varsa) d��mesine bas�n - - (e�er varsa) d��mesine bas�n - - :help yaz�n ve d��mesine bas�n - - Yard�m penceresindeki metinleri okuyarak yard�m sisteminin nas�l - �al��t���n� ��renin. - Bir pencereden di�erine ge�mek i�in W ikilisini kullan�n. - Yard�m penceresini kapatmak i�in :q yaz�p d��mesine bas�n. - - ":help" komutuna de�i�ken (arg�man) vererek herhangi bir konu hakk�nda - yard�m alabilirsiniz. �unlar� deneyin: - - :help w - :help c_ D - :help insert-index - :help user-manual - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.7.2: B�R BA�LANGI� BET��� OLU�TURUN - - - ** Vim'in �zelliklerine bak�n ** - - Vim Vi'dan �ok daha fazla �zelli�e sahiptir fakat bir�o�u �ntan�ml� olarak - kapal�d�r. Daha fazla �zellik kullanabilmek i�in bir "vimrc" dosyas� - olu�turmal�s�n�z. - - 1. "vimrc" dosyas�n� d�zenlemeye ba�lay�n. ��letim sistemlerine g�re: - - :e ~/.vimrc Unix i�in - :e ~/_vimrc Windows i�in - - 2. �imdi �rnek "vimrc" dosyas� i�eri�ini okuyun: - - :r $VIMRUNTIME/vimrc_example.vim - - 3. Dosyay� :w ile kaydedin. - - Vim'i bir sonraki �al��t�r�lmas�nda s�zdizim vurgulamas� kullanacakt�r. - T�m tercih etti�iniz ayarlar� bu "vimrc" dosyas�na ekleyebilirsiniz. - Daha fazla bilgi i�in :help vimrc-intro yaz�n. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.7.3: TAMAMLAMA - - - ** D ve ile komut istemi ekran�nda tamamlama ** - - 1. :set nocp komutunu kullanarak Vim'in uyumlu kipte olmad���ndan - emin olun. - - 2. Bulundu�unuz dizindeki dosyalara :!ls veya :!dir ile bak�n. - - 3. Bir komutun ba� k�sm�n� yaz�n, �rne�in :e. - - 4. D'ye bast���n�zda Vim size e ile ba�layan komutlar� - g�sterecektir. - - 5. d kulland���n�zda Vim komutu kendinden :edit olarak - tamamlayacakt�r. - - 6. �imdi bir bo�luk ekleyin ve var olan bir dosyan�n ba� harflerini yaz�n. - �rne�in :edit DOS. - - 7. d��mesine bas�n. E�er yaln�zca bu dosyadan bir tane varsa Vim - sizin i�in dosya ad�n�n geri kalan�n� tamamlayacakt�r. - - NOT: Tamamlama bir�ok komut i�in �al���r. Yaln�zca D ve - ikililerini deneyin. �zellikle :help i�in �ok yararl�d�r. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Ders 1.7: �ZET - - - 1. :help yazmak veya veya d��melerine basmak yard�m - penceresini a�ar. - - 2. :help cmd yazarak cmd hakk�nda bilgi sahibi olabilirsiniz. - - 3. W kullanarak ba�ka pencerelere ge�ebilirsiniz. - - 4. :q kullanarak yard�m penceresini kapatabilirsiniz. - - 5. Bir vimrc ba�lang�� beti�i olu�turarak ye�lenen ayarlar�n�z� - saklayabilirsiniz. - - 6. Bir : komutu girerken D'ye basarak olanakl� tamamlama - se�eneklerini g�rebilirsiniz. 'a basarak tamamlamay� se�in. - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - B�ylece Vim E�itmeni tamamlanm�� oldu. E�itmendeki ama� Vim d�zenleyicisi - hakk�nda k�sa bir bilgi vermek ve onu kolayca kullanman�z� sa�lamakt�. - Vim'in tamam�n� ��retmek �ok zordur zira Vim bir�ok komuta sahiptir. - Bundan sonra ":help user-manual" komutu ile kullan�c� k�lavuzunu - okumal�s�n�z. - - Daha fazla okuma ve �al��ma i�in �u kitab� �neriyoruz: - - Vim - Vi Improved - by Steve Oualline - Publisher: New Riders - - T�m�yle Vim i�in haz�rlanm�� ilk kitapt�r. �zellikle ilk kullan�c�lar i�in - �ok uygundur. - Kitapta bir�ok �rnek ve resim bulunmaktad�r. - https://iccf-holland.org/click5.html adresine bakabilirsiniz. - - Bu kitap daha eskidir ve Vim'den daha �ok Vi i�indir ancak tavsiye edilir: - - Learning the Vi Editor - by Linda Lamb - Publisher: O'Reilly & Associates Inc. - - Vi hakk�nda bilmek isteyece�iniz neredeyse her �eyin bulundu�u bir kitap. - 6. Bas�m ayn� zamanda Vim hakk�nda da bilgi i�ermektedir. - - Bu e�itmen Michael C. Pierce ve Robert K. Ware taraf�ndan yaz�ld�, - Charles Smith taraf�ndan sa�lanan fikirlerle Colorado School Of Mines, - Colorado State University. E-posta: bware@mines.colorado.edu - - Vim i�in de�i�tiren: Bram Moolenaar - - T�rk�e �eviri: - Serkan "heartsmagic" �al�� (2005), adresimeyaz (at) yahoo (dot) com - - 2019 g�ncellemesi: - Emir SARI, bitigchi (at) me (dot) com - - ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.uk.utf-8 b/runtime/tutor/tutor1.uk similarity index 100% rename from runtime/tutor/tutor1.uk.utf-8 rename to runtime/tutor/tutor1.uk diff --git a/runtime/tutor/tutor1.utf-8 b/runtime/tutor/tutor1.utf-8 deleted file mode 100644 index 04b490f0c9..0000000000 --- a/runtime/tutor/tutor1.utf-8 +++ /dev/null @@ -1,974 +0,0 @@ -=============================================================================== -= W e l c o m e t o t h e V I M T u t o r - Version 1.7 = -=============================================================================== -= C H A P T E R ONE = -=============================================================================== - - Vim is a very powerful editor that has many commands, too many to - explain in a tutor such as this. This tutor is designed to describe - enough of the commands that you will be able to easily use Vim as - an all-purpose editor. - The approximate time required to complete the tutor is 30 minutes, - depending upon how much time is spent with experimentation. - - ATTENTION: - The commands in the lessons will modify the text. Make a copy of this - file to practice on (if you started "vimtutor" this is already a copy). - - It is important to remember that this tutor is set up to teach by - use. That means that you need to execute the commands to learn them - properly. If you only read the text, you will forget the commands! - Now, make sure that your Caps-Lock key is NOT depressed and press - the j key enough times to move the cursor so that lesson 1.1.1 - completely fills the screen. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.1: MOVING THE CURSOR - - - ** To move the cursor, press the h,j,k,l keys as indicated. ** - ^ - k Hint: The h key is at the left and moves left. - < h l > The l key is at the right and moves right. - j The j key looks like a down arrow. - v - 1. Move the cursor around the screen until you are comfortable. - - 2. Hold down the down key (j) until it repeats. - Now you know how to move to the next lesson. - - 3. Using the down key, move to lesson 1.1.2. - -NOTE: If you are ever unsure about something you typed, press to place - you in Normal mode. Then retype the command you wanted. - -NOTE: The cursor keys should also work. But using hjkl you will be able to - move around much faster, once you get used to it. Really! - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.2: EXITING VIM - - - !! NOTE: Before executing any of the steps below, read this entire lesson!! - - 1. Press the key (to make sure you are in Normal mode). - - 2. Type: :q! . - This exits the editor, DISCARDING any changes you have made. - - 3. Get back here by executing the command that got you into this tutor. That - might be: vimtutor - - 4. If you have these steps memorized and are confident, execute steps - 1 through 3 to exit and re-enter the editor. - -NOTE: :q! discards any changes you made. In a few lessons you - will learn how to save the changes to a file. - - 5. Move the cursor down to lesson 1.1.3. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.3: TEXT EDITING - DELETION - - - ** Press x to delete the character under the cursor. ** - - 1. Move the cursor to the line below marked --->. - - 2. To fix the errors, move the cursor until it is on top of the - character to be deleted. - - 3. Press the x key to delete the unwanted character. - - 4. Repeat steps 2 through 4 until the sentence is correct. - ----> The ccow jumpedd ovverr thhe mooon. - - 5. Now that the line is correct, go on to lesson 1.1.4. - -NOTE: As you go through this tutor, do not try to memorize, learn by usage. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.4: TEXT EDITING - INSERTION - - - ** Press i to insert text. ** - - 1. Move the cursor to the first line below marked --->. - - 2. To make the first line the same as the second, move the cursor on top - of the character BEFORE which the text is to be inserted. - - 3. Press i and type in the necessary additions. - - 4. As each error is fixed press to return to Normal mode. - Repeat steps 2 through 4 to correct the sentence. - ----> There is text misng this . ----> There is some text missing from this line. - - 5. When you are comfortable inserting text move to lesson 1.1.5. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.5: TEXT EDITING - APPENDING - - - ** Press A to append text. ** - - 1. Move the cursor to the first line below marked --->. - It does not matter on what character the cursor is in that line. - - 2. Press A and type in the necessary additions. - - 3. As the text has been appended press to return to Normal mode. - - 4. Move the cursor to the second line marked ---> and repeat - steps 2 and 3 to correct this sentence. - ----> There is some text missing from th - There is some text missing from this line. ----> There is also some text miss - There is also some text missing here. - - 5. When you are comfortable appending text move to lesson 1.1.6. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1.6: EDITING A FILE - - ** Use :wq to save a file and exit. ** - - !! NOTE: Before executing any of the steps below, read this entire lesson!! - - 1. If you have access to another terminal, do the following there. - Otherwise, exit this tutor as you did in lesson 1.1.2: :q! - - 2. At the shell prompt type this command: vim file.txt - 'vim' is the command to start the Vim editor, 'file.txt' is the name of - the file you wish to edit. Use the name of a file that you can change. - - 3. Insert and delete text as you learned in the previous lessons. - - 4. Save the file with changes and exit Vim with: :wq - - 5. If you have quit vimtutor in step 1 restart the vimtutor and move down to - the following summary. - - 6. After reading the above steps and understanding them: do it. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.1 SUMMARY - - - 1. The cursor is moved using either the arrow keys or the hjkl keys. - h (left) j (down) k (up) l (right) - - 2. To start Vim from the shell prompt type: vim FILENAME - - 3. To exit Vim type: :q! to trash all changes. - OR type: :wq to save the changes. - - 4. To delete the character at the cursor type: x - - 5. To insert or append text type: - i type inserted text insert before the cursor - A type appended text append after the line - -NOTE: Pressing will place you in Normal mode or will cancel - an unwanted and partially completed command. - -Now continue with lesson 1.2. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.1: DELETION COMMANDS - - - ** Type dw to delete a word. ** - - 1. Press to make sure you are in Normal mode. - - 2. Move the cursor to the line below marked --->. - - 3. Move the cursor to the beginning of a word that needs to be deleted. - - 4. Type dw to make the word disappear. - - NOTE: The letter d will appear on the last line of the screen as you type - it. Vim is waiting for you to type w . If you see another character - than d you typed something wrong; press and start over. - ----> There are a some words fun that don't belong paper in this sentence. - - 5. Repeat steps 3 and 4 until the sentence is correct and go to lesson 1.2.2. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.2: MORE DELETION COMMANDS - - - ** Type d$ to delete to the end of the line. ** - - 1. Press to make sure you are in Normal mode. - - 2. Move the cursor to the line below marked --->. - - 3. Move the cursor to the end of the correct line (AFTER the first . ). - - 4. Type d$ to delete to the end of the line. - ----> Somebody typed the end of this line twice. end of this line twice. - - - 5. Move on to lesson 1.2.3 to understand what is happening. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.3: ON OPERATORS AND MOTIONS - - - Many commands that change text are made from an operator and a motion. - The format for a delete command with the d delete operator is as follows: - - d motion - - Where: - d - is the delete operator. - motion - is what the operator will operate on (listed below). - - A short list of motions: - w - until the start of the next word, EXCLUDING its first character. - e - to the end of the current word, INCLUDING the last character. - $ - to the end of the line, INCLUDING the last character. - - Thus typing de will delete from the cursor to the end of the word. - -NOTE: Pressing just the motion while in Normal mode without an operator will - move the cursor as specified. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.4: USING A COUNT FOR A MOTION - - - ** Typing a number before a motion repeats it that many times. ** - - 1. Move the cursor to the start of the line below marked --->. - - 2. Type 2w to move the cursor two words forward. - - 3. Type 3e to move the cursor to the end of the third word forward. - - 4. Type 0 (zero) to move to the start of the line. - - 5. Repeat steps 2 and 3 with different numbers. - ----> This is just a line with words you can move around in. - - 6. Move on to lesson 1.2.5. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.5: USING A COUNT TO DELETE MORE - - - ** Typing a number with an operator repeats it that many times. ** - - In the combination of the delete operator and a motion mentioned above you - insert a count before the motion to delete more: - d number motion - - 1. Move the cursor to the first UPPER CASE word in the line marked --->. - - 2. Type d2w to delete the two UPPER CASE words. - - 3. Repeat steps 1 and 2 with a different count to delete the consecutive - UPPER CASE words with one command. - ----> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.6: OPERATING ON LINES - - - ** Type dd to delete a whole line. ** - - Due to the frequency of whole line deletion, the designers of Vi decided - it would be easier to simply type two d's to delete a line. - - 1. Move the cursor to the second line in the phrase below. - 2. Type dd to delete the line. - 3. Now move to the fourth line. - 4. Type 2dd to delete two lines. - ----> 1) Roses are red, ----> 2) Mud is fun, ----> 3) Violets are blue, ----> 4) I have a car, ----> 5) Clocks tell time, ----> 6) Sugar is sweet ----> 7) And so are you. - -Doubling to operate on a line also works for operators mentioned below. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2.7: THE UNDO COMMAND - - - ** Press u to undo the last commands, U to fix a whole line. ** - - 1. Move the cursor to the line below marked ---> and place it on the - first error. - 2. Type x to delete the first unwanted character. - 3. Now type u to undo the last command executed. - 4. This time fix all the errors on the line using the x command. - 5. Now type a capital U to return the line to its original state. - 6. Now type u a few times to undo the U and preceding commands. - 7. Now type CTRL-R (keeping CTRL key pressed while hitting R) a few times - to redo the commands (undo the undos). - ----> Fiix the errors oon thhis line and reeplace them witth undo. - - 8. These are very useful commands. Now move on to the lesson 1.2 Summary. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.2 SUMMARY - - 1. To delete from the cursor up to the next word type: dw - 2. To delete from the cursor up to the end of the word type: de - 3. To delete from the cursor to the end of a line type: d$ - 4. To delete a whole line type: dd - - 5. To repeat a motion prepend it with a number: 2w - 6. The format for a change command is: - operator [number] motion - where: - operator - is what to do, such as d for delete - [number] - is an optional count to repeat the motion - motion - moves over the text to operate on, such as w (word), - e (end of word), $ (end of the line), etc. - - 7. To move to the start of the line use a zero: 0 - - 8. To undo previous actions, type: u (lowercase u) - To undo all the changes on a line, type: U (capital U) - To undo the undos, type: CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.1: THE PUT COMMAND - - - ** Type p to put previously deleted text after the cursor. ** - - 1. Move the cursor to the first line below marked --->. - - 2. Type dd to delete the line and store it in a Vim register. - - 3. Move the cursor to the c) line, ABOVE where the deleted line should go. - - 4. Type p to put the line below the cursor. - - 5. Repeat steps 2 through 4 to put all the lines in correct order. - ----> d) Can you learn too? ----> b) Violets are blue, ----> c) Intelligence is learned, ----> a) Roses are red, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.2: THE REPLACE COMMAND - - - ** Type rx to replace the character at the cursor with x . ** - - 1. Move the cursor to the first line below marked --->. - - 2. Move the cursor so that it is on top of the first error. - - 3. Type r and then the character which should be there. - - 4. Repeat steps 2 and 3 until the first line is equal to the second one. - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. Now move on to lesson 1.3.3. - -NOTE: Remember that you should be learning by doing, not memorization. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.3: THE CHANGE OPERATOR - - - ** To change until the end of a word, type ce . ** - - 1. Move the cursor to the first line below marked --->. - - 2. Place the cursor on the u in lubw. - - 3. Type ce and the correct word (in this case, type ine ). - - 4. Press and move to the next character that needs to be changed. - - 5. Repeat steps 3 and 4 until the first sentence is the same as the second. - ----> This lubw has a few wptfd that mrrf changing usf the change operator. ----> This line has a few words that need changing using the change operator. - -Notice that ce deletes the word and places you in Insert mode. - cc does the same for the whole line. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3.4: MORE CHANGES USING c - - - ** The change operator is used with the same motions as delete. ** - - 1. The change operator works in the same way as delete. The format is: - - c [number] motion - - 2. The motions are the same, such as w (word) and $ (end of line). - - 3. Move the cursor to the first line below marked --->. - - 4. Move the cursor to the first error. - - 5. Type c$ and type the rest of the line like the second and press . - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - -NOTE: You can use the Backspace key to correct mistakes while typing. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.3 SUMMARY - - - 1. To put back text that has just been deleted, type p . This puts the - deleted text AFTER the cursor (if a line was deleted it will go on the - line below the cursor). - - 2. To replace the character under the cursor, type r and then the - character you want to have there. - - 3. The change operator allows you to change from the cursor to where the - motion takes you. eg. Type ce to change from the cursor to the end of - the word, c$ to change to the end of a line. - - 4. The format for change is: - - c [number] motion - -Now go on to the next lesson. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.1: CURSOR LOCATION AND FILE STATUS - - ** Type CTRL-G to show your location in the file and the file status. - Type G to move to a line in the file. ** - - NOTE: Read this entire lesson before executing any of the steps!! - - 1. Hold down the Ctrl key and press g . We call this CTRL-G. - A message will appear at the bottom of the page with the filename and the - position in the file. Remember the line number for Step 3. - -NOTE: You may see the cursor position in the lower right corner of the screen - This happens when the 'ruler' option is set (see :help 'ruler' ) - - 2. Press G to move you to the bottom of the file. - Type gg to move you to the start of the file. - - 3. Type the number of the line you were on and then G . This will - return you to the line you were on when you first pressed CTRL-G. - - 4. If you feel confident to do this, execute steps 1 through 3. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.2: THE SEARCH COMMAND - - - ** Type / followed by a phrase to search for the phrase. ** - - 1. In Normal mode type the / character. Notice that it and the cursor - appear at the bottom of the screen as with the : command. - - 2. Now type 'errroor' . This is the word you want to search for. - - 3. To search for the same phrase again, simply type n . - To search for the same phrase in the opposite direction, type N . - - 4. To search for a phrase in the backward direction, use ? instead of / . - - 5. To go back to where you came from press CTRL-O (Keep Ctrl down while - pressing the letter o). Repeat to go back further. CTRL-I goes forward. - ----> "errroor" is not the way to spell error; errroor is an error. -NOTE: When the search reaches the end of the file it will continue at the - start, unless the 'wrapscan' option has been reset. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.3: MATCHING PARENTHESES SEARCH - - - ** Type % to find a matching ),], or } . ** - - 1. Place the cursor on any (, [, or { in the line below marked --->. - - 2. Now type the % character. - - 3. The cursor will move to the matching parenthesis or bracket. - - 4. Type % to move the cursor to the other matching bracket. - - 5. Move the cursor to another (,),[,],{ or } and see what % does. - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - - -NOTE: This is very useful in debugging a program with unmatched parentheses! - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4.4: THE SUBSTITUTE COMMAND - - - ** Type :s/old/new/g to substitute 'new' for 'old'. ** - - 1. Move the cursor to the line below marked --->. - - 2. Type :s/thee/the . Note that this command only changes the - first occurrence of "thee" in the line. - - 3. Now type :s/thee/the/g . Adding the g flag means to substitute - globally in the line, change all occurrences of "thee" in the line. - ----> thee best time to see thee flowers is in thee spring. - - 4. To change every occurrence of a character string between two lines, - type :#,#s/old/new/g where #,# are the line numbers of the range - of lines where the substitution is to be done. - Type :%s/old/new/g to change every occurrence in the whole file. - Type :%s/old/new/gc to find every occurrence in the whole file, - with a prompt whether to substitute or not. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.4 SUMMARY - - - 1. CTRL-G displays your location in the file and the file status. - G moves to the end of the file. - number G moves to that line number. - gg moves to the first line. - - 2. Typing / followed by a phrase searches FORWARD for the phrase. - Typing ? followed by a phrase searches BACKWARD for the phrase. - After a search type n to find the next occurrence in the same direction - or N to search in the opposite direction. - CTRL-O takes you back to older positions, CTRL-I to newer positions. - - 3. Typing % while the cursor is on a (,),[,],{, or } goes to its match. - - 4. To substitute new for the first old in a line type :s/old/new - To substitute new for all 'old's on a line type :s/old/new/g - To substitute phrases between two line #'s type :#,#s/old/new/g - To substitute all occurrences in the file type :%s/old/new/g - To ask for confirmation each time add 'c' :%s/old/new/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.1: HOW TO EXECUTE AN EXTERNAL COMMAND - - - ** Type :! followed by an external command to execute that command. ** - - 1. Type the familiar command : to set the cursor at the bottom of the - screen. This allows you to enter a command-line command. - - 2. Now type the ! (exclamation point) character. This allows you to - execute any external shell command. - - 3. As an example type ls following the ! and then hit . This - will show you a listing of your directory, just as if you were at the - shell prompt. Or use :!dir if ls doesn't work. - -NOTE: It is possible to execute any external command this way, also with - arguments. - -NOTE: All : commands must be finished by hitting - From here on we will not always mention it. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.2: MORE ON WRITING FILES - - - ** To save the changes made to the text, type :w FILENAME ** - - 1. Type :!dir or :!ls to get a listing of your directory. - You already know you must hit after this. - - 2. Choose a filename that does not exist yet, such as TEST. - - 3. Now type: :w TEST (where TEST is the filename you chose.) - - 4. This saves the whole file (the Vim Tutor) under the name TEST. - To verify this, type :!dir or :!ls again to see your directory. - -NOTE: If you were to exit Vim and start it again with vim TEST , the file - would be an exact copy of the tutor when you saved it. - - 5. Now remove the file by typing (Windows): :!del TEST - or (Unix): :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.3: SELECTING TEXT TO WRITE - - - ** To save part of the file, type v motion :w FILENAME ** - - 1. Move the cursor to this line. - - 2. Press v and move the cursor to the fifth item below. Notice that the - text is highlighted. - - 3. Press the : character. At the bottom of the screen :'<,'> will appear. - - 4. Type w TEST , where TEST is a filename that does not exist yet. Verify - that you see :'<,'>w TEST before you press . - - 5. Vim will write the selected lines to the file TEST. Use :!dir or :!ls - to see it. Do not remove it yet! We will use it in the next lesson. - -NOTE: Pressing v starts Visual selection. You can move the cursor around - to make the selection bigger or smaller. Then you can use an operator - to do something with the text. For example, d deletes the text. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5.4: RETRIEVING AND MERGING FILES - - - ** To insert the contents of a file, type :r FILENAME ** - - 1. Place the cursor just above this line. - -NOTE: After executing Step 2 you will see text from lesson 1.5.3. Then move - DOWN to see this lesson again. - - 2. Now retrieve your TEST file using the command :r TEST where TEST is - the name of the file you used. - The file you retrieve is placed below the cursor line. - - 3. To verify that a file was retrieved, cursor back and notice that there - are now two copies of lesson 1.5.3, the original and the file version. - -NOTE: You can also read the output of an external command. For example, - :r !ls reads the output of the ls command and puts it below the - cursor. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.5 SUMMARY - - - 1. :!command executes an external command. - - Some useful examples are: - (Windows) (Unix) - :!dir :!ls - shows a directory listing. - :!del FILENAME :!rm FILENAME - removes file FILENAME. - - 2. :w FILENAME writes the current Vim file to disk with name FILENAME. - - 3. v motion :w FILENAME saves the Visually selected lines in file - FILENAME. - - 4. :r FILENAME retrieves disk file FILENAME and puts it below the - cursor position. - - 5. :r !dir reads the output of the dir command and puts it below the - cursor position. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.1: THE OPEN COMMAND - - - ** Type o to open a line below the cursor and place you in Insert mode. ** - - 1. Move the cursor to the first line below marked --->. - - 2. Type the lowercase letter o to open up a line BELOW the cursor and place - you in Insert mode. - - 3. Now type some text and press to exit Insert mode. - ----> After typing o the cursor is placed on the open line in Insert mode. - - 4. To open up a line ABOVE the cursor, simply type a capital O , rather - than a lowercase o. Try this on the line below. - ----> Open up a line above this by typing O while the cursor is on this line. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.2: THE APPEND COMMAND - - - ** Type a to insert text AFTER the cursor. ** - - 1. Move the cursor to the start of the first line below marked --->. - - 2. Press e until the cursor is on the end of li . - - 3. Type an a (lowercase) to append text AFTER the cursor. - - 4. Complete the word like the line below it. Press to exit Insert - mode. - - 5. Use e to move to the next incomplete word and repeat steps 3 and 4. - ----> This li will allow you to pract appendi text to a line. ----> This line will allow you to practice appending text to a line. - -NOTE: a, i and A all go to the same Insert mode, the only difference is where - the characters are inserted. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.3: ANOTHER WAY TO REPLACE - - - ** Type a capital R to replace more than one character. ** - - 1. Move the cursor to the first line below marked --->. Move the cursor to - the beginning of the first xxx . - - 2. Now press R and type the number below it in the second line, so that it - replaces the xxx . - - 3. Press to leave Replace mode. Notice that the rest of the line - remains unmodified. - - 4. Repeat the steps to replace the remaining xxx. - ----> Adding 123 to xxx gives you xxx. ----> Adding 123 to 456 gives you 579. - -NOTE: Replace mode is like Insert mode, but every typed character deletes an - existing character. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.4: COPY AND PASTE TEXT - - ** Use the y operator to copy text and p to paste it ** - - 1. Move to the line below marked ---> and place the cursor after "a)". - - 2. Start Visual mode with v and move the cursor to just before "first". - - 3. Type y to yank (copy) the highlighted text. - - 4. Move the cursor to the end of the next line: j$ - - 5. Type p to put (paste) the text. Then type: a second . - - 6. Use Visual mode to select " item.", yank it with y , move to the end of - the next line with j$ and put the text there with p . - ----> a) this is the first item. - b) - - NOTE: You can also use y as an operator: yw yanks one word, - yy yanks the whole line, then p puts that line. -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6.5: SET OPTION - - - ** Set an option so a search or substitute ignores case ** - - 1. Search for 'ignore' by entering: /ignore - Repeat several times by pressing n . - - 2. Set the 'ic' (Ignore case) option by entering: :set ic - - 3. Now search for 'ignore' again by pressing n - Notice that Ignore and IGNORE are now also found. - - 4. Set the 'hlsearch' and 'incsearch' options: :set hls is - - 5. Now type the search command again and see what happens: /ignore - - 6. To disable ignoring case enter: :set noic - -NOTE: To remove the highlighting of matches enter: :nohlsearch -NOTE: If you want to ignore case for just one search command, use \c - in the phrase: /ignore\c -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.6 SUMMARY - - 1. Type o to open a line BELOW the cursor and start Insert mode. - Type O to open a line ABOVE the cursor. - - 2. Type a to insert text AFTER the cursor. - Type A to insert text after the end of the line. - - 3. The e command moves to the end of a word. - - 4. The y operator yanks (copies) text, p puts (pastes) it. - - 5. Typing a capital R enters Replace mode until is pressed. - - 6. Typing ":set xxx" sets the option "xxx". Some options are: - 'ic' 'ignorecase' ignore upper/lower case when searching - 'is' 'incsearch' show partial matches for a search phrase - 'hls' 'hlsearch' highlight all matching phrases - You can either use the long or the short option name. - - 7. Prepend "no" to switch an option off: :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.7.1: GETTING HELP - - - ** Use the on-line help system ** - - Vim has a comprehensive on-line help system. To get started, try one of - these three: - - press the key (if you have one) - - press the key (if you have one) - - type :help - - Read the text in the help window to find out how the help works. - Type CTRL-W CTRL-W to jump from one window to another. - Type :q to close the help window. - - You can find help on just about any subject, by giving an argument to the - ":help" command. Try these (don't forget pressing ): - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.7.2: CREATE A STARTUP SCRIPT - - - ** Enable Vim features ** - - Vim has many more features than Vi, but most of them are disabled by - default. To start using more features you should create a "vimrc" file. - - 1. Start editing the "vimrc" file. This depends on your system: - :e ~/.vimrc for Unix - :e ~/_vimrc for Windows - - 2. Now read the example "vimrc" file contents: - :r $VIMRUNTIME/vimrc_example.vim - - 3. Write the file with: - :w - - The next time you start Vim it will use syntax highlighting. - You can add all your preferred settings to this "vimrc" file. - For more information type :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.7.3: COMPLETION - - - ** Command line completion with CTRL-D and ** - - 1. Make sure Vim is not in compatible mode: :set nocp - - 2. Look what files exist in the directory: :!ls or :!dir - - 3. Type the start of a command: :e - - 4. Press CTRL-D and Vim will show a list of commands that start with "e". - - 5. Type d and Vim will complete the command name to ":edit". - - 6. Now add a space and the start of an existing file name: :edit FIL - - 7. Press . Vim will complete the name (if it is unique). - -NOTE: Completion works for many commands. Just try pressing CTRL-D and - . It is especially useful for :help . - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 1.7 SUMMARY - - - 1. Type :help or press or to open a help window. - - 2. Type :help cmd to find help on cmd . - - 3. Type CTRL-W CTRL-W to jump to another window. - - 4. Type :q to close the help window. - - 5. Create a vimrc startup script to keep your preferred settings. - - 6. When typing a : command, press CTRL-D to see possible completions. - Press to use one completion. - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This concludes Chapter 1 of the Vim Tutor. Consider continuing with - Chapter 2. - - It was intended to give a brief overview of the Vim editor, just enough to - allow you to use the editor fairly easily. It is far from complete as Vim - has many many more commands. - - Read the user manual next: ":help user-manual". - - For further reading and studying, this book is recommended: - Vim - Vi Improved - by Steve Oualline - Publisher: New Riders - The first book completely dedicated to Vim. Especially useful for beginners. - There are many examples and pictures. - See https://iccf-holland.org/click5.html - - This book is older and more about Vi than Vim, but also recommended: - Learning the Vi Editor - by Linda Lamb - Publisher: O'Reilly & Associates Inc. - It is a good book to get to know almost anything you want to do with Vi. - The sixth edition also includes information on Vim. - - This tutorial was written by Michael C. Pierce and Robert K. Ware, - Colorado School of Mines using ideas supplied by Charles Smith, - Colorado State University. E-mail: bware@mines.colorado.edu. - - Modified for Vim by Bram Moolenaar. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.vi.utf-8 b/runtime/tutor/tutor1.vi similarity index 100% rename from runtime/tutor/tutor1.vi.utf-8 rename to runtime/tutor/tutor1.vi diff --git a/runtime/tutor/tutor1.zh.utf-8 b/runtime/tutor/tutor1.zh similarity index 100% rename from runtime/tutor/tutor1.zh.utf-8 rename to runtime/tutor/tutor1.zh diff --git a/runtime/tutor/tutor1.zh.big5 b/runtime/tutor/tutor1.zh.big5 deleted file mode 100644 index 6a4e2cb3bc..0000000000 --- a/runtime/tutor/tutor1.zh.big5 +++ /dev/null @@ -1,852 +0,0 @@ -=============================================================================== -= �w �� �\ Ū �m V I M �� �{ �n �w�w ���� 1.5 = -=============================================================================== - vim �O�@�Ө㦳�ܦh�R�O���\��D�`�j�j���s�边�C���_�g�T�A�b���е{���� - ���N�ԲӤ��ФF�C���е{���]�p�ؼЬO���z�@�ǥ��n���򥻩R�O�A�Ӵx���n�o - �ǩR�O�A�z�N����ܮe���Nvim���@�@�ӳq�Ϊ��U��s�边�ӨϥΤF�C - - �������е{�����e�j���ݭn25-30�����A���M�_�z�V�m���ɶ��C - - �C�@�`���R�O�ާ@�N�|��糧��C���˱z�_��媺�@�Ӱƥ��A�M��b�ƥ��W - �i��V�m(�p�G�z�O�q�L"vimtutor"�ӱҰʱе{���A���򥻤�N�w�g�O�ƥ��F)�C - - ���O�@�I�J���е{���]�p����O�b�ϥΤ��i��Dzߪ��C�]�N�O���A�z�ݭn�q�L - ����R�O�ӾDzߥ��̥��������T�Ϊk�C�p�G�z�u�O�\Ū�Ӥ��ާ@�A����z�i�� - �|�ܧֿ�ѳo�ǩR�O���I - - �n�F�A�{�b�нT�w�z��Shift-Lock(�j�p�g��w��)�٨S�����U�A�M�����L�W - ���r���� j �����h�����ƨӲ��ʥ��СA����Ĥ@�`�����e��������R���̹��C - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ@���Ĥ@�`�J���ʥ��� - - - ���� �n���ʥ��СA�Ш̷ӻ������O���U h�Bj�Bk�Bl ��C ���� - - ^ - k ���ܡJ h �����_����A�C�����U�N�|�V�����ʡC - < h l > l �����_�k��A�C�����U�N�|�V�k���ʡC - j j ��ݏ��ӫܶH�@��y�ݤ�V�¤U���b�Y�C - v - - 1. ���H�N�b�̹������ʥ��СA���ܱzı�o�ΪA����C - - 2. ���U�U����(j)�A����X�{���Э��_�U��C - ----> �{�b�z���Ӥw�g�Ƿ|�p�󲾰ʨ�U�@���a�C - - 3. �{�b�ШϥΤU����A�N���в��ʨ�Ĥ@���ĤG�`�C - -���ܡJ�p�G�z�����T�w�z�ҫ��U���r���A�Ы��U��^�쥿�`(Normal)�Ҧ��C - �M��A���q��L��J�z�Q�n���R�O�C - -���ܡJ�����������]�ॿ�`�u�@���C���O�ϥ�hjkl��A�b�ߺD����z�N����ֳt - �a�b�̹����|�B���ʥ��ФF�C - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ@���ĤG�`�JVIM���i�J�M�h�X - - - !! �S�O���ܡJ�q�о\Ū���㥻�@�`�����e�A�M��~�����H�U�����Ѫ��R�O�C - - 1. �Ы���(�o�O���F�T�O�z�B�b���`�Ҧ�)�C - - 2. �M���J�J :q! <�^��> - ----> �o�ؤ覡���h�X�s�边�����|�O�s�z�i�J�s�边�H�өҰ�����ʡC - �p�G�z�Q�O�s���A�h�X�A�п�J�J - :wq <�^��> - - 3. �p�G�z�ݨ�F�R�O�洣�ܲšA�п�J����a�z�^�쥻�е{���R�O�A���N�O�J - - vimtutor <�^��> - - �q�`���p�U�z�]�i�H�γo�ؤ覡�J - - vim tutor <�^��> - ----> �o�̪� 'vim' ���ܶi�Jvim�s�边�A�� 'tutor'�h�O�z�dzƭn�s�誺���C - - 4. �p�G�z�۫H�w�g�c�c�O���F�o�ǨB�J���ܡA�бq�B�J1�����B�J3�h�X�A�M - ��A���i�J�s�边�C���۱N���в��ʨ�Ĥ@���ĤT�`���~��ڭ̪��е{���ѡC - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ@���ĤT�`�J�奻�s�褧�R�� - - - ** �b���`(Normal)�Ҧ��U�A�i�H���U x ��ӧR�����ЩҦb��m���r�šC** - - 1. �бN���в��ʨ쥻�`���U���аO�� ---> �����@��C - - 2. ���F�ץ���J���~�A�бN���в��ܷdzƧR�����r�Ū���m�B�C - - 3. �M����U x ��N���~�r�ŧR�����C - - 4. ���_�B�J2��B�J4�A����y�l�ץ�����C - ----> The ccow jumpedd ovverr thhe mooon. - - 5. �n�F�A�Ӧ�w�g�ץ��F�A�U�@�`���e�O�Ĥ@���ĥ|�`�C - -�S�O���ܡJ�b�z�s�����е{�ɡA���n�j��O�СC�O���@�I�J�b�ϥΤ��DzߡC - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ@���ĥ|�`�J�奻�s�褧���J - - - ** �b���`�Ҧ��U�A�i�H���U i ��Ӵ��J�奻�C** - - 1. �бN���в��ʨ쥻�`���U���аO�� ---> ���Ĥ@��C - - 2. ���F�ϱo�Ĥ@�椺�e�p�P�_�ĤG��A�бN���в��ܤ奻�Ĥ@�Ӧr�ŷdzƴ��J - ����m�C - - 3. �M����U i ��A���ۿ�J���n���奻�r�šC - - 4. �Ҧ��奻�m�ץ������A�Ы��U ���^���`�Ҧ��C - ���_�B�J2�ܨB�J4�H�K�ץ��y�l�C - ----> There is text misng this . ----> There is some text missing from this line. - - 5. �p�G�z��奻���J�ާ@�w�g�ܺ��N�A�б��۾\Ū�U�����p���C - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ@���p�� - - - 1. ���Цb�̹��奻�������ʬJ�i�H�νb�Y��A�]�i�H�ϥ� hjkl �r����C - h (����) j (�U��) k (�W��) l (�k��) - - 2. ���i�Jvim�s�边(�q�R�O�洣�ܲ�)�A�п�J�Jvim ���W <�^��> - - 3. ���h�Xvim�s�边�A�п�J�H�U�R�O���Ҧ��ק�J - - :q! <�^��> - - �ΎͿ�J�H�U�R�O�O�s�Ҧ��ק�J - - :wq <�^��> - - 4. �b���`�Ҧ��U�R�����ЩҦb��m���r�šA�Ы��J x - - 5. �b���`�Ҧ��U�n�b���ЩҦb��m�}�l���J�奻�A�Ы��J - - i ��J���n�奻 - -�S�O���ܡJ���U ��|�a�z�^�쥿�`�Ҧ��Ύͨ����@�Ӥ�����Ύͳ������� -���R�O�C - -�n�F�A�Ĥ@���즹�����C�U�����U���~��ĤG�������e�C - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤG���Ĥ@�`�J�R�����R�O - - - ** ��J dw �i�H�q���гB�R���ܤ@�ӳ�r/����������C** - - 1. �Ы��U ��T�O�z�B�_���`�Ҧ��C - - 2. �бN���в��ʨ쥻�`���U���аO�� ---> �����@��C - - 3. �бN���в��ܷdzƭn�R����������}�l�C - - 4. ���ۿ�J dw �R�����ӳ���C - - �S�O���ܡJ�z�ҿ�J�� dw �|�b�z��J���P�ɥX�{�b�̹����̫�@��C�p�G�z�� - �J���~�A�Ы��U ������A�M�᭫�s�A�ӡC - ----> There are a some words fun that don't belong paper in this sentence. - - 5. ���_�B�J3�ܨB�J4�A���ܥy�l�ץ������C�����~��ĤG���ĤG�`���e�C - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤG���ĤG�`�J��L�R�����R�O - - - ** ��J d$ �q���e���ЧR����楽�C** - - 1. �Ы��U ��T�O�z�B�_���`�Ҧ��C - - 2. �бN���в��ʨ쥻�`���U���аO�� ---> �����@��C - - 3. �бN���в��ʨ�Ӧ檺����(�]�N�O�b�Ĥ@���I����.���᭱)�C - - 4. �M���J d$ �q���гB�R�ܷ��e������C - ----> Somebody typed the end of this line twice. end of this line twice. - - - 5. ���~��Dz߲ĤG���ĤT�`�N���D�O���^�ƤF�C - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤG���ĤT�`�J���_�R�O�M��H - - - �R���R�O d ���榡�p�U�J - - [number] d object �Ύ� d [number] object - - ��N�p�U�J - number - �N������R�O������(�i�ﶵ�A�ʬٳ]�m�� 1 )�C - d - �N���R���C - object - �N���R�O�ҭn�ާ@����H(�U������������)�C - - �@��²�u����H�C���J - w - �q���e���з��e��m�����r/��������A�]�A�Ů�C - e - �q���e���з��e��m�����r/��������A���O *��* �]�A�Ů�C - $ - �q���e���з��e��m������e�楽�C - -�S�O���ܡJ - ��_�i�_�����͡A�Цb���`�Ҧ��U���ȫ��N��������H����Ӥ��ϥΩR�O�A�h - �N�ݨ���Ъ����ʥ��p�W������H�C���ҥN�����@�ˡC - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤG���ĥ|�`�J��H�R�O���S�����p - - - ** ��J dd �i�H�R����@�ӷ��e��C ** - - ų�_���R�������W�סAVIM ���]�p�ͨM�w�n²�ƾ��R���A�Ȼݭn�b�P�@��W - �����⦸ d �N�i�H�R�������ЩҦb�����F�C - - 1. �бN���в��ʨ쥻�`���U�����u�y�q�������ĤG��C - 2. ��J dd �R���Ӧ�C - 3. �M�Ჾ�ʨ�ĥ|��C - 4. ���ۿ�J 2dd (�ٰO�o�e�����L�� number-command-object �ܡH) �R�����C - - 1) Roses are red, - 2) Mud is fun, - 3) Violets are blue, - 4) I have a car, - 5) Clocks tell time, - 6) Sugar is sweet - 7) And so are you. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤG���Ĥ��`�J�M�����R�O - - - ** ��J u �ӺM���̫���檺�R�O�A��J U �ӭץ����C** - - 1. �бN���в��ʨ쥻�`���U���аO�� ---> �����@��A�ñN��m�_�Ĥ@�ӿ��~ - �B�C - 2. ��J x �R���Ĥ@�Ӥ��Q�O�d���r���C - 3. �M���J u �M���̫���檺(�@��)�R�O�C - 4. �o���n�ϥ� x �ץ����檺�Ҧ����~�C - 5. �{�b��J�@�Ӥj�g�� U �A���_��Ӧ檺��l���A�C - 6. ���ۦh����J u �H�M�� U �H�Χ�e���R�O�C - 7. �M��h����J CTRL-R (�����U CTRL �䤣��}�A���ۿ�J R ��) �A�o�˴N - �i�H���枩�_�R�O�A�]�N�O�M�����M���R�O�C - ----> Fiix the errors oon thhis line and reeplace them witth undo. - - 8. �o�ǐm�O�D�`���Ϊ��R�O�C�U���O�ĤG�����p���F�C - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤG���p�� - - - 1. ���q���e���ЧR���ܳ�r/��������A�п�J�Jdw - - 2. ���q���e���ЧR���ܷ��e�楽���A�п�J�Jd$ - - 3. ���R�����A�п�J�Jdd - - 4. �b���`�Ҧ��U�@�өR�O���榡�O�J - - [number] command object �Ύ� command [number] object - ��N�O�J - number - �N�����O�R�O���檺���� - command - �N���n�����Ʊ��A��p d �N���R�� - object - �N���n�ާ@����H�A��p w �N����r/����A$ �N����楽�����C - $ (to the end of line), etc. - - 5. ���M���H�e���ާ@�A�п�J�Ju (�p�g��u) - ���M���b�@�椤�Ұ�����ʡA�п�J�JU (�j�g��U) - ���M���H�e���M���R�O�A���_�H�e���ާ@���G�A�п�J�JCTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤT���Ĥ@�`�J�m�J���R�O - - - ** ��J p �N�̫�@���R�������e�m�J���Ф��� ** - - 1. �бN���в��ʨ쥻�`���U���ܭS�q��������C - - 2. ��J dd �N�Ӧ�R���A�o�˷|�N�Ӧ�O�s��vim���w�R�Ϥ��C - - 3. ���۱N���в��ʨ�dzƸm�J����m���W��C�O���J�O�W��@�C - - 4. �M��b���`�Ҧ��U(��i�J)�A��J p �N�Ӧ��߶K�m�J�C - - 5. ���_�B�J2�ܨB�J4�A�N�Ҧ�����̧ǩ�m�쥿�T����m�W�C - - d) Can you learn too? - b) Violets are blue, - c) Intelligence is learned, - a) Roses are red, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤT���ĤG�`�J�������R�O - - - ** ��J r �M�@�Ӧr�Ŵ������ЩҦb��m���r�šC** - - 1. �бN���в��ʨ쥻�`���U���аO�� ---> ���Ĥ@��C - - 2. �в��ʥ��Ш�Ĥ@�ӿ��~���A����m�C - - 3. ���ۿ�J r �A�o�˴N��N���~�������F�C - - 4. ���_�B�J2�M�B�J3�A����Ĥ@��w�g�ק粒���C - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. �M��ڭ��~��ǮղĤT���ĤT�`�C - -�S�O���ܡJ���O�z�n�b�ϥΤ��DzߡA�Ӥ��O�b�O�Ф��DzߡC - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤT���ĤT�`�J������R�O - - - ** �n���ܤ@�ӳ�r/����������Ύͥ����A�п�J cw ** - - 1. �бN���в��ʨ쥻�`���U���аO�� ---> ���Ĥ@��C - - 2. ���ۧ���Щ�b��� lubw ���r�� u ����m���̡C - - 3. �M���J cw �N�i�H�ץ��ӳ���F(�b���ҳo�̬O��J ine �C) - - 4. �̫�� ��A�M����Щw���U�@�ӿ��~�Ĥ@�ӷdzƧ�諸�r���B�C - - 5. ���_�B�J3�M�B�J4�A����Ĥ@�ӥy�l�����p�P�ĤG�ӥy�l�C - ----> This lubw has a few wptfd that mrrf changing usf the change command. ----> This line has a few words that need changing using the change command. - -���ܡJ�Ъ`�N cw �R�O���ȶȬO�����F�@�ӳ���A�]���z�i�J�奻���J���A�F�C - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤT���ĥ|�`�J�ϥ�c���O����L������R�O - - - ** ��������O�i�H�ϥΦP�R�����R�O�ҨϥΪ���H�ѼơC** - - 1. ��������O���u�@�覡��R�����R�O�O�@�P���C�ާ@�榡�O�J - - [number] c object �Ύ� c [number] object - - 2. ��H�ѼƤ]�O�@�˪��A��p w �N����r/����A$�N���楽�����C - - 3. �бN���в��ʨ쥻�`���U���аO�� ---> ���Ĥ@��C - - 4. ���۱N���в��ʨ�Ĥ@�ӿ��~�B�C - - 5. �M���J c$ �ϱo�Ӧ�ѤU�������󥿱o�P�ĤG��@�ˡC�̫�� ��C - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤT���p�� - - - 1. �n���s�m�J�w�g�R�����奻���e�A�п�J�p�g�r�� p�C�Ӿާ@�i�H�N�w�R�� - ���奻���e�m�_���Ф���C�p�G�̫�@���R�����O�@�Ӿ��A����Ӧ�N�m - �_���e���ЩҦb�檺�U�@��C - - 2. �n�������ЩҦb��m���r�šA�п�J�p�g�� r �M�n���������m�r�Ū��s�r - �ŧY�i�C - - 3. ������R�O���\�z���ܫ��w����H�A�q���e���ЩҦb��m�����H�������C - ��p��J cw �i�H�������e���Ш��������������e�F��J c$ �i�H������ - �e���Ш�楽�����e�C - - 4. ������R�O���榡�O�J - - [number] c object �Ύ� c [number] object - -�U���ڭ��~��DzߤU�@���C - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĥ|���Ĥ@�`�J�w��Τ�󪬺A - - - ** ��J CTRL-g ��ܷ��e�s���󤤷��e���ЩҦb���m�H�Τ�󪬺A�H���C - ��J SHIFT-G �h����������󤤪��Y�@���w��C** - - ���ܡJ���O�n���qŪ���`���e�A����~�i�H����H�U�B�J!!! - - 1. ���U CTRL �䤣��}�M��� g ��C�M��N�|�ݨ쭶���̩����X�{�@�Ӫ��A�H - ����A��ܪ����e�O���e�s�誺���W�M����`��ơC�аO���B�J3���渹�C - - 2. ���U SHIFT-G ��i�H�ϱo���e���Ъ����������̫�@��C - - 3. ��J�z�����d���渹�A�M����U SHIFT-G�C�o�˴N�i�H��^��z�Ĥ@�����U - CTRL-g �ɩҦb����n�F�C�`�N�J��J�渹�ɡA�渹�O���|�b�̹��W��ܥX�� - ���C - - 4. �p�G�@�N�A�z�i�H�~�����B�J1�ܨB�J�T�C - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĥ|���ĤG�`�J�j�����R�O - - - ** ��J / �H�Χ��H���r�Ŧ�i�H�ΥH�b���e��󤤬d��Ӧr�Ŧ�C** - - 1. �b���`�Ҧ��U��J / �r�šC�z���ɷ|�`�N��Ӧr�ũM���Аm�|�X�{�b�̹��� - ���A�o�� : �R�O�O�@�˪��C - - 2. ���ۿ�J errroor <�^��>�C����errroor�N�O�z�n�d�䪺�r�Ŧ�C - - 3. �n�d��P�W�@�����r�Ŧ�A�u�ݭn�� n ��C�n�V�ۤϤ�V�d��P�W�@�����r - �Ŧ�A�п�J Shift-N �Y�i�C - - 4. �p�G�z�Q�f�V�d��r�Ŧ�A�Шϥ� ? �N�� / �i��C - ----> When the search reaches the end of the file it will continue at the start. - - "errroor" is not the way to spell error; errroor is an error. - - ���ܡJ�p�G�d��w�g��F��󥽧��A�d��|�۰ʱq����Y���~��d��C - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĥ|���ĤT�`�J�t��A�����d�� - - - ** �� % �i�H�d��t�諸�A�� )�B]�B}�C** - - 1. ����Щ�b���`�U���аO�� --> ���@�椤������@�� (�B[ �� { �B�C - - 2. ���۫� % �r�šC - - 3. ���ɥ��Ъ���m�����O�b�t�諸�A���B�C - - 4. �A���� % �N�i�H���^�t�諸�Ĥ@�ӬA���B�C - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - -���ܡJ�b�{�ǽոծɡA�o�ӥ\��ΨӬd�䤣�t�諸�A���O�ܦ��Ϊ��C - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĥ|���ĥ|�`�J�ץ����~����k���@ - - - ** ��J :s/old/new/g �i�H���� old �� new�C** - - 1. �бN���в��ʨ쥻�`���U���аO�� ---> �����@��C - - 2. ��J :s/thee/the <�^��> �C�Ъ`�N�өR�O�u���ܥ��ЩҦb�檺�Ĥ@�Ӥǰt - ��C - - 3. ��J :s/thee/the/g �h�O�������檺�ǰt��C - ----> the best time to see thee flowers is in thee spring. - - 4. �n������椧���X�{���C�Ӥǰt��A�п�J :#,#s/old/new/g (#,#�N�����O - ��檺�渹)�C��J :%s/old/new/g �h�O������Ӥ�󤤪��C�Ӥǰt��C - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĥ|���p�� - - - 1. Ctrl-g �Τ_��ܷ��e���ЩҦb��m�M��󪬺A�H���CShift-G �Τ_�N���и� - ��ܤ��̫�@��C���V�J�@�Ӧ渹�M��� Shift-G �h�O�N���в��ʦܸӦ� - ���N������C - - 2. ��J / �M����H�@�Ӧr�Ŧ�O�h�O�b���e�ҽs�誺���ɤ��V��d��Ӧr�Ŧ�C - ��J�ݸ� ? �M����H�@�Ӧr�Ŧ�O�h�O�b���e�ҽs�誺���ɤ��V�e�d��Ӧr - �Ŧ�C�����@���d�䤧��� n ��h�O���_�W�@�����R�O�A�i�b�P�@��V�W�d - ��U�@�Ӧr�Ŧ�Ҧb�F�Ύͫ� Shift-N �V�ۤϤ�V�d��U�Ӧr�Ŧ�Ҧb�C - - 3. �p�G���з��e��m�O�A��(�B)�B[�B]�B{�B}�A�� % �i�H�N���в��ʨ�t�諸 - �A���W�C - - 4. �b�@�椺�����Y�@�Ӧr�Ŧ� old ���s���r�Ŧ� new�A�п�J :s/old/new - �b�@�椺�����Ҧ����r�Ŧ� old ���s���r�Ŧ� new�A�п�J :s/old/new/g - �b��椺�����Ҧ����r�Ŧ� old ���s���r�Ŧ� new�A�п�J :#,#s/old/new/g - �b��󤺴����Ҧ����r�Ŧ� old ���s���r�Ŧ� new�A�п�J :%s/old/new/g - �i���������ɸ߰ݥΤ�T�{�C�Ӵ����ݲK�[ c �ﶵ�A�п�J :%s/old/new/gc - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����Ĥ@�`�J�b VIM ������~���R�O����k - - - ** ��J :! �M����H�ۿ�J�@�ӥ~���R�O�i�H����ӥ~���R�O�C** - - 1. ���U�ڭ̩Ҽ��x�� : �R�O�]�m���Ш�̹������C�o�˴N�i�H���z��J�R�O�F�C - - 2. ���ۿ�J�P�ĸ� ! �o�Ӧr�šA�o�˴N���\�z����~���� shell �R�O�F�C - - 3. �ڭ̥H ls �R�O���ҡC��J !ls <�^��> �C�өR�O�N�|�C�|�X�z���e�ؿ��� - ���e�A�N�p�P�z�b�R�O�洣�ܲŤU��J ls �R�O�����G�@�ˡC�p�G !ls �S�� - �@�ΡA�z�i�H�ո� :!dir �ݬݡC - ----> ���ܡJ �Ҧ����~���R�O�m�i�H�H�o�ؤ覡����C - ----> ���ܡJ �Ҧ��� : �R�O�m�����H <�^��> �i�סC - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����ĤG�`�J���_�O�s��󪺧�h�H�� - - - ** �n�N���󪺧�ʫO�s���󤤡A�п�J :w FILENAME ** - - 1. ��J :!dir �Ύ� :!ls �򪾷��e�ؿ������e�C�z�����w���D�̫��ٱo�V - <�^��> �a�C - - 2. ��ܤ@�ө|���s�b���W�A��p TEST �C - - 3. ���ۿ�J :w TEST (���B TEST �O�z�ҿ�ܪ����W�C) - - 4. �өR�O�|�H TEST �����W�O�s��Ӥ�� (VIM �е{)�C���F�T�O���T�O�s�A - �ЦA����J :!dir �d�ݱz���ؿ��C�����e�C - ----> �Ъ`�N�J�p�G�z�h�X VIM �M��b�H���W TEST ���Ѽƶi�J�A����Ӥ�� - �e���ӦP�z�O�s�ɪ���󤺮e�O�����@�˪��C - - 5. �{�b�z�i�H�q�L��J :!rm TEST �ӧR�� TEST ���F�C - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����ĤT�`�J�@�Ө㦳��ܩʪ��O�s�R�O - - - ** �n�O�s��󪺳������e�A�п�J :#,# w FILENAME ** - - 1. �A�Ӱ���@�� :!dir �Ύ� :!ls �򪾷��e�ؿ������e�A�M���ܤ@�ӦX�A�� - �����W�����W�A��p TEST �C - - 2. ���۱N���в��ʦܥ������̳��ݡA�M��� CTRL-g ���Ӧ檺�渹�C�O�ѤF - �渹�@�C - - 3. ���ۧ���в��ʦܥ������̩��ݡA�A���@�� CTRL-g �C�]�O�ѤF�o�Ӧ渹�@�C - - 4. ���F�u�O�s�峹���Y�ӳ����A�п�J :#,# w TEST �C�o�̪� #,# �N�O�W�� - �n�D�z�O�����渹(���ݦ渹,���ݦ渹)�A�� TEST �N�O��w�����W�C - - 5. �̫�A�� :!dir �T�{���O�_���T�O�s�C���O�o�����O�R�����C - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����ĥ|�`�J�����M�X�ä�� - - - ** �n�V���e��󤤴��J�t�~����󪺤��e�A�п�J :r FILENAME ** - - 1. ����J :!dir �T�{�z�e���Ыت� TEST ����٦b�C - - 2. �M��N���в��ʦܷ��e���������ݡC - -�S�O���ܡJ ����B�J3����z�N�ݨ�Ĥ����ĤT�`�A�Щ��ɦA���U���ʦ^��o�̨ӡC - - 3. ���۳q�L :r TEST �N�e���Ыت��W�� TEST ����󴣨��i�ӡC - -�S�O���ܡJ�z�Ҵ����i�Ӫ����N�q���ЩҦb��m�B�}�l�m�J�C - - 4. ���F�T�{���w�g�������\�A���ʥ��Ц^���Ӫ���m�N�i�H�`�N������� - �����ĤT�`�A�@���O�쥻�A�t�~�@���O�Ӧۤ�󪺰ƥ��C - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����p�� - - - 1. :!command �Τ_����@�ӥ~���R�O command�C - - �Ьݤ@�ǹ�ڨҤl�J - :!dir - �Τ_��ܷ��e�ؿ������e�C - :!rm FILENAME - �Τ_�R���W�� FILENAME �����C - - 2. :w FILENAME �i�N���e VIM �����b�s�誺���O�s��W�� FILENAME - ����󤤡C - - 3. :#,#w FILENAME �i�N���e�s����� # ��ܲ� # �檺���e�O�s���� - FILENAME ���C - - 4. :r FILENAME �i�����ϽL��� FILENAME �ñN�䴡�J����e��󪺥��Ц�m - �᭱�C - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����Ĥ@�`�J���}���R�O - - - ** ��J o �N�b���Ъ��U�襴�}�s���@��öi�J���J�Ҧ��C** - - 1. �бN���в��ʨ쥻�`���U���аO�� ---> �����@��C - - 2. ���ۿ�J�p�g�� o �b���� *�U��* ���}�s���@��öi�J���J�Ҧ��C - - 3. �M��_��аO�� ---> ����ë� ��h�X���J�Ҧ��Ӷi�J���`�Ҧ��C - ----> After typing o the cursor is placed on the open line in Insert mode. - - 4. ���F�b���� *�W��* ���}�s���@��A�u�ݭn��J�j�g�� O �Ӥ��O�p�g�� o - �N�i�H�F�C�Цb�U����դ@�U�a�C�����гB�b�b�Ӧ�W�ɡA�� Shift-O�i�H - �b�Ӧ�W��s�}�@��C - -Open up a line above this by typing Shift-O while the cursor is on this line. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����ĤG�`�J���Ыᴡ�J���R�O - - - ** ��J a �N�i�b���Ф��ᴡ�J�奻�C ** - - 1. �Цb���`�Ҧ��U�q�L��J $ �N���в��ʨ쥻�`���U���аO�� ---> ���Ĥ@�� - �������C - - 2. ���ۿ�J�p�g�� a �h�i�b���Ф��ᴡ�J�奻�F�C�j�g�� A �h�i�H�����b�� - �����J�奻�C - -���ܡJ��J�j�g A ���ާ@��k�i�H�b�楽���J�奻�A�קK�F��J i�A���Щw��� - �̫�@�Ӧr�šA��J���奻�A �^�_���`�Ҧ��A�b�Y�k�䲾�ʥ��ХH�� - x �R�����e���ЩҦb��m�r�ŵ����Ѧh�c�����ާ@�C - - 3. �ާ@����Ĥ@��N�i�H�ɥR����F�C�Ъ`�N���Ыᴡ�J�奻�P���J�Ҧ��O�� - �������@�P���A�u�O�奻���J����m�w��y�����P�}�F�C - ----> This line will allow you to practice ----> This line will allow you to practice appending text to the end of a line. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����ĤT�`�J�t�~�@�Ӹm�����R�O������ - - - ** ��J�j�g�� R �i�s������h�Ӧr�šC** - - 1. �бN���в��ʨ쥻�`���U���аO�� ---> ���Ĥ@��C - - 2. ���ʥ��Ш�Ĥ@�椤���P�_�Ц� ---> ���ĤG�檺�Ĥ@�ӳ�����}�l�A�Y�� - �� last �B�C - - 3. �M���J�j�g�� R �}�l��Ĥ@�椤�����P�_�ĤG�檺�ѧE�r�ųv�@��J�A�N - �i�H�����������즳���r�ŦӨϱo�Ĥ@�槹���p�P�ĤG��F�C - ----> To make the first line the same as the last on this page use the keys. ----> To make the first line the same as the second, type R and the new text. - - 4. �Ъ`�N�J�p�G�z�� �h�X�m���Ҧ��^�_���`�Ҧ��A�|���������奻�N�� - �M�O���쪬�C - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����ĥ|�`�J�]�m���R�O���ﶵ - - - ** �]�m�i�Ϭd��Ύʹ����i�����j�p�g���ﶵ ** - - - 1. �n�d���� ignore �i�b���`�Ҧ��U��J /ignore �C�n���_�d��ӵ��A�i�H - ���_�� n ��C - - 2. �M��]�m ic �ﶵ(ic�N�O�^�婿���j�p�gIgnore Case�����r���Y�g��)�A�Y - ��J�J - :set ic - - 3. �{�b�i�H�q�L��J n ��A���d���� ignore�C���_�d��i�H���_��J n ��C - - 4. �M��]�m hlsearch �M incsearch �o��ӿﶵ�A��J�H�U���e�J - :set hls is - - 5. �{�b�i�H�A����J�d��R�O�A�ݬݷ|������ĪG�J - /ignore - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �Ĥ����p�� - - - 1. ��J�p�g�� o �i�H�b���ФU�襴�}�s���@��ñN���иm�_�s�}���歺�A�i�J - ���J�Ҧ��C - ��J�j�g�� O �i�H�b���ФW�襴�}�s���@��ñN���иm�_�s�}���歺�A�i�J - ���J�Ҧ��C - - 2. ��J�p�g�� a �i�H�b���ЩҦb��m���ᴡ�J�奻�C - ��J�j�g�� A �i�H�b���ЩҦb�檺�楽���ᴡ�J�奻�C - - 3. ��J�j�g�� R �N�i�J�����Ҧ��A���ܫ� ��h�X�����Ҧ��Ӷi�J���` - �Ҧ��C - - 4. ��J :set xxx �i�H�]�m xxx �ﶵ�C - - - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤC���J�b�u���U�R�O - - ** �ϥΦb�u���U�t�� ** - - Vim �֦��@�ӲӭP�������b�u���U�t�ΡC�n�Ұʸ����U�t�ΡA�п�ܦp�U�T�ؤ� - �k���@�J - - ���U �� (�p�G��L�W������) - - ���U �� (�p�G��L�W������) - - ��J :help <�^��> - - ��J :q <�^��> �i�H�������U���f�C - - ���Ѥ@�ӥ��T���ѼƵ�":help"�R�O�A�z�i�H������_�ӥD�D�����U�C�и���H - �U�Ѽ�(�i�O�ѤF���^����@�C:)�J - - :help w <�^��> - :help c_ - :help insert-index <�^��> - :help user-manual <�^��> - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ĤK���J�Ыؤ@�ӱҰʸ}�� - - ** �ҥ�vim���\�� ** - - Vim���\��S�ʭn��vi�h�o�h�A���j�����\���m�S���ʬٿE���C���F�Ұʧ�h�� - �\��A�z�o�Ыؤ@��vimrc���C - - 1. �}�l�s��vimrc���A�o���M�_�z�ҨϥΪ��ާ@�t�ΡJ - - :edit ~/.vimrc �o�OUnix�t�ΩҨϥΪ��R�O - :edit ~/_vimrc �o�OWindows�t�ΩҨϥΪ��R�O - - 2. ���۾ɤJvimrc�S�Ҥ��J - - :read $VIMRUNTIME/vimrc_example.vim - - 3. �O�s���A�R�O���J - - :write - - �b�U���z�Ұ�vim���ɭԡA�s�边�N�|���F�y�k���G���\��C�z�i�H�~���z�� - �w���䥦�\��]�m�K�[��o��vimrc��󤤡C - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - vim �е{�즹�����C���е{�u�O���F²���a���Ф@�Uvim�s�边�A���w���H���z - �ܮe���Ƿ|�ϥΥ��s�边�F�C��e��áAvim�٦��ܦh�ܦh���R�O�A���е{�Ҥ� - �Ъ��ٮt�o���۩O�C�ҥH�z�n��q���ܡA�ٱ��~��V�O�@�C�U�@�B�z�i�H�\Ū - vim��U�A�ϥΪ��R�O�O�J - :help user-manual - - ���F��i�@�B���ѦҩM�DzߡA�H�U�o���ѭȱo���ˡJ - - Vim - Vi Improved - �@�͡JSteve Oualline - �X�����JNew Riders - - �o�O�Ĥ@����������vim�����y�C��_��ǎͯS�O���ΡC�䤤�٥]�t���j�q��� - �M�ϥܡC�����Ա��A�гX�� https://iccf-holland.org/click5.html - - �H�U�o���Ѥ���ѤF�ӥB���e�D�n�Ovi�Ӥ��Ovim�A���O�]�ȱo���ˡJ - - Learning the Vi Editor - �@�͡JLinda Lamb - �X�����JO'Reilly & Associates Inc. - - �o�O�@���������ѡA�q�L���z�X�G����F�Ѩ����vi������쪺�Ʊ��C���Ѫ��� - ���Ӫ����]�]�t�F�@�����_vim���H���C - - ���е{�O�ѨӦ�Calorado School of Minese��Michael C. Pierce�BRobert K. - Ware �ҽs�g���A�䤤�Ӧ�Colorado State University��Charles Smith���ѤF - �ܦh�зN�C�s�ͳq�H�a�}�O�J - - bware@mines.colorado.edu - - ���е{�w��Bram Moolenaar�M��vim�i��׭q�C - - - - Ķ��ͪ����J - =========== - ²�餤��е{½Ķ����Ķ��ͬ������ �A�٦� - �t�~�@���p�t�a�}�Jlinuxrat@gnuchina.org�C - - �c�餤��е{�O�q²�餤��е{½Ķ���ϥ� Debian GNU/Linux ���嶵�ؤp - �ժ��_�s�����ͽs�g������~�r��X�� autoconvert �ഫ�Ӧ����A�ù��� - �������G���F�@�DzӸ`����ʡC - - �ܧ�O���J - ========= - 2002�~08��30�� ����� - �P�� RMS@SMTH �������A�N�h�B���~�ץ��C - - 2002�~04��22�� ����� - �P�� xuandong@sh163.net �������A�N��B���O�r�ץ��C - - 2002�~03��18�� ����� - �ھ�Bram Moolenaar���ͦb2002�~03��16�骺�ӫH�n�D�A�Nvimtutor1.4��Ķ - ���ɯŨ�vimtutor1.5�C - - 2001�~11��15�� ����� - �Nvimtutor1.4��Ķ�����浹Bram Moolenaar�MSven Guckes�C - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.zh.euc b/runtime/tutor/tutor1.zh.euc deleted file mode 100644 index 5cdf21c058..0000000000 --- a/runtime/tutor/tutor1.zh.euc +++ /dev/null @@ -1,996 +0,0 @@ -=============================================================================== -= �� ӭ �� �� �� V I M �� �� �� ���� �汾 1.7 = -=============================================================================== - - Vim ��һ�����кܶ�����Ĺ��ܷdz�ǿ��ı༭��������ƪ�����ڱ��̵̳��� - �Ͳ���ϸ�����ˡ����̵̳����Ŀ���ǽ���һЩ��Ҫ�Ļ�����������պ��� - Щ��������ܹ������׵ؽ� Vim ����һ��ͨ�ñ༭����ʹ���ˡ� - - ��ɱ��̵̳����ݴ�Լ��Ҫ25-30���ӣ�ȡ������ѵ����ʱ�䡣 - - ע�⣺ - ÿһ�ڵ��������������ı��ġ��Ƽ������Ʊ��ĵ�һ��������Ȼ���ڸ����� - ����ѵ��(�������ͨ��"vimtutor"�������̵̳ģ���ô���ľ��Ѿ��Ǹ�����)�� - - �м�һ�㣺���̵̳����˼·����ʹ���н���ѧϰ�ġ�Ҳ����˵������Ҫͨ�� - ִ��������ѧϰ���DZ�������ȷ�÷��������ֻ���Ķ�������������ô������ - ��ܿ�������Щ����ģ� - - ���ˣ�������ȷ������Shift-Lock(��Сд������)��û�а��£�Ȼ�󰴼����� - ����ĸ�� j �㹻������ƶ���ֱ꣬����һ�ڵ������ܹ���ȫ������Ļ�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��һ����һ�ڣ��ƶ���� - - - ** Ҫ�ƶ���꣬������˵���ֱ��� h��j��k��l ���� ** - - ^ - k ��ʾ�� h �ļ�λ����ߣ�ÿ�ΰ��¾ͻ������ƶ��� - < h l > l �ļ�λ���ұߣ�ÿ�ΰ��¾ͻ������ƶ��� - j j ������������һ֧��˷����µļ�ͷ�� - v - - 1. ����������Ļ���ƶ���ֱ꣬�����������Ϊֹ�� - - 2. �������м�(j)��ֱ�����ֹ���ظ����С� - ----> ������Ӧ���Ѿ�ѧ������ƶ�����һ���ɡ� - - 3. ������ʹ�����м���������ƶ�����һ���ڶ��ڡ� - -��ʾ�����������ȷ���������µ���ĸ���밴�����ص�����(Normal)ģʽ�� - Ȼ���ٴδӼ�����������Ҫ����� - -��ʾ������Ӧ��Ҳ�����������ġ�����ʹ��hjkl������ϰ��֮�������ܹ����� - ������Ļ���Ĵ��ƶ���ꡣ����������� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��һ���ڶ��ڣ�VIM�Ľ�����˳� - - - !! �ر���ʾ�������Ķ���һ�ڵ��������ݣ�Ȼ����ִ���������������� - - 1. ����(����Ϊ��ȷ������������ģʽ)�� - - 2. Ȼ�����룺 :q! <�س�> - ���ַ�ʽ���˳��༭���ᶪ��������༭�����������ĸĶ��� - - 3. �������������������ʾ�����������ܹ������ص����̵̳�����Ǿ��ǣ� - vimtutor <�س�> - - 4. ����������Ѿ����μ�ס����Щ����Ļ�����Ӳ���1ִ�е�����3�˳���Ȼ - ���ٴν���༭���� - -��ʾ�� :q! <�س�> �ᶪ�����������κθĶ�������֮������ѧ����α���Ķ����ļ��� - - 5. ��������Ƶ���һ�������ڡ� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��һ�������ڣ��ı��༭֮ɾ�� - - - ** ������(Normal)ģʽ�£����԰��� x ����ɾ���������λ�õ��ַ���** - - 1. �뽫����ƶ����������������� ---> ����һ�С� - - 2. Ϊ��������������뽫�������׼��ɾ�����ַ���λ�ô��� - - 3. Ȼ���� x ���������ַ�ɾ������ - - 4. �ظ�����2������4��ֱ����������Ϊֹ�� - ----> The ccow jumpedd ovverr thhe mooon. - - 5. ���ˣ������Ѿ������ˣ������ǵ�һ�����Ľڡ� - -�ر���ʾ����������̳�ʱ����Ҫǿ�м��䡣��סһ�㣺��ʹ����ѧϰ�� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��һ�����Ľڣ��ı��༭֮���� - - - ** ������ģʽ�£����԰��� i ���������ı���** - - 1. �뽫����ƶ����������������� ---> �ĵ�һ�С� - - 2. Ϊ��ʹ�õ�һ��������ͬ�ڵڶ��У��뽫��������ı���һ��׼�������ַ� - ��λ�á� - - 3. Ȼ���� i �������������Ҫ���ı��ַ��� - - 4. ÿ������������Ϻ��밴�� ����������ģʽ�� - �ظ�����2������4�Ա��������ӡ� - ----> There is text misng this . ----> There is some text missing from this line. - - 5. ��������ı���������Ѿ������⣬������Ķ�����ĵ�һ������ڡ� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��һ������ڣ��ı��༭֮���� - - - ** �� A ���������ı��� ** - - 1. �ƶ���굽�����һ������� ---> ��һ�С� - ��������һ�е��ĸ��ַ��ϲ�����Ҫ�� - - 2. �� A �������Ҫ���������ݡ� - - 3. �ı�������Ϻ󣬰� ���ص�����ģʽ�� - - 4. �ƶ���굽����ڶ�������� ---> ��һ�С��ظ�����2�Ͳ���3�Ը���������ӡ� - ----> There is some text missing from th - There is some text missing from this line. ----> There is also some text miss - There is also some text missing here. - - 5. �����������ı������е�����ʱ�������ѧϰ��һ�������ڡ� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��һ�������ڣ��༭�ļ� - - ** ʹ�� :wq �Ա����ļ����˳��� ** - - �ر���ʾ����ִ�����²���֮ǰ�����ȶ�������С�ڣ� - - 1. �����ڵ�һ���ڶ����������������˳����̳̣� :q! - ���ߣ���������Է�����һ���նˣ���������ִ�����²����� - - 2. �� shell ����ʾ����������� vim tutor <�س�> - 'vim'������ Vim �༭�������'tutor'����ϣ���༭���ļ������֡� - ��ʹ��һ�����ԸĶ����ļ��� - - 3. ʹ������ǰ��Ľ̳���ѧ�����������ɾ���ı��� - - 4. ����Ķ������ļ����˳� Vim������Щ���� :wq <�س�> - - 5. ������ڲ���1���Ѿ��˳� vimtutor�������� vimtutor �ƶ��������С��һ�ڡ� - - 6. �Ķ������ϲ��裬Ū�����ǵ����壬Ȼ����ʵ���н�����ϰ�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��һ��С�� - - - 1. �������Ļ�ı��е��ƶ��ȿ����ü�ͷ����Ҳ����ʹ�� hjkl ��ĸ���� - h (����) j (����) k (����) l (����) - - 2. ������ Vim �༭��(����������ʾ��)�������룺vim �ļ��� <�س�> - - 3. ���˳� Vim �༭���������� :q! <�س�> �������иĶ��� - �������� :wq <�س�> ����Ķ��� - - 4. ������ģʽ��ɾ���������λ�õ��ַ����밴�� x - - 5. ������������ı��������룺 - - i �����������ı� �ڹ��ǰ�����ı� - A �����������ı� ��һ�к������ı� - -�ر���ʾ������ ��������ص�����ģʽ���߳���һ����������򲿷����� -����� - -���ˣ���һ�����˽�������������������ڶ��������ݡ� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ڶ�����һ�ڣ�ɾ�������� - - - ** ���� dw ���Դӹ�괦ɾ����һ�����ʵ�ĩβ��** - - 1. �밴�� ��ȷ������������ģʽ�� - - 2. �뽫����ƶ����������������� ---> ����һ�С� - - 3. �뽫�������׼��Ҫɾ���ĵ��ʵ���ʼ���� - - 4. �������� dw ɾ�����õ��ʡ� - - �ر���ʾ����������ʱ����ĸ d ��ͬʱ��������Ļ�����һ�С�Vim �ڵȴ������� - ��ĸ w��������������dz� d ��������ַ����DZ����������ˣ��밴�� ���� - Ȼ������������ - ----> There are a some words fun that don't belong paper in this sentence. - - 5. �ظ�����3�Ͳ���4��ֱ������������ϡ����ż����ڶ����ڶ������ݡ� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ڶ����ڶ��ڣ�����ɾ�������� - - - ** ���� d$ �ӵ�ǰ���ɾ������ĩ��** - - 1. �밴�� ��ȷ������������ģʽ�� - - 2. �뽫����ƶ����������������� ---> ����һ�С� - - 3. �뽫����ƶ������е�β��(Ҳ�����ڵ�һ����š�.������)�� - - 4. Ȼ������ d$ �ӹ�괦ɾ����ǰ��β���� - ----> Somebody typed the end of this line twice. end of this line twice. - - - 5. �����ѧϰ�ڶ��������ھ�֪������ô�����ˡ� - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ڶ��������ڣ���������Ͷ��� - - - ����ı��ı��������һ����������һ���������ɡ� - ʹ��ɾ�������� d ��ɾ������ĸ�ʽ���£� - - d motion - - ���У� - d - ɾ���������� - motion - �������IJ�������(�������г�)�� - - һ����̵Ķ����б��� - w - �ӵ�ǰ��굱ǰλ��ֱ����һ��������ʼ�������������ĵ�һ���ַ��� - e - �ӵ�ǰ��굱ǰλ��ֱ������ĩβ���������һ���ַ��� - $ - �ӵ�ǰ��굱ǰλ��ֱ����ǰ��ĩ�� - - ������� de ��ӵ�ǰ���λ��ɾ��������ĩβ�� - -�ر���ʾ�� - ��������̽���ߣ���������ģʽ�������������Ӧ�����ļ�����ʹ�ò��������� - �����������ƶ���������Ķ����б���������һ���� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ڶ������Ľڣ�ʹ�ü���ָ������ - - - ** �ڶ���ǰ�������ֻ�ʹ���ظ���ô��Ρ� ** - - 1. �ƶ���굽�������� ---> ��һ�еĿ�ʼ�� - - 2. ���� 2w ʹ�����ǰ�ƶ��������ʡ� - - 3. ���� 3e ʹ�����ǰ�ƶ������������ʵ�ĩβ�� - - 4. ���� 0 (������) �ƶ���굽���ס� - - 5. �ظ�����2�Ͳ���3�����Բ�ͬ�����֡� - ----> This is just a line with words you can move around in. - - 6. �����ѧϰ�ڶ�������ڡ� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ڶ�������ڣ�ʹ�ü�����ɾ������ - - - ** ʹ�ò�����ʱ�������ֿ���ʹ���ظ���ô��Ρ� ** - - �����Ѿ��ᵽ��ɾ���������Ͷ�������ϣ�������������ж���֮ǰ����һ�������� - ɾ�����ࣺ - d number(����) motion - - 1. �ƶ���굽�������� ---> ��һ���е�һ����д��ĸ�����ϡ� - - 2. ���� d2w ��ɾ��������д��ĸ���ʡ� - - 3. �ظ�����1�Ͳ���2��ʹ�ò�ͬ������ʹ����һ���������ɾ��ȫ�����ڵĴ�д��ĸ - ���� - ----> this ABC DE line FGHI JK LMN OP of words is Q RS TUV cleaned up. - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ڶ��������ڣ��������� - - - ** ���� dd ����ɾ����һ����ǰ�С� ** - - ��������ɾ���ĸ�Ƶ�ȣ�Vi ������߾���Ҫ������ɾ��������������Ҫ��ͬһ���� - �������� d �Ϳ���ɾ����������ڵ������ˡ� - - 1. �뽫����ƶ�������������Ķ̾�����еĵڶ��С� - 2. ���� dd ɾ�����С� - 3. Ȼ���ƶ��������С� - 4. �������� 2dd ɾ�����С� - ----> 1) Roses are red, ----> 2) Mud is fun, ----> 3) Violets are blue, ----> 4) I have a car, ----> 5) Clocks tell time, ----> 6) Sugar is sweet ----> 7) And so are you. - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ڶ������߽ڣ����������� - - - ** ���� u ���������ִ�е�������� U �����������е��޸ġ� ** - - 1. �뽫����ƶ����������������� ---> ����һ�У����������ڵ�һ������ - ���� - 2. ���� x ɾ����һ�����뱣������ĸ�� - 3. Ȼ������ u �������ִ�е�(һ��)��� - 4. ���Ҫʹ�� x �������е����д��� - 5. ��������һ����д�� U ���ָ������е�ԭʼ״̬�� - 6. ���Ŷ������ u �Գ��� U �Լ���ǰ����� - 7. Ȼ�������� CTRL-R (�Ȱ��� CTRL �����ſ������Ű� R ��)�������� - �������������������Ҳ���dz������������ - ----> Fiix the errors oon thhis line and reeplace them witth undo. - - 8. ��Щ���Ƿdz����õ���������ǵڶ�����С���ˡ� - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �ڶ���С�� - - - 1. ���ӵ�ǰ���ɾ������һ�����ʣ������룺dw - 2. ���ӵ�ǰ���ɾ������ǰ��ĩβ�������룺d$ - 3. ��ɾ�����У������룺dd - - 4. ���ظ�һ��������������ǰ�����һ�����֣�2w - 5. ������ģʽ���޸�����ĸ�ʽ�ǣ� - operator [number] motion - ���У� - operator - ������������Ҫ�������飬���� d ����ɾ�� - [number] - ���Ը��ӵ����֣����������ظ��Ĵ��� - motion - ���������������������ı��ϵ��ƶ������� w ��������(word)�� - $ ������ĩ�ȵȡ� - - 6. ���ƶ���굽���ף��밴����0����0 - - 7. ��������ǰ�IJ����������룺u (Сд��u) - ��������һ���������ĸĶ��������룺U (��д��U) - ��������ǰ�ij�������ָ���ǰ�IJ�������������룺CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��������һ�ڣ����������� - - - ** ���� p �����һ��ɾ��������������֮�� ** - - 1. �뽫����ƶ��������������һ������� ---> ��һ�С� - - 2. ���� dd ������ɾ���������Ὣ���б��浽 Vim ��һ���Ĵ����С� - - 3. ���Ž�����ƶ��� c) һ�У���׼�������λ�õ��Ϸ�����ס�����Ϸ�Ŷ�� - - 4. Ȼ��������ģʽ��(������)���� p ������ճ�����롣 - - 5. �ظ�����2������4�������е���������õ���ȷ��λ���ϡ� - ----> d) Can you learn too? ----> b) Violets are blue, ----> c) Intelligence is learned, ----> a) Roses are red, - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �������ڶ��ڣ��滻������ - - - ** ���� r ��һ���ַ��滻�������λ�õ��ַ���** - - 1. �뽫����ƶ����������������� ---> �ĵ�һ�С� - - 2. ���ƶ���굽��һ��������λ�á� - - 3. �������� r ��Ҫ�滻�ɵ��ַ����������ܽ������滻���ˡ� - - 4. �ظ�����2�Ͳ���3��ֱ����һ���Ѿ��޸���ϡ� - ----> Whan this lime was tuoed in, someone presswd some wrojg keys! ----> When this line was typed in, someone pressed some wrong keys! - - 5. Ȼ�����Ǽ���ѧϰ�����������ڡ� - -�ر���ʾ���м���Ҫ��ʹ����ѧϰ���������ڼ�����ѧϰ�� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �����������ڣ����������� - - - ** Ҫ�ı��ı�ֱ��һ�����ʵ�ĩβ�������� ce ** - - 1. �뽫����ƶ����������������� ---> �ĵ�һ�С� - - 2. ���Űѹ����ڵ��� lubw ����ĸ u ��λ����� - - 3. Ȼ������ cw �Լ���ȷ�ĵ���(�ڱ����������� ine )�� - - 4. ��� ����Ȼ���궨λ����һ�������һ��׼�����ĵ���ĸ���� - - 5. �ظ�����3�Ͳ���4��ֱ����һ��������ȫ��ͬ�ڶ������ӡ� - ----> This lubw has a few wptfd that mrrf changing usf the change operator. ----> This line has a few words that need changing using the change operator. - -��ʾ����ע�� ce ���������ɾ����һ�����ʣ���Ҳ�����������ģʽ�ˡ� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���������Ľڣ�ʹ��c���ĸ��� - - - ** �����������������ɾ����ʹ�õ�ͬ���Ķ������ʹ�á� ** - - 1. ������������Ĺ�����ʽ��ɾ������һ�µġ�������ʽ�ǣ� - - c [number] motion - - 2. ��������(motion)Ҳ��һ���ģ����� w �������ʣ�$������ĩ�ȵȡ� - - 3. �뽫����ƶ����������������� ---> �ĵ�һ�С� - - 4. ���Ž�����ƶ�����һ�����󴦡� - - 5. Ȼ������ c$ ʹ�ø���ʣ�µIJ��ָ�����ͬ�ڶ���һ������� ���� - ----> The end of this line needs some help to make it like the second. ----> The end of this line needs to be corrected using the c$ command. - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������С�� - - - 1. Ҫ���������Ѿ�ɾ�����ı����ݣ��밴Сд��ĸ p �����ò������Խ���ɾ�� - ���ı��������ڹ��֮��������һ��ɾ������һ�����У���ô���н��� - �ڵ�ǰ��������е���һ�С� - - 2. Ҫ�滻�������λ�õ��ַ���������Сд�� r ��Ҫ�滻��ԭλ���ַ������� - �����ɡ� - - 3. �����������������ı�ӵ�ǰ�������λ��ֱ������ָʾ��λ���м���ı��� - �������� ce �����滻��ǰ��굽���ʵ�ĩβ�����ݣ����� c$ �����滻�� - ǰ��굽��ĩ�����ݡ� - - 4. ����������ĸ�ʽ�ǣ� - - c [number] motion - -�������Ǽ���ѧϰ��һ���� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���Ľ���һ�ڣ���λ���ļ�״̬ - - ** ���� CTRL-G ��ʾ��ǰ�༭�ļ��е�ǰ���������λ���Լ��ļ�״̬��Ϣ�� - �����д G ��ֱ����ת���ļ��е�ijһָ���С�** - - ��ʾ���м�Ҫ��ͨ���������ݣ�֮��ſ���ִ�����²���!!! - - 1. ���� CTRL �����ſ�Ȼ�� g �������dz���������Ϊ CTRL-G�� - ���ῴ��ҳ����ײ�����һ��״̬��Ϣ�У���ʾ�������ǵ�ǰ�༭���ļ��� - ���ļ��й��λ�á����ס�кţ������ڲ���3���õ��� - -��ʾ����Ҳ��������Ļ�����½ǿ������λ�ã������ 'ruler' ѡ������ʱ���� - (�μ� :help 'ruler') - - 2. �����д G ����ʹ�õ�ǰ���ֱ����ת���ļ����һ�С� - ���� gg ����ʹ�õ�ǰ���ֱ����ת���ļ���һ�С� - - 3. ��������ͣ�����кţ�Ȼ�������д G�������Ϳ��Է��ص�����һ�ΰ��� - CTRL-G ʱ���ڵ����ˡ� - - 4. ���������û����Ļ�����ִ�в���1������3�IJ���������ϰ�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���Ľ��ڶ��ڣ����������� - - - ** ���� / ����һ���ַ������������ڵ�ǰ�ļ��в��Ҹ��ַ�����** - - 1. ������ģʽ������ / �ַ�������ʱ��ע�⵽���ַ��͹�궼���������Ļ�� - ������� : ������һ���ġ� - - 2. �������� errroor <�س�>���Ǹ�errroor������Ҫ���ҵ��ַ����� - - 3. Ҫ����ͬ��һ�ε��ַ�����ֻ��Ҫ�� n ����Ҫ���෴�������ͬ��һ�ε��� - �������������д N ���ɡ� - - 4. ���������������ַ�������ʹ�� ? ���� / ���С� - - 5. Ҫ�ص���֮ǰ��λ�ð� CTRL-O (��ס Ctrl ������ͬʱ������ĸ o)���ظ������� - ���˸��ಽ��CTRL-I ����ת�����µ�λ�á� - ----> "errroor" is not the way to spell error; errroor is an error. -��ʾ����������Ѿ������ļ�ĩβ�����һ��Զ����ļ�ͷ���������ң����� - 'wrapscan' ѡ���λ�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���Ľ������ڣ�������ŵIJ��� - - - ** ���� % ���Բ�����Ե����� )��]��}��** - - 1. �ѹ����ڱ����������� --> ��һ���е��κ�һ�� (��[ �� { ���� - - 2. ���Ű� % �ַ��� - - 3. ��ʱ����λ��Ӧ��������Ե����Ŵ��� - - 4. �ٴΰ� % �Ϳ���������Եĵ�һ�����Ŵ��� - - 5. �ƶ���굽��һ�� (��)��[��]��{ �� } ������ % �鿴��������Ϊ�� - ----> This ( is a test line with ('s, ['s ] and {'s } in it. )) - - -��ʾ���ڳ������ʱ����������������Ҳ���Ե������Ǻ����õġ� - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���Ľ����Ľڣ��滻���� - - - ** ���� :s/old/new/g �����滻 old Ϊ new��** - - 1. �뽫����ƶ����������������� ---> ����һ�С� - - 2. ���� :s/thee/the <�س�> ����ע�������ֻ�ı��������еĵ�һ��ƥ�� - ���� - - 3. ���� :s/thee/the/g �����滻ȫ�е�ƥ�䴮�����������е� "thee" ���ᱻ - �ı䡣 - ----> thee best time to see thee flowers is in thee spring. - - 4. Ҫ�滻����֮����ֵ�ÿ��ƥ�䴮���� - ���� :#,#s/old/new/g ���� #,# ���������滻�������������� - ��β���е��кš� - ���� :%s/old/new/g �����滻�����ļ��е�ÿ��ƥ�䴮�� - ���� :%s/old/new/gc ���ҵ������ļ��е�ÿ��ƥ�䴮�����Ҷ�ÿ��ƥ�䴮 - ��ʾ�Ƿ�����滻�� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���Ľ�С�� - - - 1. CTRL-G ������ʾ��ǰ�������λ�ú��ļ�״̬��Ϣ�� - G ���ڽ������ת���ļ����һ�С� - ������һ���к�Ȼ�������д G ���ǽ�����ƶ������кŴ������С� - gg ���ڽ������ת���ļ���һ�С� - - 2. ���� / Ȼ�����һ���ַ������ڵ�ǰ���༭���ĵ���������Ҹ��ַ����� - ���� ? Ȼ�����һ���ַ��������ڵ�ǰ���༭���ĵ��з�����Ҹ��ַ����� - ���һ�β���֮�� n �����ظ���һ�ε��������ͬһ�����ϲ� - ����һ��ƥ���ַ������ڣ����߰���д N ���෴���������һƥ���ַ������ڡ� - CTRL-O ������ת�ؽϾɵ�λ�ã�CTRL-I ����������µ�λ�á� - - 3. �����굱ǰλ��������(��)��[��]��{��}���� % �Ὣ����ƶ�����Ե������ϡ� - - 4. ��һ�����滻ͷһ���ַ��� old Ϊ�µ��ַ��� new�������� :s/old/new - ��һ�����滻���е��ַ��� old Ϊ�µ��ַ��� new�������� :s/old/new/g - ���������滻���е��ַ��� old Ϊ�µ��ַ��� new�������� :#,#s/old/new/g - ���ļ����滻���е��ַ��� old Ϊ�µ��ַ��� new�������� :%s/old/new/g - ����ȫ���滻ʱѯ���û�ȷ��ÿ���滻������ c ��־ :%s/old/new/gc - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���彲��һ�ڣ��� VIM ��ִ���ⲿ����ķ��� - - - ** ���� :! Ȼ�����������һ���ⲿ�������ִ�и��ⲿ���** - - 1. ������������Ϥ�� : ����ʹ����ƶ�����Ļ�ײ����������Ϳ�������һ�������ˡ� - - 2. ���������̾�� ! ����ַ���������������ִ���ⲿ�� shell �����ˡ� - - 3. ������ ls ����Ϊ�������� !ls <�س�> ��������ͻ��оٳ�����ǰĿ¼�� - ���ݣ�����ͬ������������ʾ�������� ls ����Ľ��һ������� !ls û�� - ���ã����������� :!dir ������ - -��ʾ�����е��ⲿ������������ַ�ʽִ�У������������в�������Щ�� - -��ʾ�����е� : ����������� <�س�> ���������ӽ��Ժ����ǾͲ��������ᵽ��һ�� - �ˡ� - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���彲�ڶ��ڣ����ڱ����ļ��ĸ�����Ϣ - - - ** Ҫ�����ļ��ĸĶ����浽�ļ��У������� :w FILENAME ��** - - 1. ���� :!dir ���� :!ls ��֪��ǰĿ¼�����ݡ���Ӧ����֪����󻹵��� - <�س�> �ɡ� - - 2. ѡ��һ��δ���õ����ļ��������� TEST�� - - 3. �������� :w TEST (�˴� TEST ������ѡ����ļ�����) - - 4. ��������� TEST Ϊ�ļ������������ļ� (Vim �̳�)��Ϊ����֤��һ�㣬 - ���ٴ����� :!dir �� :!ls �鿴����Ŀ¼�б����ݡ� - -��ע�⣺������˳� Vim Ȼ���������� vim TEST �ٴ����� Vim����ô���ļ��� - ��Ӧ��ͬ������ʱ���ļ���������ȫһ���ġ� - - 5. ����������ɾ�� TEST �ļ��ˡ��� MS-DOS �£������룺 :!del TEST - �� Unix �£������룺 :!rm TEST - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���彲�����ڣ�һ������ѡ���Եı������� - - - ** Ҫ�����ļ��IJ������ݣ������� v motion :w FILENAME ** - - 1. �ƶ���굽���С� - - 2. ���Ű� v ����������ƶ�������������Ŀ�ϡ�����ע�⵽֮����ı��������ˡ� - - 3. Ȼ�� : �ַ�������������Ļ�ײ������ :'<,'> �� - - 4. ���������� w TEST������ TEST ��һ��δ��ʹ�õ��ļ�����ȷ���������� - :'<,'>w TEST ֮�� <�س�> ���� - - 5. ��ʱ Vim ���ѡ�е���д�뵽�� TEST �������ļ���ȥ��ʹ�� :!dir �� :!ls - ȷ���ļ�����ȷ���档����ȱ�ɾ��������������һ���л��õ����� - -��ʾ���� v ��ʹ Vim �������ģʽ����ѡȡ���������Ĵ��ƶ����ʹѡȡ������� - ��С������������ʹ��һ����������ѡ���ı����в��������磬�� d ����ɾ�� - ѡ�е��ı����ݡ� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���彲���Ľڣ���ȡ�ͺϲ��ļ� - - - ** Ҫ��ǰ�ļ��в���������ļ������ݣ������� :r FILENAME ** - - 1. ��ѹ���ƶ�����������һ�С� - -�ر���ʾ��ִ�в���2֮�������������彲�����ڵ����֣����ʱ�����ƶ� - ���ٴο����������ݡ� - - 2. ����ͨ������ :r TEST ��ǰ�洴������Ϊ TEST ���ļ���ȡ������ - ������ȡ�������ļ����ӹ������λ�ô���ʼ���롣 - - 3. Ϊ��ȷ���ļ��Ѿ���ȡ�ɹ����ƶ����ص�ԭ����λ�þͿ���ע�������ݵ� - �彲�����ڵ����ݣ�һ����ԭʼ���ݣ�����һ���������ļ��ĸ����� - -��ʾ���������Զ�ȡ�ⲿ�������������磬 :r !ls ���Զ�ȡ ls ������������ - ���������ڹ�����档 - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���彲С�� - - - 1. :!command ����ִ��һ���ⲿ���� command�� - - �뿴һЩʵ�����ӣ� - (MS-DOS) (Unix) - :!dir :!ls - ������ʾ��ǰĿ¼�����ݡ� - :!del FILENAME :!rm FILENAME - ����ɾ����Ϊ FILENAME ���ļ��� - - 2. :w FILENAME �ɽ���ǰ VIM �����ڱ༭���ļ����浽��Ϊ FILENAME ���� - ���С� - - 3. v motion :w FILENAME �ɽ���ǰ�༭�ļ��п���ģʽ��ѡ�е����ݱ��浽�ļ� - FILENAME �С� - - 4. :r FILENAME ����ȡ�����ļ� FILENAME ��������뵽��ǰ�ļ��Ĺ��λ�� - ���档 - - 5. :r !dir ���Զ�ȡ dir ����������������õ���ǰ�ļ��Ĺ��λ�ú��档 - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ��������һ�ڣ��������� - - - ** ���� o ���ڹ����·����µ�һ�в��������ģʽ��** - - 1. �뽫����ƶ����������������� ---> ����һ�С� - - 2. ��������Сд�� o �ڹ�� *�·�* ���µ�һ�У���������ʹ�� - �������ģʽ�� - - 3. Ȼ������һЩ���֣�֮�� ���˳�����ģʽ����������ģʽ�� - ----> After typing o the cursor is placed on the open line in Insert mode. - - 4. Ϊ���ڹ�� *�Ϸ�* ���µ�һ�У�ֻ��Ҫ�����д�� O ������Сд�� o - �Ϳ����ˡ��������в���һ�°ɡ� - ----> Open up a line above this by typing O while the cursor is on this line. - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �������ڶ��ڣ����������� - - - ** ���� a �����ڹ��֮������ı��� ** - - 1. ��������ģʽ�½�����ƶ����������������� ---> �ĵ�һ�е����ס� - - 2. �������� e ֱ�����λ�� li ��ĩβ�� - - 3. ����Сд�� a ����ڹ��֮������ı��ˡ� - - 4. �����ʲ���������������һ���е�������֮�� ���˳�����ģʽ�ص� - ����ģʽ�� - - 5. ʹ�� e �ƶ���굽��һ���������ĵ��ʣ��ظ�����3�Ͳ���4�� - ----> This li will allow you to pract appendi text to a line. ----> This line will allow you to practice appending text to a line. - -��ʾ��a��i �� A ��������������ģʽ��Ωһ�����������ַ������λ�á� - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - �����������ڣ�����һ���û�������İ汾 - - - ** �����д�� R �������滻����ַ���** - - 1. �뽫����ƶ����������������� ---> �ĵ�һ�С��ƶ���굽��һ�� xxx �� - ��ʼλ�á� - - 2. Ȼ�������д�� R ��ʼ�ѵ�һ���еIJ�ͬ�ڵڶ��е�ʣ���ַ���һ���룬�� - ����ȫ���滻��ԭ�е��ַ���ʹ�õ�һ����ȫ��ͬ�ڶ����ˡ� - - 3. ���Ű� ���˳��滻ģʽ�ص�����ģʽ��������ע�⵽��δ�滻���ı� - ��Ȼ����ԭ״�� - - 4. �ظ����ϲ��裬��ʣ��� xxx Ҳ�滻���� - ----> Adding 123 to xxx gives you xxx. ----> Adding 123 to 456 gives you 579. - -��ʾ���滻ģʽ�����ģʽ���ƣ�����ÿ��������ַ�����ɾ��һ�����е��ַ��� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���������Ľڣ�����ճ���ı� - - - ** ʹ�ò����� y �����ı���ʹ�� p ճ���ı� ** - - 1. ��λ���������� ---> ��һ�У�������ƶ��� "a)" ֮�� - - 2. ����ʹ�� v �������ģʽ���ƶ���굽 "first" ��ǰ�档 - - 3. �������� y �Գ��(����)�������ı��� - - 4. Ȼ���ƶ���굽��һ�е�ĩβ��j$ - - 5. �������� p �Է���(ճ��)�����˵��ı���Ȼ�����룺a second �� - - 6. ʹ�ÿ���ģʽѡ�� " item."���� y ���ƣ����� j$ ������ƶ�����һ��ĩβ�� - �� p ���ı�ճ������� - ----> a) this is the first item. - b) - - ��ʾ���������԰� y ������������ʹ�ã����� yw ������������һ�����ʡ� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ����������ڣ������������ѡ�� - - - ** ���ÿ�ʹ���һ����滻�ɺ��Դ�Сд��ѡ�� ** - - 1. Ҫ���ҵ��� ignore ��������ģʽ������ /ignore <�س�>�� - Ҫ�ظ����Ҹôʣ������ظ��� n ���� - - 2. Ȼ������ ic ѡ��(Ignore Case�����Դ�Сд)�������룺 :set ic - - 3. ���ڿ���ͨ������ n ���ٴβ��ҵ��� ignore��ע�⵽ Ignore �� IGNORE ���� - Ҳ���ҵ��ˡ� - - 4. Ȼ������ hlsearch �� incsearch ������ѡ������룺 :set hls is - - 5. ���ڿ����ٴ�������������������ʲôЧ���� /ignore <�س�> - - 6. Ҫ���ú��Դ�Сд�������룺 :set noic - -��ʾ��Ҫ�Ƴ�ƥ����ĸ�����ʾ�������룺 :nohlsearch -��ʾ���������Ҫ����һ�β���ʱ������ĸ��Сд��������ʹ�� \c�� - /ignore\c <�س�> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ������С�� - - 1. ����Сд�� o �����ڹ���·����µ�һ�в��������ģʽ�� - �����д�� O �����ڹ���Ϸ����µ�һ�С� - - 2. ����Сд�� a �����ڹ������λ��֮������ı��� - �����д�� A �����ڹ�������е���ĩ֮������ı��� - - 3. e �������ʹ����ƶ�������ĩβ�� - - 4. ������ y �����ı���p ճ����ǰ���Ƶ��ı��� - - 5. �����д�� R �������滻ģʽ��ֱ���� ���ص�����ģʽ�� - - 6. ���� :set xxx �������� xxx ѡ�һЩ���õ�ѡ�����£� - 'ic' 'ignorecase' ����ʱ������ĸ��Сд - 'is' 'incsearch' ���Ҷ���ʱ��ʾ����ƥ�� - 'hls' 'hlsearch' ������ʾ���е�ƥ����� - ѡ���������������汾��Ҳ���������԰汾�� - - 7. ��ѡ��ǰ���� no ���Թر�ѡ� :set noic - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���߽���һ�ڣ���ȡ������Ϣ - - - ** ʹ�����߰���ϵͳ ** - - Vim ӵ��һ��ϸ��ȫ������߰���ϵͳ��Ҫ�����ð���ϵͳ����ѡ���������ַ� - ��֮һ�� - - ���� �� (����������еĻ�) - - ���� �� (����������еĻ�) - - ���� :help <�س�> - - ���Ķ����������е��������˽��������ι����ġ� - ���� CTRL-W CTRL-W ����ʹ���ڴ���֮����ת�� - ���� :q <�س�> ���Թرհ������ڡ� - - �ṩһ����ȷ�IJ�����":help"����������ҵ����ڸ�����İ������������� - �²���(�ɱ����˰��س���Ŷ)�� - - :help w - :help c_CTRL-D - :help insert-index - :help user-manual -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���߽��ڶ��ڣ����������ű� - - - ** ���� Vim ������ ** - - Vim �Ĺ�������Ҫ�� Vi ��ö࣬�����д󲿷ֶ�û��ȱʡ���á�Ϊ��ʹ�ø���� - ���ԣ����ô���һ�� vimrc �ļ��� - - 1. ��ʼ�༭ vimrc �ļ�����������ȡ��������ʹ�õIJ���ϵͳ�� - :edit ~/.vimrc ���� Unix ϵͳ��ʹ�õ����� - :edit ~/_vimrc ���� MS-Windows ϵͳ��ʹ�õ����� - - 2. ���Ŷ�ȡ vimrc ʾ���ļ������ݣ� - :r $VIMRUNTIME/vimrc_example.vim - - 3. �����ļ�������Ϊ�� - :write - - �´������� Vim ʱ���༭���ͻ������﷨�����Ĺ��ܡ� - �����԰���ϲ���ĸ����������ӵ���� vimrc �ļ��С� - Ҫ�˽������Ϣ������ :help vimrc-intro - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���߽������ڣ���ȫ���� - - - ** ʹ�� CTRL-D �� ���Խ��������в�ȫ ** - - 1. ��ȷ�� Vim �������Լ���ģʽ���У� :set nocp - - 2. �鿴һ�µ�ǰĿ¼���Ѿ�������Щ�ļ������룺 :!ls ���� :!dir - - 3. ��������һ���������ʼ���֣��������룺 :e - - 4. ���Ű� CTRL-D ����Vim ����ʾ�� e ��ʼ��������б��� - - 5. Ȼ�� ����Vim �Ჹȫ����Ϊ :edit �� - - 6. ��������һ���ո��Լ�һ�������ļ����ļ�������ʼ���֣����磺 :edit FIL - - 7. ���Ű� ����Vim �Ჹȫ�ļ���(�������Ωһƥ���)�� - -��ʾ����ȫ�������������Ч����ֻ�賢�԰� CTRL-D �� �� - ������ :help ����dz����á� - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - ���߽�С�� - - - 1. ���� :help ���߰� ���� �����Դ򿪰������ڡ� - - 2. ���� :help cmd �����ҵ����� cmd ����İ����� - - 3. ���� CTRL-W CTRL-W ����ʹ���ڴ���֮����ת�� - - 4. ���� :q �Թرհ������� - - 5. �����Դ���һ�� vimrc �����ű��ļ�����������ƫ�õ����á� - - 6. ������ : ����ʱ���� CTRL-D ���Բ鿴���ܵIJ�ȫ����� - �� ����ʹ��һ����ȫ�� - - - - - - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - vim �̵̳��˾ͽ����ˡ����̳�ֻ��Ϊ�˼����ؽ���һ�� Vim �༭���������������� - ������ʹ������༭���ˡ���ӹ���ɣ�vim���кܶ�ܶ��������̳����� - �ܵľ��������IJ�ú�Զ��������Ҫ��ͨ�Ļ�����������Ŭ��Ŷ����һ���������Ķ� - Vim ���û��ֲᣬʹ�õ������ǣ� :help user-manual - - �����Ȿ��ֵ���Ƽ����ڸ���һ�����Ķ���ѧϰ�� - Vim - Vi Improved - ���ߣ�Steve Oualline - �����磺New Riders - ���ǵ�һ����ȫ���� Vim ���鼮�������ڳ�ѧ���ر����á����а����д���ʵ�� - ��ͼʾ�� - ��֪���飬����� https://iccf-holland.org/click5.html - - �����Ȿ��Ƚ����˶������ݸ����ǹ��� Vi ���� Vim������Ҳֵ���Ƽ��� - Learning the Vi Editor - ���ߣ�Linda Lamb - �����磺O'Reilly & Associates Inc. - ����һ���������飬ͨ�����������ܹ��˽⵽�κ�����Ҫʹ�� Vi �������顣 - ����ĵ������汾Ҳ������һЩ���� Vim ����Ϣ�� - - ���̳��������� Calorado School of Mines �� Michael C. Pierce �� - Robert K. Ware ����д�ģ����кܶഴ�������� Colorado State University �� - Charles Smith �ṩ�����ߵĵ��������ǣ�bware@mines.colorado.edu - - ���̳����� Bram Moolenaar רΪ Vim �����޶��� - - �����߸��ԣ� - =========== - �������Ľ̷̳����֮������Ϊ����̩ ������ - ����һ����ϵ��ַ��linuxrat@gnuchina.org�� - - �������Ľ̳��ǴӼ������Ľ̷̳����ʹ�� Debian GNU/Linux ������ĿС - ����ڹ��������д�����ĺ���ת���� autoconvert ת�����ɵģ�����ת - ���Ľ������һЩϸ�ڵĸĶ��� - - �����¼�� - ========= - 2012��10��01�� ���� - �� vimtutor ������ 1.5 ������ 1.7�� - - 2002��08��30�� ����̩ - ��л RMS@SMTH ��ָ�������ദ���������� - - 2002��04��22�� ����̩ - ��л xuandong@sh163.net ��ָ���������������������� - - 2002��03��18�� ����̩ - ����Bram Moolenaar������2002��03��16�յ�����Ҫ�󣬽�vimtutor1.4���� - ��������vimtutor1.5�� - - 2001��11��15�� ����̩ - ��vimtutor1.4������ύ��Bram Moolenaar��Sven Guckes�� -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor1.zh_cn.utf-8 b/runtime/tutor/tutor1.zh_cn similarity index 100% rename from runtime/tutor/tutor1.zh_cn.utf-8 rename to runtime/tutor/tutor1.zh_cn diff --git a/runtime/tutor/tutor1.zh_tw.utf-8 b/runtime/tutor/tutor1.zh_tw similarity index 100% rename from runtime/tutor/tutor1.zh_tw.utf-8 rename to runtime/tutor/tutor1.zh_tw diff --git a/runtime/tutor/tutor2 b/runtime/tutor/tutor2 index f41b7018cd..631b994452 100644 --- a/runtime/tutor/tutor2 +++ b/runtime/tutor/tutor2 @@ -6,7 +6,7 @@ Hic Sunt Dracones: if this is your first exposure to vim and you intended to avail yourself of the introductory chapter, kindly type - :q and try again. + :q! and run vimtutor for Chapter 1 instead. The approximate time required to complete this chapter is 8-10 minutes, depending upon how much time is spent with experimentation. @@ -23,14 +23,14 @@ MNEMONIC: into register(") named (a) (y)ank (i)nner (w)ord - 3. Navigate forward to the word 'cookie' (fk or 2fc or $2b or /co) + 3. Navigate forward to the word 'cookie' (fk or 2fc or $2b or /co) and type "byiw - 4. Navigate to any point on the word 'Vince' and type ciwa + 4. Navigate to any point on the word 'Vince' and type ciwa MNEMONIC: (c)hange (i)nner (w)ord with named (a) - 5. Navigate to any point on the word 'cake' and type ciwb + 5. Navigate to any point on the word 'cake' and type ciwb ---> a) Edward will henceforth be in charge of the cookie rations b) In this capacity, Vince will have sole cake discretionary powers @@ -40,8 +40,8 @@ NOTE: Delete also works into registers, i.e. "sdiw will delete the word under REFERENCE: Registers :h registers Named Registers :h quotea - Motion :h motion.txt /inner - CTRL-R :h insert /CTRL-R + Motion :h motion.txt /inner + CTRL-R :h insert /CTRL-R ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -54,10 +54,10 @@ REFERENCE: Registers :h registers 2. Navigate to any point on the supplied number - 3. Type ciw=60*60*24 + 3. Type ciw followed by =60*60*24 4. On the next line, enter insert mode and add today's date with - =system('date') + followed by =system('date') NOTE: All calls to system are OS dependent, e.g. on Windows use system('date /t') or :r!date /t @@ -79,7 +79,7 @@ REFERENCE: Expression Register :h quote= 1. Move the cursor to the line below marked ---> - 2. yank the zeroth line, then inspect registers with :reg + 2. yank the zeroth line, then inspect registers with :reg 3. delete line 0. with "cdd, then inspect registers (Where do you expect line 0 to be?) @@ -118,7 +118,7 @@ REFERENCE: Numbered Registers :h quote0 NOTE: a common conundrum when coding is moving around large chunks of code. The following technique helps avoid number line calculations associated with operations like "a147d or :945,1091d a or even worse using - i=1091-945 first + i followed by =1091-945 first 1. Move the cursor to the line below marked ---> @@ -172,9 +172,11 @@ REFERENCE: Marks :h marks 3. Change a whole word from anywhere within a word: ciw 4. Insert text directly from registers in insert mode: (C-r)a - 5. Insert the results of simple arithmetic operations: (C-r)=60*60 + 5. Insert the results of simple arithmetic operations: followed by + =60*60 in insert mode - 6. Insert the results of system calls: (C-r)=system('ls -1') + 6. Insert the results of system calls: followed by + =system('ls -1') in insert mode 7. Inspect registers with :reg diff --git a/runtime/tutor/tutor2.fr b/runtime/tutor/tutor2.fr new file mode 100644 index 0000000000..42114b67eb --- /dev/null +++ b/runtime/tutor/tutor2.fr @@ -0,0 +1,213 @@ +=============================================================================== += B i e n v e n u e dans l e T u t o r i e l de VIM – Version 1.7 = +=============================================================================== += C H A P I T R E DEUX = +=============================================================================== + + Hic sunt dracones : si cʼest la première fois que vous utilisez Vim + et que vous souhaitez accéder au tutoriel dʼintroduction, tapez + les trois touches :q! puis la touche et recommencez. + + Il vous faudra entre 8 et 10 minutes pour terminer ce chapitre, selon + que vous passiez plus ou moins de temps à expérimenter. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Leçon 2.1.1 : REGISTRES NOMMÉS + + + ** Conserver deux mots copiés en parallèle, puis les coller ** + + 1. Déplacez le curseur sur la ligne ci-dessous commençant par : ---> + + 2. Placez-vous nʼimporte où dans le mot 'Édouard' et tapez "ayiw + +AIDE MNÉMOTECHNIQUE : dans le registre(") nommé (a) (y)ank la portion + (i)nterne du (w)ord sous-jacent + + 3. Avancez jusquʼau mot 'chouquettes' (fq ou 2fc ou $ ou /ch) + et tapez "byiw + + 4. Rendez-vous sur le mot 'Vincent' et tapez ciwa<ÉCHAP> + +AIDE MNÉMOTECHNIQUE : é(c)hange la partie (i)nterne du (w)ord sous-jacent + avec le nommé (a) + + 5. Rendez-vous sur le mot 'croissant' et tapez ciwb<ÉCHAP> + +---> a) Édouard aura toute autorité sur le contingentement des chouquettes + b) À ce titre, Vincent exercera seul le pouvoir discrétionnaire sur + lʼattribution des croissants. + +NOTE : On peut aussi utiliser les registres avec la commande de suppression. + Taper "sdiw supprimera le mot sous-jacent et en conservera une copie + dans le registre (s). + +RÉFÉRENCES: Registres :h registers + Registres nommés :h quotea + Mouvements :h motion.txt /inner + CTRL-R :h insert /CTRL-R + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Leçon 2.1.2 : LE REGISTRE DʼEXPRESSIONS + + + ** Insérer à la volée le résultat dʼun calcul ** + + 1. Déplacez le curseur sur la ligne ci-dessous commençant par : ---> + + 2. Placez-vous sur le nombre + + 3. Tapez ciw suivi de =60*60*24 + + 4. Sur la ligne suivante, en mode Insertion, ajoutez la date du jour avec + suivi de =system('date') + +NOTE : Tous les appels système dépendent de votre système dʼexploitation. Par + exemple sur MS-Windows, utilisez plutôt + system('date /t') ou :r!date /t + +---> Dans une journée, il y a 100 secondes. + Aujourdʼhui, nous sommes : + +NOTE: on arrive au même résultat avec :pu=system('date') + ou, plus court :r!date + +RÉFÉRENCE : Registre dʼexpressions :h quote= + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Leçon 2.1.3 : LES REGISTRES NUMÉROTÉS + + + ** Tapez yy et dd afin de contempler leur effet sur les registres ** + + 1. Déplacez le curseur sur la ligne ci-dessous commençant par : ---> + + 2. Copiez (yy) la ligne 0, puis inspectez les registres avec :reg + + 3. Supprimez la ligne 0 avec "cdd, puis inspectez les registres + (Où pensez-vous retrouver la ligne 0 ?) + + 4. Continuez à supprimer chaque ligne successivement (avec dd), tout en + regardant le résultat au passage avec :reg. + +NOTE : Vous devriez remarquer que les anciennes lignes supprimées descendent + dans la liste des registres au fur et à mesure que vous supprimez de + nouvelles lignes. + + 5. Maintenant collez le contenu des registres suivant, dans cet ordre : + c, 7, 4, 2, 8. i.e collez avec "cp puis "7p puis etc. + +---> 0. Ceci + 9. zigzag + 8. secret + 7. est + 6. on + 5. axe + 4. un + 3. guerre + 2. message + 1. hommage + +NOTE : Les lignes entièrement supprimées (via dd) restent beaucoup plus + longtemps dans les registres numérotés que les lignes copiées (via yy) + ou les suppressions impliquant des mouvements plus courts. + +RÉFÉRENCE : Registres numérotés :h quote0 + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Leçon 2.1.4 : LʼÉLÉGANCE DES MARQUES + + + ** Lʼart dʼéviter les calculs pour le codeur décérébré ** + +NOTE : En programmation, déplacer de gros blocs de code est souvent une vraie + corvée. Le souci nʼest pas la difficulté de lʼopération, mais la + gymnastique mentale quʼimposent les calculs de numéros de ligne — une + tâche fastidieuse et source dʼerreurs. + La technique qui suit vous épargne justement ce tracas pour des + opérations comme "a147d ou :945,1091d a ou pire encore + i suivi de =1091-945 + + 1. Déplacez le curseur sur la ligne ci-dessous commençant par : ---> + + 2. Placez-vous sur la première ligne de la fonction et placez une marque (a) + avec ma + +NOTE : peu importe la position exacte sur la ligne. + + 3. Allez à la fin de la ligne, puis à la fin du bloc de code avec $% + + 4. Supprimez le bloc et conservez-le dans le registre (a) avec "ad'a + +AIDE MNÉMOTECHNIQUE : demande au registre(") nommé (a) de conserver la + (d)élétion effectuée depuis le curseur jusquʼà la LIGNE contenant la + marque(') (a) + + 5. Collez le bloc entre BBB et CCC avec "ap + +NOTE : exercez-vous plusieurs fois pour que ça devienne naturel ma$%"ad'a + +---> AAA + function itGotRealBigRealFast() { + if ( somethingIsTrue ) { + doIt() + } + // the taxonomy of our function has changed and it + // no longer makes alphabetical sense in its current position + + // imagine hundreds of lines of code + + // naively you could navigate to the start and end and record or + // remember each line number + } + BBB + CCC + +NOTE : les marques et les registres ne partagent pas leur espace de noms, + le registre (a) est complètement indépendant de la marque (a). + On ne peut pas en dire autant des registres et des macros. + +RÉFÉRENCES : Marques :h marks + :h mark-motions (différence entre ' et ` ) + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Leçon 2.1 RÉSUMÉ + + + 1. Utiliser lʼun des 26 registres nommés (a-z) pour conserver + (copier/supprimer) et coller du texte. + 2. Copier un mot entier en plaçant le curseur sur le mot : yiw + 3. Changer un mot entier en plaçant le curseur sur le mot : ciw + 4. Insérer du texte directement depuis un registre, en mode Insertion : + a + + 5. Insérer le résultat dʼune opération arithmétique simple : + suivi de =60*60 en mode Insertion + 6. Insérer le résultat dʼun appel système : suivi de + =system('ls -1') + en mode Insertion + + 7. Inspecter les registres avec :reg + 8. Apprendre pourquoi les suppressions de lignes entières (dd) sont + préservées plus longtemps : elles bénéficient des registres 1 à 9 et sont + préservées plus longtemps que toute autre opération + 9. Apprendre la destination finale de toutes les copies dans les registres + numérotés et à quel point elles sont éphémères + + 10. Placer des marques depuis le mode Normal m[a-zA-Z0-9] + 11. Se déplacer ligne par ligne jusquʼà une marque avec ' + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Voilà, vous êtes arrivé à la fin du chapitre deux du tutoriel de Vim. Il est + encore en chantier. + + Ce chapitre a été écrit par Paul D. Parker, + il a été traduit en français par Damien Lejay. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor2.gl b/runtime/tutor/tutor2.gl new file mode 100644 index 0000000000..8c90b8fda3 --- /dev/null +++ b/runtime/tutor/tutor2.gl @@ -0,0 +1,215 @@ +=============================================================================== += B e n v i d o a o t u t o r d o V I M - Versión 1.7 = +=============================================================================== += C A P Í T U L O D O U S = +=============================================================================== + + Hic Sunt Dracones: se este é o súa primeira exposición ao vim, e + prefire iniciarse no capítulo introducturio, pode saír premendo + :q . + + O tempo aproximado requerido para completar este capítulo é de + 8-10 minutos, dependendo de canto tempo use na experimentación. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lección 2.1.1: OS REXISTROS CON NOME + + + ** Almacene dúas palabras copiadas de xeito consecutivo, e logo pégueas. ** + + 1. Mova o cursor ata a liña inferior sinalada con --->. + + 2. Navegue ata calquera carácter da palabra 'Xoán' e escriba "ayiw . + +NEMÓNICO: + dentro do rexistro(") + chamado (a) + pega (y)ank + o interior (i)nner + da palabra (w)ord + + 3. Navegue cara a adiante ata a palabra 'galetas' + ( fl ou 4fe ou $b ou /gal ) e teclee "byiw . + + 4. Navegue ata calquera carácter da palabra 'Uxío' e teclee + ciw a + +NEMÓNICO: + cambia (c)hange + o interior (i)nner + da palabra (w)ord + co + chamado (a) + + 5. Navegue ata calquera punto da palabra 'tartas' e teclee + ciwb + +---> a) De eiquí en adiante, Xoán ficará encarregado das racións de galetas. + b) Xa que logo, Uxío somentes terá poderes no que respecta ás tartas. + +NOTA: O borrado tamén funciona nos rexistros, é dicir: + "sdiw borrará a palabra baixo o cursor e ficaráa no rexistro s. + +REFERENCIAS: Rexistros :h registers + Rexistros con come: :h quotea + Movemento :h motion.txt /inner + CTRL-R :h insert /CTRL-R + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lección 2.1.2: O REXISTRO DE EXPRESIÓN + + + ** Insira o resultado dos cáculos sobre a marcha. ** + + 1. Mova o cursor ata a liña sinalada con --->. + + 2. Navegue ata calquera carácter do número que aparece na liña. + + 3. Teclee ciw=60*60*24 . + + 4. Na seguinte liña, entre no modo Inserir e engada a data de hoxe con: + =system('date') + +NOTA: Tódalas chamadas a sistema son dependentes do sistema operativo. + Por exemplo, en Windows pode usar: + system('date /t') ou :r!date /t + +---> Esquecín o número exacto de segundos que ten un día; son 84600? +---> A data de hoxe é: + +NOTA: O mesmo pódese obter con :pu=system('date') + ou, premendo menos teclas, con :r!date . + +REFERENCIAS: Rexistro de experesión :h quote= + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lección 2.1.3: OS REXISTROS NUMERADOS + + + ** Prema yy e mais dd para ve-lo seu efecto nos rexistros. ** + + 1. Mova o cursor ata a liña sinalada con --->. + + 2. Copie a liña 0, e logo inspeccione os rexitros con :reg . + + 3. Borre a liña 0 con "cdd, e logo inspeccione os rexistros. + (Onde espera que estea o contido da liña 0?) + + 4. Continúe borrando cada liña sucesivamente, inspeccionando os rexistros + sobre a marcha. + +NOTA: Debería decatarse de que as liñas borradas máis antigas móvense cara a + embaixo na lista, consonte se engaden as novas liñas borradas. + + 5. Agora, poña (p) os seguintes rexistros en orde: c, 7, 4, 8, 2. + Por exemplo, usando "7p . + +---> 0. Esta + 9. cambalear + 8. mensaxe + 7. é + 6. en + 5. eixo + 4. unha + 3. guerra + 2. secreta. + 1. tributo + +NOTA: O borrado de liñas enteiras (dd) permanece máis tempo nos rexistros + numerados có copiado de liñas enteiras ou de texto máis pequeno. + +REFERENCIAS: Rexistros numerados :h quote00 + + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lección 2.1.4: A BELEZA DAS MARCAS + + + ** Evitando conta-las liñas de código ** + +NOTA: Un problema frecuente que acontece cando se programa é o desprazamento + entre pedazos de código. A seguinte técnica axuda a evita-lo cálculo + de números de liña asociados a operacions coma "a147d ou + :945,1091d a ou, incluso peor, usando primeiro + =1091-945 . + + 1. Mova o cursor ata a liña sinalada con --->. + + 2. Vaia á primeira liña da función e márquea con ma . + +NOTA: A posición exacta na liña NON é importante! + + 3. Navegue ata a fin da liña, e deseguido ata a fin do bloque de código + con $% . + + 4. Borre o bloque e póñao no rexistro 'a' con "ad'a . + +NEMÓNICO: + Dentro do rexistro(") + con nome de rexistro (a) + pon o borrado (d)eletion + dende o cursor ata a liña que contén a marca(') + de nome de marca (a) + + 5. Pegue o bloque entre BBB e CCC con "ap . + +NOTA: Practique esta operación múltiples veces, + ata chegar a facelo fluidamente: ma$%"ad'a + +---> AAA + function itGotRealBigRealFast() { + if ( somethingIsTrue ) { + doIt() + } + // the taxonomy of our function has changed and it + // no longer makes alphabetical sense in its current position + + // imagine hundreds of lines of code + + // naively you could navigate to the start and end and record or + // remember each line number + } + BBB + CCC + +NOTA: As marcas e mailos rexistros non comparten un espazo común de nomes, + de xeito que un rexistro 'a' é completamente independente dunha + marca 'a'. En troques, isto non acontece entre os rexistros + e mailas macros. + +REFERENCIAS: Marcas :h marks + Movemento de marcas :h mark-motions (diferencia entre ' e `) + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Lección 2.1 RESUMO + + 1. Gardar texto (por medio de copiar ou borrar), e recuperalo (pegar) dende + un total de 26 rexistros (a-z). + 2. Pegar unha palbra enteira dende calquer sitio dentro dunha palara: yiw + 3. Cambiar unha palabra enteira dende calquer punto de palabra: ciw + 4. Inserir texto directamente dende os rexistros en modo Inserir: (C-r)a + 5. Inseri-lo resultado de operacións aritméticas simples no modo + Inserir: (C-r)=60*60 + 6. Inseri-los resultados de chamadas ao sistema no modo Inserir: + (C-r)=system('ls -1') + 7. Inspecciona-los rexistros con :reg . + 8. Aprende-lo destino final do borrado de liñas enteiras (dd) nos + rexistros numerados, é dicir, descendendo dende o reistro 1 ao 9. + Decatarse de que o borrado de liñas enteiras presérvase nos rexistros + numerados máis tempo que calquera outra operación. + 9. Aprende-lo destino final de tódalas copias feitas nos rexistros + numerados e cómo son de efímeros. + 10. Situar marcas dende o modo de comandos m[a-zA-Z0-9] . + 11. Moverse a una liña cunha marca con ' . + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Isto conclúe o capítulo dows do Vim Tutor. Este é traballo en progreso. + Este capítulo foi escrito por Paul D. Parker. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + Traducido do inglés ao galego por Fernando Vilariño. + Correo electrónico: fernando@cvc.uab.es. + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor2.it b/runtime/tutor/tutor2.it index 1d04b355ef..a337acd1c7 100644 --- a/runtime/tutor/tutor2.it +++ b/runtime/tutor/tutor2.it @@ -4,11 +4,11 @@ = C A P I T O L O DUE = =============================================================================== - Hic Sunt Dracones: Se questa � la prima volta che vi accostate a vim + Hic Sunt Dracones: Se questa è la prima volta che vi accostate a vim e preferite iniziare dal capitolo introduttivo, gentilmente immettete :q e poi iniziate da quello. - Il tempo necessario per completare questo capitolo � di circa 8-10 + Il tempo necessario per completare questo capitolo è di circa 8-10 minuti, a seconda del tempo utilizzato per fare delle prove. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -32,11 +32,11 @@ MNEMONICO: (c)cambia (i)interna (w)parola con di nome (a) 5. Andate su una lettera qualsiasi di 'dolci' e battete ciwb ----> a) Edward sar� d'ora in poi responsabile della razione di biscotti - b) Come compito, Vince sar� il solo a decidere riguardo ai dolci +---> a) Edward sarà d'ora in poi responsabile della razione di biscotti + b) Come compito, Vince sarà il solo a decidere riguardo ai dolci -NOTA: Anche una parola cancellata pu� essere inviata ad un registro, p.es., - "sdiw canceller� (d) la parola sotto il cursore (iw) e la metter� +NOTA: Anche una parola cancellata può essere inviata ad un registro, p.es., + "sdiw cancellerà (d) la parola sotto il cursore (iw) e la metterà nel registro (s) RIFERIMENTI: Registri :h registers Registri con nome :h quotea @@ -62,11 +62,11 @@ RIFERIMENTI: Registri :h registers NOTA: Tutte le chiamate a sistema dipendono dal S.O., p.es., in ambiente Windows si usa system('date /t') o :r!date /t ----> Non ricordo il numero esatto di secondi in un giorno, � 84600? - La data di oggi �: +---> Non ricordo il numero esatto di secondi in un giorno, è 84600? + La data di oggi è: -NOTA: Lo stesso risultato si pu� ottenere con :pu=system('date') - o, ancora pi� brevemente, con :r!date +NOTA: Lo stesso risultato si può ottenere con :pu=system('date') + o, ancora più brevemente, con :r!date RIFERIMENTI: Registro espressioni :h quote= @@ -94,7 +94,7 @@ NOTA: Dovreste notare che le righe cancellate per prime scendono nella ---> 0. Questo 9. dondolante 8. messaggio - 7. � + 7. è 6. in 5. asse 4. un @@ -103,7 +103,7 @@ NOTA: Dovreste notare che le righe cancellate per prime scendono nella 1. tributo NOTA: Le cancellazioni di righe intere (dd) sopravvivono nei registri numerati - molto pi� a lungo delle copie di righe intere (yy), o delle + molto più a lungo delle copie di righe intere (yy), o delle cancellazioni che implicano movimenti minori RIFERIMENTI: Registri numerati :h quote0 @@ -115,7 +115,7 @@ RIFERIMENTI: Registri numerati :h quote0 ** Evitare di contare le righe di codice ** -NOTA: Un problema frequente quando si scrivono programmi � spostare numerose +NOTA: Un problema frequente quando si scrivono programmi è spostare numerose righe di codice. Il metodo seguente evita di dover calcolare numeri di riga con operazioni tipo "a147d o :945,1091d a o, ancor peggio, usando prima i=1091-945 @@ -124,7 +124,7 @@ NOTA: Un problema frequente quando si scrivono programmi 2. Andate alla prima riga della funzione e marcatela con ma -NOTA: La posizione sulla riga NON � importante! +NOTA: La posizione sulla riga NON è importante! 3. Spostatevi a fine riga e da qui alla fine del blocco di codice con $% @@ -136,14 +136,14 @@ MNEMONICO: nel registro(") di nome (a) mettere la cancellazione (d) dal 5. Incollare il blocco the le righe BBB e CCC "ap -NOTA: Provare pi� volte quest'operazione, per impratichirsi ma$%"ad'a +NOTA: Provare più volte quest'operazione, per impratichirsi ma$%"ad'a ---> AAA function cresciutaTroppoinFretta() { if ( condizioneVera ) { faiQualcosa() } - // La classificazione della nostra funzione � cambiata + // La classificazione della nostra funzione è cambiata // non ha senso mantenerla nella posizione attuale // ...immaginate centinaia di righe di codice @@ -155,7 +155,7 @@ NOTA: Provare pi CCC NOTA: marcature e registri non hanno niente in comune, quindi il registro - a � completamente indipendente dalla marcatura a. Questo non vale + a è completamente indipendente dalla marcatura a. Questo non vale per i nomi dei registri e quelli delle macro di Vim. RIFERIMENTI: Marcature :h marks @@ -181,9 +181,9 @@ RIFERIMENTI: Marcature :h marks 8. Vedere dove vanno a finire le cancellazioni di intere righe: dd nei registri numerati, ossia discendendo dal registro 1 al 9. Osservare che le righe intere cancellate sono disponibili nei registri - numerati pi� a lungo di qualsiasi altra modifica + numerati più a lungo di qualsiasi altra modifica 9. Vedere la destinazione finale delle operazioni di copia nei registri - numerati e controllare quanto si pu� aspettare che durino + numerati e controllare quanto si può aspettare che durino 10. Inserire marcature in modo Normale m[a-zA-Z0-9] 11. Spostarsi a una riga marcata con il comando ' @@ -192,6 +192,6 @@ RIFERIMENTI: Marcature :h marks Qui finisce il capitolo due della guida Vim. Ci sono lavori in corso. - Questo capitolo � stato scritto da Paul D. Parker + Questo capitolo è stato scritto da Paul D. Parker e tradotto da Antonio Colombo ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor2.it.utf-8 b/runtime/tutor/tutor2.it.utf-8 deleted file mode 100644 index a337acd1c7..0000000000 --- a/runtime/tutor/tutor2.it.utf-8 +++ /dev/null @@ -1,197 +0,0 @@ -=============================================================================== -= Benvenuto alla G u i d a all'Editor V I M - Versione 1.7 = -=============================================================================== -= C A P I T O L O DUE = -=============================================================================== - - Hic Sunt Dracones: Se questa è la prima volta che vi accostate a vim - e preferite iniziare dal capitolo introduttivo, gentilmente immettete - :q e poi iniziate da quello. - - Il tempo necessario per completare questo capitolo è di circa 8-10 - minuti, a seconda del tempo utilizzato per fare delle prove. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lezione 2.1.1: I REGISTRI CON NOME - - - ** Copiare due parole in registri diversi e poi incollarle ** - - 1. Spostate il cursore alla riga qui sotto marcata con ---> - - 2. Andate su una lettera qualsiasi di 'Edward' e battete "ayiw - -MNEMONICO: nel registro(") di nome (a) (y)copia (i)interna (w)parola - - 3. Spostatevi alla parola 'biscotti' (fc o 2fb o $b o /bis) - e battete "byiw - - 4. Andate su una lettera qualsiasi di 'Vince' e battete ciwa - -MNEMONICO: (c)cambia (i)interna (w)parola con di nome (a) - - 5. Andate su una lettera qualsiasi di 'dolci' e battete ciwb - ----> a) Edward sarà d'ora in poi responsabile della razione di biscotti - b) Come compito, Vince sarà il solo a decidere riguardo ai dolci - -NOTA: Anche una parola cancellata può essere inviata ad un registro, p.es., - "sdiw cancellerà (d) la parola sotto il cursore (iw) e la metterà - nel registro (s) -RIFERIMENTI: Registri :h registers - Registri con nome :h quotea - Movimento :h motion.txt /inner - CTRL-R :h insert /CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lezione 2.1.2: IL REGISTRO DELLE ESPRESSIONI - - - ** Inserire al volo risultati di un calcolo ** - - 1. Spostate il cursore alla riga qui sotto marcata con ---> - - 2. Andate su un punto qualsiasi del numero fornito - - 3. Battete ciw=60*60*24 - - 4. Sulla riga seguente, entrate in modo Insert e aggiungete - la data di oggi con =system('date') - -NOTA: Tutte le chiamate a sistema dipendono dal S.O., p.es., in ambiente - Windows si usa system('date /t') o :r!date /t - ----> Non ricordo il numero esatto di secondi in un giorno, è 84600? - La data di oggi è: - -NOTA: Lo stesso risultato si può ottenere con :pu=system('date') - o, ancora più brevemente, con :r!date - -RIFERIMENTI: Registro espressioni :h quote= - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lezione 2.1.3: I REGISTRI NUMERATI - - - ** Battere yy e dd per vedere l'effetto sui registri ** - - 1. Spostate il cursore alla riga qui sotto marcata con ---> - - 2. Copiate (yy) la riga stessa e controllate i registri con :reg - - 3. Cancellate la riga che inizia con "0." con "cdd, poi controllate i - registri (Dove vi aspettate sia finita la riga cancellata?) - - 4. Continuate a cancellare ogni riga seguente, controllando ogni volta - con :reg il risultato -NOTA: Dovreste notare che le righe cancellate per prime scendono nella - lista, man mano che vengono aggiunte nuove righe cancellate - 5. Poi incollate (p) i seguenti registri nell'ordine; c, 7, 4, 8, 2.+ - ossia "cp "7p ... - ----> 0. Questo - 9. dondolante - 8. messaggio - 7. è - 6. in - 5. asse - 4. un - 3. guerresco - 2. segreto - 1. tributo - -NOTA: Le cancellazioni di righe intere (dd) sopravvivono nei registri numerati - molto più a lungo delle copie di righe intere (yy), o delle - cancellazioni che implicano movimenti minori - -RIFERIMENTI: Registri numerati :h quote0 - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lezione 2.1.4: IL FASCINO DELLE MARCATURE - - - ** Evitare di contare le righe di codice ** - -NOTA: Un problema frequente quando si scrivono programmi è spostare numerose - righe di codice. Il metodo seguente evita di dover calcolare numeri di - riga con operazioni tipo "a147d o :945,1091d a o, ancor peggio, - usando prima i=1091-945 - - 1. Spostate il cursore alla riga qui sotto marcata con ---> - - 2. Andate alla prima riga della funzione e marcatela con ma - -NOTA: La posizione sulla riga NON è importante! - - 3. Spostatevi a fine riga e da qui alla fine del blocco di codice - con $% - - 4. Cancellate il blocco salvandolo nel registro a con "ad'a - -MNEMONICO: nel registro(") di nome (a) mettere la cancellazione (d) dal - cursore fino alla RIGA che contiene il marcatore (') (a) - - 5. Incollare il blocco the le righe BBB e CCC "ap - -NOTA: Provare più volte quest'operazione, per impratichirsi ma$%"ad'a - ----> AAA - function cresciutaTroppoinFretta() { - if ( condizioneVera ) { - faiQualcosa() - } - // La classificazione della nostra funzione è cambiata - // non ha senso mantenerla nella posizione attuale - - // ...immaginate centinaia di righe di codice - - // Ingenuamente si potrebbe andare dall'inizio alla fine - // e annotare da qualche parte il numero di righe - } - BBB - CCC - -NOTA: marcature e registri non hanno niente in comune, quindi il registro - a è completamente indipendente dalla marcatura a. Questo non vale - per i nomi dei registri e quelli delle macro di Vim. - -RIFERIMENTI: Marcature :h marks - Movimenti marcature :h mark-motions (differenza fra ' e `) - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lezione 2.1 SOMMARIO - - - 1. Per inserire (copiando, cancellando) testo, e per incollarlo (incolla)) - sono disponibili 26 registri (a-z) - 2. Copiare una parola da una posizione qualsiasi al suo interno: yiw - 3. Cambiare una parola da una posizione qualsiasi al suo interno: ciw - 4. Inserire testo direttamente da registri in modo Insert: (C-r)a - - 5. Inserire il risultato di semplici operazioni aritmetiche in modo - Insert: (C-r)=60*60 - 6. Inserire il risultato di chiamate a sistema in modo Insert: - (C-r)=system('ls -1') - - 7. Controllare contenuto registri con :reg - 8. Vedere dove vanno a finire le cancellazioni di intere righe: dd - nei registri numerati, ossia discendendo dal registro 1 al 9. - Osservare che le righe intere cancellate sono disponibili nei registri - numerati più a lungo di qualsiasi altra modifica - 9. Vedere la destinazione finale delle operazioni di copia nei registri - numerati e controllare quanto si può aspettare che durino - - 10. Inserire marcature in modo Normale m[a-zA-Z0-9] - 11. Spostarsi a una riga marcata con il comando ' - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Qui finisce il capitolo due della guida Vim. Ci sono lavori in corso. - - Questo capitolo è stato scritto da Paul D. Parker - e tradotto da Antonio Colombo -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/runtime/tutor/tutor2.ru.utf-8 b/runtime/tutor/tutor2.ru similarity index 100% rename from runtime/tutor/tutor2.ru.utf-8 rename to runtime/tutor/tutor2.ru diff --git a/runtime/tutor/tutor2.sr.utf-8 b/runtime/tutor/tutor2.sr similarity index 100% rename from runtime/tutor/tutor2.sr.utf-8 rename to runtime/tutor/tutor2.sr diff --git a/runtime/tutor/tutor2.utf-8 b/runtime/tutor/tutor2.utf-8 deleted file mode 100644 index f41b7018cd..0000000000 --- a/runtime/tutor/tutor2.utf-8 +++ /dev/null @@ -1,197 +0,0 @@ -=============================================================================== -= W e l c o m e t o t h e V I M T u t o r - Version 1.7 = -=============================================================================== -= C H A P T E R TWO = -=============================================================================== - - Hic Sunt Dracones: if this is your first exposure to vim and you - intended to avail yourself of the introductory chapter, kindly type - :q and try again. - - The approximate time required to complete this chapter is 8-10 minutes, - depending upon how much time is spent with experimentation. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - Lesson 2.1.1: THE NAMED REGISTERS - - - ** Store two yanked words concurrently and then paste them ** - - 1. Move the cursor to the line below marked ---> - - 2. Navigate to any point on the word 'Edward' and type "ayiw - -MNEMONIC: into register(") named (a) (y)ank (i)nner (w)ord - - 3. Navigate forward to the word 'cookie' (fk or 2fc or $2b or /co) - and type "byiw - - 4. Navigate to any point on the word 'Vince' and type ciwa - -MNEMONIC: (c)hange (i)nner (w)ord with named (a) - - 5. Navigate to any point on the word 'cake' and type ciwb - ----> a) Edward will henceforth be in charge of the cookie rations - b) In this capacity, Vince will have sole cake discretionary powers - -NOTE: Delete also works into registers, i.e. "sdiw will delete the word under - the cursor into register s. - -REFERENCE: Registers :h registers - Named Registers :h quotea - Motion :h motion.txt /inner - CTRL-R :h insert /CTRL-R - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lesson 2.1.2: THE EXPRESSION REGISTER - - - ** Insert the results of calculations on the fly ** - - 1. Move the cursor to the line below marked ---> - - 2. Navigate to any point on the supplied number - - 3. Type ciw=60*60*24 - - 4. On the next line, enter insert mode and add today's date with - =system('date') - -NOTE: All calls to system are OS dependent, e.g. on Windows use - system('date /t') or :r!date /t - ----> I have forgotten the exact number of seconds in a day, is it 84600? - Today's date is: - -NOTE: the same can be achieved with :pu=system('date') - or, with fewer keystrokes :r!date - -REFERENCE: Expression Register :h quote= - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lesson 2.1.3: THE NUMBERED REGISTERS - - - ** Press yy and dd to witness their effect on the registers ** - - 1. Move the cursor to the line below marked ---> - - 2. yank the zeroth line, then inspect registers with :reg - - 3. delete line 0. with "cdd, then inspect registers - (Where do you expect line 0 to be?) - - 4. continue deleting each successive line, inspecting :reg as you go - -NOTE: You should notice that old full-line deletions move down the list - as new full-line deletions are added - - 5. Now (p)aste the following registers in order; c, 7, 4, 8, 2. i.e. "7p - ----> 0. This - 9. wobble - 8. secret - 7. is - 6. on - 5. axis - 4. a - 3. war - 2. message - 1. tribute - -NOTE: Whole line deletions (dd) are much longer lived in the numbered registers - than whole line yanks, or deletions involving smaller movements - -REFERENCE: Numbered Registers :h quote0 - - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lesson 2.1.4: THE BEAUTY OF MARKS - - - ** Code monkey arithmetic avoidance ** - -NOTE: a common conundrum when coding is moving around large chunks of code. - The following technique helps avoid number line calculations associated - with operations like "a147d or :945,1091d a or even worse using - i=1091-945 first - - 1. Move the cursor to the line below marked ---> - - 2. Go to the first line of the function and mark it with ma - -NOTE: exact position on line is NOT important! - - 3. Navigate to the end of the line and then the end of the code block - with $% - - 4. Delete the block into register a with "ad'a - -MNEMONIC: into register(") named (a) put the (d)eletion from the cursor to the - LINE containing mark(') (a) - - 5. Paste the block between BBB and CCC "ap - -NOTE: practice this operation multiple times to become fluent ma$%"ad'a - ----> AAA - function itGotRealBigRealFast() { - if ( somethingIsTrue ) { - doIt() - } - // the taxonomy of our function has changed and it - // no longer makes alphabetical sense in its current position - - // imagine hundreds of lines of code - - // naively you could navigate to the start and end and record or - // remember each line number - } - BBB - CCC - -NOTE: marks and registers do not share a namespace, therefore register a is - completely independent of mark a. This is not true of registers and - macros. - -REFERENCE: Marks :h marks - Mark Motions :h mark-motions (difference between ' and `) - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - Lesson 2.1 SUMMARY - - - 1. To store (yank, delete) text into, and retrieve (paste) from, a total of - 26 registers (a-z) - 2. Yank a whole word from anywhere within a word: yiw - 3. Change a whole word from anywhere within a word: ciw - 4. Insert text directly from registers in insert mode: (C-r)a - - 5. Insert the results of simple arithmetic operations: (C-r)=60*60 - in insert mode - 6. Insert the results of system calls: (C-r)=system('ls -1') - in insert mode - - 7. Inspect registers with :reg - 8. Learn the final destination of whole line deletions: dd in the numbered - registers, i.e. descending from register 1 - 9. Appreciate that whole - line deletions are preserved in the numbered registers longer than any - other operation - 9. Learn the final destination of all yanks in the numbered registers and - how ephemeral they are - - 10. Place marks from command mode m[a-zA-Z0-9] - 11. Move line-wise to a mark with ' - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - This concludes chapter two of the Vim Tutor. It is a work in progress. - - This chapter was written by Paul D. Parker. - -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/INSTALLpc.txt b/src/INSTALLpc.txt index c1099295fb..24bbe04f33 100644 --- a/src/INSTALLpc.txt +++ b/src/INSTALLpc.txt @@ -1,4 +1,4 @@ -INSTALLpc.txt - Installation of Vim on PC - Last Update: 2024 Dec 27 +INSTALLpc.txt - Installation of Vim on PC - Last Update: 2025 May 14 This file contains instructions for compiling Vim. If you already have an executable version of Vim, you don't need this. @@ -183,7 +183,9 @@ src/INSTALLpc.txt file for instructions. 2. MSYS2 with MinGW =================== -2.1. Setup the basic msys2 environment +2.1 Buidling x86 32bit or 64bit versions. + +2.1.1. Setup the basic msys2 environment Go to the official page of MSYS2: https://www.msys2.org Download an installer: @@ -208,7 +210,7 @@ If pacman complains that `catgets` and `libcatgets` conflict with another package, select `y` to remove them. -2.2. Install additional packages for building Vim +2.1.2. Install additional packages for building Vim The following package groups are required for building Vim: @@ -230,7 +232,7 @@ Or you can use the `pacboy` command to avoid long package names: The suffix ":" means that it disables the package name translation. The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix -to install only i686, and the ":x" suffix to install only x86_64. +to install only i686, the ":x" suffix for x86_64 and ":a" for "aarch64". (See `pacboy help` for the help.) See also the pacman page in ArchWiki for the general usage of pacman: @@ -241,7 +243,7 @@ MSYS2 has its own git package, and you can also install it via pacman: $ pacman -S git -2.3. Keep the build environment up-to-date +2.1.3. Keep the build environment up-to-date After you have installed the build environment, you may want to keep it up-to-date (E.g. always use the latest GCC). @@ -249,7 +251,7 @@ In that case, you just need to execute the command: $ pacman -Syu -2.4. Build Vim +2.1.4. Build Vim Select one of the following icon from the Start Menu: @@ -276,7 +278,7 @@ This command is in msys32.bat. Or for the 64 bit compiler use msys64.bat: If you have msys64 in another location you will need to adjust the paths for that. -2.5. Build Vim with Clang +2.1.5. Build Vim with Clang The following package group is required for building Vim with Clang: @@ -301,6 +303,71 @@ To build Vim with the address sanitizer (ASAN), execute the following command: CXX=clang++ make -f Make_ming.mak DEBUG=yes ASAN=yes +2.2 Buidling an Arch64 version of Vim + +2.2.1. Setup the basic msys2 environment + +See also https://www.msys2.org/wiki/arm64/ +Go to the official page of MSYS2: https://www.msys2.org + +Download the self-extracting archive: + +* msys2-base-x86_64-latest.sfx.exe + +Execute the self-extracting archive into a folder of your choice. +In the extracted folder, run clangarm64.exe +This will open a MSYS2 terminal window for you. + +Execute: + $ pacman -Syu + +And restart MSYS2 console. Then execute: + $ pacman -Su + + +2.2.2. Install additional packages for building Vim + + $ pacman -S mingw-w64-clang-aarch64-clang mingw-w64-clang-aarch64-toolchain base-devel git + +Or you can use the `pacboy` command to avoid long package names: + + $ pacboy -S base-devel: toolchain:a + +The suffix ":" means that it disables the package name translation. +The suffix ":m" means both i686 and x86_64. You can also use the ":i" suffix +to install only i686, the ":x" suffix for x86_64 and ":a" for "aarch64". +(See `pacboy help` for the help.) + +See also the pacman page in ArchWiki for the general usage of pacman: + https://wiki.archlinux.org/index.php/pacman + +2.2.3. Keep the build environment up-to-date + +After you have installed the build environment, you may want to keep it +up-to-date (E.g. always use the latest GCC). +In that case, you just need to execute the command: + $ pacman -Syu + + +2.2.4. Build Vim + +Before building look through notes for MinGW in part 3 below. + +Go to the source directory of Vim, then execute the make command. E.g.: + + CC=clang + CXX=clang++ + make -f Make_ming.mak + make -f Make_ming.mak GUI=yes + make -f Make_ming.mak GUI=no DEBUG=yes + +NOTE: you can't execute vim.exe in the MSYS2 console, open a normal Windows +console for that. + +To build Vim with the address sanitizer (ASAN), execute the following command: + + make -f Make_ming.mak DEBUG=yes ASAN=yes + 3. MinGW ======== diff --git a/src/MacVim/Info.plist b/src/MacVim/Info.plist index f6d8cc9203..3283d2096a 100644 --- a/src/MacVim/Info.plist +++ b/src/MacVim/Info.plist @@ -1255,7 +1255,7 @@ CFBundleVersion - 181.1 + 181.2 LSApplicationCategoryType public.app-category.productivity NSAppTransportSecurity diff --git a/src/MacVim/MacVim.entitlements b/src/MacVim/MacVim.entitlements index a4274d6eec..450073eb90 100644 --- a/src/MacVim/MacVim.entitlements +++ b/src/MacVim/MacVim.entitlements @@ -6,7 +6,5 @@ com.apple.security.cs.disable-library-validation - com.apple.security.get-task-allow - diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Autoupdate b/src/MacVim/Sparkle_2.framework/Versions/B/Autoupdate index 919a994ea3..ccfada3570 100755 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Autoupdate and b/src/MacVim/Sparkle_2.framework/Versions/B/Autoupdate differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdaterDelegate.h b/src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdaterDelegate.h index 1b63750ef2..dd09794543 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdaterDelegate.h +++ b/src/MacVim/Sparkle_2.framework/Versions/B/Headers/SPUUpdaterDelegate.h @@ -108,7 +108,7 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey; This feature was added in Sparkle 2. @return The set of channel names the updater is allowed to find new updates in. An empty set is the default behavior, - which means the updater will only look for updates in the default channel. + which means the updater will only look for updates in the default channel. The default channel is always included in the allowed set. */ - (NSSet *)allowedChannelsForUpdater:(SPUUpdater *)updater; @@ -137,7 +137,11 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey; /** Returns whether Sparkle should prompt the user about checking for new updates automatically. - Use this to override the default behavior. + Use this to override the default behavior, which is to prompt for permission to check for updates on second app launch + (if SUEnableAutomaticChecks is not specified). + + This method is not called if SUEnableAutomaticChecks is defined in Info.plist or + if the user has responded to a permission prompt before. @param updater The updater instance. @return @c YES if the updater should prompt for permission to check for new updates automatically, otherwise @c NO @@ -382,7 +386,7 @@ SU_EXPORT extern NSString *const SUSystemProfilerPreferredLanguageKey; @param updater The updater instance. @return The custom version comparator or @c nil if you don't want to be delegated this task. */ -- (nullable id)versionComparatorForUpdater:(SPUUpdater *)updater; +- (nullable id)versionComparatorForUpdater:(SPUUpdater *)updater __deprecated_msg("Custom version comparators are deprecated because they are incompatible with how the system compares different versions of an app."); /** Called when a background update will be scheduled after a delay. diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdateAlert.nib b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdateAlert.nib index 480942352b..036e739a86 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdateAlert.nib and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdateAlert.nib differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-101300.nib b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-101300.nib index 0f58658434..603950bc3d 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-101300.nib and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-101300.nib differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-110000.nib b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-110000.nib index a7903eb9ec..a4cc88ffc2 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-110000.nib and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-110000.nib differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/Sparkle.strings index 4f44fbc92c..56a232c127 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Base.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Info.plist b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Info.plist index ef53867118..8710ef099e 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Info.plist +++ b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 22G720 + 24F74 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 2.6.4 + 2.7.1 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,23 +25,23 @@ MacOSX CFBundleVersion - 2039.1 + 2045 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - + 24B75 DTPlatformName macosx DTPlatformVersion - 14.2 + 15.1 DTSDKBuild - 23C53 + 24B75 DTSDKName - macosx14.2 + macosx15.1 DTXcode - 1520 + 1610 DTXcodeBuild - 15C500b + 16B40 LSMinimumSystemVersion 10.13 diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/SUStatus.nib b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/SUStatus.nib index be31fc26af..2f39c951d5 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/SUStatus.nib and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/SUStatus.nib differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ca.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ca.lproj/Sparkle.strings index 1a8d279b47..21ceed8282 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ca.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ca.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/cs.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/cs.lproj/Sparkle.strings index 8025bac12a..16760c304d 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/cs.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/cs.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/da.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/da.lproj/Sparkle.strings index 07b5827d5f..ec21c4129b 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/da.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/da.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/de.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/de.lproj/Sparkle.strings index d551282f6a..f23d7ca4e0 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/de.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/de.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/el.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/el.lproj/Sparkle.strings index 805e4074cf..7ced09bc1c 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/el.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/el.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/es.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/es.lproj/Sparkle.strings index 3e860d24b6..f21f746551 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/es.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/es.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/fa.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/fa.lproj/Sparkle.strings index 342f6584f6..93920083a2 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/fa.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/fa.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/fr.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/fr.lproj/Sparkle.strings index 8a9ee04797..542150576e 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/fr.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/fr.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/he.lproj/SUUpdateAlert.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/he.lproj/SUUpdateAlert.strings index dc8fa211ec..0fe2a96799 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/he.lproj/SUUpdateAlert.strings +++ b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/he.lproj/SUUpdateAlert.strings @@ -1,8 +1,8 @@ /* Class = "NSWindow"; title = "Software Update"; ObjectID = "5"; */ -"5.title" = "עדכון תכנה"; +"5.title" = "עדכון תוכנה"; /* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */ -"170.title" = "פרטי גרסה:"; +"170.title" = "הערות שחרור:"; /* Class = "NSButtonCell"; title = "Remind Me Later"; ObjectID = "171"; */ "171.title" = "הזכר לי מאוחר יותר"; @@ -11,7 +11,7 @@ "172.title" = "דלג על גרסה זו"; /* Class = "NSButtonCell"; title = "Install Update"; ObjectID = "173"; */ -"173.title" = "התקן עדכון"; +"173.title" = "התקן את העדכון"; /* Class = "NSButtonCell"; title = "Automatically download and install updates in the future"; ObjectID = "175"; */ -"175.title" = "הורד והתקן עדכונים אוטומטית גם בעתיד"; +"175.title" = "הורד והתקן עדכונים בעתיד באופן אוטומטי"; diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/he.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/he.lproj/Sparkle.strings index 8a29dbe6ae..e643d5370c 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/he.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/he.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/hr.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/hr.lproj/Sparkle.strings index 2dc1a91841..b28308316a 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/hr.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/hr.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/it.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/it.lproj/Sparkle.strings index 27f0834001..fce4b6a254 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/it.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/it.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ja.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ja.lproj/Sparkle.strings index ecfe7e4264..5a79207415 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ja.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ja.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ko.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ko.lproj/Sparkle.strings index 5a5652baaa..80540be4c4 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ko.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ko.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nb.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nb.lproj/Sparkle.strings index 3d8e2aa2ad..97d43767f3 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nb.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nb.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nl.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nl.lproj/Sparkle.strings index 3c4c92ba18..b03a3bf610 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nl.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nl.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nn.lproj/SUUpdateAlert.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nn.lproj/SUUpdateAlert.strings index 4de4de2d72..f4172f6fc6 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nn.lproj/SUUpdateAlert.strings +++ b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nn.lproj/SUUpdateAlert.strings @@ -2,7 +2,7 @@ "5.title" = "Programoppdatering"; /* Class = "NSTextFieldCell"; title = "Release Notes:"; ObjectID = "170"; */ -"170.title" = "Om oppdateringen:"; +"170.title" = "Om oppdateringa:"; /* Class = "NSButtonCell"; title = "Remind Me Later"; ObjectID = "171"; */ "171.title" = "Utsett"; diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nn.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nn.lproj/Sparkle.strings index 400fad7ef5..aad25f42f6 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nn.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/nn.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pl.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pl.lproj/Sparkle.strings index 33226f240c..0848478df2 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pl.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pl.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pt-BR.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pt-BR.lproj/Sparkle.strings index 6c393ab947..0f3b0c5664 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pt-BR.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pt-BR.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pt-PT.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pt-PT.lproj/Sparkle.strings index fddae71bb5..b8f3213b08 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pt-PT.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/pt-PT.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ro.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ro.lproj/Sparkle.strings index f08fba0eb3..1e910ad081 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ro.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ro.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ru.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ru.lproj/Sparkle.strings index 1ce90e80bd..5452deb17d 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ru.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/ru.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/sk.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/sk.lproj/Sparkle.strings index 9e3444e0d8..8e9a150aad 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/sk.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/sk.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/sl.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/sl.lproj/Sparkle.strings index 2e64a63baf..085252e71f 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/sl.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/sl.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/th.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/th.lproj/Sparkle.strings index 6b8c878683..6b8734e166 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/th.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/th.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/tr.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/tr.lproj/Sparkle.strings index 88784d3263..98fdde8859 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/tr.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/tr.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/uk.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/uk.lproj/Sparkle.strings index e3f0791902..1e811b2cdf 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/uk.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/uk.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_CN.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_CN.lproj/Sparkle.strings index 3acf2a0c65..1e3a42a080 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_CN.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_CN.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_HK.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_HK.lproj/Sparkle.strings index 4d758a3c87..b9dfe52955 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_HK.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_HK.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_TW.lproj/Sparkle.strings b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_TW.lproj/Sparkle.strings index 6018e8bca0..1e826ad212 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_TW.lproj/Sparkle.strings and b/src/MacVim/Sparkle_2.framework/Versions/B/Resources/zh_TW.lproj/Sparkle.strings differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Sparkle b/src/MacVim/Sparkle_2.framework/Versions/B/Sparkle index c168dfabd2..c216fa3a91 100755 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Sparkle and b/src/MacVim/Sparkle_2.framework/Versions/B/Sparkle differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/Info.plist b/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/Info.plist index d9eef639a1..25ebe87267 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/Info.plist +++ b/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 22G720 + 24F74 CFBundleDevelopmentRegion en CFBundleExecutable @@ -55,7 +55,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.6.4 + 2.7.1 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -63,23 +63,23 @@ MacOSX CFBundleVersion - 2039.1 + 2045 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - + 24B75 DTPlatformName macosx DTPlatformVersion - 14.2 + 15.1 DTSDKBuild - 23C53 + 24B75 DTSDKName - macosx14.2 + macosx15.1 DTXcode - 1520 + 1610 DTXcodeBuild - 15C500b + 16B40 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/MacOS/Updater b/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/MacOS/Updater index dad8002cd8..05ca615e62 100755 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/MacOS/Updater and b/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/MacOS/Updater differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/Resources/SUStatus.nib b/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/Resources/SUStatus.nib index be31fc26af..2f39c951d5 100644 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/Resources/SUStatus.nib and b/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/Resources/SUStatus.nib differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/_CodeSignature/CodeResources b/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/_CodeSignature/CodeResources index 03549c4cc0..9e5328ba74 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/_CodeSignature/CodeResources +++ b/src/MacVim/Sparkle_2.framework/Versions/B/Updater.app/Contents/_CodeSignature/CodeResources @@ -6,7 +6,7 @@ Resources/SUStatus.nib - wynGxRmaznvKG2L/LPvVOJEsppM= + F10odNSB22LnWavm8BKYRztljaQ= files2 @@ -15,7 +15,7 @@ hash2 - LqrcSrjlLj0k1M9i0eVaZkLZQ2wmvWtwA7jvX8SGcwU= + msjlCHgfQ2V9V4Dt6Z5968eaMn6zeL/en7Mg22/5Pso= diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Downloader.xpc/Contents/Info.plist b/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Downloader.xpc/Contents/Info.plist index 50bdb4e75f..14aa52bcef 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Downloader.xpc/Contents/Info.plist +++ b/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Downloader.xpc/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 22G720 + 24F74 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 2.6.4 + 2.7.1 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,23 +25,23 @@ MacOSX CFBundleVersion - 2039.1 + 2045 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - + 24B75 DTPlatformName macosx DTPlatformVersion - 14.2 + 15.1 DTSDKBuild - 23C53 + 24B75 DTSDKName - macosx14.2 + macosx15.1 DTXcode - 1520 + 1610 DTXcodeBuild - 15C500b + 16B40 LSMinimumSystemVersion 10.13 NSAppTransportSecurity diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Downloader.xpc/Contents/MacOS/Downloader b/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Downloader.xpc/Contents/MacOS/Downloader index 7f0f2c7d93..7700c851d0 100755 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Downloader.xpc/Contents/MacOS/Downloader and b/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Downloader.xpc/Contents/MacOS/Downloader differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Installer.xpc/Contents/Info.plist b/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Installer.xpc/Contents/Info.plist index ed4ab6a1c0..01e1ab0473 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Installer.xpc/Contents/Info.plist +++ b/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Installer.xpc/Contents/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 22G720 + 24F74 CFBundleDevelopmentRegion en CFBundleExecutable @@ -17,7 +17,7 @@ CFBundlePackageType XPC! CFBundleShortVersionString - 2.6.4 + 2.7.1 CFBundleSignature ???? CFBundleSupportedPlatforms @@ -25,23 +25,23 @@ MacOSX CFBundleVersion - 2039.1 + 2045 DTCompiler com.apple.compilers.llvm.clang.1_0 DTPlatformBuild - + 24B75 DTPlatformName macosx DTPlatformVersion - 14.2 + 15.1 DTSDKBuild - 23C53 + 24B75 DTSDKName - macosx14.2 + macosx15.1 DTXcode - 1520 + 1610 DTXcodeBuild - 15C500b + 16B40 LSMinimumSystemVersion 10.13 NSHumanReadableCopyright diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Installer.xpc/Contents/MacOS/Installer b/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Installer.xpc/Contents/MacOS/Installer index 15cde7a67e..e65a4d85b5 100755 Binary files a/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Installer.xpc/Contents/MacOS/Installer and b/src/MacVim/Sparkle_2.framework/Versions/B/XPCServices/Installer.xpc/Contents/MacOS/Installer differ diff --git a/src/MacVim/Sparkle_2.framework/Versions/B/_CodeSignature/CodeResources b/src/MacVim/Sparkle_2.framework/Versions/B/_CodeSignature/CodeResources index be2efc2ea8..d037440866 100644 --- a/src/MacVim/Sparkle_2.framework/Versions/B/_CodeSignature/CodeResources +++ b/src/MacVim/Sparkle_2.framework/Versions/B/_CodeSignature/CodeResources @@ -6,23 +6,23 @@ Resources/Base.lproj/SUUpdateAlert.nib - 0rW1wTNcm/Uu4ix8yhISrWRKwKU= + PcmPQ5PkNUQbIm63Lz9sGqS3Zo4= Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-101300.nib - 0faCRWKAGe89/C2vGoilEmwgpjs= + JrbMp4B+sF01oqE++7qM4+lesU8= Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-110000.nib - gCq7ramhj8vmmJR4Ku5qE9S5Nhc= + tkAMCg7eArVqgWxlHOgjeWwIh2I= Resources/Base.lproj/Sparkle.strings - yENpjnRY3Io5iY3w/nXBi2P2CFc= + pAyxkvXEa1VYttb53ia0t3P1TGY= Resources/Info.plist - 8898FLXaAgWaPlgE1aZ3Sj7YpPg= + wXJdsGhwBC78/vnlxpGNRcoJOo4= Resources/ReleaseNotesColorStyle.css @@ -30,7 +30,7 @@ Resources/SUStatus.nib - wynGxRmaznvKG2L/LPvVOJEsppM= + F10odNSB22LnWavm8BKYRztljaQ= Resources/ar.lproj/SUUpdateAlert.strings @@ -72,7 +72,7 @@ hash - DL6k3g2A8CPQPkykQht4w+H/xYc= + KNs5vPpTuHWbG6nFpC1whO4KeAs= optional @@ -99,7 +99,7 @@ hash - KTLNyu97zLvTNgaUfYWqc8nB9C4= + BWMaDw6qC8BVuA7Sgi4yCI9PLE8= optional @@ -126,7 +126,7 @@ hash - 7MO7J38OUDrmZMLJiNSeNRATia8= + HLtVLvZwASiygsiyWKQbf/xJUxs= optional @@ -153,7 +153,7 @@ hash - FcFO4FvZjeiHQb9cbZI1wh1jHT4= + +UtK947GbWlGrHkPf2vScu5uqbE= optional @@ -180,7 +180,7 @@ hash - 6VadVc0qrgmUnWfL3FgiI6TzchM= + 9UeCcfb2L6dVPSZnXLzdkFW2GDM= optional @@ -225,7 +225,7 @@ hash - bt9xytBAy/CZ0aLyzGAKrh1dVZc= + s5wDya2zzL7tcyVlcPo9/F8I9/c= optional @@ -234,7 +234,7 @@ hash - IySTqO8MqmOO/IHR5WBZdf0jYaA= + kXmDOKYT484fFJrriUe3zomlV64= optional @@ -288,7 +288,7 @@ hash - BS6wdN+n1R2u/skiaNGAfrXwcKA= + uTXM8PB96z88GkvNFhyvR/7ZCOc= optional @@ -297,7 +297,16 @@ hash - nZXhvxaoacIflCBRrHxQ4NDkeKg= + UqQyzt7i1BzLE/1l70C8EbAHpPw= + + optional + + + Resources/he.lproj/SUUpdatePermissionPrompt.strings + + hash + + dexoxvq5Mj4kIvh+qtUm1tChHvo= optional @@ -306,7 +315,7 @@ hash - +bhO5LfEJtbZlq+wfPs/WUEO2ic= + ytz0i0mchT2bWQ89CgV2ZjC+HFo= optional @@ -333,7 +342,7 @@ hash - 70rdfUc3cUNcMed6Hq4zQBWoGrk= + bUdgUfCRgtrzw1YzsRrGCVY9Tms= optional @@ -414,7 +423,7 @@ hash - HvJh7rlxinaVRX3rGu84YDTq5j8= + 4dXESUaHE2dFeufUHNwRIqZX9Wc= optional @@ -441,7 +450,7 @@ hash - XybbnN3dRODKY9v8li4+41QLCpc= + PSzuLg6o8oUsLxsm8t81XLFGCZg= optional @@ -468,7 +477,7 @@ hash - 30lZbzu4QerfbEwayFqoboTwLSs= + PG5i0JLjiHsmQaKDJEna5hDIsnk= optional @@ -495,7 +504,7 @@ hash - Xm8t/g53ktlmyq8w1aI29nEiGO8= + bV8ftjOesaSv8Q38w8irgIv/al4= optional @@ -522,7 +531,7 @@ hash - HUFefTfqhwJx6nNNmACg3qxtHKo= + 5ICRko8SDlROYWigTD41Ukfe13U= optional @@ -531,7 +540,7 @@ hash - v2c8gYdlWN2U2PbZlUQwmfWIeGk= + OSmchqvF31OYAu223yZI6p3J4g4= optional @@ -549,7 +558,7 @@ hash - 8GnPpOmTh7bQRiUCzZDL6pq1KNE= + zeWvaM0pXtKqlA2EbY5ZKjcJ0ws= optional @@ -576,7 +585,7 @@ hash - MXjhjMKrcFaSZhXYssMrBTXPu80= + oWDxhBptd82i6ZmAqb12V/ie16Q= optional @@ -603,7 +612,7 @@ hash - mVP9x5C0h0Q+njDLXhZXmDsOjWM= + bqAxqCt98Zz3ABFiwwwYXQ5RlKo= optional @@ -630,7 +639,7 @@ hash - 6IY8J7Jbjd3eG/BMld5iJSwZZvM= + k2BwHr4kNubgvwIIu5MHJl0uWck= optional @@ -657,7 +666,7 @@ hash - rihcAKPJ1j7EoW5B+lq7Dpci/Zo= + d8GetrPioKdukXC3+9RWZjJr8GY= optional @@ -684,7 +693,7 @@ hash - ZtVq/Mf1qT9j8xdhz9ULfJ1O05k= + NX1iJXeJfZM/lLLj7Tt/9vRGlhs= optional @@ -711,7 +720,7 @@ hash - gqdvwKoHMg+gDZ4MZVVqbV4yqI8= + vR3wiQ+pBcmOi9SbgnU3KN+pfeQ= optional @@ -738,7 +747,7 @@ hash - hz8NwYxW1d0aWPQDMF8/c4lJRwU= + jlj1XBE0qnu8pOj1JWwNTkuApsw= optional @@ -792,7 +801,7 @@ hash - O9PZTdxbP4Y306ym/2sJ6p5klE0= + cHFejOD/e8AZNJ6m+9pJO20GLO4= optional @@ -819,7 +828,7 @@ hash - DzlYjutWBP2dCq5D9RQaB5mCf94= + vH9BCtbtOSwK4l2PV03JXOAdkUk= optional @@ -846,7 +855,7 @@ hash - 3YLrl/aRzoPCubIKa873XDZeU1w= + Q2Yszs2/8NW6kuRp8rQasC+ddL0= optional @@ -873,7 +882,7 @@ hash - Q18TnLdR6a0E72xXP6ETh0FF4CY= + rbBF5STK0BIDGJVCzYm2QBsEBWw= optional @@ -900,7 +909,7 @@ hash - v2NQCc/vUJacBpqiLL5yANtiGc4= + MZXR0fFAMrdBQPKAjYvzVQdzNCk= optional @@ -927,7 +936,7 @@ hash - 48nGyIkkDrsDKSq77pFReYsumCA= + 1cp4nThwvuJlVhetrBKY1Dh0IJA= optional @@ -939,10 +948,10 @@ cdhash - 8SHNI2//iEq3D5kTas9tzb/l8Ok= + qQxnZU1QdwbUQBXZyrH2V1ChI/A= requirement - cdhash H"f121cd236fff884ab70f99136acf6dcdbfe5f0e9" or cdhash H"82f6861d22cb4b317c616706faea20f034a09868" + cdhash H"a90c67654d507706d44015d9cab1f65750a123f0" or cdhash H"2db2b41972e392d082f8e4389149c75b33f67bcc" Headers/SPUDownloadData.h @@ -997,7 +1006,7 @@ hash2 - A7Rnysd5Q/yqhviRSeLa7hyuJQcqe4eRb+qxnUx7S9g= + bUP8h5u5vMbDU68cKrno2Y22fRQTrOJp5Ipj2rHTSbc= Headers/SPUUpdaterSettings.h @@ -1158,35 +1167,35 @@ hash2 - msqgijJ6kRed766AfmWbJn145KdRi5g9UAZA1lbU8hc= + bgRZIOcTfZL9pl4BT/HvgIT5ZPhs3PrnmLIjNgITHQc= Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-101300.nib hash2 - FE1Ls8JHeImpqisF2F5vkgNrgyLy3esoM5CoEU910U0= + fy81zcr5Zv60ws5tSpTwuIz6KA+G/FvUGqQi1VeNU+w= Resources/Base.lproj/SUUpdatePermissionPrompt.nib/keyedobjects-110000.nib hash2 - T43hI+h3I1bnq0zpNmBQjHnZX8nF4ceCX9n8n0t8KNE= + YphQq0fD3fZ5t8uYO1r6pZg0EERR6ufHAkOS/3bi4m4= Resources/Base.lproj/Sparkle.strings hash2 - aZ6hIsTY6mApb4yL8CxqMHw0W1sTdp71lBqcEBR5ATk= + pJuZ4AXoYAPXaXMNPVsYwbjuBIkF7E74sl51ZQ6aS6Q= Resources/Info.plist hash2 - +BB+A7FvWsdNGRdHPjnpR/ph7s+cZH/weSOLH1MDDuA= + I/DvncfquNtI8SR/sgA4MwNNnnEehgIG1Q8GbOtRpaA= Resources/ReleaseNotesColorStyle.css @@ -1200,7 +1209,7 @@ hash2 - LqrcSrjlLj0k1M9i0eVaZkLZQ2wmvWtwA7jvX8SGcwU= + msjlCHgfQ2V9V4Dt6Z5968eaMn6zeL/en7Mg22/5Pso= Resources/ar.lproj/SUUpdateAlert.strings @@ -1243,7 +1252,7 @@ hash2 - 3iHHzb3P1DvR6KaXp59ybrj1JySnfOgPbOigOIgI7es= + q5q/aoEk+YqUvSwYTQoIFsLkOCGi0GrSU9M7jJjbFls= optional @@ -1270,7 +1279,7 @@ hash2 - 2Nm0MQj4WgMucaSuEdljuTIGS/oceXEuVWi2kDgjRq0= + jJ0IN1A7sFqS9MHzYIVu5VNP397YTaDN17HzroZOEtg= optional @@ -1297,7 +1306,7 @@ hash2 - BOUi5PfyUb/ZRM6WZOuFC34IOic4+XPJkLikDtwhZIw= + LirzjdLk2XjCuG2WQSlj/+Ri7kuJWGCKHYjlAbEs/u8= optional @@ -1324,7 +1333,7 @@ hash2 - Wv+mo8RfxojepYE9GcBeYwUNycpqkk9qo/BjYGwb08M= + +s2Td5ADN+Rd4/RXNcTw6CpoP1A8s39Gg9Pe5+9bP+g= optional @@ -1351,7 +1360,7 @@ hash2 - Bl2oDZnDwbj55sSp/MNoHmcSbiOW5kxY1OGcL3k5scY= + lipDQYoREFmgYjH/L6Hxgq7ZUzqDs4eCf3uF9ud8V6o= optional @@ -1396,7 +1405,7 @@ hash2 - ePEUtDjS6DBYvydizpitYtRl22FpVXHcVWNAkniUsQg= + a/q2vGBx2sEPgWuCojPnHLSaxlyIyFQScfSU9kJCW6I= optional @@ -1405,7 +1414,7 @@ hash2 - Ue4NSlcLQL9OAOrD5Ibul1RaIwZOl6vcIv7DsffzQMA= + RySqsJrzYm/5ovwmAzh14SCylM/HQhMZnk/Ig1o7DkI= optional @@ -1459,7 +1468,7 @@ hash2 - O5To7z4frtvm1D6zwFzz6rpleVtia2BFro3bElXznDg= + 7mKHxz1DsYdoE7f7nXPNJn+bKFSFhL/rtJ8v7kj4cbo= optional @@ -1468,7 +1477,16 @@ hash2 - SmfKGCNVK9M61LCNGqWk4/FZInlcKG2U9uD5ajPVobw= + WsgO6lp/qlATRSKTuRsgSEyWC3VdH7EHaf6dwQH2R7E= + + optional + + + Resources/he.lproj/SUUpdatePermissionPrompt.strings + + hash2 + + l8hApwbD8wJajAI7FMKOztb0glfifBsELIttJ0rut5I= optional @@ -1477,7 +1495,7 @@ hash2 - dWNbn7k2fHYYtPta1WhZ1DvglupayXIaQjBYK/8G7cQ= + b9A+ycAkv1kaeQx2DWRY6g/YF5OKutwp3OgZTqsnMJ8= optional @@ -1504,7 +1522,7 @@ hash2 - Nmip9NgB014UDYN3yOsmsOFa9D3wED0L56Mve3WIVQg= + CDNSmpfDfg9ej5euTcVZn9qdwrITMM9eGHvazN/qaoI= optional @@ -1585,7 +1603,7 @@ hash2 - 2Glm2TwT78wZfe8iqBg8z/oCgrmtzqthnzNlHvHt5ls= + VtrQu7072Gm3W1Ftss0bT1HaDNXans+x1OSpryBAnIw= optional @@ -1612,7 +1630,7 @@ hash2 - 2afwbTtbV/x9iTHs2lInaksiJHghls+esi7MQ3bIq3Q= + 9/986n4BuwYWJvE7kvt3dEFYcqRUBomWR9K/VRhqVCY= optional @@ -1639,7 +1657,7 @@ hash2 - 5GHHunaDv0dty7CogRs+i3C+zY3SkTVkReD90hjRdGk= + +FiqGTbCIl9mzgETQukEUOwPP+yCyIhH1rVtteYpRFk= optional @@ -1666,7 +1684,7 @@ hash2 - 6sl0vlKoRBQtvGvC7oGwtHA8/B+fNdwBGwN2AyISsXQ= + HaK7lCMSQ/6QAhjF2NPsMSHsIjD4gGVRyno7LU4CfkI= optional @@ -1693,7 +1711,7 @@ hash2 - tBjWBavMtayqool9JGs+xH56A2Kui/7dRQX27xG2jx0= + 0FzLPeENJRrP48p4R9sZQ8Idb7RSPgGfxKfo3G7hHPQ= optional @@ -1702,7 +1720,7 @@ hash2 - giHYMaf7DkBFSModZ1CL3EswwwGHyOmkxRjtDP6bmk8= + dpngnl3ALnXwnnfHDsUnHAQGvaHux00hwlsOA/Q+Ixs= optional @@ -1720,7 +1738,7 @@ hash2 - ouNyYGUrFy2VqYdwZnSn1emcGTGoyHGqb8Sb9Cg0cWk= + l74nJ72QXsvfX67e7wiYv5R75YhNPEYYmhQRUPZgS0k= optional @@ -1747,7 +1765,7 @@ hash2 - KwctPd8Y+mrsEYWALAkKXeCfY4celUbA3MVn+Ye4Imc= + T2dYzgWycdgWtM2GradgZ/AVnqEQO2SoegYAL0W2blQ= optional @@ -1774,7 +1792,7 @@ hash2 - Kcwam/xq0V6VzMD4+rbUrDyAtrsl186J6lEeu5K2qD4= + v/+cq4Y3AZRgzPAw+Uayb16a/B4DsW9CREPLZ0ZeAzU= optional @@ -1801,7 +1819,7 @@ hash2 - RLdbB4cQnps2k/crFyvGScdjmGE3KSkG448wTbYi4vY= + HLPjh7OJ3y4u8VF5tWq4uwlZM+WN+R36xnBspxYufA0= optional @@ -1828,7 +1846,7 @@ hash2 - w2L0Ki7vhlIa92HDkDRmDExmCXIGkOWil+ROXr+6I+k= + Yxv56WlVa4Rme1qqV2WWPKFO1L5YcTZlpmPGMIYNxy0= optional @@ -1855,7 +1873,7 @@ hash2 - INHL+VHSTd0hjYmUXHPShl3l4xTB4C3KcCLgVn/AHGw= + PuJX1B8K6ruacb5r12BMc806qHX0YYUsdKzIQFfDxHE= optional @@ -1882,7 +1900,7 @@ hash2 - VmLLF6tJBA+j9jFby3BVx9GagD//qx4ETRywoU71PVQ= + qSS0yMxRzil00PjSBaev/rOo2hIw2L3weCw7KuC3WPA= optional @@ -1909,7 +1927,7 @@ hash2 - VTtzpxCnkPCO1yB2GviO6AkaZFKPpcUh530dTdqFcQE= + Q4g17Sb7/h2sQcSt3m+NyotwcVYQs7Bni47UBAs/+2c= optional @@ -1963,7 +1981,7 @@ hash2 - vj4h7104vuQqis9NXvSgrgQNz9czX6lMJqdvem4VCUk= + NLP4i+CKF5ehWqBBJuaKp5e5s4ghXesi+SNu1fKjhKY= optional @@ -1990,7 +2008,7 @@ hash2 - 4gu++3cg7m13GuNxuYNnb8ug7xC0s/B4KtUZ5D+AMec= + nDvfKMpj859i2WgGrsJ7SU8aApnABAX4fI6Oi8XgFRE= optional @@ -2017,7 +2035,7 @@ hash2 - gvuLzOKGahqSQtAwSCb9CuBAYuDVwfj+lwwSv/NPq8s= + zIBA0lJgtMZBvE35PSaFseeRbAuXK8+hs8f1K15msRY= optional @@ -2044,7 +2062,7 @@ hash2 - nKdLa3IQhWTKipj6MF+VwRUugjpvTVuGIpzQF/QDUYI= + nporciTF4tpZdmXibARMfweij3VC0/ffScoI32t3h1E= optional @@ -2071,7 +2089,7 @@ hash2 - AKEvYEi8FGZbbYnhpr2nqeUWrBQaj7wJjo8/KjED1U0= + K0EiYSQbTZEZG84QzfFr0YmJT6Lx8z0y63vYBmojCzc= optional @@ -2098,7 +2116,7 @@ hash2 - NhrxIO01cQJckmOoEhEbQ73y2RcEy8drXCHDvsvcLEw= + f9/Ie/kQ1VCKt2xveY7KlxJq9G1Qy/LttGgtIfSoxsk= optional @@ -2107,28 +2125,28 @@ cdhash - FUu8fe4a0BThd4e3aAS1ESFerTA= + hgqdqSJKiC72OINHzBKQdH/kUMo= requirement - cdhash H"154bbc7dee1ad014e17787b76804b511215ead30" or cdhash H"98978bf031c6ea78567452af336111bb74f503e5" + cdhash H"860a9da9224a882ef6388347cc1290747fe450ca" or cdhash H"0aee5266308de5eb155033b2a74bf37d6591569a" XPCServices/Downloader.xpc cdhash - X5fZetRn2Saen2h7dEPry59CnV0= + rzbdk6/kj7md9qiwOdSKKy5RTv4= requirement - cdhash H"5f97d97ad467d9269e9f687b7443ebcb9f429d5d" or cdhash H"d20a89312b4694cb7637a1beb849e39b54453b2b" + cdhash H"af36dd93afe48fb99df6a8b039d48a2b2e514efe" or cdhash H"e2247c8ac568d5dc90b6af02828fb6bfed800882" XPCServices/Installer.xpc cdhash - C2FFtOq0VOM5vJmKQYom8Xl9KVk= + cEeLZtkcKkxQwVXALAU01/pu8kk= requirement - cdhash H"0b6145b4eab454e339bc998a418a26f1797d2959" or cdhash H"bfe3d53e82fffda6c87e7dfa656e84ab49371973" + cdhash H"70478b66d91c2a4c50c155c02c0534d7fa6ef249" or cdhash H"e15aca1cf22ca1821e482d7c090fb266860fbf17" rules diff --git a/src/MacVim/scripts/sign-developer-id b/src/MacVim/scripts/sign-developer-id index 59cabea185..0e7a517403 100755 --- a/src/MacVim/scripts/sign-developer-id +++ b/src/MacVim/scripts/sign-developer-id @@ -2,24 +2,33 @@ # Utility script to sign MacVim with a valid Developer ID with hardened runtime # along with a provided entitlments file. This script requires a Developer ID -# cert already installed on the computer. +# cert already installed on the computer, unless only making adhoc signatures. # Use the following to verify: # codesign -d --verbose=4 --entitlements - if [[ $# == 0 || $# == 1 ]]; then - echo "Usage: sign-developer-id " + echo "Usage: sign-developer-id [--adhoc] " exit -1 fi set -e +signature_identity="Developer ID Application" + +if [[ "$1" == "--adhoc" ]]; then + # Create an adhoc signature. This is useful for local testing, but cannot + # generate a valid signed app that you could distribute to other people. + signature_identity="-" + shift +fi + macvim_path=$1 entitlements=$2 if [[ "$macvim_path" =~ dmg ]]; then set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path" + codesign -f -s "$signature_identity" -o runtime --timestamp "$macvim_path" else # Sign bottom-up to make sure everything is signed in order. # Note: Not using --deep because it's been deprecated since macOS 13, and @@ -27,21 +36,21 @@ else # explicit and sign everything in order to be clear what we are doing. if [ -d "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A" ]; then (set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop" - codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app") + codesign -f -s "$signature_identity" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app/Contents/MacOS/fileop" + codesign -f -s "$signature_identity" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/A/Resources/Autoupdate.app") fi if [ -d $macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B ]; then (set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate" - codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app") + codesign -f -s "$signature_identity" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B/Autoupdate" + codesign -f -s "$signature_identity" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework/Versions/B/Updater.app") fi if [ -d $macvim_path/Contents/Frameworks/Sparkle.framework ]; then (set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework") + codesign -f -s "$signature_identity" -o runtime --timestamp "$macvim_path/Contents/Frameworks/Sparkle.framework") fi set -x - codesign -f -s "Developer ID Application" -o runtime --timestamp "$macvim_path/Contents/Library/QuickLook/QLStephen.qlgenerator/Contents/MacOS/QLStephen" - codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements "$macvim_path/Contents/bin/xxd" - codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements "$macvim_path/Contents/MacOS/Vim" - codesign -f -s "Developer ID Application" -o runtime --timestamp --entitlements $entitlements "$macvim_path" + codesign -f -s "$signature_identity" -o runtime --timestamp "$macvim_path/Contents/Library/QuickLook/QLStephen.qlgenerator/Contents/MacOS/QLStephen" + codesign -f -s "$signature_identity" -o runtime --timestamp "$macvim_path/Contents/bin/xxd" + codesign -f -s "$signature_identity" -o runtime --timestamp --entitlements $entitlements "$macvim_path/Contents/MacOS/Vim" + codesign -f -s "$signature_identity" -o runtime --timestamp --entitlements $entitlements "$macvim_path" fi diff --git a/src/Make_ami.mak b/src/Make_ami.mak index 4dc86ddc6c..7c96467357 100644 --- a/src/Make_ami.mak +++ b/src/Make_ami.mak @@ -162,6 +162,7 @@ SRC += \ strings.c \ syntax.c \ tag.c \ + tabpanel.c \ term.c \ termlib.c \ testing.c \ @@ -182,6 +183,7 @@ SRC += \ vim9compile.c \ vim9execute.c \ vim9expr.c \ + vim9generics.c \ vim9instr.c \ vim9script.c \ vim9type.c \ diff --git a/src/Make_cyg_ming.mak b/src/Make_cyg_ming.mak index 991feb9631..6ae1c0a054 100644 --- a/src/Make_cyg_ming.mak +++ b/src/Make_cyg_ming.mak @@ -25,7 +25,7 @@ # http://www.matcode.com/mpress.htm # # Maintained by Ron Aaron et al. -# Updated 2014 Oct 13. +# Last Update: 2025 May 14. #>>>>> choose options: # FEATURES=[TINY | NORMAL | HUGE] @@ -58,6 +58,7 @@ GUI=yes # Set to no if you do not want to use DirectWrite (DirectX). # MinGW-w64 is needed, and ARCH should be set to i686 or x86-64. +# Note: Does not work with AARCH64 DIRECTX=yes # Disable Color emoji support @@ -66,6 +67,7 @@ DIRECTX=yes # Set to one of i386, i486, i586, i686 as the minimum target processor. # For amd64/x64 architecture set ARCH=x86-64 . +# For AARCH64, set to native # If not set, it will be automatically detected. (Normally i686 or x86-64.) #ARCH=i686 # Set to yes to cross-compile from unix; no=native Windows (and Cygwin). @@ -221,9 +223,14 @@ MKDIR = mkdir DIRSLASH = \\ endif endif + +# for AARCH64, set to clang +# CC := clang # set $CC to "gcc" unless it matches "clang" ifeq ($(findstring clang,$(CC)),) CC := $(CROSS_COMPILE)gcc +else ifeq ($(findstring clang,$(CXX)),) +CXX := clang++ endif # set $CXX to "g++" unless it matches "clang" ifeq ($(findstring clang,$(CXX)),) @@ -238,8 +245,15 @@ WINDRES := llvm-windres endif # Get the default ARCH. +# clang on AARCH64 does not like the native arch64-w64-windows-gnu +# so set to native instead ifndef ARCH +ARCH := $(shell $(CC) -dumpmachine) + ifeq ($(ARCH), aarch64-w64-windows-gnu) +ARCH := native + else ARCH := $(shell $(CC) -dumpmachine | sed -e "s/-.*//" -e "s/_/-/" -e "s/^mingw32$$/i686/") + endif endif @@ -718,6 +732,9 @@ XPM = xpm/x86 ifeq ($(ARCH),x86-64) XPM = xpm/x64 endif + ifeq ($(ARCH),native) +XPM = no + endif endif ifdef XPM ifneq ($(XPM),no) @@ -858,6 +875,7 @@ OBJ = \ $(OUTDIR)/spellsuggest.o \ $(OUTDIR)/strings.o \ $(OUTDIR)/syntax.o \ + $(OUTDIR)/tabpanel.o \ $(OUTDIR)/tag.o \ $(OUTDIR)/term.o \ $(OUTDIR)/testing.o \ @@ -877,6 +895,7 @@ OBJ = \ $(OUTDIR)/vim9compile.o \ $(OUTDIR)/vim9execute.o \ $(OUTDIR)/vim9expr.o \ + $(OUTDIR)/vim9generics.o \ $(OUTDIR)/vim9instr.o \ $(OUTDIR)/vim9script.o \ $(OUTDIR)/vim9type.o \ @@ -1186,7 +1205,7 @@ tee/tee.exe: tee/tee.c $(MAKE) -C tee -f Make_ming.mak CC='$(CC)' GvimExt/gvimext.dll: GvimExt/gvimext.cpp GvimExt/gvimext.rc GvimExt/gvimext.h - $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX='$(CXX)' STATIC_STDCPLUS=$(STATIC_STDCPLUS) + $(MAKE) -C GvimExt -f Make_ming.mak CROSS=$(CROSS) CROSS_COMPILE=$(CROSS_COMPILE) CXX=$(CXX) STATIC_STDCPLUS=$(STATIC_STDCPLUS) tags: notags $(CTAGS) $(TAGS_FILES) @@ -1215,14 +1234,14 @@ endif $(MAKE) -C xxd -f Make_ming.mak clean $(MAKE) -C tee -f Make_ming.mak clean -# Run vim script to generate the Ex command lookup table. +# Run Vim script to generate the Ex command lookup table. # This only needs to be run when a command name has been added or changed. # If this fails because you don't have Vim yet, first build and install Vim # without changes. cmdidxs: ex_cmds.h vim --clean -N -X --not-a-term -u create_cmdidxs.vim -c quit -# Run vim script to generate the normal/visual mode command lookup table. +# Run Vim script to generate the normal/visual mode command lookup table. # This only needs to be run when a new normal/visual mode command has been # added. If this fails because you don't have Vim yet: # - change nv_cmds[] in nv_cmds.h to add the new normal/visual mode command. @@ -1310,6 +1329,8 @@ $(OUTDIR)/vim9execute.o: vim9execute.c $(INCL) vim9.h $(OUTDIR)/vim9expr.o: vim9expr.c $(INCL) vim9.h +$(OUTDIR)/vim9generics.o: vim9generics.c $(INCL) vim9.h + $(OUTDIR)/vim9instr.o: vim9instr.c $(INCL) vim9.h $(OUTDIR)/vim9script.o: vim9script.c $(INCL) vim9.h diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak index 282586536d..f4899d5661 100644 --- a/src/Make_mvc.mak +++ b/src/Make_mvc.mak @@ -342,7 +342,11 @@ MSVCRT_NAME = vcruntime$(MSVCRT_VER) ### Set the default $(WINVER) to make it work with Windows 7 !ifndef WINVER +! if "$(CPU)" == "ARM64" +WINVER = 0x0A00 +! else WINVER = 0x0601 +! endif !endif # Use multiprocess build @@ -533,7 +537,7 @@ CON_LIB = $(CON_LIB) /DELAYLOAD:comdlg32.dll /DELAYLOAD:ole32.dll DelayImp.lib CFLAGS = -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DHAVE_STDINT_H \ $(CSCOPE_DEFS) $(TERM_DEFS) $(SOUND_DEFS) $(NETBEANS_DEFS) \ $(NBDEBUG_DEFS) $(XPM_DEFS) $(SOD_DEFS) $(SOD_INC) \ - $(CHANNEL_DEFS) $(DEFINES) \ + $(CHANNEL_DEFS) $(DEFINES) $(CI_CFLAGS) \ -DWINVER=$(WINVER) -D_WIN32_WINNT=$(WINVER) \ /source-charset:utf-8 @@ -571,7 +575,8 @@ CPUNR = sse2 ! error *** ERROR Unknown target architecture "$(CPUNR)". Make aborted. ! endif !elseif "$(CPU)" == "ARM64" -# TODO: Validate CPUNR. +# TODO: Validate CPUNR depending on the VS version. +CPUNR = armv8.0 !endif # Convert processor ID to MVC-compatible number @@ -779,6 +784,7 @@ OBJ = \ $(OUTDIR)\spellsuggest.obj \ $(OUTDIR)\strings.obj \ $(OUTDIR)\syntax.obj \ + $(OUTDIR)\tabpanel.obj \ $(OUTDIR)\tag.obj \ $(OUTDIR)\term.obj \ $(OUTDIR)\testing.obj \ @@ -797,6 +803,7 @@ OBJ = \ $(OUTDIR)\vim9compile.obj \ $(OUTDIR)\vim9execute.obj \ $(OUTDIR)\vim9expr.obj \ + $(OUTDIR)\vim9generics.obj \ $(OUTDIR)\vim9instr.obj \ $(OUTDIR)\vim9script.obj \ $(OUTDIR)\vim9type.obj \ @@ -1430,14 +1437,14 @@ clean: testclean $(MAKE) /NOLOGO -f Make_mvc.mak clean cd .. -# Run vim script to generate the Ex command lookup table. +# Run Vim script to generate the Ex command lookup table. # This only needs to be run when a command name has been added or changed. # If this fails because you don't have Vim yet, first build and install Vim # without changes. cmdidxs: ex_cmds.h vim --clean -N -X --not-a-term -u create_cmdidxs.vim -c quit -# Run vim script to generate the normal/visual mode command lookup table. +# Run Vim script to generate the normal/visual mode command lookup table. # This only needs to be run when a new normal/visual mode command has been # added. If this fails because you don't have Vim yet: # - change nv_cmds[] in nv_cmds.h to add the new normal/visual mode command. @@ -1778,6 +1785,8 @@ $(OUTDIR)/strings.obj: $(OUTDIR) strings.c $(INCL) $(OUTDIR)/syntax.obj: $(OUTDIR) syntax.c $(INCL) +$(OUTDIR)/tabpanel.obj: $(OUTDIR) tabpanel.c $(INCL) + $(OUTDIR)/tag.obj: $(OUTDIR) tag.c $(INCL) $(OUTDIR)/term.obj: $(OUTDIR) term.c $(INCL) @@ -1816,6 +1825,8 @@ $(OUTDIR)/vim9execute.obj: $(OUTDIR) vim9execute.c $(INCL) vim9.h $(OUTDIR)/vim9expr.obj: $(OUTDIR) vim9expr.c $(INCL) vim9.h +$(OUTDIR)/vim9generics.obj: $(OUTDIR) vim9generics.c $(INCL) vim9.h + $(OUTDIR)/vim9instr.obj: $(OUTDIR) vim9instr.c $(INCL) vim9.h $(OUTDIR)/vim9script.obj: $(OUTDIR) vim9script.c $(INCL) vim9.h @@ -2001,6 +2012,7 @@ proto.h: \ proto/spellsuggest.pro \ proto/strings.pro \ proto/syntax.pro \ + proto/tabpanel.pro \ proto/tag.pro \ proto/term.pro \ proto/testing.pro \ @@ -2019,6 +2031,7 @@ proto.h: \ proto/vim9compile.pro \ proto/vim9execute.pro \ proto/vim9expr.pro \ + proto/vim9generics.pro \ proto/vim9instr.pro \ proto/vim9script.pro \ proto/vim9type.pro \ diff --git a/src/Make_vms.mms b/src/Make_vms.mms index a30ed653e4..fb247f3ba4 100644 --- a/src/Make_vms.mms +++ b/src/Make_vms.mms @@ -424,6 +424,7 @@ SRC = \ spellsuggest.c \ strings.c \ syntax.c \ + tabpanel.c \ tag.c \ term.c \ terminal.c \ @@ -445,6 +446,7 @@ SRC = \ vim9compile.c \ vim9execute.c \ vim9expr.c \ + vim9generics.c \ vim9instr.c \ vim9script.c \ vim9type.c \ @@ -559,6 +561,7 @@ OBJ = \ spellsuggest.obj \ strings.obj \ syntax.obj \ + tabpanel.obj \ tag.obj \ term.obj \ terminal.obj \ @@ -580,6 +583,7 @@ OBJ = \ vim9compile.obj \ vim9execute.obj \ vim9expr.obj \ + vim9generics.obj \ vim9instr.obj \ vim9script.obj \ vim9type.obj \ @@ -1146,6 +1150,10 @@ syntax.obj : syntax.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ errors.h globals.h +tabpanel.obj : tabpanel.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h tag.obj : tag.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h termdefs.h macros.h structs.h regexp.h gui.h beval.h \ [.proto]gui_beval.pro option.h ex_cmds.h proto.h errors.h globals.h @@ -1219,6 +1227,10 @@ vim9expr.obj : vim9expr.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ errors.h globals.h version.h +vim9generics.obj : vim9generics.c vim.h [.auto]config.h feature.h os_unix.h \ + ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ + gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ + errors.h globals.h version.h vim9instr.obj : vim9instr.c vim.h [.auto]config.h feature.h os_unix.h \ ascii.h keymap.h termdefs.h macros.h structs.h regexp.h \ gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \ diff --git a/src/Makefile b/src/Makefile index 8694c5c3da..f04b1b4ffb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1423,6 +1423,7 @@ ALL_LIBS = \ $(GUI_LIBS2) \ $(X_PRE_LIBS) \ $(X_LIBS) \ + $(WAYLAND_LIBS) \ $(X_EXTRA_LIBS) \ $(MZSCHEME_LIBS) \ $(LIBS) \ @@ -1595,6 +1596,7 @@ BASIC_SRC = \ spellsuggest.c \ strings.c \ syntax.c \ + tabpanel.c \ tag.c \ term.c \ terminal.c \ @@ -1615,6 +1617,7 @@ BASIC_SRC = \ vim9compile.c \ vim9execute.c \ vim9expr.c \ + vim9generics.c \ vim9instr.c \ vim9script.c \ vim9type.c \ @@ -1632,13 +1635,23 @@ SRC = $(BASIC_SRC) \ $(PERL_SRC) \ $(PYTHON_SRC) $(PYTHON3_SRC) \ $(TCL_SRC) \ - $(RUBY_SRC) + $(RUBY_SRC) \ + $(WAYLAND_SRC) EXTRA_SRC = if_lua.c if_mzsch.c auto/if_perl.c if_perlsfio.c \ if_python.c if_python3.c if_tcl.c if_ruby.c \ gui_beval.c netbeans.c job.c channel.c \ $(GRESOURCE_SRC) +$(WAYLAND_SRC): + cd auto/wayland; $(MAKE) + +# Needed for parallel jobs to work +auto/wayland/ext-data-control-v1.h: auto/wayland/ext-data-control-v1.c +auto/wayland/wlr-data-control-unstable-v1.h: auto/wayland/wlr-data-control-unstable-v1.c +auto/wayland/primary-selection-unstable-v1.h: auto/wayland/primary-selection-unstable-v1.c +auto/wayland/xdg-shell.h: auto/wayland/xdg-shell.c + # Unittest files JSON_TEST_SRC = json_test.c JSON_TEST_TARGET = json_test$(EXEEXT) @@ -1654,7 +1667,8 @@ UNITTEST_TARGETS = $(JSON_TEST_TARGET) $(KWORD_TEST_TARGET) $(MEMFILE_TEST_TARGE RUN_UNITTESTS = run_json_test run_kword_test run_memfile_test run_message_test # All sources, also the ones that are not configured -ALL_LOCAL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC) +ALL_LOCAL_SRC = $(BASIC_SRC) $(ALL_GUI_SRC) $(UNITTEST_SRC) $(EXTRA_SRC) \ + $(WAYLAND_SRC) ALL_SRC = $(ALL_LOCAL_SRC) $(TERM_SRC) $(XDIFF_SRC) # Which files to check with lint. Select one of these three lines. ALL_SRC @@ -1756,6 +1770,7 @@ OBJ_COMMON = \ objects/spellsuggest.o \ objects/strings.o \ objects/syntax.o \ + objects/tabpanel.o \ objects/tag.o \ objects/term.o \ objects/terminal.o \ @@ -1776,6 +1791,7 @@ OBJ_COMMON = \ objects/vim9compile.o \ objects/vim9execute.o \ objects/vim9expr.o \ + objects/vim9generics.o \ objects/vim9instr.o \ objects/vim9script.o \ objects/vim9type.o \ @@ -1794,7 +1810,8 @@ OBJ_COMMON = \ $(OS_EXTRA_OBJ) \ $(NETBEANS_OBJ) \ $(CHANNEL_OBJ) \ - $(XDIFF_OBJS_USED) + $(XDIFF_OBJS_USED) \ + $(WAYLAND_OBJ) # The files included by tests are not in OBJ_COMMON. OBJ_MAIN = \ @@ -1949,6 +1966,7 @@ PRO_AUTO = \ spellsuggest.pro \ strings.pro \ syntax.pro \ + tabpanel.pro \ tag.pro \ term.pro \ terminal.pro \ @@ -1970,6 +1988,7 @@ PRO_AUTO = \ vim9compile.pro \ vim9execute.pro \ vim9expr.pro \ + vim9generics.pro \ vim9instr.pro \ vim9script.pro \ vim9type.pro \ @@ -2056,7 +2075,7 @@ autoconf: -rm -rf autom4te.cache -rm -f auto/config.status auto/config.cache -# Run vim script to generate the Ex command lookup table. +# Run Vim script to generate the Ex command lookup table. # This only needs to be run when a command name has been added or changed. # If this fails because you don't have Vim yet, first build and install Vim # without changes. @@ -2064,7 +2083,7 @@ autoconf: cmdidxs: ex_cmds.h vim --clean -X --not-a-term -S create_cmdidxs.vim -c quit -# Run vim script to generate the normal/visual mode command lookup table. +# Run Vim script to generate the normal/visual mode command lookup table. # This only needs to be run when a new normal/visual mode command has been # added. # This requires a "vim" executable with the +eval feature. @@ -2976,6 +2995,7 @@ clean celan: testclean macvimclean cd $(PODIR); $(MAKE) prefix=$(DESTDIR)$(prefix) clean; \ fi cd xxd; $(MAKE) clean + cd auto/wayland; $(MAKE) clean # Make a shadow directory for compilation on another system or with different # features: @@ -3004,6 +3024,8 @@ shadow: runtime pixmaps $(MKDIR_P) $(SHADOWDIR) cd $(SHADOWDIR); ln -s $(LINKEDFILES) . mkdir $(SHADOWDIR)/auto + mkdir $(SHADOWDIR)/auto/wayland + cd $(SHADOWDIR)/auto/wayland; ln -s ../../../auto/wayland/* . cd $(SHADOWDIR)/auto; ln -s ../../auto/configure . $(MKDIR_P) $(SHADOWDIR)/po cd $(SHADOWDIR)/po; ln -s ../../po/*.po ../../po/*.mak ../../po/*.vim ../../po/*.in ../../po/Makefile ../../po/*.c . @@ -3028,6 +3050,7 @@ shadow: runtime pixmaps ../../testdir/ru_RU \ ../../testdir/sautest \ ../../testdir/samples \ + ../../testdir/util \ ../../testdir/dumps \ ../../testdir/*.ok \ ../../testdir/testluaplugin \ @@ -3581,6 +3604,9 @@ objects/strings.o: strings.c objects/syntax.o: syntax.c $(CCC) -o $@ syntax.c +objects/tabpanel.o: tabpanel.c + $(CCC) -o $@ tabpanel.c + objects/tag.o: tag.c $(CCC) -o $@ tag.c @@ -3641,6 +3667,9 @@ objects/vim9execute.o: vim9execute.c objects/vim9expr.o: vim9expr.c $(CCC) -o $@ vim9expr.c +objects/vim9generics.o: vim9generics.c + $(CCC) -o $@ vim9generics.c + objects/vim9instr.o: vim9instr.c $(CCC) -o $@ vim9instr.c @@ -3656,6 +3685,21 @@ objects/viminfo.o: viminfo.c objects/window.o: window.c $(CCC) -o $@ window.c +objects/wayland.o: wayland.c + $(CCC) $(WAYLAND_CFLAGS) -o $@ wayland.c + +objects/wlr-data-control-unstable-v1.o: auto/wayland/wlr-data-control-unstable-v1.c + $(CCC) $(WAYLAND_CFLAGS) -o $@ auto/wayland/wlr-data-control-unstable-v1.c + +objects/ext-data-control-v1.o: auto/wayland/ext-data-control-v1.c + $(CCC) $(WAYLAND_CFLAGS) -o $@ auto/wayland/ext-data-control-v1.c + +objects/xdg-shell.o: auto/wayland/xdg-shell.c + $(CCC) $(WAYLAND_CFLAGS) -o $@ auto/wayland/xdg-shell.c + +objects/primary-selection-unstable-v1.o: auto/wayland/primary-selection-unstable-v1.c + $(CCC) $(WAYLAND_CFLAGS) -o $@ auto/wayland/primary-selection-unstable-v1.c + objects/netbeans.o: netbeans.c $(CCC) -o $@ netbeans.c @@ -3729,7 +3773,7 @@ Makefile: ############################################################################## ### MacVim GUI -.PHONY: macvim macvim-dmg macvim-dmg-legacy macvimclean macvim-signed macvim-dmg-release macvim-dmg-release-legacy macvim-install-runtime macvim-xcodeproj-compat +.PHONY: macvim macvim-dmg macvim-dmg-legacy macvimclean macvim-signed macvim-signed-adhoc macvim-dmg-release macvim-dmg-release-legacy macvim-install-runtime macvim-xcodeproj-compat RUNTIME_FOLDER_LIST = MacVim/auto/runtime_folder_list.xcfilelist @@ -3759,6 +3803,9 @@ macvim-tests: macvim-signed: MacVim/scripts/sign-developer-id $(RELEASEDIR)/MacVim.app $(ENTITLEMENTS) +macvim-signed-adhoc: + MacVim/scripts/sign-developer-id --adhoc $(RELEASEDIR)/MacVim.app $(ENTITLEMENTS) + macvim-dmg-legacy: DMGFILESYSTEM = HFS+ macvim-dmg-legacy: DMGFORMAT = UDZO macvim-dmg-legacy: macvim-dmg @@ -4346,6 +4393,11 @@ objects/syntax.o: syntax.c vim.h protodef.h auto/config.h feature.h os_unix.h \ proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ libvterm/include/vterm_keycodes.h xdiff/xdiff.h xdiff/../vim.h alloc.h \ ex_cmds.h spell.h proto.h globals.h errors.h +objects/tabpanel.o: tabpanel.c vim.h protodef.h auto/config.h feature.h os_unix.h \ + os_mac.h ascii.h keymap.h termdefs.h macros.h option.h beval.h \ + proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ + libvterm/include/vterm_keycodes.h xdiff/xdiff.h xdiff/../vim.h alloc.h \ + ex_cmds.h spell.h proto.h globals.h errors.h objects/tag.o: tag.c vim.h protodef.h auto/config.h feature.h os_unix.h os_mac.h \ ascii.h keymap.h termdefs.h macros.h option.h beval.h \ proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ @@ -4451,6 +4503,12 @@ objects/vim9expr.o: vim9expr.c vim.h protodef.h auto/config.h feature.h os_unix. proto/gui_beval.pro structs.h regexp.h gui.h libvterm/include/vterm.h \ libvterm/include/vterm_keycodes.h xdiff/xdiff.h xdiff/../vim.h alloc.h \ ex_cmds.h spell.h proto.h globals.h errors.h vim9.h +objects/vim9generics.o: vim9generics.c vim.h protodef.h auto/config.h feature.h \ + os_unix.h os_mac.h ascii.h keymap.h termdefs.h macros.h option.h \ + beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ + libvterm/include/vterm.h libvterm/include/vterm_keycodes.h \ + xdiff/xdiff.h xdiff/../vim.h alloc.h ex_cmds.h spell.h proto.h \ + globals.h errors.h objects/vim9instr.o: vim9instr.c vim.h protodef.h auto/config.h feature.h \ os_unix.h os_mac.h ascii.h keymap.h termdefs.h macros.h option.h \ beval.h proto/gui_beval.pro structs.h regexp.h gui.h \ diff --git a/src/README.md b/src/README.md index 404298863d..a01f695d93 100644 --- a/src/README.md +++ b/src/README.md @@ -35,7 +35,7 @@ clientserver.c | client server functionality clipboard.c | handling the clipboard cmdexpand.c | command-line completion cmdhist.c | command-line history -debugger.c | vim script debugger +debugger.c | Vim script debugger diff.c | diff mode (vimdiff) drawline.c | drawing a window line drawscreen.c | drawing the windows @@ -70,7 +70,7 @@ option.c | options optionstr.c | handling string options popupmenu.c | popup menu popupwin.c | popup window -profiler.c | vim script profiler +profiler.c | Vim script profiler quickfix.c | quickfix commands (":make", ":cn") regexp.c | pattern matching register.c | handling registers @@ -91,7 +91,7 @@ textformat.c | text formatting textobject.c | text objects textprop.c | text properties time.c | time and timer functions -typval.c | vim script type/value functions +typval.c | Vim script type/value functions undo.c | undo and redo usercmd.c | user defined commands userfunc.c | user defined functions diff --git a/src/arglist.c b/src/arglist.c index 4eec079df4..bfc8bbd121 100644 --- a/src/arglist.c +++ b/src/arglist.c @@ -561,7 +561,7 @@ check_arg_idx(win_T *win) } /* - * ":args", ":argslocal" and ":argsglobal". + * ":args", ":arglocal" and ":argglobal". */ void ex_args(exarg_T *eap) diff --git a/src/auto/configure b/src/auto/configure index d4ead96468..a5b9624e75 100755 --- a/src/auto/configure +++ b/src/auto/configure @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71. +# Generated by GNU Autoconf 2.72. # # -# Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, +# Copyright (C) 1992-1996, 1998-2017, 2020-2023 Free Software Foundation, # Inc. # # @@ -15,7 +15,6 @@ # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -24,12 +23,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -101,7 +101,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -131,15 +131,14 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then - as_bourne_compatible="as_nop=: -if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 + as_bourne_compatible="if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: @@ -147,12 +146,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST -else \$as_nop - case \`(set -o) 2>/dev/null\` in #( +else case e in #( + e) case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi " @@ -170,8 +170,9 @@ as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : -else \$as_nop - exitcode=1; echo positional parameters were not saved. +else case e in #( + e) exitcode=1; echo positional parameters were not saved. ;; +esac fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) @@ -185,14 +186,15 @@ test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes -else $as_nop - as_have_required=no +else case e in #( + e) as_have_required=no ;; +esac fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : -else $as_nop - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +else case e in #( + e) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do @@ -225,12 +227,13 @@ IFS=$as_save_IFS if $as_found then : -else $as_nop - if { test -f "$SHELL" || test -f "$SHELL.exe"; } && +else case e in #( + e) if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes -fi +fi ;; +esac fi @@ -252,7 +255,7 @@ case $- in # (((( esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail -# out after a failed `exec'. +# out after a failed 'exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi @@ -271,7 +274,8 @@ $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 -fi +fi ;; +esac fi fi SHELL=${CONFIG_SHELL-/bin/sh} @@ -310,14 +314,6 @@ as_fn_exit () as_fn_set_status $1 exit $1 } # as_fn_exit -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_mkdir_p # ------------- @@ -386,11 +382,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -404,21 +401,14 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith -# as_fn_nop -# --------- -# Do nothing but, unlike ":", preserve the value of $?. -as_fn_nop () -{ - return $? -} -as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- @@ -492,6 +482,8 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits /[$]LINENO/= ' <$as_myself | sed ' + t clear + :clear s/[$]LINENO.*/&-/ t lineno b @@ -540,7 +532,6 @@ esac as_echo='printf %s\n' as_echo_n='printf %s' - rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file @@ -552,9 +543,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -579,10 +570,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated test -n "$DJDIR" || exec 7<&0 /dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1034,7 +1034,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid feature name: \`$ac_useropt'" + as_fn_error $? "invalid feature name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1247,7 +1247,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1263,7 +1263,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error $? "invalid package name: \`$ac_useropt'" + as_fn_error $? "invalid package name: '$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1293,8 +1293,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error $? "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information" + -*) as_fn_error $? "unrecognized option: '$ac_option' +Try '$0 --help' for more information" ;; *=*) @@ -1302,7 +1302,7 @@ Try \`$0 --help' for more information" # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: '$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1352,7 +1352,7 @@ do as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done -# There might be people who depend on the old broken behavior: `$host' +# There might be people who depend on the old broken behavior: '$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias @@ -1420,7 +1420,7 @@ if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_msg="sources are in $srcdir, but 'cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` @@ -1448,7 +1448,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures this package to adapt to many kinds of systems. +'configure' configures this package to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1462,11 +1462,11 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking ...' messages + -q, --quiet, --silent do not print 'checking ...' messages --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' + -C, --config-cache alias for '--cache-file=config.cache' -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] + --srcdir=DIR find the sources in DIR [configure dir or '..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX @@ -1474,10 +1474,10 @@ Installation directories: --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. +By default, 'make install' will install all the files in +'$ac_default_prefix/bin', '$ac_default_prefix/lib' etc. You can specify +an installation prefix other than '$ac_default_prefix' using '--prefix', +for instance '--prefix=\$HOME'. For better control, use the options below. @@ -1564,6 +1564,7 @@ Optional Features: --enable-gpm=OPTS Use gpm (Linux mouse daemon). default=yes OPTS=yes/no/dynamic --disable-sysmouse Don't use sysmouse (mouse in *BSD console). --disable-nls Don't support NLS (gettext()). + --enable-year2038 support timestamps after 2038 Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1592,6 +1593,7 @@ Optional Packages: --with-properly-linked-python2-python3 Link with properly linked Python 2 and Python 3. --with-tclsh=PATH which tclsh to use (default: tclsh8.0) --with-ruby-command=RUBY name of the Ruby command (default: ruby) + --with-wayland Include support for the Wayland protocol. --with-x use the X Window System --with-gnome-includes=DIR Specify location of GNOME headers --with-gnome-libs=DIR Specify location of GNOME libs @@ -1611,7 +1613,7 @@ Some influential environment variables: CPP C preprocessor XMKMF Path to xmkmf, Makefile generator for X Window System -Use these variables to override the choices made by `configure' or to help +Use these variables to override the choices made by 'configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to the package provider. @@ -1679,9 +1681,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.71 +generated by GNU Autoconf 2.72 -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1720,11 +1722,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } && test -s conftest.$ac_objext then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1758,11 +1761,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval @@ -1800,11 +1804,12 @@ printf "%s\n" "$ac_try_echo"; } >&5 } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=1 + ac_retval=1 ;; +esac fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would @@ -1846,12 +1851,13 @@ printf "%s\n" "$ac_try_echo"; } >&5 test $ac_status = 0; }; } then : ac_retval=0 -else $as_nop - printf "%s\n" "$as_me: program exited with status $ac_status" >&5 +else case e in #( + e) printf "%s\n" "$as_me: program exited with status $ac_status" >&5 printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_retval=$ac_status + ac_retval=$ac_status ;; +esac fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno @@ -1871,8 +1877,8 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> @@ -1880,10 +1886,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1903,15 +1911,15 @@ printf %s "checking for $2... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $2 (); below. */ + which can conflict with char $2 (void); below. */ #include #undef $2 @@ -1922,7 +1930,7 @@ else $as_nop #ifdef __cplusplus extern "C" #endif -char $2 (); +char $2 (void); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ @@ -1941,11 +1949,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$3=yes" -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -1999,18 +2009,19 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid; break -else $as_nop - as_fn_arith $ac_mid + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith $ac_mid + 1 && ac_lo=$as_val if test $ac_lo -le $ac_mid; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid + 1 && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int @@ -2045,20 +2056,23 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_lo=$ac_mid; break -else $as_nop - as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' - 1 && ac_hi=$as_val if test $ac_mid -le $ac_hi; then ac_lo= ac_hi= break fi - as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val + as_fn_arith 2 '*' $ac_mid && ac_mid=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done -else $as_nop - ac_lo= ac_hi= +else case e in #( + e) ac_lo= ac_hi= ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # Binary search between lo and hi bounds. @@ -2081,8 +2095,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_hi=$ac_mid -else $as_nop - as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val +else case e in #( + e) as_fn_arith '(' $ac_mid ')' + 1 && ac_lo=$as_val ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done @@ -2130,8 +2145,9 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : echo >>conftest.val; read $3 &6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 @@ -2186,12 +2202,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - eval "$3=yes" +else case e in #( + e) eval "$3=yes" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2212,8 +2230,8 @@ printf %s "checking for uint$2_t... " >&6; } if eval test \${$3+y} then : printf %s "(cached) " >&6 -else $as_nop - eval "$3=no" +else case e in #( + e) eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ @@ -2245,10 +2263,12 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if eval test \"x\$"$3"\" = x"no" then : -else $as_nop - break +else case e in #( + e) break ;; +esac fi - done + done ;; +esac fi eval ac_res=\$$3 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -2281,7 +2301,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was $ $0$ac_configure_args_raw @@ -2527,10 +2547,10 @@ esac printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ - || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi done @@ -2566,9 +2586,7 @@ struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; +static char *e (char **p, int i) { return p[i]; } @@ -2582,6 +2600,21 @@ static char *f (char * (*g) (char **, int), char **p, ...) return s; } +/* C89 style stringification. */ +#define noexpand_stringify(a) #a +const char *stringified = noexpand_stringify(arbitrary+token=sequence); + +/* C89 style token pasting. Exercises some of the corner cases that + e.g. old MSVC gets wrong, but not very hard. */ +#define noexpand_concat(a,b) a##b +#define expand_concat(a,b) noexpand_concat(a,b) +extern int vA; +extern int vbee; +#define aye A +#define bee B +int *pvA = &expand_concat(v,aye); +int *pvbee = &noexpand_concat(v,bee); + /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated @@ -2609,16 +2642,19 @@ ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' -// Does the compiler advertise C99 conformance? +/* Does the compiler advertise C99 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif +// See if C++-style comments work. + #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); +extern void free (void *); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare @@ -2668,7 +2704,6 @@ typedef const char *ccp; static inline int test_restrict (ccp restrict text) { - // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) @@ -2734,6 +2769,8 @@ ac_c_conftest_c99_main=' ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; + // Work around memory leak warnings. + free (ia); // Check named initializers. struct named_init ni = { @@ -2755,7 +2792,7 @@ ac_c_conftest_c99_main=' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' -// Does the compiler advertise C11 conformance? +/* Does the compiler advertise C11 conformance? */ #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif @@ -2881,12 +2918,12 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was set to '$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' was not set in the previous run" >&5 +printf "%s\n" "$as_me: error: '$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) @@ -2895,18 +2932,18 @@ printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 -printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: '$ac_var' has changed since the previous run:" >&5 +printf "%s\n" "$as_me: error: '$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&5 +printf "%s\n" "$as_me: warning: ignoring whitespace changes in '$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 -printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 -printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: '$ac_old_val'" >&5 +printf "%s\n" "$as_me: former value: '$ac_old_val'" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: '$ac_new_val'" >&5 +printf "%s\n" "$as_me: current value: '$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. @@ -2922,11 +2959,11 @@ printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' + as_fn_error $? "run '${MAKE-make} distclean' and/or 'rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## @@ -2953,8 +2990,8 @@ ac_make=`printf "%s\n" "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval test \${ac_cv_prog_make_${ac_make}_set+y} then : printf %s "(cached) " >&6 -else $as_nop - cat >conftest.make <<\_ACEOF +else case e in #( + e) cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' @@ -2966,7 +3003,8 @@ case `${MAKE-make} -f conftest.make 2>/dev/null` in *) eval ac_cv_prog_make_${ac_make}_set=no;; esac -rm -f conftest.make +rm -f conftest.make ;; +esac fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -3001,8 +3039,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3024,7 +3062,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3046,8 +3085,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3069,7 +3108,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3104,8 +3144,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3127,7 +3167,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3149,8 +3190,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -3189,7 +3230,8 @@ if test $ac_prog_rejected = yes; then ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3213,8 +3255,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3236,7 +3278,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3262,8 +3305,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3285,7 +3328,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3323,8 +3367,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$CC"; then +else case e in #( + e) if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3346,7 +3390,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi CC=$ac_cv_prog_CC if test -n "$CC"; then @@ -3368,8 +3413,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$ac_ct_CC"; then +else case e in #( + e) if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3391,7 +3436,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then @@ -3420,10 +3466,10 @@ fi fi -test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3495,8 +3541,8 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' + # Autoconf-2.13 could set the ac_cv_exeext variable to 'no'. +# So ignore a value of 'no', otherwise this would lead to 'EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. @@ -3516,7 +3562,7 @@ do ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' + # safe: cross compilers may not add the suffix if given an '-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. @@ -3527,8 +3573,9 @@ do done test "$ac_cv_exeext" = no && ac_cv_exeext= -else $as_nop - ac_file='' +else case e in #( + e) ac_file='' ;; +esac fi if test -z "$ac_file" then : @@ -3537,13 +3584,14 @@ printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -printf "%s\n" "yes" >&6; } +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } @@ -3567,10 +3615,10 @@ printf "%s\n" "$ac_try_echo"; } >&5 printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. + # If both 'conftest.exe' and 'conftest' are 'present' (well, observable) +# catch 'conftest.exe'. For instance with Cygwin, 'ls conftest' will +# work properly (i.e., refer to 'conftest.exe'), while it won't with +# 'rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in @@ -3580,11 +3628,12 @@ for ac_file in conftest.exe conftest conftest.*; do * ) break;; esac done -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3600,6 +3649,8 @@ int main (void) { FILE *f = fopen ("conftest.out", "w"); + if (!f) + return 1; return ferror (f) || fclose (f) != 0; ; @@ -3639,26 +3690,27 @@ printf "%s\n" "$ac_try_echo"; } >&5 if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details" "$LINENO" 5; } +If you meant to cross compile, use '--host'. +See 'config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } -rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +rm -f conftest.$ac_ext conftest$ac_cv_exeext \ + conftest.o conftest.obj conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3690,16 +3742,18 @@ then : break;; esac done -else $as_nop - printf "%s\n" "$as_me: failed program was:" >&5 +else case e in #( + e) printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi -rm -f conftest.$ac_cv_objext conftest.$ac_ext +rm -f conftest.$ac_cv_objext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } @@ -3710,8 +3764,8 @@ printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -3728,12 +3782,14 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes -else $as_nop - ac_compiler_gnu=no +else case e in #( + e) ac_compiler_gnu=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } @@ -3751,8 +3807,8 @@ printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_c_werror_flag=$ac_c_werror_flag +else case e in #( + e) ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" @@ -3770,8 +3826,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes -else $as_nop - CFLAGS="" +else case e in #( + e) CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3786,8 +3842,8 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : -else $as_nop - ac_c_werror_flag=$ac_save_c_werror_flag +else case e in #( + e) ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3804,12 +3860,15 @@ if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag + ac_c_werror_flag=$ac_save_c_werror_flag ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } @@ -3836,8 +3895,8 @@ printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c11=no +else case e in #( + e) ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3854,25 +3913,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c11" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } - CC="$CC $ac_cv_prog_cc_c11" + CC="$CC $ac_cv_prog_cc_c11" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 - ac_prog_cc_stdc=c11 + ac_prog_cc_stdc=c11 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -3882,8 +3944,8 @@ printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c99=no +else case e in #( + e) ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3900,25 +3962,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c99" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } - CC="$CC $ac_cv_prog_cc_c99" + CC="$CC $ac_cv_prog_cc_c99" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 - ac_prog_cc_stdc=c99 + ac_prog_cc_stdc=c99 ;; +esac fi fi if test x$ac_prog_cc_stdc = xno @@ -3928,8 +3993,8 @@ printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_prog_cc_c89=no +else case e in #( + e) ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -3946,25 +4011,28 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext -CC=$ac_save_CC +CC=$ac_save_CC ;; +esac fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } -else $as_nop - if test "x$ac_cv_prog_cc_c89" = x +else case e in #( + e) if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } - CC="$CC $ac_cv_prog_cc_c89" + CC="$CC $ac_cv_prog_cc_c89" ;; +esac fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 - ac_prog_cc_stdc=c89 + ac_prog_cc_stdc=c89 ;; +esac fi fi @@ -3988,8 +4056,8 @@ if test -z "$CPP"; then if test ${ac_cv_prog_CPP+y} then : printf %s "(cached) " >&6 -else $as_nop - # Double quotes because $CC needs to be expanded +else case e in #( + e) # Double quotes because $CC needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" cpp /lib/cpp do ac_preproc_ok=false @@ -4007,9 +4075,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -4023,15 +4092,16 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : @@ -4040,7 +4110,8 @@ fi done ac_cv_prog_CPP=$CPP - + ;; +esac fi CPP=$ac_cv_prog_CPP else @@ -4063,9 +4134,10 @@ _ACEOF if ac_fn_c_try_cpp "$LINENO" then : -else $as_nop - # Broken: fails on valid input. -continue +else case e in #( + e) # Broken: fails on valid input. +continue ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext @@ -4079,24 +4151,26 @@ if ac_fn_c_try_cpp "$LINENO" then : # Broken: success on invalid input. continue -else $as_nop - # Passes both tests. +else case e in #( + e) # Passes both tests. ac_preproc_ok=: -break +break ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +# Because of 'break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok then : -else $as_nop - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } ;; +esac fi ac_ext=c @@ -4109,8 +4183,8 @@ printf %s "checking for grep that handles long lines and -e... " >&6; } if test ${ac_cv_path_GREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -z "$GREP"; then +else case e in #( + e) if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4129,9 +4203,10 @@ do as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in +case `"$ac_path_GREP" --version 2>&1` in #( *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -4166,7 +4241,8 @@ IFS=$as_save_IFS else ac_cv_path_GREP=$GREP fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 printf "%s\n" "$ac_cv_path_GREP" >&6; } @@ -4178,8 +4254,8 @@ printf %s "checking for egrep... " >&6; } if test ${ac_cv_path_EGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 +else case e in #( + e) if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then @@ -4201,9 +4277,10 @@ do as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in +case `"$ac_path_EGREP" --version 2>&1` in #( *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -4239,19 +4316,22 @@ else ac_cv_path_EGREP=$EGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 printf "%s\n" "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" + EGREP_TRADITIONAL=$EGREP + ac_cv_path_EGREP_TRADITIONAL=$EGREP { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5 printf %s "checking for fgrep... " >&6; } if test ${ac_cv_path_FGREP+y} then : printf %s "(cached) " >&6 -else $as_nop - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 +else case e in #( + e) if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then @@ -4273,9 +4353,10 @@ do as_fn_executable_p "$ac_path_FGREP" || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in +case `"$ac_path_FGREP" --version 2>&1` in #( *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; +#( *) ac_count=0 printf %s 0123456789 >"conftest.in" @@ -4311,7 +4392,8 @@ else ac_cv_path_FGREP=$FGREP fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5 printf "%s\n" "$ac_cv_path_FGREP" >&6; } @@ -4326,8 +4408,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_AWK+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$AWK"; then +else case e in #( + e) if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4349,7 +4431,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then @@ -4371,8 +4454,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_STRIP+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$STRIP"; then +else case e in #( + e) if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4395,7 +4478,8 @@ done IFS=$as_save_IFS test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":" -fi +fi ;; +esac fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then @@ -4416,8 +4500,8 @@ printf %s "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } if test ${ac_cv_header_sys_wait_h+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -4441,10 +4525,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_header_sys_wait_h=yes -else $as_nop - ac_cv_header_sys_wait_h=no +else case e in #( + e) ac_cv_header_sys_wait_h=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_sys_wait_h" >&5 printf "%s\n" "$ac_cv_header_sys_wait_h" >&6; } @@ -4455,6 +4541,119 @@ printf "%s\n" "#define HAVE_SYS_WAIT_H 1" >>confdefs.h fi +if test -z "$PKG_CONFIG"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +printf "%s\n" "$PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="no" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi + if test x"$ac_cv_prog_cc_c99" != xno; then @@ -4463,8 +4662,8 @@ printf %s "checking for unsigned long long int... " >&6; } if test ${ac_cv_type_unsigned_long_long_int+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_type_unsigned_long_long_int=yes +else case e in #( + e) ac_cv_type_unsigned_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) @@ -4503,12 +4702,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else $as_nop - ac_cv_type_unsigned_long_long_int=no +else case e in #( + e) ac_cv_type_unsigned_long_long_int=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext;; - esac + esac ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_unsigned_long_long_int" >&5 printf "%s\n" "$ac_cv_type_unsigned_long_long_int" >&6; } @@ -4525,8 +4726,8 @@ printf %s "checking for long long int... " >&6; } if test ${ac_cv_type_long_long_int+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_type_long_long_int=yes +else case e in #( + e) ac_cv_type_long_long_int=yes case $ac_prog_cc_stdc in no | c89) ;; *) @@ -4535,12 +4736,12 @@ else $as_nop if test "$cross_compiling" = yes then : : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef LLONG_MAX - # define HALF \ + # define HALF \\ (1LL << (sizeof (long long int) * CHAR_BIT - 2)) # define LLONG_MAX (HALF - 1 + HALF) #endif @@ -4565,15 +4766,18 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : -else $as_nop - ac_cv_type_long_long_int=no +else case e in #( + e) ac_cv_type_long_long_int=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi fi;; - esac + esac ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_long_long_int" >&5 printf "%s\n" "$ac_cv_type_long_long_int" >&6; } @@ -4584,10 +4788,10 @@ printf "%s\n" "#define HAVE_LONG_LONG_INT 1" >>confdefs.h fi if test "$ac_cv_type_long_long_int" = no; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Compiler does not support long long int -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler supports trailing commas" >&5 @@ -4611,16 +4815,17 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; trailing_commas=yes -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$trailing_commas" = no; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Compiler does not support trailing comma in enum -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if the compiler supports C++ comments" >&5 @@ -4641,16 +4846,17 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; slash_comments=yes -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext if test "$slash_comments" = no; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "Compiler does not support C++ comments -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } fi fi @@ -4670,8 +4876,9 @@ printf %s "checking --enable-fail-if-missing argument... " >&6; } if test ${enable_fail_if_missing+y} then : enableval=$enable_fail_if_missing; fail_if_missing="yes" -else $as_nop - fail_if_missing="no" +else case e in #( + e) fail_if_missing="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $fail_if_missing" >&5 @@ -4811,8 +5018,9 @@ printf %s "checking --disable-darwin argument... " >&6; } if test ${enable_darwin+y} then : enableval=$enable_darwin; -else $as_nop - enable_darwin="yes" +else case e in #( + e) enable_darwin="yes" ;; +esac fi if test "$enable_darwin" = "yes"; then @@ -4839,8 +5047,9 @@ printf %s "checking --disable-sparkle argument... " >&6; } if test ${enable_sparkle+y} then : enableval=$enable_sparkle; -else $as_nop - enable_sparkle="yes" +else case e in #( + e) enable_sparkle="yes" ;; +esac fi if test "$enable_sparkle" == "yes"; then @@ -4881,9 +5090,10 @@ if test ${with_developer_dir+y} then : withval=$with_developer_dir; DEVELOPER_DIR="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $DEVELOPER_DIR" >&5 printf "%s\n" "$DEVELOPER_DIR" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not present" >&5 -printf "%s\n" "not present" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not present" >&5 +printf "%s\n" "not present" >&6; } ;; +esac fi @@ -4895,8 +5105,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_XCODE_SELECT+y} then : printf %s "(cached) " >&6 -else $as_nop - case $XCODE_SELECT in +else case e in #( + e) case $XCODE_SELECT in [\\/]* | ?:[\\/]*) ac_cv_path_XCODE_SELECT="$XCODE_SELECT" # Let the user override the test with a path. ;; @@ -4921,6 +5131,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi XCODE_SELECT=$ac_cv_path_XCODE_SELECT @@ -4952,9 +5163,10 @@ if test ${with_macsdk+y} then : withval=$with_macsdk; MACSDK="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MACSDK" >&5 printf "%s\n" "$MACSDK" >&6; } -else $as_nop - MACSDK=""; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using default" >&5 -printf "%s\n" "using default" >&6; } +else case e in #( + e) MACSDK=""; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using default" >&5 +printf "%s\n" "using default" >&6; } ;; +esac fi @@ -4991,12 +5203,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } XCODEFLAGS="$XCODEFLAGS -sdk macosx$MACSDK MACOSX_DEPLOYMENT_TARGET=$MACSDK" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } MACSDK="" CFLAGS="$save_cflags" - LDFLAGS="$save_ldflags" + LDFLAGS="$save_ldflags" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -5032,9 +5245,10 @@ if test ${with_macarchs+y} then : withval=$with_macarchs; ARCHS="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ARCHS" >&5 printf "%s\n" "$ARCHS" >&6; } -else $as_nop - ARCHS=""; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to native arch" >&5 -printf "%s\n" "defaulting to native arch" >&6; } +else case e in #( + e) ARCHS=""; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to native arch" >&5 +printf "%s\n" "defaulting to native arch" >&6; } ;; +esac fi @@ -5070,12 +5284,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } XCODEFLAGS="$XCODEFLAGS ARCHS=\"$ARCHS\" ONLY_ACTIVE_ARCH=\"NO\"" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, will build for native arch only" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no, will build for native arch only" >&5 printf "%s\n" "no, will build for native arch only" >&6; } ARCHS="" CFLAGS="$save_cflags" - LDFLAGS="$save_ldflags" + LDFLAGS="$save_ldflags" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -5183,12 +5398,13 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $local_dir" >&5 printf "%s\n" "$local_dir" >&6; } -else $as_nop - +else case e in #( + e) local_dir=/usr/local { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to $local_dir" >&5 printf "%s\n" "Defaulting to $local_dir" >&6; } - + ;; +esac fi if test "$GCC" = yes -a "$local_dir" != no; then @@ -5219,9 +5435,10 @@ if test ${with_vim_name+y} then : withval=$with_vim_name; VIMNAME="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIMNAME" >&5 printf "%s\n" "$VIMNAME" >&6; } -else $as_nop - VIMNAME="vim"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to $VIMNAME" >&5 -printf "%s\n" "Defaulting to $VIMNAME" >&6; } +else case e in #( + e) VIMNAME="vim"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to $VIMNAME" >&5 +printf "%s\n" "Defaulting to $VIMNAME" >&6; } ;; +esac fi @@ -5233,9 +5450,10 @@ if test ${with_ex_name+y} then : withval=$with_ex_name; EXNAME="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $EXNAME" >&5 printf "%s\n" "$EXNAME" >&6; } -else $as_nop - EXNAME="ex"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to ex" >&5 -printf "%s\n" "Defaulting to ex" >&6; } +else case e in #( + e) EXNAME="ex"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to ex" >&5 +printf "%s\n" "Defaulting to ex" >&6; } ;; +esac fi @@ -5247,9 +5465,10 @@ if test ${with_view_name+y} then : withval=$with_view_name; VIEWNAME="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $VIEWNAME" >&5 printf "%s\n" "$VIEWNAME" >&6; } -else $as_nop - VIEWNAME="view"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to view" >&5 -printf "%s\n" "Defaulting to view" >&6; } +else case e in #( + e) VIEWNAME="view"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to view" >&5 +printf "%s\n" "Defaulting to view" >&6; } ;; +esac fi @@ -5262,9 +5481,10 @@ if test ${with_global_runtime+y} then : withval=$with_global_runtime; RUNTIME_GLOBAL="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 printf "%s\n" "$withval" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -5285,9 +5505,10 @@ then : withval=$with_modified_by; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 printf "%s\n" "$withval" >&6; }; printf "%s\n" "#define MODIFIED_BY \"$withval\"" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -5314,9 +5535,10 @@ if ac_fn_c_try_compile "$LINENO" then : # TryCompile action if true cf_cv_ebcdic=yes -else $as_nop - # TryCompile action if false -cf_cv_ebcdic=no +else case e in #( + e) # TryCompile action if false +cf_cv_ebcdic=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # end of TryCompile ]) @@ -5388,8 +5610,9 @@ printf %s "checking --disable-smack argument... " >&6; } if test ${enable_smack+y} then : enableval=$enable_smack; -else $as_nop - enable_smack="yes" +else case e in #( + e) enable_smack="yes" ;; +esac fi if test "$enable_smack" = "yes"; then @@ -5399,8 +5622,9 @@ printf "%s\n" "no" >&6; } if test "x$ac_cv_header_linux_xattr_h" = xyes then : true -else $as_nop - enable_smack="no" +else case e in #( + e) enable_smack="no" ;; +esac fi else @@ -5412,8 +5636,9 @@ if test "$enable_smack" = "yes"; then if test "x$ac_cv_header_sys_xattr_h" = xyes then : true -else $as_nop - enable_smack="no" +else case e in #( + e) enable_smack="no" ;; +esac fi fi @@ -5421,18 +5646,153 @@ if test "$enable_smack" = "yes"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for XATTR_NAME_SMACKEXEC in linux/xattr.h" >&5 printf %s "checking for XATTR_NAME_SMACKEXEC in linux/xattr.h... " >&6; } +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for egrep -e" >&5 +printf %s "checking for egrep -e... " >&6; } +if test ${ac_cv_path_EGREP_TRADITIONAL+y} +then : + printf %s "(cached) " >&6 +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in grep ggrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" -E 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + : + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + + if test "$ac_cv_path_EGREP_TRADITIONAL" +then : + ac_cv_path_EGREP_TRADITIONAL="$ac_cv_path_EGREP_TRADITIONAL -E" +else case e in #( + e) if test -z "$EGREP_TRADITIONAL"; then + ac_path_EGREP_TRADITIONAL_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_prog in egrep + do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP_TRADITIONAL="$as_dir$ac_prog$ac_exec_ext" + as_fn_executable_p "$ac_path_EGREP_TRADITIONAL" || continue +# Check for GNU ac_path_EGREP_TRADITIONAL and select it if it is found. + # Check for GNU $ac_path_EGREP_TRADITIONAL +case `"$ac_path_EGREP_TRADITIONAL" --version 2>&1` in #( +*GNU*) + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" ac_path_EGREP_TRADITIONAL_found=:;; +#( +*) + ac_count=0 + printf %s 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + printf "%s\n" 'EGREP_TRADITIONAL' >> "conftest.nl" + "$ac_path_EGREP_TRADITIONAL" 'EGR(EP|AC)_TRADITIONAL$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_TRADITIONAL_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP_TRADITIONAL="$ac_path_EGREP_TRADITIONAL" + ac_path_EGREP_TRADITIONAL_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_TRADITIONAL_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP_TRADITIONAL"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP_TRADITIONAL=$EGREP_TRADITIONAL +fi + ;; +esac +fi ;; +esac +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP_TRADITIONAL" >&5 +printf "%s\n" "$ac_cv_path_EGREP_TRADITIONAL" >&6; } + EGREP_TRADITIONAL=$ac_cv_path_EGREP_TRADITIONAL + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "XATTR_NAME_SMACKEXEC" >/dev/null 2>&1 + $EGREP_TRADITIONAL "XATTR_NAME_SMACKEXEC" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; enable_smack="no" +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; enable_smack="no" ;; +esac fi rm -rf conftest* @@ -5443,16 +5803,22 @@ printf %s "checking for setxattr in -lattr... " >&6; } if test ${ac_cv_lib_attr_setxattr+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lattr $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char setxattr (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char setxattr (void); int main (void) { @@ -5464,12 +5830,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_attr_setxattr=yes -else $as_nop - ac_cv_lib_attr_setxattr=no +else case e in #( + e) ac_cv_lib_attr_setxattr=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_setxattr" >&5 printf "%s\n" "$ac_cv_lib_attr_setxattr" >&6; } @@ -5490,8 +5858,9 @@ printf %s "checking --disable-selinux argument... " >&6; } if test ${enable_selinux+y} then : enableval=$enable_selinux; -else $as_nop - enable_selinux="yes" +else case e in #( + e) enable_selinux="yes" ;; +esac fi if test "$enable_selinux" = "yes"; then @@ -5502,16 +5871,22 @@ printf %s "checking for is_selinux_enabled in -lselinux... " >&6; } if test ${ac_cv_lib_selinux_is_selinux_enabled+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lselinux $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char is_selinux_enabled (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char is_selinux_enabled (void); int main (void) { @@ -5523,12 +5898,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_selinux_is_selinux_enabled=yes -else $as_nop - ac_cv_lib_selinux_is_selinux_enabled=no +else case e in #( + e) ac_cv_lib_selinux_is_selinux_enabled=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_selinux_is_selinux_enabled" >&5 printf "%s\n" "$ac_cv_lib_selinux_is_selinux_enabled" >&6; } @@ -5556,8 +5933,9 @@ printf %s "checking --enable-xattr argument... " >&6; } if test ${enable_xattr+y} then : enableval=$enable_xattr; -else $as_nop - enable_xattr="yes" +else case e in #( + e) enable_xattr="yes" ;; +esac fi if test "$enable_xattr" = "yes"; then @@ -5584,9 +5962,10 @@ if test ${with_features+y} then : withval=$with_features; features="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $features" >&5 printf "%s\n" "$features" >&6; } -else $as_nop - features="huge"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to huge" >&5 -printf "%s\n" "Defaulting to huge" >&6; } +else case e in #( + e) features="huge"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: Defaulting to huge" >&5 +printf "%s\n" "Defaulting to huge" >&6; } ;; +esac fi @@ -5627,9 +6006,10 @@ if test ${with_compiledby+y} then : withval=$with_compiledby; compiledby="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 printf "%s\n" "$withval" >&6; } -else $as_nop - compiledby=""; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) compiledby=""; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -5640,8 +6020,9 @@ printf %s "checking --disable-xsmp argument... " >&6; } if test ${enable_xsmp+y} then : enableval=$enable_xsmp; -else $as_nop - enable_xsmp="yes" +else case e in #( + e) enable_xsmp="yes" ;; +esac fi @@ -5654,8 +6035,9 @@ printf %s "checking --disable-xsmp-interact argument... " >&6; } if test ${enable_xsmp_interact+y} then : enableval=$enable_xsmp_interact; -else $as_nop - enable_xsmp_interact="yes" +else case e in #( + e) enable_xsmp_interact="yes" ;; +esac fi if test "$enable_xsmp_interact" = "yes"; then @@ -5692,8 +6074,9 @@ printf %s "checking --enable-luainterp argument... " >&6; } if test ${enable_luainterp+y} then : enableval=$enable_luainterp; -else $as_nop - enable_luainterp="no" +else case e in #( + e) enable_luainterp="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_luainterp" >&5 @@ -5714,9 +6097,10 @@ if test ${with_lua_prefix+y} then : withval=$with_lua_prefix; with_lua_prefix="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_lua_prefix" >&5 printf "%s\n" "$with_lua_prefix" >&6; } -else $as_nop - with_lua_prefix="";{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) with_lua_prefix="";{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -5743,8 +6127,9 @@ printf %s "checking --with-luajit... " >&6; } if test ${with_luajit+y} then : withval=$with_luajit; vi_cv_with_luajit="$withval" -else $as_nop - vi_cv_with_luajit="no" +else case e in #( + e) vi_cv_with_luajit="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_with_luajit" >&5 @@ -5760,8 +6145,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_luajit+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_luajit in +else case e in #( + e) case $vi_cv_path_luajit in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_luajit="$vi_cv_path_luajit" # Let the user override the test with a path. ;; @@ -5786,6 +6171,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_luajit=$ac_cv_path_vi_cv_path_luajit @@ -5804,8 +6190,9 @@ printf %s "checking LuaJIT version... " >&6; } if test ${vi_cv_version_luajit+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([0-9.]*\)\.[0-9]\(-*[a-z0-9]*\)* .*/\1/'` +else case e in #( + e) vi_cv_version_luajit=`${vi_cv_path_luajit} -v 2>&1 | sed 's/LuaJIT \([0-9.]*\)\.[0-9]\(-*[a-z0-9]*\)* .*/\1/'` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_luajit" >&5 printf "%s\n" "$vi_cv_version_luajit" >&6; } @@ -5814,8 +6201,9 @@ printf %s "checking Lua version of LuaJIT... " >&6; } if test ${vi_cv_version_lua_luajit+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` +else case e in #( + e) vi_cv_version_lua_luajit=`${vi_cv_path_luajit} -e "print(_VERSION)" | sed 's/.* //'` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_lua_luajit" >&5 printf "%s\n" "$vi_cv_version_lua_luajit" >&6; } @@ -5830,8 +6218,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_plain_lua+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_plain_lua in +else case e in #( + e) case $vi_cv_path_plain_lua in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_plain_lua="$vi_cv_path_plain_lua" # Let the user override the test with a path. ;; @@ -5856,6 +6244,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_plain_lua=$ac_cv_path_vi_cv_path_plain_lua @@ -5874,8 +6263,9 @@ printf %s "checking Lua version... " >&6; } if test ${vi_cv_version_plain_lua+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` +else case e in #( + e) vi_cv_version_plain_lua=`${vi_cv_path_plain_lua} -e "print(_VERSION)" | sed 's/.* //'` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_version_plain_lua" >&5 printf "%s\n" "$vi_cv_version_plain_lua" >&6; } @@ -5985,9 +6375,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; lua_ok="yes" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; lua_ok="no"; LUA_LIBS="" +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; lua_ok="no"; LUA_LIBS="" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -6097,8 +6488,9 @@ printf %s "checking --enable-mzschemeinterp argument... " >&6; } if test ${enable_mzschemeinterp+y} then : enableval=$enable_mzschemeinterp; -else $as_nop - enable_mzschemeinterp="no" +else case e in #( + e) enable_mzschemeinterp="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_mzschemeinterp" >&5 @@ -6115,9 +6507,10 @@ if test ${with_plthome+y} then : withval=$with_plthome; with_plthome="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_plthome" >&5 printf "%s\n" "$with_plthome" >&6; } -else $as_nop - with_plthome="";{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5 -printf "%s\n" "\"no\"" >&6; } +else case e in #( + e) with_plthome="";{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5 +printf "%s\n" "\"no\"" >&6; } ;; +esac fi @@ -6142,8 +6535,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_mzscheme+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_mzscheme in +else case e in #( + e) case $vi_cv_path_mzscheme in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_mzscheme="$vi_cv_path_mzscheme" # Let the user override the test with a path. ;; @@ -6168,6 +6561,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_mzscheme=$ac_cv_path_vi_cv_path_mzscheme @@ -6194,13 +6588,14 @@ printf %s "checking MzScheme install prefix... " >&6; } if test ${vi_cv_path_mzscheme_pfx+y} then : printf %s "(cached) " >&6 -else $as_nop - echo "(display (simplify-path \ +else case e in #( + e) echo "(display (simplify-path \ (build-path (call-with-values \ (lambda () (split-path (find-system-path (quote exec-file)))) \ (lambda (base name must-be-dir?) base)) (quote up))))" > mzdirs.scm vi_cv_path_mzscheme_pfx=`${vi_cv_path_mzscheme} -r mzdirs.scm | \ - sed -e 's+/$++'` + sed -e 's+/$++'` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_mzscheme_pfx" >&5 printf "%s\n" "$vi_cv_path_mzscheme_pfx" >&6; } @@ -6417,16 +6812,22 @@ printf %s "checking for ffi_type_void in -lffi... " >&6; } if test ${ac_cv_lib_ffi_ffi_type_void+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lffi $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char ffi_type_void (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char ffi_type_void (void); int main (void) { @@ -6438,12 +6839,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ffi_ffi_type_void=yes -else $as_nop - ac_cv_lib_ffi_ffi_type_void=no +else case e in #( + e) ac_cv_lib_ffi_ffi_type_void=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ffi_ffi_type_void" >&5 printf "%s\n" "$ac_cv_lib_ffi_ffi_type_void" >&6; } @@ -6477,9 +6880,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; mzs_ok=yes -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: MZSCHEME DISABLED" >&5 -printf "%s\n" "no: MZSCHEME DISABLED" >&6; }; mzs_ok=no +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: MZSCHEME DISABLED" >&5 +printf "%s\n" "no: MZSCHEME DISABLED" >&6; }; mzs_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -6514,8 +6918,9 @@ printf %s "checking --enable-perlinterp argument... " >&6; } if test ${enable_perlinterp+y} then : enableval=$enable_perlinterp; -else $as_nop - enable_perlinterp="no" +else case e in #( + e) enable_perlinterp="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_perlinterp" >&5 @@ -6532,8 +6937,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_perl+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_perl in +else case e in #( + e) case $vi_cv_path_perl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_perl="$vi_cv_path_perl" # Let the user override the test with a path. ;; @@ -6558,6 +6963,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_perl=$ac_cv_path_vi_cv_path_perl @@ -6687,9 +7093,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; perl_ok=yes -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PERL DISABLED" >&5 -printf "%s\n" "no: PERL DISABLED" >&6; }; perl_ok=no +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PERL DISABLED" >&5 +printf "%s\n" "no: PERL DISABLED" >&6; }; perl_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -6747,8 +7154,9 @@ printf "%s\n" ">>> too old; need Perl version 5.003_01 or later <<<" >&6; } if test ${vi_cv_dll_name_perl+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_dll_name_perl="$libperl" +else case e in #( + e) vi_cv_dll_name_perl="$libperl" ;; +esac fi PERL_CFLAGS="-DDYNAMIC_PERL_DLL=\\\"$vi_cv_dll_name_perl\\\" $PERL_CFLAGS" @@ -6774,8 +7182,9 @@ printf %s "checking --enable-pythoninterp argument... " >&6; } if test ${enable_pythoninterp+y} then : enableval=$enable_pythoninterp; -else $as_nop - enable_pythoninterp="no" +else case e in #( + e) enable_pythoninterp="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_pythoninterp" >&5 @@ -6794,9 +7203,10 @@ if test ${with_python_command+y} then : withval=$with_python_command; vi_cv_path_python="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python" >&5 printf "%s\n" "$vi_cv_path_python" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -6810,8 +7220,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_python+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_python in +else case e in #( + e) case $vi_cv_path_python in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_python="$vi_cv_path_python" # Let the user override the test with a path. ;; @@ -6836,6 +7246,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_python=$ac_cv_path_vi_cv_path_python @@ -6859,10 +7270,11 @@ printf %s "checking Python version... " >&6; } if test ${vi_cv_var_python_version+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_var_python_version=` +else case e in #( + e) vi_cv_var_python_version=` ${vi_cv_path_python} -c 'import sys; print sys.version[:3]'` - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python_version" >&5 printf "%s\n" "$vi_cv_var_python_version" >&6; } @@ -6880,10 +7292,11 @@ printf %s "checking Python's install prefix... " >&6; } if test ${vi_cv_path_python_pfx+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_path_python_pfx=` +else case e in #( + e) vi_cv_path_python_pfx=` ${vi_cv_path_python} -c \ - "import sys; print sys.prefix"` + "import sys; print sys.prefix"` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_pfx" >&5 printf "%s\n" "$vi_cv_path_python_pfx" >&6; } @@ -6893,10 +7306,11 @@ printf %s "checking Python's execution prefix... " >&6; } if test ${vi_cv_path_python_epfx+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_path_python_epfx=` +else case e in #( + e) vi_cv_path_python_epfx=` ${vi_cv_path_python} -c \ - "import sys; print sys.exec_prefix"` + "import sys; print sys.exec_prefix"` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_epfx" >&5 printf "%s\n" "$vi_cv_path_python_epfx" >&6; } @@ -6905,11 +7319,12 @@ printf "%s\n" "$vi_cv_path_python_epfx" >&6; } if test ${vi_cv_path_pythonpath+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_path_pythonpath=` +else case e in #( + e) vi_cv_path_pythonpath=` unset PYTHONPATH; ${vi_cv_path_python} -c \ - "import sys, string; print string.join(sys.path,':')"` + "import sys, string; print string.join(sys.path,':')"` ;; +esac fi @@ -6927,8 +7342,8 @@ printf %s "checking Python's configuration directory... " >&6; } if test ${vi_cv_path_python_conf+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) vi_cv_path_python_conf= d=`${vi_cv_path_python} -c "import distutils.sysconfig; print distutils.sysconfig.get_config_var('LIBPL')"` if test -d "$d" && test -f "$d/config.c"; then @@ -6943,7 +7358,8 @@ else $as_nop done done fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python_conf" >&5 printf "%s\n" "$vi_cv_path_python_conf" >&6; } @@ -6958,8 +7374,8 @@ printf "%s\n" "can't find it!" >&6; } if test ${vi_cv_path_python_plibs+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) pwd=`pwd` tmp_mkf="$pwd/config-PyMake$$" cat -- "${PYTHON_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" @@ -6998,7 +7414,8 @@ eof vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}" vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//` fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Python's dll name" >&5 @@ -7006,14 +7423,15 @@ printf %s "checking Python's dll name... " >&6; } if test ${vi_cv_dll_name_python+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "X$python_DLLLIBRARY" != "X"; then vi_cv_dll_name_python="$python_DLLLIBRARY" else vi_cv_dll_name_python="$python_INSTSONAME" fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_dll_name_python" >&5 printf "%s\n" "$vi_cv_dll_name_python" >&6; } @@ -7065,10 +7483,11 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; PYTHON_CFLAGS="$PYTHON_CFLAGS $threadsafe_flag" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; LIBS=$libs_save_old - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7106,9 +7525,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; python_ok=yes -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PYTHON DISABLED" >&5 -printf "%s\n" "no: PYTHON DISABLED" >&6; }; python_ok=no +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PYTHON DISABLED" >&5 +printf "%s\n" "no: PYTHON DISABLED" >&6; }; python_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7149,8 +7569,9 @@ printf %s "checking --enable-python3interp argument... " >&6; } if test ${enable_python3interp+y} then : enableval=$enable_python3interp; -else $as_nop - enable_python3interp="no" +else case e in #( + e) enable_python3interp="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_python3interp" >&5 @@ -7169,9 +7590,10 @@ if test ${with_python3_command+y} then : withval=$with_python3_command; vi_cv_path_python3="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3" >&5 printf "%s\n" "$vi_cv_path_python3" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi @@ -7185,8 +7607,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_python3+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_python3 in +else case e in #( + e) case $vi_cv_path_python3 in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_python3="$vi_cv_path_python3" # Let the user override the test with a path. ;; @@ -7211,6 +7633,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_python3=$ac_cv_path_vi_cv_path_python3 @@ -7234,10 +7657,11 @@ printf %s "checking Python version... " >&6; } if test ${vi_cv_var_python3_version+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_var_python3_version=` +else case e in #( + e) vi_cv_var_python3_version=` ${vi_cv_path_python3} -c 'import sys; print("{}.{}".format(sys.version_info.major, sys.version_info.minor))'` - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_version" >&5 printf "%s\n" "$vi_cv_var_python3_version" >&6; } @@ -7266,20 +7690,22 @@ then : fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_stable_abi" >&5 printf "%s\n" "$vi_cv_var_python3_stable_abi" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi if test "X$vi_cv_var_python3_stable_abi" != "X"; then if test ${vi_cv_var_python3_stable_abi_hex+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) vi_cv_var_python3_stable_abi_hex=` ${vi_cv_path_python3} -c \ - "major_minor='${vi_cv_var_python3_stable_abi}'.split('.'); print('0x{0:X}'.format( (int(major_minor.__getitem__(0))<<24) + (int(major_minor.__getitem__(1))<<16) ))"` + "major_minor='${vi_cv_var_python3_stable_abi}'.split('.'); print('0x{0:X}'.format( (int(major_minor.__getitem__(0))<<24) + (int(major_minor.__getitem__(1))<<16) ))"` ;; +esac fi if test "X$vi_cv_var_python3_stable_abi_hex" = "X"; then @@ -7292,15 +7718,16 @@ printf %s "checking Python's abiflags... " >&6; } if test ${vi_cv_var_python3_abiflags+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) vi_cv_var_python3_abiflags= if ${vi_cv_path_python3} -c \ "import sys; sys.exit(${vi_cv_var_python3_version} < 3.2)" then vi_cv_var_python3_abiflags=`${vi_cv_path_python3} -c \ "import sys; print(sys.abiflags)"` - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_var_python3_abiflags" >&5 printf "%s\n" "$vi_cv_var_python3_abiflags" >&6; } @@ -7310,10 +7737,11 @@ printf %s "checking Python's install prefix... " >&6; } if test ${vi_cv_path_python3_pfx+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_path_python3_pfx=` +else case e in #( + e) vi_cv_path_python3_pfx=` ${vi_cv_path_python3} -c \ - "import sys; print(sys.prefix)"` + "import sys; print(sys.prefix)"` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_pfx" >&5 printf "%s\n" "$vi_cv_path_python3_pfx" >&6; } @@ -7323,10 +7751,11 @@ printf %s "checking Python's execution prefix... " >&6; } if test ${vi_cv_path_python3_epfx+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_path_python3_epfx=` +else case e in #( + e) vi_cv_path_python3_epfx=` ${vi_cv_path_python3} -c \ - "import sys; print(sys.exec_prefix)"` + "import sys; print(sys.exec_prefix)"` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_epfx" >&5 printf "%s\n" "$vi_cv_path_python3_epfx" >&6; } @@ -7336,10 +7765,11 @@ printf %s "checking Python's include path... " >&6; } if test ${vi_cv_path_python3_include+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_path_python3_include=` +else case e in #( + e) vi_cv_path_python3_include=` ${vi_cv_path_python3} -c \ - "import sysconfig; print(sysconfig.get_path(\"include\"))"` + "import sysconfig; print(sysconfig.get_path(\"include\"))"` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_include" >&5 printf "%s\n" "$vi_cv_path_python3_include" >&6; } @@ -7349,10 +7779,11 @@ printf %s "checking Python's include path... " >&6; } if test ${vi_cv_path_python3_platinclude+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_path_python3_platinclude=` +else case e in #( + e) vi_cv_path_python3_platinclude=` ${vi_cv_path_python3} -c \ - "import sysconfig; print(sysconfig.get_path(\"platinclude\"))"` + "import sysconfig; print(sysconfig.get_path(\"platinclude\"))"` ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_platinclude" >&5 printf "%s\n" "$vi_cv_path_python3_platinclude" >&6; } @@ -7361,11 +7792,12 @@ printf "%s\n" "$vi_cv_path_python3_platinclude" >&6; } if test ${vi_cv_path_python3path+y} then : printf %s "(cached) " >&6 -else $as_nop - vi_cv_path_python3path=` +else case e in #( + e) vi_cv_path_python3path=` unset PYTHONPATH; ${vi_cv_path_python3} -c \ - "import sys, string; print(':'.join(sys.path))"` + "import sys, string; print(':'.join(sys.path))"` ;; +esac fi @@ -7383,8 +7815,8 @@ printf %s "checking Python's configuration directory... " >&6; } if test ${vi_cv_path_python3_conf+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) vi_cv_path_python3_conf= config_dir="config-${vi_cv_var_python3_version}${vi_cv_var_python3_abiflags}" d=`${vi_cv_path_python3} -c "import sysconfig; print(sysconfig.get_config_var('LIBPL'))" 2> /dev/null` @@ -7403,7 +7835,8 @@ else $as_nop done done fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_path_python3_conf" >&5 printf "%s\n" "$vi_cv_path_python3_conf" >&6; } @@ -7418,8 +7851,8 @@ printf "%s\n" "can't find it!" >&6; } if test ${vi_cv_path_python3_plibs+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) pwd=`pwd` tmp_mkf="$pwd/config-PyMake$$" cat -- "${PYTHON3_CONFDIR}/Makefile" - <<'eof' >"${tmp_mkf}" @@ -7437,7 +7870,8 @@ eof vi_cv_path_python3_plibs="${vi_cv_path_python3_plibs} ${python3_BASEMODLIBS} ${python3_LIBS} ${python3_SYSLIBS}" vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-ltermcap//` vi_cv_path_python3_plibs=`echo $vi_cv_path_python3_plibs | sed s/-lffi//` - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking Python3's dll name" >&5 @@ -7445,8 +7879,8 @@ printf %s "checking Python3's dll name... " >&6; } if test ${vi_cv_dll_name_python3+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "X$python3_DLLLIBRARY" != "X"; then vi_cv_dll_name_python3="$python3_DLLLIBRARY" elif test "X$python3_PYTHONFRAMEWORKPREFIX" != "X"; then @@ -7454,7 +7888,8 @@ else $as_nop else vi_cv_dll_name_python3="$python3_INSTSONAME" fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_dll_name_python3" >&5 printf "%s\n" "$vi_cv_dll_name_python3" >&6; } @@ -7508,10 +7943,11 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; PYTHON3_CFLAGS="$PYTHON3_CFLAGS $threadsafe_flag" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; LIBS=$libs_save_old - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7542,9 +7978,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; python3_ok=yes -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PYTHON3 DISABLED" >&5 -printf "%s\n" "no: PYTHON3 DISABLED" >&6; }; python3_ok=no +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no: PYTHON3 DISABLED" >&5 +printf "%s\n" "no: PYTHON3 DISABLED" >&6; }; python3_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7582,8 +8019,9 @@ fi if test ${with_properly_linked_python2_python3+y} then : withval=$with_properly_linked_python2_python3; vi_cv_with_properly_linked_python2_python3="yes" -else $as_nop - vi_cv_with_properly_linked_python2_python3="no" +else case e in #( + e) vi_cv_with_properly_linked_python2_python3="no" ;; +esac fi @@ -7605,12 +8043,12 @@ printf %s "checking whether we can do without RTLD_GLOBAL for Python... " >&6; } if test "x$MACOS_X" != "xyes"; then if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7652,12 +8090,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; };printf "%s\n" "#define PY_NO_RTLD_GLOBAL 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -7672,12 +8112,12 @@ printf %s "checking whether we can do without RTLD_GLOBAL for Python3... " >&6; LIBS="-ldl $LIBS" if test "$cross_compiling" = yes then : - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error $? "cannot run test program while cross compiling -See \`config.log' for more details" "$LINENO" 5; } -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +See 'config.log' for more details" "$LINENO" 5; } +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -7720,12 +8160,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; };printf "%s\n" "#define PY3_NO_RTLD_GLOBAL 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi fi @@ -7791,9 +8233,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; fpie_ok=yes -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; fpie_ok=no +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; fpie_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7849,9 +8292,10 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; fpie_ok=yes -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; fpie_ok=no +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; fpie_ok=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -7868,8 +8312,9 @@ printf %s "checking --enable-tclinterp argument... " >&6; } if test ${enable_tclinterp+y} then : enableval=$enable_tclinterp; -else $as_nop - enable_tclinterp="no" +else case e in #( + e) enable_tclinterp="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_tclinterp" >&5 @@ -7885,9 +8330,10 @@ if test ${with_tclsh+y} then : withval=$with_tclsh; tclsh_name="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $tclsh_name" >&5 printf "%s\n" "$tclsh_name" >&6; } -else $as_nop - tclsh_name="tclsh8.5"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) tclsh_name="tclsh8.5"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi # Extract the first word of "$tclsh_name", so it can be a program name with args. @@ -7897,8 +8343,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_tcl in +else case e in #( + e) case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -7923,6 +8369,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -7946,8 +8393,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_tcl in +else case e in #( + e) case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -7972,6 +8419,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -7994,8 +8442,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_tcl in +else case e in #( + e) case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -8020,6 +8468,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -8042,8 +8491,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_tcl in +else case e in #( + e) case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -8068,6 +8517,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -8090,8 +8540,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_tcl+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_tcl in +else case e in #( + e) case $vi_cv_path_tcl in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_tcl="$vi_cv_path_tcl" # Let the user override the test with a path. ;; @@ -8116,6 +8566,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_tcl=$ac_cv_path_vi_cv_path_tcl @@ -8252,8 +8703,9 @@ printf %s "checking --enable-rubyinterp argument... " >&6; } if test ${enable_rubyinterp+y} then : enableval=$enable_rubyinterp; -else $as_nop - enable_rubyinterp="no" +else case e in #( + e) enable_rubyinterp="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_rubyinterp" >&5 @@ -8272,9 +8724,10 @@ if test ${with_ruby_command+y} then : withval=$with_ruby_command; RUBY_CMD="$withval"; vi_cv_path_ruby="$withval"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RUBY_CMD" >&5 printf "%s\n" "$RUBY_CMD" >&6; } -else $as_nop - RUBY_CMD="ruby"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to $RUBY_CMD" >&5 -printf "%s\n" "defaulting to $RUBY_CMD" >&6; } +else case e in #( + e) RUBY_CMD="ruby"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to $RUBY_CMD" >&5 +printf "%s\n" "defaulting to $RUBY_CMD" >&6; } ;; +esac fi # Extract the first word of "$RUBY_CMD", so it can be a program name with args. @@ -8284,8 +8737,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_vi_cv_path_ruby+y} then : printf %s "(cached) " >&6 -else $as_nop - case $vi_cv_path_ruby in +else case e in #( + e) case $vi_cv_path_ruby in [\\/]* | ?:[\\/]*) ac_cv_path_vi_cv_path_ruby="$vi_cv_path_ruby" # Let the user override the test with a path. ;; @@ -8310,6 +8763,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi vi_cv_path_ruby=$ac_cv_path_vi_cv_path_ruby @@ -8440,8 +8894,9 @@ printf %s "checking --enable-cscope argument... " >&6; } if test ${enable_cscope+y} then : enableval=$enable_cscope; -else $as_nop - enable_cscope="no" +else case e in #( + e) enable_cscope="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_cscope" >&5 @@ -8457,8 +8912,9 @@ printf %s "checking --disable-netbeans argument... " >&6; } if test ${enable_netbeans+y} then : enableval=$enable_netbeans; -else $as_nop - enable_netbeans="yes" +else case e in #( + e) enable_netbeans="yes" ;; +esac fi if test "$enable_netbeans" = "yes"; then @@ -8481,8 +8937,9 @@ printf %s "checking --disable-channel argument... " >&6; } if test ${enable_channel+y} then : enableval=$enable_channel; -else $as_nop - enable_channel="yes" +else case e in #( + e) enable_channel="yes" ;; +esac fi if test "$enable_channel" = "yes"; then @@ -8512,16 +8969,22 @@ printf %s "checking for socket in -lnetwork... " >&6; } if test ${ac_cv_lib_network_socket+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnetwork $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char socket (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); int main (void) { @@ -8533,12 +8996,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_network_socket=yes -else $as_nop - ac_cv_lib_network_socket=no +else case e in #( + e) ac_cv_lib_network_socket=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_socket" >&5 printf "%s\n" "$ac_cv_lib_network_socket" >&6; } @@ -8556,16 +9021,22 @@ printf %s "checking for socket in -lsocket... " >&6; } if test ${ac_cv_lib_socket_socket+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char socket (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char socket (void); int main (void) { @@ -8577,12 +9048,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_socket=yes -else $as_nop - ac_cv_lib_socket_socket=no +else case e in #( + e) ac_cv_lib_socket_socket=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 printf "%s\n" "$ac_cv_lib_socket_socket" >&6; } @@ -8601,8 +9074,8 @@ printf %s "checking whether compiling with IPv6 networking is possible... " >&6; if test ${vim_cv_ipv6_networking+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -8641,11 +9114,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : vim_cv_ipv6_networking="yes" -else $as_nop - vim_cv_ipv6_networking="no" +else case e in #( + e) vim_cv_ipv6_networking="no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_ipv6_networking" >&5 printf "%s\n" "$vim_cv_ipv6_networking" >&6; } @@ -8666,16 +9141,22 @@ printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -8687,12 +9168,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes -else $as_nop - ac_cv_lib_nsl_gethostbyname=no +else case e in #( + e) ac_cv_lib_nsl_gethostbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } @@ -8709,8 +9192,8 @@ printf %s "checking whether compiling with IPv4 networking is possible... " >&6; if test ${vim_cv_ipv4_networking+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -8747,11 +9230,13 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : vim_cv_ipv4_networking="yes" -else $as_nop - vim_cv_ipv4_networking="no"; enable_netbeans="no"; enable_channel="no" +else case e in #( + e) vim_cv_ipv4_networking="no"; enable_netbeans="no"; enable_channel="no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_ipv4_networking" >&5 printf "%s\n" "$vim_cv_ipv4_networking" >&6; } @@ -8780,8 +9265,9 @@ printf %s "checking --enable-terminal argument... " >&6; } if test ${enable_terminal+y} then : enableval=$enable_terminal; -else $as_nop - enable_terminal="auto" +else case e in #( + e) enable_terminal="auto" ;; +esac fi if test "$enable_terminal" = "yes" || test "$enable_terminal" = "auto" -a "x$features" = "xhuge" ; then @@ -8826,8 +9312,9 @@ printf %s "checking --enable-autoservername argument... " >&6; } if test ${enable_autoservername+y} then : enableval=$enable_autoservername; -else $as_nop - enable_autoservername="no" +else case e in #( + e) enable_autoservername="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_autoservername" >&5 @@ -8843,8 +9330,9 @@ printf %s "checking --enable-multibyte argument... " >&6; } if test ${enable_multibyte+y} then : enableval=$enable_multibyte; -else $as_nop - enable_multibyte="yes" +else case e in #( + e) enable_multibyte="yes" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_multibyte" >&5 @@ -8860,8 +9348,9 @@ printf %s "checking --disable-rightleft argument... " >&6; } if test ${enable_rightleft+y} then : enableval=$enable_rightleft; -else $as_nop - enable_rightleft="yes" +else case e in #( + e) enable_rightleft="yes" ;; +esac fi if test "$enable_rightleft" = "yes"; then @@ -8880,8 +9369,9 @@ printf %s "checking --disable-arabic argument... " >&6; } if test ${enable_arabic+y} then : enableval=$enable_arabic; -else $as_nop - enable_arabic="yes" +else case e in #( + e) enable_arabic="yes" ;; +esac fi if test "$enable_arabic" = "yes"; then @@ -8908,9 +9398,10 @@ if test ${enable_xim+y} then : enableval=$enable_xim; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_xim" >&5 printf "%s\n" "$enable_xim" >&6; } -else $as_nop - enable_xim="auto"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to auto" >&5 -printf "%s\n" "defaulting to auto" >&6; } +else case e in #( + e) enable_xim="auto"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to auto" >&5 +printf "%s\n" "defaulting to auto" >&6; } ;; +esac fi @@ -8920,20 +9411,111 @@ printf %s "checking --enable-fontset argument... " >&6; } if test ${enable_fontset+y} then : enableval=$enable_fontset; -else $as_nop - enable_fontset="no" +else case e in #( + e) enable_fontset="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_fontset" >&5 printf "%s\n" "$enable_fontset" >&6; } -test -z "$with_x" && with_x=yes -test "${enable_gui-yes}" != no -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && with_x=yes -if test "$with_x" = no; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to: don't HAVE_X11" >&5 -printf "%s\n" "defaulting to: don't HAVE_X11" >&6; } -else - +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if shm_open is available" >&5 +printf %s "checking if shm_open is available... " >&6; } +cppflags_save=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $X_CFLAGS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + #include + #include +int +main (void) +{ +shm_open("/test", O_CREAT, 0600); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SHM_OPEN 1" >>confdefs.h + +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +CPPFLAGS=$cppflags_save + +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking --with-wayland argument" >&5 +printf %s "checking --with-wayland argument... " >&6; } + +# Check whether --with-wayland was given. +if test ${with_wayland+y} +then : + withval=$with_wayland; with_wayland=$withval +else case e in #( + e) if test "x$features" = xtiny +then : + with_wayland=no + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: cannot use wayland with tiny features" >&5 +printf "%s\n" "cannot use wayland with tiny features" >&6; } +else case e in #( + e) with_wayland=yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } ;; +esac +fi ;; +esac +fi + + +if test "$with_wayland" = yes; then +cflags_save=$CFLAGS + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for wayland" >&5 +printf %s "checking for wayland... " >&6; } + if "$PKG_CONFIG" --exists 'wayland-client'; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } + printf "%s\n" "#define HAVE_WAYLAND 1" >>confdefs.h + + WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client` + CFLAGS="$CFLAGS $WAYLAND_CFLAGS" + WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client` + WAYLAND_SRC=" \ + auto/wayland/wlr-data-control-unstable-v1.c \ + auto/wayland/ext-data-control-v1.c \ + auto/wayland/xdg-shell.c \ + auto/wayland/primary-selection-unstable-v1.c \ + wayland.c" + WAYLAND_OBJ=" \ + objects/wlr-data-control-unstable-v1.o \ + objects/ext-data-control-v1.o \ + objects/xdg-shell.o \ + objects/primary-selection-unstable-v1.o \ + objects/wayland.o" + + + + + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } + with_wayland=no + fi +CFLAGS=$cflags_save +fi + +test -z "$with_x" && with_x=yes +test "${enable_gui-yes}" != no -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && with_x=yes +if test "$with_x" = no; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: defaulting to: don't HAVE_X11" >&5 +printf "%s\n" "defaulting to: don't HAVE_X11" >&6; } +else + # Extract the first word of "xmkmf", so it can be a program name with args. set dummy xmkmf; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -8941,8 +9523,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_xmkmfpath+y} then : printf %s "(cached) " >&6 -else $as_nop - case $xmkmfpath in +else case e in #( + e) case $xmkmfpath in [\\/]* | ?:[\\/]*) ac_cv_path_xmkmfpath="$xmkmfpath" # Let the user override the test with a path. ;; @@ -8967,6 +9549,7 @@ done IFS=$as_save_IFS ;; +esac ;; esac fi xmkmfpath=$ac_cv_path_xmkmfpath @@ -8990,7 +9573,7 @@ then : withval=$with_x; fi -# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +# $have_x is 'yes', 'no', 'disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled @@ -9000,8 +9583,8 @@ else *,NONE | NONE,*) if test ${ac_cv_have_x+y} then : printf %s "(cached) " >&6 -else $as_nop - # One or both of the vars are not set, and there is no cached value. +else case e in #( + e) # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no # Do we need to do anything special at all? @@ -9124,13 +9707,14 @@ if ac_fn_c_try_cpp "$LINENO" then : # We can compile using X headers with no special include directory. ac_x_includes= -else $as_nop - for ac_dir in $ac_x_header_dirs; do +else case e in #( + e) for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi -done +done ;; +esac fi rm -f conftest.err conftest.i conftest.$ac_ext fi # $ac_x_includes = no @@ -9157,8 +9741,8 @@ then : LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= -else $as_nop - LIBS=$ac_save_LIBS +else case e in #( + e) LIBS=$ac_save_LIBS for ac_dir in `printf "%s\n" "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! @@ -9168,7 +9752,8 @@ do break 2 fi done -done +done ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -9185,6 +9770,7 @@ case $ac_x_includes,$ac_x_libraries in #( ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" ;; +esac ;; esac fi ;; #( @@ -9246,8 +9832,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" -else $as_nop - LIBS="$ac_xsave_LIBS -R $x_libraries" +else case e in #( + e) LIBS="$ac_xsave_LIBS -R $x_libraries" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -9264,12 +9850,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 -printf "%s\n" "neither works" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: neither works" >&5 +printf "%s\n" "neither works" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -9293,8 +9881,14 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam \ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XOpenDisplay (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XOpenDisplay (void); int main (void) { @@ -9306,22 +9900,28 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dnet_ntoa in -ldnet" >&5 printf %s "checking for dnet_ntoa in -ldnet... " >&6; } if test ${ac_cv_lib_dnet_dnet_ntoa+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dnet_ntoa (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (void); int main (void) { @@ -9333,12 +9933,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_dnet_ntoa=yes -else $as_nop - ac_cv_lib_dnet_dnet_ntoa=no +else case e in #( + e) ac_cv_lib_dnet_dnet_ntoa=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_dnet_ntoa" >&6; } @@ -9353,16 +9955,22 @@ printf %s "checking for dnet_ntoa in -ldnet_stub... " >&6; } if test ${ac_cv_lib_dnet_stub_dnet_ntoa+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dnet_ntoa (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dnet_ntoa (void); int main (void) { @@ -9374,12 +9982,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dnet_stub_dnet_ntoa=yes -else $as_nop - ac_cv_lib_dnet_stub_dnet_ntoa=no +else case e in #( + e) ac_cv_lib_dnet_stub_dnet_ntoa=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 printf "%s\n" "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } @@ -9388,7 +9998,8 @@ then : X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi - fi + fi ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -9414,16 +10025,22 @@ printf %s "checking for gethostbyname in -lnsl... " >&6; } if test ${ac_cv_lib_nsl_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -9435,12 +10052,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_nsl_gethostbyname=yes -else $as_nop - ac_cv_lib_nsl_gethostbyname=no +else case e in #( + e) ac_cv_lib_nsl_gethostbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_nsl_gethostbyname" >&6; } @@ -9455,16 +10074,22 @@ printf %s "checking for gethostbyname in -lbsd... " >&6; } if test ${ac_cv_lib_bsd_gethostbyname+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char gethostbyname (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (void); int main (void) { @@ -9476,12 +10101,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_bsd_gethostbyname=yes -else $as_nop - ac_cv_lib_bsd_gethostbyname=no +else case e in #( + e) ac_cv_lib_bsd_gethostbyname=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_gethostbyname" >&5 printf "%s\n" "$ac_cv_lib_bsd_gethostbyname" >&6; } @@ -9512,16 +10139,22 @@ printf %s "checking for connect in -lsocket... " >&6; } if test ${ac_cv_lib_socket_connect+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char connect (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char connect (void); int main (void) { @@ -9533,12 +10166,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_socket_connect=yes -else $as_nop - ac_cv_lib_socket_connect=no +else case e in #( + e) ac_cv_lib_socket_connect=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_connect" >&5 printf "%s\n" "$ac_cv_lib_socket_connect" >&6; } @@ -9562,16 +10197,22 @@ printf %s "checking for remove in -lposix... " >&6; } if test ${ac_cv_lib_posix_remove+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char remove (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char remove (void); int main (void) { @@ -9583,12 +10224,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_posix_remove=yes -else $as_nop - ac_cv_lib_posix_remove=no +else case e in #( + e) ac_cv_lib_posix_remove=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix_remove" >&5 printf "%s\n" "$ac_cv_lib_posix_remove" >&6; } @@ -9612,16 +10255,22 @@ printf %s "checking for shmat in -lipc... " >&6; } if test ${ac_cv_lib_ipc_shmat+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char shmat (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char shmat (void); int main (void) { @@ -9633,12 +10282,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ipc_shmat=yes -else $as_nop - ac_cv_lib_ipc_shmat=no +else case e in #( + e) ac_cv_lib_ipc_shmat=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ipc_shmat" >&5 printf "%s\n" "$ac_cv_lib_ipc_shmat" >&6; } @@ -9664,16 +10315,22 @@ printf %s "checking for IceConnectionNumber in -lICE... " >&6; } if test ${ac_cv_lib_ICE_IceConnectionNumber+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char IceConnectionNumber (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char IceConnectionNumber (void); int main (void) { @@ -9685,12 +10342,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ICE_IceConnectionNumber=yes -else $as_nop - ac_cv_lib_ICE_IceConnectionNumber=no +else case e in #( + e) ac_cv_lib_ICE_IceConnectionNumber=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 printf "%s\n" "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } @@ -9754,9 +10413,10 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; }; no_x=yes +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; }; no_x=yes ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$cflags_save @@ -9777,16 +10437,22 @@ printf %s "checking for _XdmcpAuthDoIt in -lXdmcp... " >&6; } if test ${ac_cv_lib_Xdmcp__XdmcpAuthDoIt+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lXdmcp -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS -lXdmcp $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char _XdmcpAuthDoIt (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char _XdmcpAuthDoIt (void); int main (void) { @@ -9798,12 +10464,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xdmcp__XdmcpAuthDoIt=yes -else $as_nop - ac_cv_lib_Xdmcp__XdmcpAuthDoIt=no +else case e in #( + e) ac_cv_lib_Xdmcp__XdmcpAuthDoIt=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xdmcp__XdmcpAuthDoIt" >&5 printf "%s\n" "$ac_cv_lib_Xdmcp__XdmcpAuthDoIt" >&6; } @@ -9818,16 +10486,22 @@ printf %s "checking for IceOpenConnection in -lICE... " >&6; } if test ${ac_cv_lib_ICE_IceOpenConnection+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char IceOpenConnection (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char IceOpenConnection (void); int main (void) { @@ -9839,12 +10513,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_ICE_IceOpenConnection=yes -else $as_nop - ac_cv_lib_ICE_IceOpenConnection=no +else case e in #( + e) ac_cv_lib_ICE_IceOpenConnection=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ICE_IceOpenConnection" >&5 printf "%s\n" "$ac_cv_lib_ICE_IceOpenConnection" >&6; } @@ -9860,16 +10536,22 @@ printf %s "checking for XpmCreatePixmapFromData in -lXpm... " >&6; } if test ${ac_cv_lib_Xpm_XpmCreatePixmapFromData+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lXpm -lXt $X_PRE_LIBS -lXpm -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XpmCreatePixmapFromData (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XpmCreatePixmapFromData (void); int main (void) { @@ -9881,12 +10563,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xpm_XpmCreatePixmapFromData=yes -else $as_nop - ac_cv_lib_Xpm_XpmCreatePixmapFromData=no +else case e in #( + e) ac_cv_lib_Xpm_XpmCreatePixmapFromData=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&5 printf "%s\n" "$ac_cv_lib_Xpm_XpmCreatePixmapFromData" >&6; } @@ -9919,8 +10603,8 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } -else $as_nop - CFLAGS="$CFLAGS -Wno-implicit-int" +else case e in #( + e) CFLAGS="$CFLAGS -Wno-implicit-int" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -9936,13 +10620,15 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; cflags_save="$cflags_save -Wno-implicit-int" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: test failed" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: test failed" >&5 printf "%s\n" "test failed" >&6; } - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CFLAGS=$cflags_save @@ -9951,28 +10637,30 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of wchar_t" >&5 printf %s "checking size of wchar_t... " >&6; } if test ${ac_cv_sizeof_wchar_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (wchar_t))" "ac_cv_sizeof_wchar_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_wchar_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_wchar_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (wchar_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_wchar_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_wchar_t" >&5 printf "%s\n" "$ac_cv_sizeof_wchar_t" >&6; } @@ -10002,8 +10690,9 @@ printf %s "checking --enable-gui argument... " >&6; } if test ${enable_gui+y} then : enableval=$enable_gui; -else $as_nop - enable_gui="auto" +else case e in #( + e) enable_gui="auto" ;; +esac fi @@ -10106,8 +10795,9 @@ printf %s "checking whether or not to look for GTK+ 2... " >&6; } if test ${enable_gtk2_check+y} then : enableval=$enable_gtk2_check; -else $as_nop - enable_gtk2_check="yes" +else case e in #( + e) enable_gtk2_check="yes" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_gtk2_check" >&5 @@ -10125,8 +10815,9 @@ printf %s "checking whether or not to look for GNOME... " >&6; } if test ${enable_gnome_check+y} then : enableval=$enable_gnome_check; -else $as_nop - enable_gnome_check="no" +else case e in #( + e) enable_gnome_check="no" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_gnome_check" >&5 @@ -10143,8 +10834,9 @@ printf %s "checking whether or not to look for GTK+ 3... " >&6; } if test ${enable_gtk3_check+y} then : enableval=$enable_gtk3_check; -else $as_nop - enable_gtk3_check="yes" +else case e in #( + e) enable_gtk3_check="yes" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_gtk3_check" >&5 @@ -10161,8 +10853,9 @@ printf %s "checking whether or not to look for Motif... " >&6; } if test ${enable_motif_check+y} then : enableval=$enable_motif_check; -else $as_nop - enable_motif_check="yes" +else case e in #( + e) enable_motif_check="yes" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_motif_check" >&5 @@ -10179,8 +10872,9 @@ printf %s "checking whether or not to look for MacVim... " >&6; } if test ${enable_macvim_check+y} then : enableval=$enable_macvim_check; -else $as_nop - enable_macvim_check="yes" +else case e in #( + e) enable_macvim_check="yes" ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_macvim_check" >&5 @@ -10233,128 +10927,189 @@ fi -if test "X$PKG_CONFIG" = "X"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_PKG_CONFIG+y} +if test -z "$SKIP_GTK3"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking --disable-gtktest argument" >&5 +printf %s "checking --disable-gtktest argument... " >&6; } + # Check whether --enable-gtktest was given. +if test ${enable_gtktest+y} then : - printf %s "(cached) " >&6 -else $as_nop - case $PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 + enableval=$enable_gtktest; +else case e in #( + e) enable_gtktest=yes ;; +esac +fi + + if test "x$enable_gtktest" = "xyes" ; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gtk test enabled" >&5 +printf "%s\n" "gtk test enabled" >&6; } + else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gtk test disabled" >&5 +printf "%s\n" "gtk test disabled" >&6; } fi -done - done -IFS=$as_save_IFS - ;; + if test "x$PKG_CONFIG" != "xno"; then + + min_gtk_version="3.0.0" + + if test "$PKG_CONFIG" != "no"; then + case $min_gtk_version in #( + 2.*) : + gtk_pkg_name="gtk+-2.0" ;; #( + 3.*) : + gtk_pkg_name="gtk+-3.0" ;; #( + *) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "The configure script does not know which pkg-config name to use for GTK $min_gtk_version\" +See 'config.log' for more details" "$LINENO" 5; } ;; esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -printf "%s\n" "$PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } -fi + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pkg-config $gtk_pkg_name" >&5 +printf %s "checking for pkg-config $gtk_pkg_name... " >&6; } + if "$PKG_CONFIG" --exists "$gtk_pkg_name" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 +printf %s "checking for GTK - version >= $min_gtk_version... " >&6; } + GTK_CFLAGS=`$PKG_CONFIG --cflags $gtk_pkg_name` + GTK_LIBDIR=`$PKG_CONFIG --libs-only-L $gtk_pkg_name` + GTK_LIBS=`$PKG_CONFIG --libs $gtk_pkg_name` + gtk_major_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` + gtk_minor_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` + gtk_micro_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 +printf "%s\n" "yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } +else case e in #( + e) + GTK_CFLAGS="" + GTK_LIBDIR="" + GTK_LIBS="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; consider installing your distro GTK -dev package" >&5 +printf "%s\n" "no; consider installing your distro GTK -dev package" >&6; } + if test "$fail_if_missing" = "yes" -a "$gui_auto" != "yes"; then + as_fn_error $? "pkg-config could not find $gtk_pkg_name" "$LINENO" 5 + fi + ;; +esac fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -printf %s "checking for $ac_word... " >&6; } -if test ${ac_cv_path_ac_pt_PKG_CONFIG+y} -then : - printf %s "(cached) " >&6 -else $as_nop - case $ac_pt_PKG_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - case $as_dir in #((( - '') as_dir=./ ;; - */) ;; - *) as_dir=$as_dir/ ;; - esac - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir$ac_word$ac_exec_ext" - printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 - break 2 fi -done - done -IFS=$as_save_IFS - ;; + gtktest_success="yes" + if test "$enable_gtktest" = "yes"; then + { + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ability to compile GTK test program" >&5 +printf %s "checking ability to compile GTK test program... " >&6; } + if test "$cross_compiling" = yes +then : + echo $ac_n "cross compiling; assumed OK... $ac_c" +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +#include +#include +#if STDC_HEADERS +# include +# include +#endif + +int +main () +{ + int ex_major = $gtk_major_version; + int ex_minor = $gtk_minor_version; + int ex_micro = $gtk_micro_version; + + #if $gtk_major_version == 2 + guint ob_major = gtk_major_version; + guint ob_minor = gtk_minor_version; + guint ob_micro = gtk_micro_version; + #else + guint ob_major = gtk_get_major_version(); + guint ob_minor = gtk_get_minor_version(); + guint ob_micro = gtk_get_micro_version(); + #endif + + if ((ob_major > ex_major) || + ((ob_major == ex_major) + && (ob_minor > ex_minor)) || + ((ob_major == ex_major) + && (ob_minor == ex_minor) + && (ob_micro >= ex_micro))) + return 0; + else + return 1; +} + +_ACEOF +if ac_fn_c_try_run "$LINENO" +then : + gtktest_success="yes"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else case e in #( + e) gtktest_success="no"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; esac fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -printf "%s\n" "$ac_pt_PKG_CONFIG" >&6; } -else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="no" + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + } + fi + + if test "$gtktest_success" = "yes"; then + GUI_LIB_LOC="$GTK_LIBDIR" + GTK_LIBNAME="$GTK_LIBS" + GUI_INC_LOC="$GTK_CFLAGS" else - case $cross_compiling:$ac_tool_warned in -yes:) -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG + GTK_CFLAGS="" + GTK_LIBDIR="" + GTK_LIBS="" + if test "$fail_if_missing" = "yes" -a "$gui_auto" != "yes"; then + as_fn_error $? "Failed to compile GTK test program." "$LINENO" 5 + fi fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi -fi -if test -z "$SKIP_GTK2"; then + if test -n "$GTK_CFLAGS"; then + SKIP_GTK2=YES + SKIP_GNOME=YES + SKIP_MOTIF=YES + GUITYPE=GTK + + printf "%s\n" "#define USE_GTK3 1" >>confdefs.h + + fi + fi +fi + +if test -z "$SKIP_GTK2"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking --disable-gtktest argument" >&5 printf %s "checking --disable-gtktest argument... " >&6; } # Check whether --enable-gtktest was given. if test ${enable_gtktest+y} then : enableval=$enable_gtktest; -else $as_nop - enable_gtktest=yes +else case e in #( + e) enable_gtktest=yes ;; +esac fi if test "x$enable_gtktest" = "xyes" ; then @@ -10366,64 +11121,73 @@ printf "%s\n" "gtk test disabled" >&6; } fi if test "x$PKG_CONFIG" != "xno"; then - save_skip_gtk3=$SKIP_GTK3 - SKIP_GTK3=YES - if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then - { - no_gtk="" - if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ - && $PKG_CONFIG --exists gtk+-2.0; then - { - min_gtk_version=2.2.0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 -printf %s "checking for GTK - version >= $min_gtk_version... " >&6; } - GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` - GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0` - GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0` - gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` - gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` - gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` - } - elif (test "X$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ - && $PKG_CONFIG --exists gtk+-3.0; then - { - min_gtk_version=2.2.0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 + min_gtk_version="2.2.0" + + if test "$PKG_CONFIG" != "no"; then + case $min_gtk_version in #( + 2.*) : + gtk_pkg_name="gtk+-2.0" ;; #( + 3.*) : + gtk_pkg_name="gtk+-3.0" ;; #( + *) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "The configure script does not know which pkg-config name to use for GTK $min_gtk_version\" +See 'config.log' for more details" "$LINENO" 5; } ;; +esac + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for pkg-config $gtk_pkg_name" >&5 +printf %s "checking for pkg-config $gtk_pkg_name... " >&6; } + if "$PKG_CONFIG" --exists "$gtk_pkg_name" +then : + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found" >&5 +printf "%s\n" "found" >&6; } + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 printf %s "checking for GTK - version >= $min_gtk_version... " >&6; } + GTK_CFLAGS=`$PKG_CONFIG --cflags $gtk_pkg_name` + GTK_LIBDIR=`$PKG_CONFIG --libs-only-L $gtk_pkg_name` + GTK_LIBS=`$PKG_CONFIG --libs $gtk_pkg_name` + gtk_major_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` + gtk_minor_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` + gtk_micro_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 +printf "%s\n" "yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } - GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0` - GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0` - GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0` - gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` - gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` - gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` - } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTK -dev package" >&5 -printf %s "checking for GTK -dev package... " >&6; } - no_gtk=yes - fi +else case e in #( + e) + GTK_CFLAGS="" + GTK_LIBDIR="" + GTK_LIBS="" + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; consider installing your distro GTK -dev package" >&5 +printf "%s\n" "no; consider installing your distro GTK -dev package" >&6; } + if test "$fail_if_missing" = "yes" -a "$gui_auto" != "yes"; then + as_fn_error $? "pkg-config could not find $gtk_pkg_name" "$LINENO" 5 + fi + ;; +esac +fi + fi - if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then - { - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" + gtktest_success="yes" + if test "$enable_gtktest" = "yes"; then + { + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" - rm -f conf.gtktest - if test "$cross_compiling" = yes + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking ability to compile GTK test program" >&5 +printf %s "checking ability to compile GTK test program... " >&6; } + if test "$cross_compiling" = yes then : echo $ac_n "cross compiling; assumed OK... $ac_c" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -10436,86 +11200,71 @@ else $as_nop int main () { -int major, minor, micro; -char *tmp_version; - -system ("touch conf.gtktest"); - -/* HP/UX 9 (%@#!) writes to sscanf strings */ -tmp_version = g_strdup("$min_gtk_version"); -if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - g_free(tmp_version); - exit(1); - } - -g_free(tmp_version); - -if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && - (gtk_micro_version >= micro))) -{ - return 0; -} -return 1; + int ex_major = $gtk_major_version; + int ex_minor = $gtk_minor_version; + int ex_micro = $gtk_micro_version; + + #if $gtk_major_version == 2 + guint ob_major = gtk_major_version; + guint ob_minor = gtk_minor_version; + guint ob_micro = gtk_micro_version; + #else + guint ob_major = gtk_get_major_version(); + guint ob_minor = gtk_get_minor_version(); + guint ob_micro = gtk_get_micro_version(); + #endif + + if ((ob_major > ex_major) || + ((ob_major == ex_major) + && (ob_minor > ex_minor)) || + ((ob_major == ex_major) + && (ob_minor == ex_minor) + && (ob_micro >= ex_micro))) + return 0; + else + return 1; } _ACEOF if ac_fn_c_try_run "$LINENO" then : - -else $as_nop - no_gtk=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - } - fi - if test "x$no_gtk" = x ; then - if test "x$enable_gtktest" = "xyes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 -printf "%s\n" "yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 -printf "%s\n" "found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } - fi - GUI_LIB_LOC="$GTK_LIBDIR" - GTK_LIBNAME="$GTK_LIBS" - GUI_INC_LOC="$GTK_CFLAGS" - else - { - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - GTK_CFLAGS="" - GTK_LIBS="" - : - if test "$fail_if_missing" = "yes" -a "X$gui_auto" != "Xyes"; then - as_fn_error $? "could not configure GTK" "$LINENO" 5 - fi - } - fi + gtktest_success="yes"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +printf "%s\n" "yes" >&6; } +else case e in #( + e) gtktest_success="no"; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" } + fi + + if test "$gtktest_success" = "yes"; then + GUI_LIB_LOC="$GTK_LIBDIR" + GTK_LIBNAME="$GTK_LIBS" + GUI_INC_LOC="$GTK_CFLAGS" else - GTK_CFLAGS="" + GTK_CFLAGS="" + GTK_LIBDIR="" GTK_LIBS="" - : + if test "$fail_if_missing" = "yes" -a "$gui_auto" != "yes"; then + as_fn_error $? "Failed to compile GTK test program." "$LINENO" 5 + fi fi - rm -f conf.gtktest - if test "x$GTK_CFLAGS" != "x"; then - SKIP_GTK3=YES + + if test -n "$GTK_CFLAGS"; then SKIP_MOTIF=YES GUITYPE=GTK - else - SKIP_GTK3=$save_skip_gtk3 fi fi if test "x$GUITYPE" = "xGTK"; then @@ -10561,8 +11310,9 @@ then : gnome_prefix=$withval/lib fi fi -else $as_nop - want_gnome=yes +else case e in #( + e) want_gnome=yes ;; +esac fi @@ -10610,185 +11360,6 @@ printf "%s\n" "not found" >&6; } fi fi - -if test -z "$SKIP_GTK3"; then - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking --disable-gtktest argument" >&5 -printf %s "checking --disable-gtktest argument... " >&6; } - # Check whether --enable-gtktest was given. -if test ${enable_gtktest+y} -then : - enableval=$enable_gtktest; -else $as_nop - enable_gtktest=yes -fi - - if test "x$enable_gtktest" = "xyes" ; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gtk test enabled" >&5 -printf "%s\n" "gtk test enabled" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gtk test disabled" >&5 -printf "%s\n" "gtk test disabled" >&6; } - fi - - if test "x$PKG_CONFIG" != "xno"; then - save_skip_gtk2=$SKIP_GTK2 - SKIP_GTK2=YES - - if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then - { - no_gtk="" - if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ - && $PKG_CONFIG --exists gtk+-2.0; then - { - min_gtk_version=3.0.0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 -printf %s "checking for GTK - version >= $min_gtk_version... " >&6; } - GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` - GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0` - GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0` - gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` - gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` - gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` - } - elif (test "X$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ - && $PKG_CONFIG --exists gtk+-3.0; then - { - min_gtk_version=3.0.0 - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTK - version >= $min_gtk_version" >&5 -printf %s "checking for GTK - version >= $min_gtk_version... " >&6; } - - GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0` - GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0` - GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0` - gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\1/'` - gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\2/'` - gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/\3/'` - } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for GTK -dev package" >&5 -printf %s "checking for GTK -dev package... " >&6; } - no_gtk=yes - fi - - if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then - { - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" - - rm -f conf.gtktest - if test "$cross_compiling" = yes -then : - echo $ac_n "cross compiling; assumed OK... $ac_c" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -#include -#include -#if STDC_HEADERS -# include -# include -#endif - -int -main () -{ -int major, minor, micro; -char *tmp_version; - -system ("touch conf.gtktest"); - -/* HP/UX 9 (%@#!) writes to sscanf strings */ -tmp_version = g_strdup("$min_gtk_version"); -if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - g_free(tmp_version); - exit(1); - } - -g_free(tmp_version); - -if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && - (gtk_micro_version >= micro))) -{ - return 0; -} -return 1; -} - -_ACEOF -if ac_fn_c_try_run "$LINENO" -then : - -else $as_nop - no_gtk=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - } - fi - if test "x$no_gtk" = x ; then - if test "x$enable_gtktest" = "xyes"; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 -printf "%s\n" "yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } - else - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&5 -printf "%s\n" "found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version" >&6; } - fi - GUI_LIB_LOC="$GTK_LIBDIR" - GTK_LIBNAME="$GTK_LIBS" - GUI_INC_LOC="$GTK_CFLAGS" - else - { - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } - GTK_CFLAGS="" - GTK_LIBS="" - : - if test "$fail_if_missing" = "yes" -a "X$gui_auto" != "Xyes"; then - as_fn_error $? "could not configure GTK" "$LINENO" 5 - fi - } - fi - } - else - GTK_CFLAGS="" - GTK_LIBS="" - : - fi - - - rm -f conf.gtktest - - if test "x$GTK_CFLAGS" != "x"; then - SKIP_GTK2=YES - SKIP_GNOME=YES - SKIP_MOTIF=YES - GUITYPE=GTK - - printf "%s\n" "#define USE_GTK3 1" >>confdefs.h - - else - SKIP_GTK2=$save_skip_gtk2 - fi - fi -fi - if test "x$GUITYPE" = "xGTK"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking version of Gdk-Pixbuf" >&5 printf %s "checking version of Gdk-Pixbuf... " >&6; } @@ -10807,8 +11378,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GLIB_COMPILE_RESOURCES+y} then : printf %s "(cached) " >&6 -else $as_nop - case $GLIB_COMPILE_RESOURCES in +else case e in #( + e) case $GLIB_COMPILE_RESOURCES in [\\/]* | ?:[\\/]*) ac_cv_path_GLIB_COMPILE_RESOURCES="$GLIB_COMPILE_RESOURCES" # Let the user override the test with a path. ;; @@ -10834,6 +11405,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_GLIB_COMPILE_RESOURCES" && ac_cv_path_GLIB_COMPILE_RESOURCES="no" ;; +esac ;; esac fi GLIB_COMPILE_RESOURCES=$ac_cv_path_GLIB_COMPILE_RESOURCES @@ -10875,8 +11447,9 @@ printf %s "checking --disable-icon-cache-update argument... " >&6; } if test ${enable_icon_cache_update+y} then : enableval=$enable_icon_cache_update; -else $as_nop - enable_icon_cache_update="yes" +else case e in #( + e) enable_icon_cache_update="yes" ;; +esac fi if test "$enable_icon_cache_update" = "yes"; then @@ -10889,8 +11462,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_GTK_UPDATE_ICON_CACHE+y} then : printf %s "(cached) " >&6 -else $as_nop - case $GTK_UPDATE_ICON_CACHE in +else case e in #( + e) case $GTK_UPDATE_ICON_CACHE in [\\/]* | ?:[\\/]*) ac_cv_path_GTK_UPDATE_ICON_CACHE="$GTK_UPDATE_ICON_CACHE" # Let the user override the test with a path. ;; @@ -10916,6 +11489,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_GTK_UPDATE_ICON_CACHE" && ac_cv_path_GTK_UPDATE_ICON_CACHE="no" ;; +esac ;; esac fi GTK_UPDATE_ICON_CACHE=$ac_cv_path_GTK_UPDATE_ICON_CACHE @@ -10943,8 +11517,9 @@ printf %s "checking --disable-desktop-database-update argument... " >&6; } if test ${enable_desktop_database_update+y} then : enableval=$enable_desktop_database_update; -else $as_nop - enable_desktop_database_update="yes" +else case e in #( + e) enable_desktop_database_update="yes" ;; +esac fi if test "$enable_desktop_database_update" = "yes"; then @@ -10957,8 +11532,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_UPDATE_DESKTOP_DATABASE+y} then : printf %s "(cached) " >&6 -else $as_nop - case $UPDATE_DESKTOP_DATABASE in +else case e in #( + e) case $UPDATE_DESKTOP_DATABASE in [\\/]* | ?:[\\/]*) ac_cv_path_UPDATE_DESKTOP_DATABASE="$UPDATE_DESKTOP_DATABASE" # Let the user override the test with a path. ;; @@ -10984,6 +11559,7 @@ IFS=$as_save_IFS test -z "$ac_cv_path_UPDATE_DESKTOP_DATABASE" && ac_cv_path_UPDATE_DESKTOP_DATABASE="no" ;; +esac ;; esac fi UPDATE_DESKTOP_DATABASE=$ac_cv_path_UPDATE_DESKTOP_DATABASE @@ -11121,16 +11697,22 @@ printf %s "checking for XShapeQueryExtension in -lXext... " >&6; } if test ${ac_cv_lib_Xext_XShapeQueryExtension+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lXext -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XShapeQueryExtension (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XShapeQueryExtension (void); int main (void) { @@ -11142,12 +11724,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xext_XShapeQueryExtension=yes -else $as_nop - ac_cv_lib_Xext_XShapeQueryExtension=no +else case e in #( + e) ac_cv_lib_Xext_XShapeQueryExtension=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xext_XShapeQueryExtension" >&5 printf "%s\n" "$ac_cv_lib_Xext_XShapeQueryExtension" >&6; } @@ -11161,16 +11745,22 @@ printf %s "checking for wslen in -lw... " >&6; } if test ${ac_cv_lib_w_wslen+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lw $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char wslen (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char wslen (void); int main (void) { @@ -11182,12 +11772,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_w_wslen=yes -else $as_nop - ac_cv_lib_w_wslen=no +else case e in #( + e) ac_cv_lib_w_wslen=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_w_wslen" >&5 printf "%s\n" "$ac_cv_lib_w_wslen" >&6; } @@ -11201,16 +11793,22 @@ printf %s "checking for dlsym in -ldl... " >&6; } if test ${ac_cv_lib_dl_dlsym+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char dlsym (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char dlsym (void); int main (void) { @@ -11222,12 +11820,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_dl_dlsym=yes -else $as_nop - ac_cv_lib_dl_dlsym=no +else case e in #( + e) ac_cv_lib_dl_dlsym=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlsym" >&5 printf "%s\n" "$ac_cv_lib_dl_dlsym" >&6; } @@ -11241,16 +11841,22 @@ printf %s "checking for XmuCreateStippledPixmap in -lXmu... " >&6; } if test ${ac_cv_lib_Xmu_XmuCreateStippledPixmap+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lXmu $GUI_X_LIBS -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XmuCreateStippledPixmap (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XmuCreateStippledPixmap (void); int main (void) { @@ -11262,12 +11868,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xmu_XmuCreateStippledPixmap=yes -else $as_nop - ac_cv_lib_Xmu_XmuCreateStippledPixmap=no +else case e in #( + e) ac_cv_lib_Xmu_XmuCreateStippledPixmap=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xmu_XmuCreateStippledPixmap" >&5 printf "%s\n" "$ac_cv_lib_Xmu_XmuCreateStippledPixmap" >&6; } @@ -11282,16 +11890,22 @@ printf %s "checking for XpEndJob in -lXp... " >&6; } if test ${ac_cv_lib_Xp_XpEndJob+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lXp $GUI_X_LIBS -lXm -lXt $X_PRE_LIBS -lX11 $X_EXTRA_LIBS $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char XpEndJob (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char XpEndJob (void); int main (void) { @@ -11303,12 +11917,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_Xp_XpEndJob=yes -else $as_nop - ac_cv_lib_Xp_XpEndJob=no +else case e in #( + e) ac_cv_lib_Xp_XpEndJob=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Xp_XpEndJob" >&5 printf "%s\n" "$ac_cv_lib_Xp_XpEndJob" >&6; } @@ -11385,13 +12001,14 @@ printf %s "checking for XIMText in X11/Xlib.h... " >&6; } #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "XIMText" >/dev/null 2>&1 + $EGREP_TRADITIONAL "XIMText" >/dev/null 2>&1 then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; xim has been disabled" >&5 -printf "%s\n" "no; xim has been disabled" >&6; }; enable_xim="no" +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; xim has been disabled" >&5 +printf "%s\n" "no; xim has been disabled" >&6; }; enable_xim="no" ;; +esac fi rm -rf conftest* @@ -11429,9 +12046,10 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_X11_XMU_EDITRES_H 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS=$cppflags_save @@ -11513,11 +12131,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define XPMATTRIBUTES_TYPE XpmAttributes_21" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; printf "%s\n" "#define XPMATTRIBUTES_TYPE XpmAttributes" >>confdefs.h - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext else @@ -11621,8 +12240,8 @@ printf %s "checking whether toupper is broken... " >&6; } if test ${vim_cv_toupper_broken+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : @@ -11630,8 +12249,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_toupper_broken'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_toupper_broken'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -11648,15 +12267,18 @@ then : vim_cv_toupper_broken=yes -else $as_nop - +else case e in #( + e) vim_cv_toupper_broken=no - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_toupper_broken" >&5 printf "%s\n" "$vim_cv_toupper_broken" >&6; } @@ -11684,9 +12306,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DATE_TIME 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -11708,22 +12331,23 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ATTRIBUTE_UNUSED 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do - as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` + as_ac_Header=`printf "%s\n" "ac_cv_header_dirent_$ac_hdr" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_hdr that defines DIR" >&5 printf %s "checking for $ac_hdr that defines DIR... " >&6; } if eval test \${$as_ac_Header+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include <$ac_hdr> @@ -11740,10 +12364,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : eval "$as_ac_Header=yes" -else $as_nop - eval "$as_ac_Header=no" +else case e in #( + e) eval "$as_ac_Header=no" ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi eval ac_res=\$$as_ac_Header { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -11751,7 +12377,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Header"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_$ac_hdr" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_$ac_hdr" | sed "$as_sed_cpp"` 1 _ACEOF ac_header_dirent=$ac_hdr; break @@ -11765,15 +12391,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -11804,11 +12436,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -11825,15 +12459,21 @@ printf %s "checking for library containing opendir... " >&6; } if test ${ac_cv_search_opendir+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_func_search_save_LIBS=$LIBS +else case e in #( + e) ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char opendir (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char opendir (void); int main (void) { @@ -11864,11 +12504,13 @@ done if test ${ac_cv_search_opendir+y} then : -else $as_nop - ac_cv_search_opendir=no +else case e in #( + e) ac_cv_search_opendir=no ;; +esac fi rm conftest.$ac_ext -LIBS=$ac_func_search_save_LIBS +LIBS=$ac_func_search_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opendir" >&5 printf "%s\n" "$ac_cv_search_opendir" >&6; } @@ -11904,9 +12546,10 @@ printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_UNION_WAIT 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -12209,9 +12852,10 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_PTHREAD_NP_H 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -12260,68 +12904,24 @@ if ac_fn_c_try_compile "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - printf "%s\n" "#define NO_STRINGS_WITH_STRING_H 1" >>confdefs.h +else case e in #( + e) printf "%s\n" "#define NO_STRINGS_WITH_STRING_H 1" >>confdefs.h { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext CPPFLAGS=$cppflags_save fi -if test $ac_cv_c_compiler_gnu = yes; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC needs -traditional" >&5 -printf %s "checking whether $CC needs -traditional... " >&6; } -if test ${ac_cv_prog_gcc_traditional+y} -then : - printf %s "(cached) " >&6 -else $as_nop - ac_pattern="Autoconf.*'x'" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TIOCGETP -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1 -then : - ac_cv_prog_gcc_traditional=yes -else $as_nop - ac_cv_prog_gcc_traditional=no -fi -rm -rf conftest* - - - if test $ac_cv_prog_gcc_traditional = no; then - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -Autoconf TCGETA -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "$ac_pattern" >/dev/null 2>&1 -then : - ac_cv_prog_gcc_traditional=yes -fi -rm -rf conftest* - - fi -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_gcc_traditional" >&5 -printf "%s\n" "$ac_cv_prog_gcc_traditional" >&6; } - if test $ac_cv_prog_gcc_traditional = yes; then - CC="$CC -traditional" - fi -fi - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 printf %s "checking for an ANSI C-conforming const... " >&6; } if test ${ac_cv_c_const+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12385,10 +12985,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_const=yes -else $as_nop - ac_cv_c_const=no +else case e in #( + e) ac_cv_c_const=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 printf "%s\n" "$ac_cv_c_const" >&6; } @@ -12403,8 +13005,8 @@ printf %s "checking for working volatile... " >&6; } if test ${ac_cv_c_volatile+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int @@ -12421,10 +13023,12 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_volatile=yes -else $as_nop - ac_cv_c_volatile=no +else case e in #( + e) ac_cv_c_volatile=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_volatile" >&5 printf "%s\n" "$ac_cv_c_volatile" >&6; } @@ -12438,20 +13042,22 @@ ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" if test "x$ac_cv_type_mode_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define mode_t int" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" if test "x$ac_cv_type_off_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define off_t long int" >>confdefs.h - + ;; +esac fi @@ -12460,8 +13066,8 @@ fi if test "x$ac_cv_type_pid_t" = xyes then : -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if defined _WIN64 && !defined __CYGWIN__ @@ -12480,14 +13086,16 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_pid_type='int' -else $as_nop - ac_pid_type='__int64' +else case e in #( + e) ac_pid_type='__int64' ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext printf "%s\n" "#define pid_t $ac_pid_type" >>confdefs.h - + ;; +esac fi @@ -12495,42 +13103,33 @@ ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define size_t unsigned int" >>confdefs.h - -fi - -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for uid_t in sys/types.h" >&5 -printf %s "checking for uid_t in sys/types.h... " >&6; } -if test ${ac_cv_type_uid_t+y} -then : - printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1 -then : - ac_cv_type_uid_t=yes -else $as_nop - ac_cv_type_uid_t=no + ;; +esac fi -rm -rf conftest* -fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_uid_t" >&5 -printf "%s\n" "$ac_cv_type_uid_t" >&6; } -if test $ac_cv_type_uid_t = no; then +ac_fn_c_check_type "$LINENO" "uid_t" "ac_cv_type_uid_t" "$ac_includes_default" +if test "x$ac_cv_type_uid_t" = xyes +then : +else case e in #( + e) printf "%s\n" "#define uid_t int" >>confdefs.h + ;; +esac +fi +ac_fn_c_check_type "$LINENO" "gid_t" "ac_cv_type_gid_t" "$ac_includes_default" +if test "x$ac_cv_type_gid_t" = xyes +then : +else case e in #( + e) printf "%s\n" "#define gid_t int" >>confdefs.h - + ;; +esac fi ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" @@ -12553,20 +13152,22 @@ ac_fn_c_check_type "$LINENO" "ino_t" "ac_cv_type_ino_t" "$ac_includes_default" if test "x$ac_cv_type_ino_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define ino_t long" >>confdefs.h - + ;; +esac fi ac_fn_c_check_type "$LINENO" "dev_t" "ac_cv_type_dev_t" "$ac_includes_default" if test "x$ac_cv_type_dev_t" = xyes then : -else $as_nop - +else case e in #( + e) printf "%s\n" "#define dev_t unsigned" >>confdefs.h - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 @@ -12574,8 +13175,8 @@ printf %s "checking whether byte ordering is bigendian... " >&6; } if test ${ac_cv_c_bigendian+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_bigendian=unknown +else case e in #( + e) ac_cv_c_bigendian=unknown # See if we're dealing with a universal compiler. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12621,8 +13222,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext int main (void) { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \\ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \\ && LITTLE_ENDIAN) bogus endian macros #endif @@ -12653,8 +13254,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -12698,8 +13300,9 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_c_bigendian=yes -else $as_nop - ac_cv_c_bigendian=no +else case e in #( + e) ac_cv_c_bigendian=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi @@ -12726,22 +13329,23 @@ unsigned short int ascii_mm[] = int use_ebcdic (int i) { return ebcdic_mm[i] + ebcdic_ii[i]; } - extern int foo; - -int -main (void) -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} + int + main (int argc, char **argv) + { + /* Intimidate the compiler so that it does not + optimize the arrays away. */ + char *p = argv[0]; + ascii_mm[1] = *p++; ebcdic_mm[1] = *p++; + ascii_ii[1] = *p++; ebcdic_ii[1] = *p++; + return use_ascii (argc) == use_ebcdic (*p); + } _ACEOF -if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_link "$LINENO" then : - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + if grep BIGenDianSyS conftest$ac_exeext >/dev/null; then ac_cv_c_bigendian=yes fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if grep LiTTleEnDian conftest$ac_exeext >/dev/null ; then if test "$ac_cv_c_bigendian" = unknown; then ac_cv_c_bigendian=no else @@ -12750,9 +13354,10 @@ then : fi fi fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int @@ -12775,14 +13380,17 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : ac_cv_c_bigendian=no -else $as_nop - ac_cv_c_bigendian=yes +else case e in #( + e) ac_cv_c_bigendian=yes ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - fi + fi ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_bigendian" >&5 printf "%s\n" "$ac_cv_c_bigendian" >&6; } @@ -12807,8 +13415,8 @@ printf %s "checking for inline... " >&6; } if test ${ac_cv_c_inline+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_c_inline=no +else case e in #( + e) ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12826,7 +13434,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext test "$ac_cv_c_inline" != no && break done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_inline" >&5 printf "%s\n" "$ac_cv_c_inline" >&6; } @@ -12867,11 +13476,12 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]" >/dev/null 2>&1 + $EGREP_TRADITIONAL "(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]" >/dev/null 2>&1 then : ac_cv_type_rlim_t=yes -else $as_nop - ac_cv_type_rlim_t=no +else case e in #( + e) ac_cv_type_rlim_t=no ;; +esac fi rm -rf conftest* @@ -12902,11 +13512,12 @@ else _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "stack_t" >/dev/null 2>&1 + $EGREP_TRADITIONAL "stack_t" >/dev/null 2>&1 then : ac_cv_type_stack_t=yes -else $as_nop - ac_cv_type_stack_t=no +else case e in #( + e) ac_cv_type_stack_t=no ;; +esac fi rm -rf conftest* @@ -12945,9 +13556,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SS_BASE 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -12982,8 +13594,9 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: OK" >&5 printf "%s\n" "OK" >&6; } -else $as_nop - as_fn_error $? "FAILED" "$LINENO" 5 +else case e in #( + e) as_fn_error $? "FAILED" "$LINENO" 5 ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -12996,22 +13609,28 @@ printf "%s\n" "empty: automatic terminal library selection" >&6; } *) tlibs="tinfo ncurses termlib termcap curses";; esac for libname in $tlibs; do - as_ac_Lib=`printf "%s\n" "ac_cv_lib_${libname}""_tgetent" | $as_tr_sh` + as_ac_Lib=`printf "%s\n" "ac_cv_lib_${libname}""_tgetent" | sed "$as_sed_sh"` { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tgetent in -l${libname}" >&5 printf %s "checking for tgetent in -l${libname}... " >&6; } if eval test \${$as_ac_Lib+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-l${libname} $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char tgetent (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char tgetent (void); int main (void) { @@ -13023,12 +13642,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : eval "$as_ac_Lib=yes" -else $as_nop - eval "$as_ac_Lib=no" +else case e in #( + e) eval "$as_ac_Lib=no" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi eval ac_res=\$$as_ac_Lib { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 @@ -13036,7 +13657,7 @@ printf "%s\n" "$ac_res" >&6; } if eval test \"x\$"$as_ac_Lib"\" = x"yes" then : cat >>confdefs.h <<_ACEOF -#define `printf "%s\n" "HAVE_LIB${libname}" | $as_tr_cpp` 1 +#define `printf "%s\n" "HAVE_LIB${libname}" | sed "$as_sed_cpp"` 1 _ACEOF LIBS="-l${libname} $LIBS" @@ -13047,8 +13668,8 @@ fi if test "$cross_compiling" = yes then : res="OK" -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_TERMCAP_H @@ -13063,11 +13684,13 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : res="OK" -else $as_nop - res="FAIL" +else case e in #( + e) res="FAIL" ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi if test "$res" = "OK"; then @@ -13102,11 +13725,12 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } -else $as_nop - as_fn_error $? "NOT FOUND! +else case e in #( + e) as_fn_error $? "NOT FOUND! You need to install a terminal library; for example ncurses. On Linux that would be the libncurses-dev package. - Or specify the name of the library with --with-tlib." "$LINENO" 5 + Or specify the name of the library with --with-tlib." "$LINENO" 5 ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13117,8 +13741,8 @@ printf %s "checking whether we talk terminfo... " >&6; } if test ${vim_cv_terminfo+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : @@ -13126,8 +13750,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_terminfo'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_terminfo'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -13150,16 +13774,19 @@ then : vim_cv_terminfo=yes -else $as_nop - +else case e in #( + e) vim_cv_terminfo=no - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_terminfo" >&5 printf "%s\n" "$vim_cv_terminfo" >&6; } @@ -13174,8 +13801,8 @@ printf %s "checking what tgetent() returns for an unknown terminal... " >&6; } if test ${vim_cv_tgetent+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : @@ -13183,8 +13810,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_tgetent'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_tgetent'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -13204,16 +13831,19 @@ then : vim_cv_tgetent=zero -else $as_nop - +else case e in #( + e) vim_cv_tgetent=non-zero - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_tgetent" >&5 printf "%s\n" "$vim_cv_tgetent" >&6; } @@ -13245,8 +13875,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_OSPEED 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether ospeed can be extern" >&5 printf %s "checking whether ospeed can be extern... " >&6; } @@ -13271,13 +13901,15 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define OSPEED_EXTERN 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13304,8 +13936,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_UP_BC_PC 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether UP, BC and PC can be extern" >&5 printf %s "checking whether UP, BC and PC can be extern... " >&6; } @@ -13330,13 +13962,15 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define UP_BC_PC_EXTERN 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - + ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13363,9 +13997,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_OUTFUNTYPE 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13392,9 +14027,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DEL_CURTERM 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13421,9 +14057,10 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define SYS_SELECT_WITH_SYS_TIME 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13466,9 +14103,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SVR4_PTYS 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -13492,11 +14130,12 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "yes" >/dev/null 2>&1 + $EGREP_TRADITIONAL "yes" >/dev/null 2>&1 then : ptys=`echo /dev/ptyp??` -else $as_nop - ptys=`echo $pdir/pty??` +else case e in #( + e) ptys=`echo $pdir/pty??` ;; +esac fi rm -rf conftest* @@ -13541,9 +14180,10 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_SIGCONTEXT 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -13552,8 +14192,8 @@ printf %s "checking getcwd implementation is broken... " >&6; } if test ${vim_cv_getcwd_broken+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : @@ -13561,8 +14201,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_getcwd_broken'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_getcwd_broken'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -13584,16 +14224,19 @@ then : vim_cv_getcwd_broken=no -else $as_nop - +else case e in #( + e) vim_cv_getcwd_broken=yes - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_getcwd_broken" >&5 printf "%s\n" "$vim_cv_getcwd_broken" >&6; } @@ -13955,8 +14598,8 @@ printf %s "checking types of arguments for select... " >&6; } if test ${ac_cv_func_select_args+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_func_select_args='int,int *,struct timeval *' +else case e in #( + e) ac_cv_func_select_args='int,int *,struct timeval *' for ac_arg234 in 'fd_set *' 'int *' 'void *'; do for ac_arg1 in 'int' 'size_t' 'unsigned long int' 'unsigned int'; do for ac_arg5 in 'struct timeval *' 'const struct timeval *'; do @@ -13988,7 +14631,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done done done - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_select_args" >&5 printf "%s\n" "$ac_cv_func_select_args" >&6; } @@ -14007,73 +14651,98 @@ printf "%s\n" "#define SELECT_TYPE_ARG5 ($3)" >>confdefs.h rm -rf conftest* -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGEFILE_SOURCE value needed for large files" >&5 -printf %s "checking for _LARGEFILE_SOURCE value needed for large files... " >&6; } -if test ${ac_cv_sys_largefile_source+y} +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for declarations of fseeko and ftello" >&5 +printf %s "checking for declarations of fseeko and ftello... " >&6; } +if test ${ac_cv_func_fseeko_ftello+y} then : printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ + +#if defined __hpux && !defined _LARGEFILE_SOURCE +# include +# if LONG_MAX >> 31 == 0 +# error "32-bit HP-UX 11/ia64 needs _LARGEFILE_SOURCE for fseeko in C++" +# endif +#endif #include /* for off_t */ - #include +#include + int main (void) { -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + + int (*fp1) (FILE *, off_t, int) = fseeko; + off_t (*fp2) (FILE *) = ftello; + return fseeko (stdin, 0, 0) + && fp1 (stdin, 0, 0) + && ftello (stdin) >= 0 + && fp2 (stdin) >= 0; + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_largefile_source=no; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_cv_func_fseeko_ftello=yes +else case e in #( + e) ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE=1" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _LARGEFILE_SOURCE 1 + +#if defined __hpux && !defined _LARGEFILE_SOURCE +# include +# if LONG_MAX >> 31 == 0 +# error "32-bit HP-UX 11/ia64 needs _LARGEFILE_SOURCE for fseeko in C++" +# endif +#endif #include /* for off_t */ - #include +#include + int main (void) { -int (*fp) (FILE *, off_t, int) = fseeko; - return fseeko (stdin, 0, 0) && fp (stdin, 0, 0); + + int (*fp1) (FILE *, off_t, int) = fseeko; + off_t (*fp2) (FILE *) = ftello; + return fseeko (stdin, 0, 0) + && fp1 (stdin, 0, 0) + && ftello (stdin) >= 0 + && fp2 (stdin) >= 0; + ; return 0; } _ACEOF -if ac_fn_c_try_link "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_largefile_source=1; break + ac_cv_func_fseeko_ftello="need _LARGEFILE_SOURCE" +else case e in #( + e) ac_cv_func_fseeko_ftello=no ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext - ac_cv_sys_largefile_source=unknown - break -done +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_source" >&5 -printf "%s\n" "$ac_cv_sys_largefile_source" >&6; } -case $ac_cv_sys_largefile_source in #( - no | unknown) ;; - *) -printf "%s\n" "#define _LARGEFILE_SOURCE $ac_cv_sys_largefile_source" >>confdefs.h -;; +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; esac -rm -rf conftest* - -# We used to try defining _XOPEN_SOURCE=500 too, to work around a bug -# in glibc 2.1.3, but that breaks too many other things. -# If you want fseeko and ftello with glibc, upgrade to a fixed glibc. -if test $ac_cv_sys_largefile_source != unknown; then +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_fseeko_ftello" >&5 +printf "%s\n" "$ac_cv_func_fseeko_ftello" >&6; } +if test "$ac_cv_func_fseeko_ftello" != no +then : printf "%s\n" "#define HAVE_FSEEKO 1" >>confdefs.h +fi +if test "$ac_cv_func_fseeko_ftello" = "need _LARGEFILE_SOURCE" +then : + +printf "%s\n" "#define _LARGEFILE_SOURCE 1" >>confdefs.h + fi @@ -14082,31 +14751,34 @@ if test ${enable_largefile+y} then : enableval=$enable_largefile; fi - -if test "$enable_largefile" != no; then - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 -printf %s "checking for special C compiler options needed for large files... " >&6; } -if test ${ac_cv_sys_largefile_CC+y} +if test "$enable_largefile,$enable_year2038" != no,no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable large file support" >&5 +printf %s "checking for $CC option to enable large file support... " >&6; } +if test ${ac_cv_sys_largefile_opts+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) ac_save_CC="$CC" + ac_opt_found=no + for ac_opt in "none needed" "-D_FILE_OFFSET_BITS=64" "-D_LARGE_FILES=1" "-n32"; do + if test x"$ac_opt" != x"none needed" +then : + CC="$ac_save_CC $ac_opt" +fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, +#ifndef FTYPE +# define FTYPE off_t +#endif + /* Check that FTYPE can represent 2**63 - 1 correctly. + We can't simply define LARGE_FTYPE to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) +#define LARGE_FTYPE (((FTYPE) 1 << 31 << 31) - 1 + ((FTYPE) 1 << 31 << 31)) + int FTYPE_is_large[(LARGE_FTYPE % 2147483629 == 721 + && LARGE_FTYPE % 2147483647 == 1) ? 1 : -1]; int main (void) @@ -14116,142 +14788,88 @@ main (void) return 0; } _ACEOF - if ac_fn_c_try_compile "$LINENO" +if ac_fn_c_try_compile "$LINENO" then : - break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam - CC="$CC -n32" + if test x"$ac_opt" = x"none needed" +then : + # GNU/Linux s390x and alpha need _FILE_OFFSET_BITS=64 for wide ino_t. + CC="$CC -DFTYPE=ino_t" if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_largefile_CC=' -n32'; break + +else case e in #( + e) CC="$CC -D_FILE_OFFSET_BITS=64" + if ac_fn_c_try_compile "$LINENO" +then : + ac_opt='-D_FILE_OFFSET_BITS=64' +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 -printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test ${ac_cv_sys_file_offset_bits+y} -then : - printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_file_offset_bits=no; break + ac_cv_sys_largefile_opts=$ac_opt + ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ + test $ac_opt_found = no || break + done + CC="$ac_save_CC" - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" -then : - ac_cv_sys_file_offset_bits=64; break -fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done + test $ac_opt_found = yes || ac_cv_sys_largefile_opts="support not detected" ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 -printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h -;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_opts" >&5 +printf "%s\n" "$ac_cv_sys_largefile_opts" >&6; } + +ac_have_largefile=yes +case $ac_cv_sys_largefile_opts in #( + "none needed") : + ;; #( + "supported through gnulib") : + ;; #( + "support not detected") : + ac_have_largefile=no ;; #( + "-D_FILE_OFFSET_BITS=64") : + +printf "%s\n" "#define _FILE_OFFSET_BITS 64" >>confdefs.h + ;; #( + "-D_LARGE_FILES=1") : + +printf "%s\n" "#define _LARGE_FILES 1" >>confdefs.h + ;; #( + "-n32") : + CC="$CC -n32" ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_largefile_opts" "$LINENO" 5 ;; esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 -printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } -if test ${ac_cv_sys_large_files+y} + +if test "$enable_year2038" != no +then : + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option for timestamps after 2038" >&5 +printf %s "checking for $CC option for timestamps after 2038... " >&6; } +if test ${ac_cv_sys_year2038_opts+y} then : printf %s "(cached) " >&6 -else $as_nop - while :; do - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main (void) -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO" +else case e in #( + e) ac_save_CPPFLAGS="$CPPFLAGS" + ac_opt_found=no + for ac_opt in "none needed" "-D_TIME_BITS=64" "-D__MINGW_USE_VC2005_COMPAT" "-U_USE_32_BIT_TIME_T -D__MINGW_USE_VC2005_COMPAT"; do + if test x"$ac_opt" != x"none needed" then : - ac_cv_sys_large_files=no; break + CPPFLAGS="$ac_save_CPPFLAGS $ac_opt" fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; + + #include + /* Check that time_t can represent 2**32 - 1 correctly. */ + #define LARGE_TIME_T \\ + ((time_t) (((time_t) 1 << 30) - 1 + 3 * ((time_t) 1 << 30))) + int verify_time_t_range[(LARGE_TIME_T / 65537 == 65535 + && LARGE_TIME_T % 65537 == 0) + ? 1 : -1]; + int main (void) { @@ -14262,25 +14880,47 @@ main (void) _ACEOF if ac_fn_c_try_compile "$LINENO" then : - ac_cv_sys_large_files=1; break + ac_cv_sys_year2038_opts="$ac_opt" + ac_opt_found=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done + test $ac_opt_found = no || break + done + CPPFLAGS="$ac_save_CPPFLAGS" + test $ac_opt_found = yes || ac_cv_sys_year2038_opts="support not detected" ;; +esac fi -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 -printf "%s\n" "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h -;; +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_year2038_opts" >&5 +printf "%s\n" "$ac_cv_sys_year2038_opts" >&6; } + +ac_have_year2038=yes +case $ac_cv_sys_year2038_opts in #( + "none needed") : + ;; #( + "support not detected") : + ac_have_year2038=no ;; #( + "-D_TIME_BITS=64") : + +printf "%s\n" "#define _TIME_BITS 64" >>confdefs.h + ;; #( + "-D__MINGW_USE_VC2005_COMPAT") : + +printf "%s\n" "#define __MINGW_USE_VC2005_COMPAT 1" >>confdefs.h + ;; #( + "-U_USE_32_BIT_TIME_T"*) : + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} +as_fn_error $? "the 'time_t' type is currently forced to be 32-bit. It +will stop working after mid-January 2038. Remove +_USE_32BIT_TIME_T from the compiler flags. +See 'config.log' for more details" "$LINENO" 5; } ;; #( + *) : + as_fn_error $? "internal error: bad value for \$ac_cv_sys_year2038_opts" "$LINENO" 5 ;; esac -rm -rf conftest* - fi + fi +fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking --enable-canberra argument" >&5 printf %s "checking --enable-canberra argument... " >&6; } @@ -14288,8 +14928,9 @@ printf %s "checking --enable-canberra argument... " >&6; } if test ${enable_canberra+y} then : enableval=$enable_canberra; -else $as_nop - enable_canberra="maybe" +else case e in #( + e) enable_canberra="maybe" ;; +esac fi @@ -14350,9 +14991,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_CANBERRA 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; try installing libcanberra-dev" >&5 -printf "%s\n" "no; try installing libcanberra-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; try installing libcanberra-dev" >&5 +printf "%s\n" "no; try installing libcanberra-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14364,8 +15006,9 @@ printf %s "checking --enable-libsodium argument... " >&6; } if test ${enable_libsodium+y} then : enableval=$enable_libsodium; -else $as_nop - enable_libsodium="maybe" +else case e in #( + e) enable_libsodium="maybe" ;; +esac fi @@ -14417,9 +15060,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SODIUM 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; try installing libsodium-dev" >&5 -printf "%s\n" "no; try installing libsodium-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no; try installing libsodium-dev" >&5 +printf "%s\n" "no; try installing libsodium-dev" >&6; }; CFLAGS="$ac_save_CFLAGS"; LIBS="$ac_save_LIBS" ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14464,9 +15108,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ST_BLKSIZE 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -14475,8 +15120,8 @@ printf %s "checking for timer_create without -lrt... " >&6; } if test ${vim_cv_timer_create+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14495,11 +15140,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : vim_cv_timer_create=yes -else $as_nop - vim_cv_timer_create=no - +else case e in #( + e) vim_cv_timer_create=no + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create" >&5 printf "%s\n" "$vim_cv_timer_create" >&6; } @@ -14512,8 +15159,8 @@ printf %s "checking for timer_create with -lrt... " >&6; } if test ${vim_cv_timer_create_with_lrt+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14532,11 +15179,13 @@ _ACEOF if ac_fn_c_try_compile "$LINENO" then : vim_cv_timer_create_with_lrt=yes -else $as_nop - vim_cv_timer_create_with_lrt=no - +else case e in #( + e) vim_cv_timer_create_with_lrt=no + ;; +esac fi -rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create_with_lrt" >&5 printf "%s\n" "$vim_cv_timer_create_with_lrt" >&6; } @@ -14557,16 +15206,16 @@ printf %s "checking if timer_create works... " >&6; } if test ${vim_cv_timer_create_works+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : vim_cv_timer_create_works=yes { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_timer_create_works'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_timer_create_works'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #if STDC_HEADERS @@ -14597,13 +15246,16 @@ _ACEOF if ac_fn_c_try_run "$LINENO" then : vim_cv_timer_create_works=yes -else $as_nop - vim_cv_timer_create_works=no +else case e in #( + e) vim_cv_timer_create_works=no ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_timer_create_works" >&5 printf "%s\n" "$vim_cv_timer_create_works" >&6; } @@ -14621,8 +15273,8 @@ printf %s "checking whether stat() ignores a trailing slash... " >&6; } if test ${vim_cv_stat_ignores_slash+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : @@ -14630,8 +15282,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_stat_ignores_slash'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_stat_ignores_slash'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include "confdefs.h" @@ -14649,16 +15301,19 @@ then : vim_cv_stat_ignores_slash=yes -else $as_nop - +else case e in #( + e) vim_cv_stat_ignores_slash=no - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_stat_ignores_slash" >&5 printf "%s\n" "$vim_cv_stat_ignores_slash" >&6; } @@ -14673,8 +15328,8 @@ printf %s "checking for nanoseconds field of struct stat... " >&6; } if test ${ac_cv_struct_st_mtim_nsec+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_save_CPPFLAGS="$CPPFLAGS" +else case e in #( + e) ac_save_CPPFLAGS="$CPPFLAGS" ac_cv_struct_st_mtim_nsec=no # st_mtim.tv_nsec -- the usual case # st_mtim._tv_nsec -- Solaris 2.6, if @@ -14704,7 +15359,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext done CPPFLAGS="$ac_save_CPPFLAGS" - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_st_mtim_nsec" >&5 printf "%s\n" "$ac_cv_struct_st_mtim_nsec" >&6; } @@ -14738,8 +15394,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes; with -liconv" >&5 printf "%s\n" "yes; with -liconv" >&6; }; printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h -else $as_nop - LIBS="$save_LIBS" +else case e in #( + e) LIBS="$save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -14760,12 +15416,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ICONV 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14793,9 +15451,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_NL_LANGINFO_CODESET 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14805,16 +15464,22 @@ printf %s "checking for strtod in -lm... " >&6; } if test ${ac_cv_lib_m_strtod+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char strtod (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char strtod (void); int main (void) { @@ -14826,12 +15491,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_m_strtod=yes -else $as_nop - ac_cv_lib_m_strtod=no +else case e in #( + e) ac_cv_lib_m_strtod=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_strtod" >&5 printf "%s\n" "$ac_cv_lib_m_strtod" >&6; } @@ -14870,9 +15537,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ISINF 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14903,9 +15571,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_ISNAN 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -14916,8 +15585,9 @@ printf %s "checking --disable-acl argument... " >&6; } if test ${enable_acl+y} then : enableval=$enable_acl; -else $as_nop - enable_acl="yes" +else case e in #( + e) enable_acl="yes" ;; +esac fi if test "$enable_acl" = "yes"; then @@ -14928,16 +15598,22 @@ printf %s "checking for acl_get_file in -lposix1e... " >&6; } if test ${ac_cv_lib_posix1e_acl_get_file+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lposix1e $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char acl_get_file (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char acl_get_file (void); int main (void) { @@ -14949,34 +15625,42 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_posix1e_acl_get_file=yes -else $as_nop - ac_cv_lib_posix1e_acl_get_file=no +else case e in #( + e) ac_cv_lib_posix1e_acl_get_file=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_posix1e_acl_get_file" >&5 printf "%s\n" "$ac_cv_lib_posix1e_acl_get_file" >&6; } if test "x$ac_cv_lib_posix1e_acl_get_file" = xyes then : LIBS="$LIBS -lposix1e" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5 printf %s "checking for acl_get_file in -lacl... " >&6; } if test ${ac_cv_lib_acl_acl_get_file+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lacl $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char acl_get_file (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char acl_get_file (void); int main (void) { @@ -14988,12 +15672,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_acl_acl_get_file=yes -else $as_nop - ac_cv_lib_acl_acl_get_file=no +else case e in #( + e) ac_cv_lib_acl_acl_get_file=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_acl_acl_get_file" >&5 printf "%s\n" "$ac_cv_lib_acl_acl_get_file" >&6; } @@ -15005,16 +15691,22 @@ printf %s "checking for fgetxattr in -lattr... " >&6; } if test ${ac_cv_lib_attr_fgetxattr+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lattr $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char fgetxattr (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char fgetxattr (void); int main (void) { @@ -15026,12 +15718,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_attr_fgetxattr=yes -else $as_nop - ac_cv_lib_attr_fgetxattr=no +else case e in #( + e) ac_cv_lib_attr_fgetxattr=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_fgetxattr" >&5 printf "%s\n" "$ac_cv_lib_attr_fgetxattr" >&6; } @@ -15041,7 +15735,8 @@ then : fi fi - + ;; +esac fi @@ -15070,9 +15765,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_POSIX_ACL 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15082,16 +15778,22 @@ printf %s "checking for acl_get in -lsec... " >&6; } if test ${ac_cv_lib_sec_acl_get+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lsec $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char acl_get (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char acl_get (void); int main (void) { @@ -15103,12 +15805,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_sec_acl_get=yes -else $as_nop - ac_cv_lib_sec_acl_get=no +else case e in #( + e) ac_cv_lib_sec_acl_get=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_sec_acl_get" >&5 printf "%s\n" "$ac_cv_lib_sec_acl_get" >&6; } @@ -15116,8 +15820,8 @@ if test "x$ac_cv_lib_sec_acl_get" = xyes then : LIBS="$LIBS -lsec"; printf "%s\n" "#define HAVE_SOLARIS_ZFS_ACL 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for Solaris ACL support" >&5 printf %s "checking for Solaris ACL support... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -15139,12 +15843,14 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SOLARIS_ACL 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi @@ -15185,9 +15891,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_AIX_ACL 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15219,9 +15926,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_PANGO_SHAPE_FULL 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15235,8 +15943,9 @@ printf %s "checking --enable-gpm argument... " >&6; } if test ${enable_gpm+y} then : enableval=$enable_gpm; -else $as_nop - enable_gpm="yes" +else case e in #( + e) enable_gpm="yes" ;; +esac fi @@ -15248,8 +15957,8 @@ printf %s "checking for gpm... " >&6; } if test ${vi_cv_have_gpm+y} then : printf %s "(cached) " >&6 -else $as_nop - olibs="$LIBS" ; LIBS="-lgpm" +else case e in #( + e) olibs="$LIBS" ; LIBS="-lgpm" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -15265,13 +15974,15 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : vi_cv_have_gpm=yes -else $as_nop - vi_cv_have_gpm=no +else case e in #( + e) vi_cv_have_gpm=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext LIBS="$olibs" - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_have_gpm" >&5 printf "%s\n" "$vi_cv_have_gpm" >&6; } @@ -15296,8 +16007,9 @@ printf %s "checking --disable-sysmouse argument... " >&6; } if test ${enable_sysmouse+y} then : enableval=$enable_sysmouse; -else $as_nop - enable_sysmouse="yes" +else case e in #( + e) enable_sysmouse="yes" ;; +esac fi @@ -15309,8 +16021,8 @@ printf %s "checking for sysmouse... " >&6; } if test ${vi_cv_have_sysmouse+y} then : printf %s "(cached) " >&6 -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include @@ -15330,12 +16042,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : vi_cv_have_sysmouse=yes -else $as_nop - vi_cv_have_sysmouse=no +else case e in #( + e) vi_cv_have_sysmouse=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vi_cv_have_sysmouse" >&5 printf "%s\n" "$vi_cv_have_sysmouse" >&6; } @@ -15368,9 +16082,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_FD_CLOEXEC 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15392,9 +16107,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_RENAME 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15418,9 +16134,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DIRFD 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15443,9 +16160,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_FLOCK 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15476,9 +16194,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSCTL 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15506,9 +16225,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSINFO 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -15534,9 +16254,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSINFO_MEM_UNIT 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15564,9 +16285,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSINFO_UPTIME 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15590,9 +16312,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSCONF 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -15615,36 +16338,39 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SYSCONF_SIGSTKSZ 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 -printf "%s\n" "not usable" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: not usable" >&5 +printf "%s\n" "not usable" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 printf %s "checking size of int... " >&6; } if test ${ac_cv_sizeof_int+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_int" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_int" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (int) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_int" >&5 printf "%s\n" "$ac_cv_sizeof_int" >&6; } @@ -15656,28 +16382,30 @@ printf "%s\n" "#define SIZEOF_INT $ac_cv_sizeof_int" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 printf %s "checking size of long... " >&6; } if test ${ac_cv_sizeof_long+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_long" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_long" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 printf "%s\n" "$ac_cv_sizeof_long" >&6; } @@ -15689,28 +16417,30 @@ printf "%s\n" "#define SIZEOF_LONG $ac_cv_sizeof_long" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of time_t" >&5 printf %s "checking size of time_t... " >&6; } if test ${ac_cv_sizeof_time_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (time_t))" "ac_cv_sizeof_time_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_time_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_time_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (time_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_time_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_time_t" >&5 printf "%s\n" "$ac_cv_sizeof_time_t" >&6; } @@ -15722,28 +16452,30 @@ printf "%s\n" "#define SIZEOF_TIME_T $ac_cv_sizeof_time_t" >>confdefs.h # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# declarations like 'int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 printf %s "checking size of off_t... " >&6; } if test ${ac_cv_sizeof_off_t+y} then : printf %s "(cached) " >&6 -else $as_nop - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default" +else case e in #( + e) if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "$ac_includes_default" then : -else $as_nop - if test "$ac_cv_type_off_t" = yes; then - { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} +else case e in #( + e) if test "$ac_cv_type_off_t" = yes; then + { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5 +printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;} as_fn_error 77 "cannot compute sizeof (off_t) -See \`config.log' for more details" "$LINENO" 5; } +See 'config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_off_t=0 - fi + fi ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 printf "%s\n" "$ac_cv_sizeof_off_t" >&6; } @@ -15765,8 +16497,8 @@ if test "$cross_compiling" = yes then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: assuming uint32_t is correct when cross-compiling" >&5 printf "%s\n" "$as_me: WARNING: assuming uint32_t is correct when cross-compiling" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef HAVE_STDINT_H @@ -15786,11 +16518,13 @@ if ac_fn_c_try_run "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ok" >&5 printf "%s\n" "ok" >&6; } -else $as_nop - as_fn_error $? "WRONG! uint32_t not defined correctly." "$LINENO" 5 +else case e in #( + e) as_fn_error $? "WRONG! uint32_t not defined correctly." "$LINENO" 5 ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi @@ -15822,8 +16556,8 @@ printf %s "checking whether memmove handles overlaps... " >&6; } if test ${vim_cv_memmove_handles_overlap+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : @@ -15831,8 +16565,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_memmove_handles_overlap'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_memmove_handles_overlap'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_memmove(s,d,l) memmove(d,s,l) $bcopy_test_prog _ACEOF @@ -15841,16 +16575,19 @@ then : vim_cv_memmove_handles_overlap=yes -else $as_nop - +else case e in #( + e) vim_cv_memmove_handles_overlap=no - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_memmove_handles_overlap" >&5 printf "%s\n" "$vim_cv_memmove_handles_overlap" >&6; } @@ -15864,8 +16601,8 @@ printf %s "checking whether bcopy handles overlaps... " >&6; } if test ${vim_cv_bcopy_handles_overlap+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : @@ -15873,8 +16610,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_bcopy_handles_overlap'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_bcopy_handles_overlap'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_bcopy(s,d,l) bcopy(d,s,l) $bcopy_test_prog _ACEOF @@ -15883,16 +16620,19 @@ then : vim_cv_bcopy_handles_overlap=yes -else $as_nop - +else case e in #( + e) vim_cv_bcopy_handles_overlap=no - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_bcopy_handles_overlap" >&5 printf "%s\n" "$vim_cv_bcopy_handles_overlap" >&6; } @@ -15906,8 +16646,8 @@ printf %s "checking whether memcpy handles overlaps... " >&6; } if test ${vim_cv_memcpy_handles_overlap+y} then : printf %s "(cached) " >&6 -else $as_nop - +else case e in #( + e) if test "$cross_compiling" = yes then : @@ -15915,8 +16655,8 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cross-compiling: consider setting 'vim_cv_memcpy_handles_overlap'" >&5 printf "%s\n" "$as_me: WARNING: cross-compiling: consider setting 'vim_cv_memcpy_handles_overlap'" >&2;} -else $as_nop - cat confdefs.h - <<_ACEOF >conftest.$ac_ext +else case e in #( + e) cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define mch_memcpy(s,d,l) memcpy(d,s,l) $bcopy_test_prog _ACEOF @@ -15925,16 +16665,19 @@ then : vim_cv_memcpy_handles_overlap=yes -else $as_nop - +else case e in #( + e) vim_cv_memcpy_handles_overlap=no - + ;; +esac fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext + conftest.$ac_objext conftest.beam conftest.$ac_ext ;; +esac fi - + ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $vim_cv_memcpy_handles_overlap" >&5 printf "%s\n" "$vim_cv_memcpy_handles_overlap" >&6; } @@ -15973,8 +16716,14 @@ then : /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char _Xsetlocale (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char _Xsetlocale (void); int main (void) { @@ -15989,15 +16738,17 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define X_LOCALE 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext @@ -16008,8 +16759,14 @@ printf %s "checking whether Xutf8SetWMProperties() can be used... " >&6; } /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char Xutf8SetWMProperties (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char Xutf8SetWMProperties (void); int main (void) { @@ -16024,9 +16781,10 @@ then : printf "%s\n" "yes" >&6; } printf "%s\n" "#define HAVE_XUTF8SETWMPROPERTIES 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16040,16 +16798,22 @@ printf %s "checking for _xpg4_setrunelocale in -lxpg4... " >&6; } if test ${ac_cv_lib_xpg4__xpg4_setrunelocale+y} then : printf %s "(cached) " >&6 -else $as_nop - ac_check_lib_save_LIBS=$LIBS +else case e in #( + e) ac_check_lib_save_LIBS=$LIBS LIBS="-lxpg4 $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -char _xpg4_setrunelocale (); + builtin and then its argument prototype would still apply. + The 'extern "C"' is for builds by C++ compilers; + although this is not generally supported in C code supporting it here + has little cost and some practical benefit (sr 110532). */ +#ifdef __cplusplus +extern "C" +#endif +char _xpg4_setrunelocale (void); int main (void) { @@ -16061,12 +16825,14 @@ _ACEOF if ac_fn_c_try_link "$LINENO" then : ac_cv_lib_xpg4__xpg4_setrunelocale=yes -else $as_nop - ac_cv_lib_xpg4__xpg4_setrunelocale=no +else case e in #( + e) ac_cv_lib_xpg4__xpg4_setrunelocale=no ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS +LIBS=$ac_check_lib_save_LIBS ;; +esac fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xpg4__xpg4_setrunelocale" >&5 printf "%s\n" "$ac_cv_lib_xpg4__xpg4_setrunelocale" >&6; } @@ -16116,8 +16882,9 @@ printf %s "checking --disable-nls argument... " >&6; } if test ${enable_nls+y} then : enableval=$enable_nls; -else $as_nop - enable_nls="yes" +else case e in #( + e) enable_nls="yes" ;; +esac fi @@ -16137,8 +16904,8 @@ printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_MSGFMT+y} then : printf %s "(cached) " >&6 -else $as_nop - if test -n "$MSGFMT"; then +else case e in #( + e) if test -n "$MSGFMT"; then ac_cv_prog_MSGFMT="$MSGFMT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -16160,7 +16927,8 @@ done done IFS=$as_save_IFS -fi +fi ;; +esac fi MSGFMT=$ac_cv_prog_MSGFMT if test -n "$MSGFMT"; then @@ -16194,8 +16962,8 @@ if ac_fn_c_try_link "$LINENO" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gettext() works" >&5 printf "%s\n" "gettext() works" >&6; }; have_gettext="yes"; LIBS=$olibs -else $as_nop - LIBS="-lintl" +else case e in #( + e) LIBS="-lintl" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include @@ -16212,13 +16980,15 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gettext() works with -lintl" >&5 printf "%s\n" "gettext() works with -lintl" >&6; }; have_gettext="yes"; LIBS="$olibs -lintl" -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gettext() doesn't work" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: gettext() doesn't work" >&5 printf "%s\n" "gettext() doesn't work" >&6; }; - LIBS=$olibs + LIBS=$olibs ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16256,11 +17026,12 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DGETTEXT 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dngettext" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dngettext" >&5 printf %s "checking for dngettext... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16280,9 +17051,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DNGETTEXT 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16305,9 +17077,10 @@ then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_NL_MSG_CAT_CNTR 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 -printf "%s\n" "no" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16371,13 +17144,14 @@ ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_inc if test "x$ac_cv_header_dlfcn_h" = xyes then : DLL=dlfcn.h -else $as_nop - ac_fn_c_check_header_compile "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" +else case e in #( + e) ac_fn_c_check_header_compile "$LINENO" "dl.h" "ac_cv_header_dl_h" "$ac_includes_default" if test "x$ac_cv_header_dl_h" = xyes then : DLL=dl.h fi - + ;; +esac fi if test x${DLL} = xdlfcn.h; then @@ -16407,8 +17181,8 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DLOPEN 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlopen() in -ldl" >&5 printf %s "checking for dlopen() in -ldl... " >&6; } @@ -16435,13 +17209,15 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DLOPEN 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; - LIBS=$olibs + LIBS=$olibs ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16468,8 +17244,8 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DLSYM 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for dlsym() in -ldl" >&5 printf %s "checking for dlsym() in -ldl... " >&6; } @@ -16496,13 +17272,15 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_DLSYM 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; - LIBS=$olibs + LIBS=$olibs ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16533,8 +17311,8 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SHL_LOAD 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for shl_load() in -ldld" >&5 printf %s "checking for shl_load() in -ldld... " >&6; } @@ -16561,13 +17339,15 @@ printf "%s\n" "yes" >&6; }; printf "%s\n" "#define HAVE_SHL_LOAD 1" >>confdefs.h -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; }; - LIBS=$olibs + LIBS=$olibs ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ - conftest$ac_exeext conftest.$ac_ext + conftest$ac_exeext conftest.$ac_ext ;; +esac fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext conftest.$ac_ext @@ -16618,9 +17398,10 @@ then : withval=$with_xcodecfg; XCODEFLAGS="$XCODEFLAGS -configuration $withval" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $withval" >&5 printf "%s\n" "$withval" >&6; } -else $as_nop - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using default" >&5 -printf "%s\n" "using default" >&6; } +else case e in #( + e) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: using default" >&5 +printf "%s\n" "using default" >&6; } ;; +esac fi @@ -16719,8 +17500,8 @@ cat >confcache <<\_ACEOF # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the +# 'ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* 'ac_cv_foo' will be assigned the # following values. _ACEOF @@ -16750,14 +17531,14 @@ printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes: double-quote + # 'set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) - # `set' quotes correctly as required by POSIX, so do not add quotes. + # 'set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | @@ -16819,6 +17600,12 @@ LTLIBOBJS=$ac_ltlibobjs +# Check whether --enable-year2038 was given. +if test ${enable_year2038+y} +then : + enableval=$enable_year2038; +fi + : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 @@ -16848,7 +17635,6 @@ cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh -as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh @@ -16857,12 +17643,13 @@ then : # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST -else $as_nop - case `(set -o) 2>/dev/null` in #( +else case e in #( + e) case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; +esac ;; esac fi @@ -16934,7 +17721,7 @@ IFS=$as_save_IFS ;; esac -# We did not find ourselves, most probably we were run as `sh COMMAND' +# We did not find ourselves, most probably we were run as 'sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 @@ -16963,7 +17750,6 @@ as_fn_error () } # as_fn_error - # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. @@ -17003,11 +17789,12 @@ then : { eval $1+=\$2 }' -else $as_nop - as_fn_append () +else case e in #( + e) as_fn_append () { eval $1=\$$1\$2 - } + } ;; +esac fi # as_fn_append # as_fn_arith ARG... @@ -17021,11 +17808,12 @@ then : { as_val=$(( $* )) }' -else $as_nop - as_fn_arith () +else case e in #( + e) as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` - } + } ;; +esac fi # as_fn_arith @@ -17108,9 +17896,9 @@ if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -pR'. + # 1) On MSYS, both 'ln -s file dir' and 'ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; 'ln -s' creates a wrapper executable. + # In both cases, we have to default to 'cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then @@ -17191,10 +17979,12 @@ as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +as_sed_cpp="y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed '$as_sed_cpp'" # deprecated # Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +as_sed_sh="y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed '$as_sed_sh'" # deprecated exec 6>&1 @@ -17210,7 +18000,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.71. Invocation command line was +generated by GNU Autoconf 2.72. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -17241,7 +18031,7 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ -\`$as_me' instantiates files and other configuration actions +'$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. @@ -17274,10 +18064,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.71, +configured by $0, generated by GNU Autoconf 2.72, with options \\"\$ac_cs_config\\" -Copyright (C) 2021 Free Software Foundation, Inc. +Copyright (C) 2023 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -17337,8 +18127,8 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error $? "ambiguous option: \`$1' -Try \`$0 --help' for more information.";; + as_fn_error $? "ambiguous option: '$1' +Try '$0 --help' for more information.";; --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ @@ -17346,8 +18136,8 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error $? "unrecognized option: \`$1' -Try \`$0 --help' for more information." ;; + -*) as_fn_error $? "unrecognized option: '$1' +Try '$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; @@ -17398,7 +18188,7 @@ do "auto/config.h") CONFIG_HEADERS="$CONFIG_HEADERS auto/config.h:config.h.in" ;; "auto/config.mk") CONFIG_FILES="$CONFIG_FILES auto/config.mk:config.mk.in" ;; - *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: '$ac_config_target'" "$LINENO" 5;; esac done @@ -17417,7 +18207,7 @@ fi # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# after its creation but before its name has been assigned to '$tmp'. $debug || { tmp= ac_tmp= @@ -17441,7 +18231,7 @@ ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# This happens for instance with './config.status config.h'. if test -n "$CONFIG_FILES"; then @@ -17599,13 +18389,13 @@ fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. +# This happens for instance with './config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as +# Transform confdefs.h into an awk script 'defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. @@ -17715,7 +18505,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag '$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -17737,19 +18527,19 @@ do -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. + # because $ac_f cannot contain ':'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: '$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done - # Let's still pretend it is `configure' which instantiates (i.e., don't + # Let's still pretend it is 'configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` @@ -17873,7 +18663,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 esac _ACEOF -# Neutralize VPATH when `$srcdir' = `.'. +# Neutralize VPATH when '$srcdir' = '.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 @@ -17902,9 +18692,9 @@ test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && - { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&5 -printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable 'datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" diff --git a/src/auto/wayland/Makefile b/src/auto/wayland/Makefile new file mode 100644 index 0000000000..e88b3b86e7 --- /dev/null +++ b/src/auto/wayland/Makefile @@ -0,0 +1,52 @@ +# List of files to generate +GEN_XML = protocols/ext-data-control-v1.xml \ + protocols/primary-selection-unstable-v1.xml \ + protocols/wlr-data-control-unstable-v1.xml \ + protocols/xdg-shell.xml +GEN_SRC = ext-data-control-v1.c \ + primary-selection-unstable-v1.c \ + wlr-data-control-unstable-v1.c \ + xdg-shell.c +GEN_INCLUDE = ext-data-control-v1.h \ + primary-selection-unstable-v1.h \ + wlr-data-control-unstable-v1.h \ + xdg-shell.h + +# Default target +all: $(GEN_SRC) $(GEN_INCLUDE) + @if ! command -v wayland-scanner 2>&1 > /dev/null ; then \ + echo "wayland-scanner not available, cannot generate protocol files"; \ + false; \ + fi + +ext-data-control-v1.c: + wayland-scanner private-code protocols/ext-data-control-v1.xml $@ +ext-data-control-v1.h: + wayland-scanner client-header protocols/ext-data-control-v1.xml $@ + +wlr-data-control-unstable-v1.c: + wayland-scanner private-code protocols/wlr-data-control-unstable-v1.xml $@ +wlr-data-control-unstable-v1.h: + wayland-scanner client-header protocols/wlr-data-control-unstable-v1.xml $@ + +primary-selection-unstable-v1.c: + wayland-scanner private-code protocols/primary-selection-unstable-v1.xml $@ +primary-selection-unstable-v1.h: + wayland-scanner client-header protocols/primary-selection-unstable-v1.xml $@ + +xdg-shell.c: + wayland-scanner private-code protocols/xdg-shell.xml $@ +xdg-shell.h: + wayland-scanner client-header protocols/xdg-shell.xml $@ + +$(GEN_SRC) $(GEN_INCLUDE): $(GEN_XML) + +$(GEN_XML): + +# Clean rule +clean: + rm -f *.c *.h + +.PHONY: all clean + +# vim:ts=8:sw=8:tw=78 diff --git a/src/auto/wayland/README.txt b/src/auto/wayland/README.txt new file mode 100644 index 0000000000..ee0de0a775 --- /dev/null +++ b/src/auto/wayland/README.txt @@ -0,0 +1,11 @@ +This directory contains the auto-generated protocol files for the Wayland +System Integration. + +To re-generate them run make. + +It requires wayland-scanner to be installed, which is generally found as +wayland-utils package in Linux distributions. + +Included as of Vim patch v9.1.1485 (2025 Jun 27). + +Initial work done by Foxe Chen. diff --git a/src/auto/wayland/protocols/ext-data-control-v1.xml b/src/auto/wayland/protocols/ext-data-control-v1.xml new file mode 100644 index 0000000000..37ee577ed9 --- /dev/null +++ b/src/auto/wayland/protocols/ext-data-control-v1.xml @@ -0,0 +1,276 @@ + + + + Copyright © 2018 Simon Ser + Copyright © 2019 Ivan Molodetskikh + Copyright © 2024 Neal Gompa + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + the copyright holders not be used in advertising or publicity + pertaining to distribution of the software without specific, + written prior permission. The copyright holders make no + representations about the suitability of this software for any + purpose. It is provided "as is" without express or implied + warranty. + + THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + THIS SOFTWARE. + + + + This protocol allows a privileged client to control data devices. In + particular, the client will be able to manage the current selection and take + the role of a clipboard manager. + + Warning! The protocol described in this file is currently in the testing + phase. Backward compatible changes may be added together with the + corresponding interface version bump. Backward incompatible changes can + only be done by creating a new major version of the extension. + + + + + This interface is a manager that allows creating per-seat data device + controls. + + + + + Create a new data source. + + + + + + + Create a data device that can be used to manage a seat's selection. + + + + + + + + All objects created by the manager will still remain valid, until their + appropriate destroy request has been called. + + + + + + + This interface allows a client to manage a seat's selection. + + When the seat is destroyed, this object becomes inert. + + + + + This request asks the compositor to set the selection to the data from + the source on behalf of the client. + + The given source may not be used in any further set_selection or + set_primary_selection requests. Attempting to use a previously used + source triggers the used_source protocol error. + + To unset the selection, set the source to NULL. + + + + + + + Destroys the data device object. + + + + + + The data_offer event introduces a new ext_data_control_offer object, + which will subsequently be used in either the + ext_data_control_device.selection event (for the regular clipboard + selections) or the ext_data_control_device.primary_selection event (for + the primary clipboard selections). Immediately following the + ext_data_control_device.data_offer event, the new data_offer object + will send out ext_data_control_offer.offer events to describe the MIME + types it offers. + + + + + + + The selection event is sent out to notify the client of a new + ext_data_control_offer for the selection for this device. The + ext_data_control_device.data_offer and the ext_data_control_offer.offer + events are sent out immediately before this event to introduce the data + offer object. The selection event is sent to a client when a new + selection is set. The ext_data_control_offer is valid until a new + ext_data_control_offer or NULL is received. The client must destroy the + previous selection ext_data_control_offer, if any, upon receiving this + event. Regardless, the previous selection will be ignored once a new + selection ext_data_control_offer is received. + + The first selection event is sent upon binding the + ext_data_control_device object. + + + + + + + This data control object is no longer valid and should be destroyed by + the client. + + + + + + The primary_selection event is sent out to notify the client of a new + ext_data_control_offer for the primary selection for this device. The + ext_data_control_device.data_offer and the ext_data_control_offer.offer + events are sent out immediately before this event to introduce the data + offer object. The primary_selection event is sent to a client when a + new primary selection is set. The ext_data_control_offer is valid until + a new ext_data_control_offer or NULL is received. The client must + destroy the previous primary selection ext_data_control_offer, if any, + upon receiving this event. Regardless, the previous primary selection + will be ignored once a new primary selection ext_data_control_offer is + received. + + If the compositor supports primary selection, the first + primary_selection event is sent upon binding the + ext_data_control_device object. + + + + + + + This request asks the compositor to set the primary selection to the + data from the source on behalf of the client. + + The given source may not be used in any further set_selection or + set_primary_selection requests. Attempting to use a previously used + source triggers the used_source protocol error. + + To unset the primary selection, set the source to NULL. + + The compositor will ignore this request if it does not support primary + selection. + + + + + + + + + + + + The ext_data_control_source object is the source side of a + ext_data_control_offer. It is created by the source client in a data + transfer and provides a way to describe the offered data and a way to + respond to requests to transfer the data. + + + + + + + + + This request adds a MIME type to the set of MIME types advertised to + targets. Can be called several times to offer multiple types. + + Calling this after ext_data_control_device.set_selection is a protocol + error. + + + + + + + Destroys the data source object. + + + + + + Request for data from the client. Send the data as the specified MIME + type over the passed file descriptor, then close it. + + + + + + + + This data source is no longer valid. The data source has been replaced + by another data source. + + The client should clean up and destroy this data source. + + + + + + + A ext_data_control_offer represents a piece of data offered for transfer + by another client (the source client). The offer describes the different + MIME types that the data can be converted to and provides the mechanism + for transferring the data directly from the source client. + + + + + To transfer the offered data, the client issues this request and + indicates the MIME type it wants to receive. The transfer happens + through the passed file descriptor (typically created with the pipe + system call). The source client writes the data in the MIME type + representation requested and then closes the file descriptor. + + The receiving client reads from the read end of the pipe until EOF and + then closes its end, at which point the transfer is complete. + + This request may happen multiple times for different MIME types. + + + + + + + + Destroys the data offer object. + + + + + + Sent immediately after creating the ext_data_control_offer object. + One event per offered MIME type. + + + + + diff --git a/src/auto/wayland/protocols/primary-selection-unstable-v1.xml b/src/auto/wayland/protocols/primary-selection-unstable-v1.xml new file mode 100644 index 0000000000..e5a39e34ce --- /dev/null +++ b/src/auto/wayland/protocols/primary-selection-unstable-v1.xml @@ -0,0 +1,225 @@ + + + + Copyright © 2015, 2016 Red Hat + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + + + This protocol provides the ability to have a primary selection device to + match that of the X server. This primary selection is a shortcut to the + common clipboard selection, where text just needs to be selected in order + to allow copying it elsewhere. The de facto way to perform this action + is the middle mouse button, although it is not limited to this one. + + Clients wishing to honor primary selection should create a primary + selection source and set it as the selection through + wp_primary_selection_device.set_selection whenever the text selection + changes. In order to minimize calls in pointer-driven text selection, + it should happen only once after the operation finished. Similarly, + a NULL source should be set when text is unselected. + + wp_primary_selection_offer objects are first announced through the + wp_primary_selection_device.data_offer event. Immediately after this event, + the primary data offer will emit wp_primary_selection_offer.offer events + to let know of the mime types being offered. + + When the primary selection changes, the client with the keyboard focus + will receive wp_primary_selection_device.selection events. Only the client + with the keyboard focus will receive such events with a non-NULL + wp_primary_selection_offer. Across keyboard focus changes, previously + focused clients will receive wp_primary_selection_device.events with a + NULL wp_primary_selection_offer. + + In order to request the primary selection data, the client must pass + a recent serial pertaining to the press event that is triggering the + operation, if the compositor deems the serial valid and recent, the + wp_primary_selection_source.send event will happen in the other end + to let the transfer begin. The client owning the primary selection + should write the requested data, and close the file descriptor + immediately. + + If the primary selection owner client disappeared during the transfer, + the client reading the data will receive a + wp_primary_selection_device.selection event with a NULL + wp_primary_selection_offer, the client should take this as a hint + to finish the reads related to the no longer existing offer. + + The primary selection owner should be checking for errors during + writes, merely cancelling the ongoing transfer if any happened. + + + + + The primary selection device manager is a singleton global object that + provides access to the primary selection. It allows to create + wp_primary_selection_source objects, as well as retrieving the per-seat + wp_primary_selection_device objects. + + + + + Create a new primary selection source. + + + + + + + Create a new data device for a given seat. + + + + + + + + Destroy the primary selection device manager. + + + + + + + + Replaces the current selection. The previous owner of the primary + selection will receive a wp_primary_selection_source.cancelled event. + + To unset the selection, set the source to NULL. + + + + + + + + Introduces a new wp_primary_selection_offer object that may be used + to receive the current primary selection. Immediately following this + event, the new wp_primary_selection_offer object will send + wp_primary_selection_offer.offer events to describe the offered mime + types. + + + + + + + The wp_primary_selection_device.selection event is sent to notify the + client of a new primary selection. This event is sent after the + wp_primary_selection.data_offer event introducing this object, and after + the offer has announced its mimetypes through + wp_primary_selection_offer.offer. + + The data_offer is valid until a new offer or NULL is received + or until the client loses keyboard focus. The client must destroy the + previous selection data_offer, if any, upon receiving this event. + + + + + + + Destroy the primary selection device. + + + + + + + A wp_primary_selection_offer represents an offer to transfer the contents + of the primary selection clipboard to the client. Similar to + wl_data_offer, the offer also describes the mime types that the data can + be converted to and provides the mechanisms for transferring the data + directly to the client. + + + + + To transfer the contents of the primary selection clipboard, the client + issues this request and indicates the mime type that it wants to + receive. The transfer happens through the passed file descriptor + (typically created with the pipe system call). The source client writes + the data in the mime type representation requested and then closes the + file descriptor. + + The receiving client reads from the read end of the pipe until EOF and + closes its end, at which point the transfer is complete. + + + + + + + + Destroy the primary selection offer. + + + + + + Sent immediately after creating announcing the + wp_primary_selection_offer through + wp_primary_selection_device.data_offer. One event is sent per offered + mime type. + + + + + + + + The source side of a wp_primary_selection_offer, it provides a way to + describe the offered data and respond to requests to transfer the + requested contents of the primary selection clipboard. + + + + + This request adds a mime type to the set of mime types advertised to + targets. Can be called several times to offer multiple types. + + + + + + + Destroy the primary selection source. + + + + + + Request for the current primary selection contents from the client. + Send the specified mime type over the passed file descriptor, then + close it. + + + + + + + + This primary selection source is no longer valid. The client should + clean up and destroy this primary selection source. + + + + diff --git a/src/auto/wayland/protocols/wlr-data-control-unstable-v1.xml b/src/auto/wayland/protocols/wlr-data-control-unstable-v1.xml new file mode 100644 index 0000000000..75e8671b0d --- /dev/null +++ b/src/auto/wayland/protocols/wlr-data-control-unstable-v1.xml @@ -0,0 +1,278 @@ + + + + Copyright © 2018 Simon Ser + Copyright © 2019 Ivan Molodetskikh + + Permission to use, copy, modify, distribute, and sell this + software and its documentation for any purpose is hereby granted + without fee, provided that the above copyright notice appear in + all copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + the copyright holders not be used in advertising or publicity + pertaining to distribution of the software without specific, + written prior permission. The copyright holders make no + representations about the suitability of this software for any + purpose. It is provided "as is" without express or implied + warranty. + + THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY + SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, + ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + THIS SOFTWARE. + + + + This protocol allows a privileged client to control data devices. In + particular, the client will be able to manage the current selection and take + the role of a clipboard manager. + + Warning! The protocol described in this file is experimental and + backward incompatible changes may be made. Backward compatible changes + may be added together with the corresponding interface version bump. + Backward incompatible changes are done by bumping the version number in + the protocol and interface names and resetting the interface version. + Once the protocol is to be declared stable, the 'z' prefix and the + version number in the protocol and interface names are removed and the + interface version number is reset. + + + + + This interface is a manager that allows creating per-seat data device + controls. + + + + + Create a new data source. + + + + + + + Create a data device that can be used to manage a seat's selection. + + + + + + + + All objects created by the manager will still remain valid, until their + appropriate destroy request has been called. + + + + + + + This interface allows a client to manage a seat's selection. + + When the seat is destroyed, this object becomes inert. + + + + + This request asks the compositor to set the selection to the data from + the source on behalf of the client. + + The given source may not be used in any further set_selection or + set_primary_selection requests. Attempting to use a previously used + source is a protocol error. + + To unset the selection, set the source to NULL. + + + + + + + Destroys the data device object. + + + + + + The data_offer event introduces a new wlr_data_control_offer object, + which will subsequently be used in either the + wlr_data_control_device.selection event (for the regular clipboard + selections) or the wlr_data_control_device.primary_selection event (for + the primary clipboard selections). Immediately following the + wlr_data_control_device.data_offer event, the new data_offer object + will send out wlr_data_control_offer.offer events to describe the MIME + types it offers. + + + + + + + The selection event is sent out to notify the client of a new + wlr_data_control_offer for the selection for this device. The + wlr_data_control_device.data_offer and the wlr_data_control_offer.offer + events are sent out immediately before this event to introduce the data + offer object. The selection event is sent to a client when a new + selection is set. The wlr_data_control_offer is valid until a new + wlr_data_control_offer or NULL is received. The client must destroy the + previous selection wlr_data_control_offer, if any, upon receiving this + event. + + The first selection event is sent upon binding the + wlr_data_control_device object. + + + + + + + This data control object is no longer valid and should be destroyed by + the client. + + + + + + + + The primary_selection event is sent out to notify the client of a new + wlr_data_control_offer for the primary selection for this device. The + wlr_data_control_device.data_offer and the wlr_data_control_offer.offer + events are sent out immediately before this event to introduce the data + offer object. The primary_selection event is sent to a client when a + new primary selection is set. The wlr_data_control_offer is valid until + a new wlr_data_control_offer or NULL is received. The client must + destroy the previous primary selection wlr_data_control_offer, if any, + upon receiving this event. + + If the compositor supports primary selection, the first + primary_selection event is sent upon binding the + wlr_data_control_device object. + + + + + + + This request asks the compositor to set the primary selection to the + data from the source on behalf of the client. + + The given source may not be used in any further set_selection or + set_primary_selection requests. Attempting to use a previously used + source is a protocol error. + + To unset the primary selection, set the source to NULL. + + The compositor will ignore this request if it does not support primary + selection. + + + + + + + + + + + + The wlr_data_control_source object is the source side of a + wlr_data_control_offer. It is created by the source client in a data + transfer and provides a way to describe the offered data and a way to + respond to requests to transfer the data. + + + + + + + + + This request adds a MIME type to the set of MIME types advertised to + targets. Can be called several times to offer multiple types. + + Calling this after wlr_data_control_device.set_selection is a protocol + error. + + + + + + + Destroys the data source object. + + + + + + Request for data from the client. Send the data as the specified MIME + type over the passed file descriptor, then close it. + + + + + + + + This data source is no longer valid. The data source has been replaced + by another data source. + + The client should clean up and destroy this data source. + + + + + + + A wlr_data_control_offer represents a piece of data offered for transfer + by another client (the source client). The offer describes the different + MIME types that the data can be converted to and provides the mechanism + for transferring the data directly from the source client. + + + + + To transfer the offered data, the client issues this request and + indicates the MIME type it wants to receive. The transfer happens + through the passed file descriptor (typically created with the pipe + system call). The source client writes the data in the MIME type + representation requested and then closes the file descriptor. + + The receiving client reads from the read end of the pipe until EOF and + then closes its end, at which point the transfer is complete. + + This request may happen multiple times for different MIME types. + + + + + + + + Destroys the data offer object. + + + + + + Sent immediately after creating the wlr_data_control_offer object. + One event per offered MIME type. + + + + + diff --git a/src/auto/wayland/protocols/xdg-shell.xml b/src/auto/wayland/protocols/xdg-shell.xml new file mode 100644 index 0000000000..c4d4685a3f --- /dev/null +++ b/src/auto/wayland/protocols/xdg-shell.xml @@ -0,0 +1,1415 @@ + + + + + Copyright © 2008-2013 Kristian Høgsberg + Copyright © 2013 Rafael Antognolli + Copyright © 2013 Jasper St. Pierre + Copyright © 2010-2013 Intel Corporation + Copyright © 2015-2017 Samsung Electronics Co., Ltd + Copyright © 2015-2017 Red Hat Inc. + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice (including the next + paragraph) shall be included in all copies or substantial portions of the + Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + + + + The xdg_wm_base interface is exposed as a global object enabling clients + to turn their wl_surfaces into windows in a desktop environment. It + defines the basic functionality needed for clients and the compositor to + create windows that can be dragged, resized, maximized, etc, as well as + creating transient windows such as popup menus. + + + + + + + + + + + + + + + Destroy this xdg_wm_base object. + + Destroying a bound xdg_wm_base object while there are surfaces + still alive created by this xdg_wm_base object instance is illegal + and will result in a defunct_surfaces error. + + + + + + Create a positioner object. A positioner object is used to position + surfaces relative to some parent surface. See the interface description + and xdg_surface.get_popup for details. + + + + + + + This creates an xdg_surface for the given surface. While xdg_surface + itself is not a role, the corresponding surface may only be assigned + a role extending xdg_surface, such as xdg_toplevel or xdg_popup. It is + illegal to create an xdg_surface for a wl_surface which already has an + assigned role and this will result in a role error. + + This creates an xdg_surface for the given surface. An xdg_surface is + used as basis to define a role to a given surface, such as xdg_toplevel + or xdg_popup. It also manages functionality shared between xdg_surface + based surface roles. + + See the documentation of xdg_surface for more details about what an + xdg_surface is and how it is used. + + + + + + + + A client must respond to a ping event with a pong request or + the client may be deemed unresponsive. See xdg_wm_base.ping + and xdg_wm_base.error.unresponsive. + + + + + + + The ping event asks the client if it's still alive. Pass the + serial specified in the event back to the compositor by sending + a "pong" request back with the specified serial. See xdg_wm_base.pong. + + Compositors can use this to determine if the client is still + alive. It's unspecified what will happen if the client doesn't + respond to the ping request, or in what timeframe. Clients should + try to respond in a reasonable amount of time. The “unresponsive” + error is provided for compositors that wish to disconnect unresponsive + clients. + + A compositor is free to ping in any way it wants, but a client must + always respond to any xdg_wm_base object it created. + + + + + + + + The xdg_positioner provides a collection of rules for the placement of a + child surface relative to a parent surface. Rules can be defined to ensure + the child surface remains within the visible area's borders, and to + specify how the child surface changes its position, such as sliding along + an axis, or flipping around a rectangle. These positioner-created rules are + constrained by the requirement that a child surface must intersect with or + be at least partially adjacent to its parent surface. + + See the various requests for details about possible rules. + + At the time of the request, the compositor makes a copy of the rules + specified by the xdg_positioner. Thus, after the request is complete the + xdg_positioner object can be destroyed or reused; further changes to the + object will have no effect on previous usages. + + For an xdg_positioner object to be considered complete, it must have a + non-zero size set by set_size, and a non-zero anchor rectangle set by + set_anchor_rect. Passing an incomplete xdg_positioner object when + positioning a surface raises an invalid_positioner error. + + + + + + + + + Notify the compositor that the xdg_positioner will no longer be used. + + + + + + Set the size of the surface that is to be positioned with the positioner + object. The size is in surface-local coordinates and corresponds to the + window geometry. See xdg_surface.set_window_geometry. + + If a zero or negative size is set the invalid_input error is raised. + + + + + + + + Specify the anchor rectangle within the parent surface that the child + surface will be placed relative to. The rectangle is relative to the + window geometry as defined by xdg_surface.set_window_geometry of the + parent surface. + + When the xdg_positioner object is used to position a child surface, the + anchor rectangle may not extend outside the window geometry of the + positioned child's parent surface. + + If a negative size is set the invalid_input error is raised. + + + + + + + + + + + + + + + + + + + + + + Defines the anchor point for the anchor rectangle. The specified anchor + is used derive an anchor point that the child surface will be + positioned relative to. If a corner anchor is set (e.g. 'top_left' or + 'bottom_right'), the anchor point will be at the specified corner; + otherwise, the derived anchor point will be centered on the specified + edge, or in the center of the anchor rectangle if no edge is specified. + + + + + + + + + + + + + + + + + + + Defines in what direction a surface should be positioned, relative to + the anchor point of the parent surface. If a corner gravity is + specified (e.g. 'bottom_right' or 'top_left'), then the child surface + will be placed towards the specified gravity; otherwise, the child + surface will be centered over the anchor point on any axis that had no + gravity specified. If the gravity is not in the ‘gravity’ enum, an + invalid_input error is raised. + + + + + + + The constraint adjustment value define ways the compositor will adjust + the position of the surface, if the unadjusted position would result + in the surface being partly constrained. + + Whether a surface is considered 'constrained' is left to the compositor + to determine. For example, the surface may be partly outside the + compositor's defined 'work area', thus necessitating the child surface's + position be adjusted until it is entirely inside the work area. + + The adjustments can be combined, according to a defined precedence: 1) + Flip, 2) Slide, 3) Resize. + + + + Don't alter the surface position even if it is constrained on some + axis, for example partially outside the edge of an output. + + + + + Slide the surface along the x axis until it is no longer constrained. + + First try to slide towards the direction of the gravity on the x axis + until either the edge in the opposite direction of the gravity is + unconstrained or the edge in the direction of the gravity is + constrained. + + Then try to slide towards the opposite direction of the gravity on the + x axis until either the edge in the direction of the gravity is + unconstrained or the edge in the opposite direction of the gravity is + constrained. + + + + + Slide the surface along the y axis until it is no longer constrained. + + First try to slide towards the direction of the gravity on the y axis + until either the edge in the opposite direction of the gravity is + unconstrained or the edge in the direction of the gravity is + constrained. + + Then try to slide towards the opposite direction of the gravity on the + y axis until either the edge in the direction of the gravity is + unconstrained or the edge in the opposite direction of the gravity is + constrained. + + + + + Invert the anchor and gravity on the x axis if the surface is + constrained on the x axis. For example, if the left edge of the + surface is constrained, the gravity is 'left' and the anchor is + 'left', change the gravity to 'right' and the anchor to 'right'. + + If the adjusted position also ends up being constrained, the resulting + position of the flip_x adjustment will be the one before the + adjustment. + + + + + Invert the anchor and gravity on the y axis if the surface is + constrained on the y axis. For example, if the bottom edge of the + surface is constrained, the gravity is 'bottom' and the anchor is + 'bottom', change the gravity to 'top' and the anchor to 'top'. + + The adjusted position is calculated given the original anchor + rectangle and offset, but with the new flipped anchor and gravity + values. + + If the adjusted position also ends up being constrained, the resulting + position of the flip_y adjustment will be the one before the + adjustment. + + + + + Resize the surface horizontally so that it is completely + unconstrained. + + + + + Resize the surface vertically so that it is completely unconstrained. + + + + + + + Specify how the window should be positioned if the originally intended + position caused the surface to be constrained, meaning at least + partially outside positioning boundaries set by the compositor. The + adjustment is set by constructing a bitmask describing the adjustment to + be made when the surface is constrained on that axis. + + If no bit for one axis is set, the compositor will assume that the child + surface should not change its position on that axis when constrained. + + If more than one bit for one axis is set, the order of how adjustments + are applied is specified in the corresponding adjustment descriptions. + + The default adjustment is none. + + + + + + + Specify the surface position offset relative to the position of the + anchor on the anchor rectangle and the anchor on the surface. For + example if the anchor of the anchor rectangle is at (x, y), the surface + has the gravity bottom|right, and the offset is (ox, oy), the calculated + surface position will be (x + ox, y + oy). The offset position of the + surface is the one used for constraint testing. See + set_constraint_adjustment. + + An example use case is placing a popup menu on top of a user interface + element, while aligning the user interface element of the parent surface + with some user interface element placed somewhere in the popup surface. + + + + + + + + + + When set reactive, the surface is reconstrained if the conditions used + for constraining changed, e.g. the parent window moved. + + If the conditions changed and the popup was reconstrained, an + xdg_popup.configure event is sent with updated geometry, followed by an + xdg_surface.configure event. + + + + + + Set the parent window geometry the compositor should use when + positioning the popup. The compositor may use this information to + determine the future state the popup should be constrained using. If + this doesn't match the dimension of the parent the popup is eventually + positioned against, the behavior is undefined. + + The arguments are given in the surface-local coordinate space. + + + + + + + + Set the serial of an xdg_surface.configure event this positioner will be + used in response to. The compositor may use this information together + with set_parent_size to determine what future state the popup should be + constrained using. + + + + + + + + An interface that may be implemented by a wl_surface, for + implementations that provide a desktop-style user interface. + + It provides a base set of functionality required to construct user + interface elements requiring management by the compositor, such as + toplevel windows, menus, etc. The types of functionality are split into + xdg_surface roles. + + Creating an xdg_surface does not set the role for a wl_surface. In order + to map an xdg_surface, the client must create a role-specific object + using, e.g., get_toplevel, get_popup. The wl_surface for any given + xdg_surface can have at most one role, and may not be assigned any role + not based on xdg_surface. + + A role must be assigned before any other requests are made to the + xdg_surface object. + + The client must call wl_surface.commit on the corresponding wl_surface + for the xdg_surface state to take effect. + + Creating an xdg_surface from a wl_surface which has a buffer attached or + committed is a client error, and any attempts by a client to attach or + manipulate a buffer prior to the first xdg_surface.configure call must + also be treated as errors. + + After creating a role-specific object and setting it up (e.g. by sending + the title, app ID, size constraints, parent, etc), the client must + perform an initial commit without any buffer attached. The compositor + will reply with initial wl_surface state such as + wl_surface.preferred_buffer_scale followed by an xdg_surface.configure + event. The client must acknowledge it and is then allowed to attach a + buffer to map the surface. + + Mapping an xdg_surface-based role surface is defined as making it + possible for the surface to be shown by the compositor. Note that + a mapped surface is not guaranteed to be visible once it is mapped. + + For an xdg_surface to be mapped by the compositor, the following + conditions must be met: + (1) the client has assigned an xdg_surface-based role to the surface + (2) the client has set and committed the xdg_surface state and the + role-dependent state to the surface + (3) the client has committed a buffer to the surface + + A newly-unmapped surface is considered to have met condition (1) out + of the 3 required conditions for mapping a surface if its role surface + has not been destroyed, i.e. the client must perform the initial commit + again before attaching a buffer. + + + + + + + + + + + + + + Destroy the xdg_surface object. An xdg_surface must only be destroyed + after its role object has been destroyed, otherwise + a defunct_role_object error is raised. + + + + + + This creates an xdg_toplevel object for the given xdg_surface and gives + the associated wl_surface the xdg_toplevel role. + + See the documentation of xdg_toplevel for more details about what an + xdg_toplevel is and how it is used. + + + + + + + This creates an xdg_popup object for the given xdg_surface and gives + the associated wl_surface the xdg_popup role. + + If null is passed as a parent, a parent surface must be specified using + some other protocol, before committing the initial state. + + See the documentation of xdg_popup for more details about what an + xdg_popup is and how it is used. + + + + + + + + + The window geometry of a surface is its "visible bounds" from the + user's perspective. Client-side decorations often have invisible + portions like drop-shadows which should be ignored for the + purposes of aligning, placing and constraining windows. + + The window geometry is double-buffered state, see wl_surface.commit. + + When maintaining a position, the compositor should treat the (x, y) + coordinate of the window geometry as the top left corner of the window. + A client changing the (x, y) window geometry coordinate should in + general not alter the position of the window. + + Once the window geometry of the surface is set, it is not possible to + unset it, and it will remain the same until set_window_geometry is + called again, even if a new subsurface or buffer is attached. + + If never set, the value is the full bounds of the surface, + including any subsurfaces. This updates dynamically on every + commit. This unset is meant for extremely simple clients. + + The arguments are given in the surface-local coordinate space of + the wl_surface associated with this xdg_surface, and may extend outside + of the wl_surface itself to mark parts of the subsurface tree as part of + the window geometry. + + When applied, the effective window geometry will be the set window + geometry clamped to the bounding rectangle of the combined + geometry of the surface of the xdg_surface and the associated + subsurfaces. + + The effective geometry will not be recalculated unless a new call to + set_window_geometry is done and the new pending surface state is + subsequently applied. + + The width and height of the effective window geometry must be + greater than zero. Setting an invalid size will raise an + invalid_size error. + + + + + + + + + + When a configure event is received, if a client commits the + surface in response to the configure event, then the client + must make an ack_configure request sometime before the commit + request, passing along the serial of the configure event. + + For instance, for toplevel surfaces the compositor might use this + information to move a surface to the top left only when the client has + drawn itself for the maximized or fullscreen state. + + If the client receives multiple configure events before it + can respond to one, it only has to ack the last configure event. + Acking a configure event that was never sent raises an invalid_serial + error. + + A client is not required to commit immediately after sending + an ack_configure request - it may even ack_configure several times + before its next surface commit. + + A client may send multiple ack_configure requests before committing, but + only the last request sent before a commit indicates which configure + event the client really is responding to. + + Sending an ack_configure request consumes the serial number sent with + the request, as well as serial numbers sent by all configure events + sent on this xdg_surface prior to the configure event referenced by + the committed serial. + + It is an error to issue multiple ack_configure requests referencing a + serial from the same configure event, or to issue an ack_configure + request referencing a serial from a configure event issued before the + event identified by the last ack_configure request for the same + xdg_surface. Doing so will raise an invalid_serial error. + + + + + + + The configure event marks the end of a configure sequence. A configure + sequence is a set of one or more events configuring the state of the + xdg_surface, including the final xdg_surface.configure event. + + Where applicable, xdg_surface surface roles will during a configure + sequence extend this event as a latched state sent as events before the + xdg_surface.configure event. Such events should be considered to make up + a set of atomically applied configuration states, where the + xdg_surface.configure commits the accumulated state. + + Clients should arrange their surface for the new states, and then send + an ack_configure request with the serial sent in this configure event at + some point before committing the new surface. + + If the client receives multiple configure events before it can respond + to one, it is free to discard all but the last event it received. + + + + + + + + + This interface defines an xdg_surface role which allows a surface to, + among other things, set window-like properties such as maximize, + fullscreen, and minimize, set application-specific metadata like title and + id, and well as trigger user interactive operations such as interactive + resize and move. + + A xdg_toplevel by default is responsible for providing the full intended + visual representation of the toplevel, which depending on the window + state, may mean things like a title bar, window controls and drop shadow. + + Unmapping an xdg_toplevel means that the surface cannot be shown + by the compositor until it is explicitly mapped again. + All active operations (e.g., move, resize) are canceled and all + attributes (e.g. title, state, stacking, ...) are discarded for + an xdg_toplevel surface when it is unmapped. The xdg_toplevel returns to + the state it had right after xdg_surface.get_toplevel. The client + can re-map the toplevel by performing a commit without any buffer + attached, waiting for a configure event and handling it as usual (see + xdg_surface description). + + Attaching a null buffer to a toplevel unmaps the surface. + + + + + This request destroys the role surface and unmaps the surface; + see "Unmapping" behavior in interface section for details. + + + + + + + + + + + + Set the "parent" of this surface. This surface should be stacked + above the parent surface and all other ancestor surfaces. + + Parent surfaces should be set on dialogs, toolboxes, or other + "auxiliary" surfaces, so that the parent is raised when the dialog + is raised. + + Setting a null parent for a child surface unsets its parent. Setting + a null parent for a surface which currently has no parent is a no-op. + + Only mapped surfaces can have child surfaces. Setting a parent which + is not mapped is equivalent to setting a null parent. If a surface + becomes unmapped, its children's parent is set to the parent of + the now-unmapped surface. If the now-unmapped surface has no parent, + its children's parent is unset. If the now-unmapped surface becomes + mapped again, its parent-child relationship is not restored. + + The parent toplevel must not be one of the child toplevel's + descendants, and the parent must be different from the child toplevel, + otherwise the invalid_parent protocol error is raised. + + + + + + + Set a short title for the surface. + + This string may be used to identify the surface in a task bar, + window list, or other user interface elements provided by the + compositor. + + The string must be encoded in UTF-8. + + + + + + + Set an application identifier for the surface. + + The app ID identifies the general class of applications to which + the surface belongs. The compositor can use this to group multiple + surfaces together, or to determine how to launch a new application. + + For D-Bus activatable applications, the app ID is used as the D-Bus + service name. + + The compositor shell will try to group application surfaces together + by their app ID. As a best practice, it is suggested to select app + ID's that match the basename of the application's .desktop file. + For example, "org.freedesktop.FooViewer" where the .desktop file is + "org.freedesktop.FooViewer.desktop". + + Like other properties, a set_app_id request can be sent after the + xdg_toplevel has been mapped to update the property. + + See the desktop-entry specification [0] for more details on + application identifiers and how they relate to well-known D-Bus + names and .desktop files. + + [0] https://standards.freedesktop.org/desktop-entry-spec/ + + + + + + + Clients implementing client-side decorations might want to show + a context menu when right-clicking on the decorations, giving the + user a menu that they can use to maximize or minimize the window. + + This request asks the compositor to pop up such a window menu at + the given position, relative to the local surface coordinates of + the parent surface. There are no guarantees as to what menu items + the window menu contains, or even if a window menu will be drawn + at all. + + This request must be used in response to some sort of user action + like a button press, key press, or touch down event. + + + + + + + + + + Start an interactive, user-driven move of the surface. + + This request must be used in response to some sort of user action + like a button press, key press, or touch down event. The passed + serial is used to determine the type of interactive move (touch, + pointer, etc). + + The server may ignore move requests depending on the state of + the surface (e.g. fullscreen or maximized), or if the passed serial + is no longer valid. + + If triggered, the surface will lose the focus of the device + (wl_pointer, wl_touch, etc) used for the move. It is up to the + compositor to visually indicate that the move is taking place, such as + updating a pointer cursor, during the move. There is no guarantee + that the device focus will return when the move is completed. + + + + + + + + These values are used to indicate which edge of a surface + is being dragged in a resize operation. + + + + + + + + + + + + + + + Start a user-driven, interactive resize of the surface. + + This request must be used in response to some sort of user action + like a button press, key press, or touch down event. The passed + serial is used to determine the type of interactive resize (touch, + pointer, etc). + + The server may ignore resize requests depending on the state of + the surface (e.g. fullscreen or maximized). + + If triggered, the client will receive configure events with the + "resize" state enum value and the expected sizes. See the "resize" + enum value for more details about what is required. The client + must also acknowledge configure events using "ack_configure". After + the resize is completed, the client will receive another "configure" + event without the resize state. + + If triggered, the surface also will lose the focus of the device + (wl_pointer, wl_touch, etc) used for the resize. It is up to the + compositor to visually indicate that the resize is taking place, + such as updating a pointer cursor, during the resize. There is no + guarantee that the device focus will return when the resize is + completed. + + The edges parameter specifies how the surface should be resized, and + is one of the values of the resize_edge enum. Values not matching + a variant of the enum will cause the invalid_resize_edge protocol error. + The compositor may use this information to update the surface position + for example when dragging the top left corner. The compositor may also + use this information to adapt its behavior, e.g. choose an appropriate + cursor image. + + + + + + + + + The different state values used on the surface. This is designed for + state values like maximized, fullscreen. It is paired with the + configure event to ensure that both the client and the compositor + setting the state can be synchronized. + + States set in this way are double-buffered, see wl_surface.commit. + + + + The surface is maximized. The window geometry specified in the configure + event must be obeyed by the client, or the xdg_wm_base.invalid_surface_state + error is raised. + + The client should draw without shadow or other + decoration outside of the window geometry. + + + + + The surface is fullscreen. The window geometry specified in the + configure event is a maximum; the client cannot resize beyond it. For + a surface to cover the whole fullscreened area, the geometry + dimensions must be obeyed by the client. For more details, see + xdg_toplevel.set_fullscreen. + + + + + The surface is being resized. The window geometry specified in the + configure event is a maximum; the client cannot resize beyond it. + Clients that have aspect ratio or cell sizing configuration can use + a smaller size, however. + + + + + Client window decorations should be painted as if the window is + active. Do not assume this means that the window actually has + keyboard or pointer focus. + + + + + The window is currently in a tiled layout and the left edge is + considered to be adjacent to another part of the tiling grid. + + The client should draw without shadow or other decoration outside of + the window geometry on the left edge. + + + + + The window is currently in a tiled layout and the right edge is + considered to be adjacent to another part of the tiling grid. + + The client should draw without shadow or other decoration outside of + the window geometry on the right edge. + + + + + The window is currently in a tiled layout and the top edge is + considered to be adjacent to another part of the tiling grid. + + The client should draw without shadow or other decoration outside of + the window geometry on the top edge. + + + + + The window is currently in a tiled layout and the bottom edge is + considered to be adjacent to another part of the tiling grid. + + The client should draw without shadow or other decoration outside of + the window geometry on the bottom edge. + + + + + The surface is currently not ordinarily being repainted; for + example because its content is occluded by another window, or its + outputs are switched off due to screen locking. + + + + + The left edge of the window is currently constrained, meaning it + shouldn't attempt to resize from that edge. It can for example mean + it's tiled next to a monitor edge on the constrained side of the + window. + + + + + The right edge of the window is currently constrained, meaning it + shouldn't attempt to resize from that edge. It can for example mean + it's tiled next to a monitor edge on the constrained side of the + window. + + + + + The top edge of the window is currently constrained, meaning it + shouldn't attempt to resize from that edge. It can for example mean + it's tiled next to a monitor edge on the constrained side of the + window. + + + + + The bottom edge of the window is currently constrained, meaning it + shouldn't attempt to resize from that edge. It can for example mean + it's tiled next to a monitor edge on the constrained side of the + window. + + + + + + + Set a maximum size for the window. + + The client can specify a maximum size so that the compositor does + not try to configure the window beyond this size. + + The width and height arguments are in window geometry coordinates. + See xdg_surface.set_window_geometry. + + Values set in this way are double-buffered, see wl_surface.commit. + + The compositor can use this information to allow or disallow + different states like maximize or fullscreen and draw accurate + animations. + + Similarly, a tiling window manager may use this information to + place and resize client windows in a more effective way. + + The client should not rely on the compositor to obey the maximum + size. The compositor may decide to ignore the values set by the + client and request a larger size. + + If never set, or a value of zero in the request, means that the + client has no expected maximum size in the given dimension. + As a result, a client wishing to reset the maximum size + to an unspecified state can use zero for width and height in the + request. + + Requesting a maximum size to be smaller than the minimum size of + a surface is illegal and will result in an invalid_size error. + + The width and height must be greater than or equal to zero. Using + strictly negative values for width or height will result in a + invalid_size error. + + + + + + + + Set a minimum size for the window. + + The client can specify a minimum size so that the compositor does + not try to configure the window below this size. + + The width and height arguments are in window geometry coordinates. + See xdg_surface.set_window_geometry. + + Values set in this way are double-buffered, see wl_surface.commit. + + The compositor can use this information to allow or disallow + different states like maximize or fullscreen and draw accurate + animations. + + Similarly, a tiling window manager may use this information to + place and resize client windows in a more effective way. + + The client should not rely on the compositor to obey the minimum + size. The compositor may decide to ignore the values set by the + client and request a smaller size. + + If never set, or a value of zero in the request, means that the + client has no expected minimum size in the given dimension. + As a result, a client wishing to reset the minimum size + to an unspecified state can use zero for width and height in the + request. + + Requesting a minimum size to be larger than the maximum size of + a surface is illegal and will result in an invalid_size error. + + The width and height must be greater than or equal to zero. Using + strictly negative values for width and height will result in a + invalid_size error. + + + + + + + + Maximize the surface. + + After requesting that the surface should be maximized, the compositor + will respond by emitting a configure event. Whether this configure + actually sets the window maximized is subject to compositor policies. + The client must then update its content, drawing in the configured + state. The client must also acknowledge the configure when committing + the new content (see ack_configure). + + It is up to the compositor to decide how and where to maximize the + surface, for example which output and what region of the screen should + be used. + + If the surface was already maximized, the compositor will still emit + a configure event with the "maximized" state. + + If the surface is in a fullscreen state, this request has no direct + effect. It may alter the state the surface is returned to when + unmaximized unless overridden by the compositor. + + + + + + Unmaximize the surface. + + After requesting that the surface should be unmaximized, the compositor + will respond by emitting a configure event. Whether this actually + un-maximizes the window is subject to compositor policies. + If available and applicable, the compositor will include the window + geometry dimensions the window had prior to being maximized in the + configure event. The client must then update its content, drawing it in + the configured state. The client must also acknowledge the configure + when committing the new content (see ack_configure). + + It is up to the compositor to position the surface after it was + unmaximized; usually the position the surface had before maximizing, if + applicable. + + If the surface was already not maximized, the compositor will still + emit a configure event without the "maximized" state. + + If the surface is in a fullscreen state, this request has no direct + effect. It may alter the state the surface is returned to when + unmaximized unless overridden by the compositor. + + + + + + Make the surface fullscreen. + + After requesting that the surface should be fullscreened, the + compositor will respond by emitting a configure event. Whether the + client is actually put into a fullscreen state is subject to compositor + policies. The client must also acknowledge the configure when + committing the new content (see ack_configure). + + The output passed by the request indicates the client's preference as + to which display it should be set fullscreen on. If this value is NULL, + it's up to the compositor to choose which display will be used to map + this surface. + + If the surface doesn't cover the whole output, the compositor will + position the surface in the center of the output and compensate with + with border fill covering the rest of the output. The content of the + border fill is undefined, but should be assumed to be in some way that + attempts to blend into the surrounding area (e.g. solid black). + + If the fullscreened surface is not opaque, the compositor must make + sure that other screen content not part of the same surface tree (made + up of subsurfaces, popups or similarly coupled surfaces) are not + visible below the fullscreened surface. + + + + + + + Make the surface no longer fullscreen. + + After requesting that the surface should be unfullscreened, the + compositor will respond by emitting a configure event. + Whether this actually removes the fullscreen state of the client is + subject to compositor policies. + + Making a surface unfullscreen sets states for the surface based on the following: + * the state(s) it may have had before becoming fullscreen + * any state(s) decided by the compositor + * any state(s) requested by the client while the surface was fullscreen + + The compositor may include the previous window geometry dimensions in + the configure event, if applicable. + + The client must also acknowledge the configure when committing the new + content (see ack_configure). + + + + + + Request that the compositor minimize your surface. There is no + way to know if the surface is currently minimized, nor is there + any way to unset minimization on this surface. + + If you are looking to throttle redrawing when minimized, please + instead use the wl_surface.frame event for this, as this will + also work with live previews on windows in Alt-Tab, Expose or + similar compositor features. + + + + + + This configure event asks the client to resize its toplevel surface or + to change its state. The configured state should not be applied + immediately. See xdg_surface.configure for details. + + The width and height arguments specify a hint to the window + about how its surface should be resized in window geometry + coordinates. See set_window_geometry. + + If the width or height arguments are zero, it means the client + should decide its own window dimension. This may happen when the + compositor needs to configure the state of the surface but doesn't + have any information about any previous or expected dimension. + + The states listed in the event specify how the width/height + arguments should be interpreted, and possibly how it should be + drawn. + + Clients must send an ack_configure in response to this event. See + xdg_surface.configure and xdg_surface.ack_configure for details. + + + + + + + + + The close event is sent by the compositor when the user + wants the surface to be closed. This should be equivalent to + the user clicking the close button in client-side decorations, + if your application has any. + + This is only a request that the user intends to close the + window. The client may choose to ignore this request, or show + a dialog to ask the user to save their data, etc. + + + + + + + + The configure_bounds event may be sent prior to a xdg_toplevel.configure + event to communicate the bounds a window geometry size is recommended + to constrain to. + + The passed width and height are in surface coordinate space. If width + and height are 0, it means bounds is unknown and equivalent to as if no + configure_bounds event was ever sent for this surface. + + The bounds can for example correspond to the size of a monitor excluding + any panels or other shell components, so that a surface isn't created in + a way that it cannot fit. + + The bounds may change at any point, and in such a case, a new + xdg_toplevel.configure_bounds will be sent, followed by + xdg_toplevel.configure and xdg_surface.configure. + + + + + + + + + + + + + + + + + This event advertises the capabilities supported by the compositor. If + a capability isn't supported, clients should hide or disable the UI + elements that expose this functionality. For instance, if the + compositor doesn't advertise support for minimized toplevels, a button + triggering the set_minimized request should not be displayed. + + The compositor will ignore requests it doesn't support. For instance, + a compositor which doesn't advertise support for minimized will ignore + set_minimized requests. + + Compositors must send this event once before the first + xdg_surface.configure event. When the capabilities change, compositors + must send this event again and then send an xdg_surface.configure + event. + + The configured state should not be applied immediately. See + xdg_surface.configure for details. + + The capabilities are sent as an array of 32-bit unsigned integers in + native endianness. + + + + + + + + A popup surface is a short-lived, temporary surface. It can be used to + implement for example menus, popovers, tooltips and other similar user + interface concepts. + + A popup can be made to take an explicit grab. See xdg_popup.grab for + details. + + When the popup is dismissed, a popup_done event will be sent out, and at + the same time the surface will be unmapped. See the xdg_popup.popup_done + event for details. + + Explicitly destroying the xdg_popup object will also dismiss the popup and + unmap the surface. Clients that want to dismiss the popup when another + surface of their own is clicked should dismiss the popup using the destroy + request. + + A newly created xdg_popup will be stacked on top of all previously created + xdg_popup surfaces associated with the same xdg_toplevel. + + The parent of an xdg_popup must be mapped (see the xdg_surface + description) before the xdg_popup itself. + + The client must call wl_surface.commit on the corresponding wl_surface + for the xdg_popup state to take effect. + + + + + + + + + This destroys the popup. Explicitly destroying the xdg_popup + object will also dismiss the popup, and unmap the surface. + + If this xdg_popup is not the "topmost" popup, the + xdg_wm_base.not_the_topmost_popup protocol error will be sent. + + + + + + This request makes the created popup take an explicit grab. An explicit + grab will be dismissed when the user dismisses the popup, or when the + client destroys the xdg_popup. This can be done by the user clicking + outside the surface, using the keyboard, or even locking the screen + through closing the lid or a timeout. + + If the compositor denies the grab, the popup will be immediately + dismissed. + + This request must be used in response to some sort of user action like a + button press, key press, or touch down event. The serial number of the + event should be passed as 'serial'. + + The parent of a grabbing popup must either be an xdg_toplevel surface or + another xdg_popup with an explicit grab. If the parent is another + xdg_popup it means that the popups are nested, with this popup now being + the topmost popup. + + Nested popups must be destroyed in the reverse order they were created + in, e.g. the only popup you are allowed to destroy at all times is the + topmost one. + + When compositors choose to dismiss a popup, they may dismiss every + nested grabbing popup as well. When a compositor dismisses popups, it + will follow the same dismissing order as required from the client. + + If the topmost grabbing popup is destroyed, the grab will be returned to + the parent of the popup, if that parent previously had an explicit grab. + + If the parent is a grabbing popup which has already been dismissed, this + popup will be immediately dismissed. If the parent is a popup that did + not take an explicit grab, an error will be raised. + + During a popup grab, the client owning the grab will receive pointer + and touch events for all their surfaces as normal (similar to an + "owner-events" grab in X11 parlance), while the top most grabbing popup + will always have keyboard focus. + + + + + + + + This event asks the popup surface to configure itself given the + configuration. The configured state should not be applied immediately. + See xdg_surface.configure for details. + + The x and y arguments represent the position the popup was placed at + given the xdg_positioner rule, relative to the upper left corner of the + window geometry of the parent surface. + + For version 2 or older, the configure event for an xdg_popup is only + ever sent once for the initial configuration. Starting with version 3, + it may be sent again if the popup is setup with an xdg_positioner with + set_reactive requested, or in response to xdg_popup.reposition requests. + + + + + + + + + + The popup_done event is sent out when a popup is dismissed by the + compositor. The client should destroy the xdg_popup object at this + point. + + + + + + + + Reposition an already-mapped popup. The popup will be placed given the + details in the passed xdg_positioner object, and a + xdg_popup.repositioned followed by xdg_popup.configure and + xdg_surface.configure will be emitted in response. Any parameters set + by the previous positioner will be discarded. + + The passed token will be sent in the corresponding + xdg_popup.repositioned event. The new popup position will not take + effect until the corresponding configure event is acknowledged by the + client. See xdg_popup.repositioned for details. The token itself is + opaque, and has no other special meaning. + + If multiple reposition requests are sent, the compositor may skip all + but the last one. + + If the popup is repositioned in response to a configure event for its + parent, the client should send an xdg_positioner.set_parent_configure + and possibly an xdg_positioner.set_parent_size request to allow the + compositor to properly constrain the popup. + + If the popup is repositioned together with a parent that is being + resized, but not in response to a configure event, the client should + send an xdg_positioner.set_parent_size request. + + + + + + + + The repositioned event is sent as part of a popup configuration + sequence, together with xdg_popup.configure and lastly + xdg_surface.configure to notify the completion of a reposition request. + + The repositioned event is to notify about the completion of a + xdg_popup.reposition request. The token argument is the token passed + in the xdg_popup.reposition request. + + Immediately after this event is emitted, xdg_popup.configure and + xdg_surface.configure will be sent with the updated size and position, + as well as a new configure serial. + + The client should optionally update the content of the popup, but must + acknowledge the new popup configuration for the new position to take + effect. See xdg_surface.ack_configure for details. + + + + + + diff --git a/src/autocmd.c b/src/autocmd.c index 07c1d6f12b..fe283b2897 100644 --- a/src/autocmd.c +++ b/src/autocmd.c @@ -110,6 +110,7 @@ static keyvalue_T event_tab[NUM_EVENTS] = { KEYVALUE_ENTRY(EVENT_CMDLINECHANGED, "CmdlineChanged"), KEYVALUE_ENTRY(EVENT_CMDLINEENTER, "CmdlineEnter"), KEYVALUE_ENTRY(EVENT_CMDLINELEAVE, "CmdlineLeave"), + KEYVALUE_ENTRY(EVENT_CMDLINELEAVEPRE, "CmdlineLeavePre"), KEYVALUE_ENTRY(EVENT_CMDUNDEFINED, "CmdUndefined"), KEYVALUE_ENTRY(EVENT_CMDWINENTER, "CmdwinEnter"), KEYVALUE_ENTRY(EVENT_CMDWINLEAVE, "CmdwinLeave"), @@ -803,16 +804,26 @@ find_end_event( int event_ignored(event_T event, char_u *ei) { + int ignored = FALSE; while (*ei != NUL) { - if (STRNICMP(ei, "all", 3) == 0 && (ei[3] == NUL || ei[3] == ',') - && (ei == p_ei || (event_tab[event].key <= 0))) - return TRUE; - if (event_name2nr(ei, &ei) == event) - return TRUE; + int unignore = *ei == '-'; + ei += unignore; + if (STRNICMP(ei, "all", 3) == 0 && (ei[3] == NUL || ei[3] == ',')) + { + ignored = ei == p_ei || (event_tab[event].key <= 0); + ei += 3 + (ei[3] == ','); + } + else if (event_name2nr(ei, &ei) == event) + { + if (unignore) + return FALSE; + else + ignored = TRUE; + } } - return FALSE; + return ignored; } /* @@ -827,13 +838,10 @@ check_ei(char_u *ei) while (*ei) { if (STRNICMP(ei, "all", 3) == 0 && (ei[3] == NUL || ei[3] == ',')) - { - ei += 3; - if (*ei == ',') - ++ei; - } + ei += 3 + (ei[3] == ','); else { + ei += (*ei == '-'); event_T event = event_name2nr(ei, &ei); if (event == NUM_EVENTS || (win && event_tab[event].key > 0)) return FAIL; @@ -1585,9 +1593,10 @@ aucmd_prepbuf( #ifdef FEAT_AUTOCHDIR int save_acd; #endif + int same_buffer = buf == curbuf; // Find a window that is for the new buffer - if (buf == curbuf) // be quick when buf is curbuf + if (same_buffer) // be quick when buf is curbuf win = curwin; else FOR_ALL_WINDOWS(win) @@ -1665,7 +1674,7 @@ aucmd_prepbuf( #endif (void)win_split_ins(0, WSP_TOP | WSP_FORCE_ROOM, auc_win, 0, NULL); - (void)win_comp_pos(); // recompute window positions + win_comp_pos(); // recompute window positions p_ea = save_ea; #ifdef FEAT_AUTOCHDIR p_acd = save_acd; @@ -1677,9 +1686,10 @@ aucmd_prepbuf( aco->new_curwin_id = curwin->w_id; set_bufref(&aco->new_curbuf, curbuf); - // disable the Visual area, the position may be invalid in another buffer aco->save_VIsual_active = VIsual_active; - VIsual_active = FALSE; + if (!same_buffer) + // disable the Visual area, position may be invalid in another buffer + VIsual_active = FALSE; } /* @@ -1740,7 +1750,7 @@ aucmd_restbuf( close_tabpage(curtab); restore_snapshot(SNAP_AUCMD_IDX, FALSE); - (void)win_comp_pos(); // recompute window positions + win_comp_pos(); // recompute window positions unblock_autocmds(); save_curwin = win_find_by_id(aco->save_curwin_id); @@ -2135,16 +2145,24 @@ apply_autocmds_group( if (event_ignored(event, p_ei)) goto BYPASS_AU; - wininfo_T *wip; int win_ignore = FALSE; // If event is allowed in 'eventignorewin', check if curwin or all windows // into "buf" are ignoring the event. if (buf == curbuf && event_tab[event].key <= 0) win_ignore = event_ignored(event, curwin->w_p_eiw); - else if (buf != NULL && event_tab[event].key <= 0) - FOR_ALL_BUF_WININFO(buf, wip) - if (wip->wi_win != NULL && wip->wi_win->w_buffer == buf) - win_ignore = event_ignored(event, wip->wi_win->w_p_eiw); + else if (buf != NULL && event_tab[event].key <= 0 && buf->b_nwindows > 0) + { + tabpage_T *tp; + win_T *wp; + + win_ignore = TRUE; + FOR_ALL_TAB_WINDOWS(tp, wp) + if (wp->w_buffer == buf && !event_ignored(event, wp->w_p_eiw)) + { + win_ignore = FALSE; + break; + } + } if (win_ignore) goto BYPASS_AU; @@ -2254,6 +2272,7 @@ apply_autocmds_group( || event == EVENT_SYNTAX || event == EVENT_CMDLINECHANGED || event == EVENT_CMDLINEENTER + || event == EVENT_CMDLINELEAVEPRE || event == EVENT_CMDLINELEAVE || event == EVENT_CURSORMOVEDC || event == EVENT_CMDWINENTER diff --git a/src/buffer.c b/src/buffer.c index 4a1df577cc..32ff04d687 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -45,7 +45,7 @@ static int buf_same_ino(buf_T *buf, stat_T *stp); static int otherfile_buf(buf_T *buf, char_u *ffname); #endif static int value_changed(char_u *str, char_u **last); -static int append_arg_number(win_T *wp, char_u *buf, int buflen, int add_file); +static int append_arg_number(win_T *wp, char_u *buf, size_t buflen, int add_file); static void free_buffer(buf_T *); static void free_buffer_stuff(buf_T *buf, int free_options); static int bt_nofileread(buf_T *buf); @@ -72,6 +72,33 @@ static int buf_free_count = 0; static int top_file_num = 1; // highest file number static garray_T buf_reuse = GA_EMPTY; // file numbers to recycle + static void +trigger_undo_ftplugin(buf_T *buf, win_T *win) +{ + window_layout_lock(); + buf->b_locked++; + win->w_locked = TRUE; + // b:undo_ftplugin may be set, undo it + do_cmdline_cmd((char_u*)"if exists('b:undo_ftplugin') | :legacy :exe \ + b:undo_ftplugin | endif"); + buf->b_locked--; + win->w_locked = FALSE; + window_layout_unlock(); +} + +/* + * Calculate the percentage that `part` is of the `whole`. + */ + static int +calc_percentage(long part, long whole) +{ + // With 32 bit longs and more than 21,474,836 lines multiplying by 100 + // causes an overflow, thus for large numbers divide instead. + return (part > 1000000L) + ? (int)(part / (whole / 100L)) + : (int)((part * 100L) / whole); +} + /* * Return the highest possible buffer number. */ @@ -454,7 +481,7 @@ static hashtab_T buf_hashtab; static void buf_hashtab_add(buf_T *buf) { - sprintf((char *)buf->b_key, "%x", buf->b_fnum); + vim_snprintf((char *)buf->b_key, sizeof(buf->b_key), "%x", buf->b_fnum); if (hash_add(&buf_hashtab, buf->b_key, "create buffer") == FAIL) emsg(_(e_buffer_cannot_be_registered)); } @@ -499,12 +526,6 @@ can_unload_buffer(buf_T *buf) return can_unload; } - int -buf_locked(buf_T *buf) -{ - return buf->b_locked || buf->b_locked_split; -} - /* * Close the link to a buffer. * "action" is used when there is no longer a window for the buffer. @@ -892,7 +913,7 @@ buf_freeall(buf_T *buf, int flags) // If the buffer was in curwin and the window has changed, go back to that // window, if it still exists. This avoids that ":edit x" triggering a // "tabnext" BufUnload autocmd leaves a window behind without a buffer. - if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) + if (is_curwin && curwin != the_curwin && win_valid_any_tab(the_curwin)) { block_autocmds(); goto_tabpage_win(the_curtab, the_curwin); @@ -1409,12 +1430,19 @@ do_buffer_ext( if ((flags & DOBUF_NOPOPUP) && bt_popup(buf) && !bt_terminal(buf)) return OK; #endif - if ( - action == DOBUF_GOTO - && buf != curbuf - && !check_can_set_curbuf_forceit((flags & DOBUF_FORCEIT) ? TRUE : FALSE)) - // disallow navigating to another buffer when 'winfixbuf' is applied - return FAIL; + if (action == DOBUF_GOTO && buf != curbuf) + { + if (!check_can_set_curbuf_forceit((flags & DOBUF_FORCEIT) != 0)) + // disallow navigating to another buffer when 'winfixbuf' is applied + return FAIL; + if (buf->b_locked_split) + { + // disallow navigating to a closing buffer, which like splitting, + // can result in more windows displaying it + emsg(_(e_cannot_switch_to_a_closing_buffer)); + return FAIL; + } + } if ((action == DOBUF_GOTO || action == DOBUF_SPLIT) && (buf->b_flags & BF_DUMMY)) @@ -2196,12 +2224,14 @@ buflist_new( buf = NULL; if ((flags & BLN_CURBUF) && curbuf_reusable()) { + bufref_T bufref; + buf = curbuf; + set_bufref(&bufref, buf); + trigger_undo_ftplugin(buf, curwin); // It's like this buffer is deleted. Watch out for autocommands that // change curbuf! If that happens, allocate a new buffer anyway. buf_freeall(buf, BFA_WIPE | BFA_DEL); - if (buf != curbuf) // autocommands deleted the buffer! - return NULL; #ifdef FEAT_EVAL if (aborting()) // autocmds may abort script processing { @@ -2209,6 +2239,8 @@ buflist_new( return NULL; } #endif + if (!bufref_valid(&bufref)) + buf = NULL; // buf was deleted; allocate a new buffer } if (buf != curbuf || curbuf == NULL) { @@ -2470,6 +2502,7 @@ free_buf_options( clear_string_option(&buf->b_p_cinw); clear_string_option(&buf->b_p_cot); clear_string_option(&buf->b_p_cpt); + clear_string_option(&buf->b_p_ise); #ifdef FEAT_COMPL_FUNC clear_string_option(&buf->b_p_cfu); free_callback(&buf->b_cfu_cb); @@ -2479,6 +2512,7 @@ free_buf_options( free_callback(&buf->b_tsrfu_cb); #endif #ifdef FEAT_QUICKFIX + clear_string_option(&buf->b_p_gefm); clear_string_option(&buf->b_p_gp); clear_string_option(&buf->b_p_mp); clear_string_option(&buf->b_p_efm); @@ -2494,6 +2528,9 @@ free_buf_options( free_callback(&buf->b_ffu_cb); #endif clear_string_option(&buf->b_p_dict); +#ifdef FEAT_DIFF + clear_string_option(&buf->b_p_dia); +#endif clear_string_option(&buf->b_p_tsr); clear_string_option(&buf->b_p_qe); buf->b_p_ar = -1; @@ -2930,6 +2967,8 @@ ExpandBufnames( p = home_replace_save(buf, p); else p = vim_strsave(p); + if (p == NULL) + return FAIL; if (!fuzzy) { @@ -3090,7 +3129,7 @@ buflist_findnr(int nr) if (nr == 0) nr = curwin->w_alt_fnum; - sprintf((char *)key, "%x", nr); + vim_snprintf((char *)key, sizeof(key), "%x", nr); hi = hash_find(&buf_hashtab, key); if (!HASHITEM_EMPTY(hi)) @@ -3387,6 +3426,8 @@ buflist_list(exarg_T *eap) for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next) #endif { + char_u *name; + #ifdef FEAT_TERMINAL job_running = term_job_running(buf->b_term); job_none_open = term_none_open(buf->b_term); @@ -3415,8 +3456,9 @@ buflist_list(exarg_T *eap) || (vim_strchr(eap->arg, '#') && (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum))) continue; - if (buf_spname(buf) != NULL) - vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1); + name = buf_spname(buf); + if (name != NULL) + vim_strncpy(NameBuff, name, MAXPATHL - 1); else home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE); if (message_filtered(NameBuff)) @@ -3441,7 +3483,7 @@ buflist_list(exarg_T *eap) ro_char = !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' '); msg_putchar('\n'); - len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", + len = (int)vim_snprintf_safelen((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", buf->b_fnum, buf->b_p_bl ? ' ' : 'u', buf == curbuf ? '%' : @@ -3451,8 +3493,6 @@ buflist_list(exarg_T *eap) ro_char, changed_char, NameBuff); - if (len > IOSIZE - 20) - len = IOSIZE - 20; // put "line 999" in column 40 or after the file name i = 40 - vim_strsize(IObuff); @@ -3852,83 +3892,81 @@ fileinfo( int dont_truncate) { char_u *name; - int n; - char *p; char *buffer; - size_t len; + size_t bufferlen = 0; buffer = alloc(IOSIZE); if (buffer == NULL) return; if (fullname > 1) // 2 CTRL-G: include buffer number - { - vim_snprintf(buffer, IOSIZE, "buf %d: ", curbuf->b_fnum); - p = buffer + STRLEN(buffer); - } - else - p = buffer; + bufferlen = vim_snprintf_safelen(buffer, IOSIZE, "buf %d: ", curbuf->b_fnum); - *p++ = '"'; - if (buf_spname(curbuf) != NULL) - vim_strncpy((char_u *)p, buf_spname(curbuf), IOSIZE - (p - buffer) - 1); + buffer[bufferlen++] = '"'; + + name = buf_spname(curbuf); + if (name != NULL) + bufferlen += vim_snprintf_safelen(buffer + bufferlen, + IOSIZE - bufferlen, "%s", name); else { if (!fullname && curbuf->b_fname != NULL) name = curbuf->b_fname; else name = curbuf->b_ffname; - home_replace(shorthelp ? curbuf : NULL, name, (char_u *)p, - (int)(IOSIZE - (p - buffer)), TRUE); + home_replace(shorthelp ? curbuf : NULL, name, (char_u *)buffer + bufferlen, + IOSIZE - (int)bufferlen, TRUE); + bufferlen += STRLEN(buffer + bufferlen); } - vim_snprintf_add(buffer, IOSIZE, "\"%s%s%s%s%s%s", - curbufIsChanged() ? (shortmess(SHM_MOD) - ? " [+]" : _(" [Modified]")) : " ", - (curbuf->b_flags & BF_NOTEDITED) && !bt_dontwrite(curbuf) - ? _("[Not edited]") : "", - (curbuf->b_flags & BF_NEW) && !bt_dontwrite(curbuf) - ? new_file_message() : "", - (curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "", - curbuf->b_p_ro ? (shortmess(SHM_RO) ? _("[RO]") - : _("[readonly]")) : "", - (curbufIsChanged() || (curbuf->b_flags & BF_WRITE_MASK) - || curbuf->b_p_ro) ? - " " : ""); - // With 32 bit longs and more than 21,474,836 lines multiplying by 100 - // causes an overflow, thus for large numbers divide instead. - if (curwin->w_cursor.lnum > 1000000L) - n = (int)(((long)curwin->w_cursor.lnum) / - ((long)curbuf->b_ml.ml_line_count / 100L)); - else - n = (int)(((long)curwin->w_cursor.lnum * 100L) / - (long)curbuf->b_ml.ml_line_count); + bufferlen += vim_snprintf_safelen( + buffer + bufferlen, + IOSIZE - bufferlen, + "\"%s%s%s%s%s%s", + curbufIsChanged() ? (shortmess(SHM_MOD) + ? " [+]" : _(" [Modified]")) : " ", + (curbuf->b_flags & BF_NOTEDITED) && !bt_dontwrite(curbuf) + ? _("[Not edited]") : "", + (curbuf->b_flags & BF_NEW) && !bt_dontwrite(curbuf) + ? new_file_message() : "", + (curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "", curbuf->b_p_ro + ? (shortmess(SHM_RO) ? _("[RO]") : _("[readonly]")) : "", + (curbufIsChanged() || (curbuf->b_flags & BF_WRITE_MASK) || curbuf->b_p_ro) + ? " " : ""); + if (curbuf->b_ml.ml_flags & ML_EMPTY) - vim_snprintf_add(buffer, IOSIZE, "%s", _(no_lines_msg)); + bufferlen += vim_snprintf_safelen(buffer + bufferlen, + IOSIZE - bufferlen, "%s", _(no_lines_msg)); else if (p_ru) // Current line and column are already on the screen -- webb - vim_snprintf_add(buffer, IOSIZE, - NGETTEXT("%ld line --%d%%--", "%ld lines --%d%%--", - curbuf->b_ml.ml_line_count), - (long)curbuf->b_ml.ml_line_count, n); + bufferlen += vim_snprintf_safelen( + buffer + bufferlen, + IOSIZE - bufferlen, + NGETTEXT("%ld line --%d%%--", "%ld lines --%d%%--", curbuf->b_ml.ml_line_count), + (long)curbuf->b_ml.ml_line_count, + calc_percentage(curwin->w_cursor.lnum, curbuf->b_ml.ml_line_count)); else { - vim_snprintf_add(buffer, IOSIZE, - _("line %ld of %ld --%d%%-- col "), - (long)curwin->w_cursor.lnum, - (long)curbuf->b_ml.ml_line_count, - n); + bufferlen += vim_snprintf_safelen( + buffer + bufferlen, + IOSIZE - bufferlen, + _("line %ld of %ld --%d%%-- col "), + (long)curwin->w_cursor.lnum, + (long)curbuf->b_ml.ml_line_count, + calc_percentage(curwin->w_cursor.lnum, curbuf->b_ml.ml_line_count)); + validate_virtcol(); - len = STRLEN(buffer); - (void)col_print((char_u *)buffer + len, IOSIZE - len, + bufferlen += col_print((char_u *)buffer + bufferlen, IOSIZE - bufferlen, (int)curwin->w_cursor.col + 1, (int)curwin->w_virtcol + 1); } - (void)append_arg_number(curwin, (char_u *)buffer, IOSIZE, - !shortmess(SHM_FILE)); + (void)append_arg_number(curwin, (char_u *)buffer + bufferlen, + IOSIZE - bufferlen, !shortmess(SHM_FILE)); if (dont_truncate) { + int n; + // Temporarily set msg_scroll to avoid the message being truncated. // First call msg_start() to get the message in the right place. msg_start(); @@ -3939,7 +3977,7 @@ fileinfo( } else { - p = msg_trunc_attr(buffer, FALSE, 0); + char *p = msg_trunc_attr(buffer, FALSE, 0); if (restart_edit != 0 || (msg_scrolled && !need_wait_return)) // Need to repeat the message after redrawing when: // - When restart_edit is set (otherwise there will be a delay @@ -3960,9 +3998,9 @@ col_print( int vcol) { if (col == vcol) - return vim_snprintf((char *)buf, buflen, "%d", col); + return (int)vim_snprintf_safelen((char *)buf, buflen, "%d", col); - return vim_snprintf((char *)buf, buflen, "%d-%d", col, vcol); + return (int)vim_snprintf_safelen((char *)buf, buflen, "%d-%d", col, vcol); } static char_u *lasttitle = NULL; @@ -3974,14 +4012,11 @@ static char_u *lasticon = NULL; void maketitle(void) { - char_u *p; char_u *title_str = NULL; char_u *icon_str = NULL; - int maxlen = 0; - int len; int mustset; char_u buf[IOSIZE]; - int off; + size_t buflen = 0; if (!redrawing()) { @@ -4000,6 +4035,8 @@ maketitle(void) if (p_title) { + int maxlen = 0; + if (p_titlelen > 0) { maxlen = p_titlelen * Columns / 100; @@ -4018,46 +4055,90 @@ maketitle(void) else #endif title_str = p_titlestring; + buflen = STRLEN(title_str); } else { - // format: "fname + (path) (1 of 2) - VIM" + char_u *p; + + // format: " [flags] <(path)> [argument info] <- servername>" + // example: + // buffer.c + (/home/vim/src) (1 of 2) - VIM -#define SPACE_FOR_FNAME (IOSIZE - 100) -#define SPACE_FOR_DIR (IOSIZE - 20) -#define SPACE_FOR_ARGNR (IOSIZE - 10) // at least room for " - VIM" + // reserve some space for different parts of the title. + // use sizeof() to introduce 'size_t' so we don't have to + // cast sizes to it. +#define SPACE_FOR_FNAME (sizeof(buf) - 100) +#define SPACE_FOR_DIR (sizeof(buf) - 20) +#define SPACE_FOR_ARGNR (sizeof(buf) - 10) // at least room for " - VIM" + + // file name if (curbuf->b_fname == NULL) - vim_strncpy(buf, (char_u *)_("[No Name]"), SPACE_FOR_FNAME); + buflen = vim_snprintf_safelen((char *)buf, + SPACE_FOR_FNAME, "%s", _("[No Name]")); #ifdef FEAT_TERMINAL else if (curbuf->b_term != NULL) - { - vim_strncpy(buf, term_get_status_text(curbuf->b_term), - SPACE_FOR_FNAME); - } + buflen = vim_snprintf_safelen((char *)buf, + SPACE_FOR_FNAME, "%s", + term_get_status_text(curbuf->b_term)); #endif else { - p = transstr(gettail(curbuf->b_fname)); - vim_strncpy(buf, p, SPACE_FOR_FNAME); + buflen = vim_snprintf_safelen((char *)buf, + SPACE_FOR_FNAME, "%s", + ((p = transstr(gettail(curbuf->b_fname))) != NULL) + ? p + : (char_u *)""); vim_free(p); } + // flags #ifdef FEAT_TERMINAL if (curbuf->b_term == NULL) #endif + { switch (bufIsChanged(curbuf) + (curbuf->b_p_ro * 2) + (!curbuf->b_p_ma * 4)) { - case 1: STRCAT(buf, " +"); break; - case 2: STRCAT(buf, " ="); break; - case 3: STRCAT(buf, " =+"); break; + case 1: + // file was modified + buflen += vim_snprintf_safelen( + (char *)buf + buflen, + sizeof(buf) - buflen, " +"); + break; + case 2: + // file is readonly + buflen += vim_snprintf_safelen( + (char *)buf + buflen, + sizeof(buf) - buflen, " ="); + break; + case 3: + // file was modified and is readonly + buflen += vim_snprintf_safelen( + (char *)buf + buflen, + sizeof(buf) - buflen, " =+"); + break; case 4: - case 6: STRCAT(buf, " -"); break; + case 6: + // file cannot be modified + buflen += vim_snprintf_safelen( + (char *)buf + buflen, + sizeof(buf) - buflen, " -"); + break; case 5: - case 7: STRCAT(buf, " -+"); break; + case 7: + // file cannot be modified but was modified + buflen += vim_snprintf_safelen( + (char *)buf + buflen, + sizeof(buf) - buflen, " -+"); + break; + default: + break; } + } + // path (surrounded by '()') if (curbuf->b_fname != NULL #ifdef FEAT_TERMINAL && curbuf->b_term == NULL @@ -4065,63 +4146,71 @@ maketitle(void) ) { // Get path of file, replace home dir with ~ - off = (int)STRLEN(buf); - buf[off++] = ' '; - buf[off++] = '('; + buflen += vim_snprintf_safelen((char *)buf + buflen, + sizeof(buf) - buflen, " ("); + home_replace(curbuf, curbuf->b_ffname, - buf + off, SPACE_FOR_DIR - off, TRUE); + buf + buflen, (int)(SPACE_FOR_DIR - buflen), TRUE); + #ifdef BACKSLASH_IN_FILENAME // avoid "c:/name" to be reduced to "c" - if (SAFE_isalpha(buf[off]) && buf[off + 1] == ':') - off += 2; + if (SAFE_isalpha(buf[buflen]) && buf[buflen + 1] == ':') + buflen += 2; // step over "c:" #endif - // remove the file name - p = gettail_sep(buf + off); - if (p == buf + off) - { - // must be a help buffer - vim_strncpy(buf + off, (char_u *)_("help"), - (size_t)(SPACE_FOR_DIR - off - 1)); - } - else - *p = NUL; - // Translate unprintable chars and concatenate. Keep some - // room for the server name. When there is no room (very long - // file name) use (...). - if (off < SPACE_FOR_DIR) + // determine if we have a help or normal buffer + p = gettail_sep(buf + buflen); + if (p == buf + buflen) { - p = transstr(buf + off); - vim_strncpy(buf + off, p, (size_t)(SPACE_FOR_DIR - off)); - vim_free(p); + // help buffer + buflen += vim_snprintf_safelen((char *)buf + buflen, + SPACE_FOR_DIR - buflen, "%s)", _("help")); } else { - vim_strncpy(buf + off, (char_u *)"...", - (size_t)(SPACE_FOR_ARGNR - off)); + // normal buffer + + // Translate unprintable chars and concatenate. Keep some + // room for the server name. When there is no room (very long + // file name) use (...). + if (buflen < SPACE_FOR_DIR) + { + // remove the file name + *p = NUL; + + buflen += vim_snprintf_safelen((char *)buf + buflen, + SPACE_FOR_DIR - buflen, "%s)", + ((p = transstr(buf + buflen)) != NULL) + ? p + : (char_u *)""); + vim_free(p); + } + else + buflen += vim_snprintf_safelen((char *)buf + buflen, + SPACE_FOR_ARGNR - buflen, "...)"); } - STRCAT(buf, ")"); } #ifndef FEAT_GUI_MACVIM - append_arg_number(curwin, buf, SPACE_FOR_ARGNR, FALSE); + // argument info + buflen += append_arg_number(curwin, buf + buflen, + SPACE_FOR_ARGNR - buflen, FALSE); #endif + // servername + buflen += vim_snprintf_safelen((char *)buf + buflen, + sizeof(buf) - buflen, " - %s", #if defined(FEAT_CLIENTSERVER) - if (serverName != NULL) - { - STRCAT(buf, " - "); - vim_strcat(buf, serverName, IOSIZE); - } - else + (serverName != NULL) + ? serverName : #endif - STRCAT(buf, " - VIM"); + (char_u *)"VIM"); if (maxlen > 0) { // make it shorter by removing a bit in the middle if (vim_strsize(buf) > maxlen) - trunc_string(buf, buf, maxlen, IOSIZE); + trunc_string(buf, buf, maxlen, sizeof(buf)); } } } @@ -4142,22 +4231,23 @@ maketitle(void) } else { - if (buf_spname(curbuf) != NULL) - p = buf_spname(curbuf); - else // use file name only in icon - p = gettail(curbuf->b_ffname); - *icon_str = NUL; + char_u *name; + int namelen; + + name = buf_spname(curbuf); + if (name == NULL) + name = gettail(curbuf->b_ffname); // Truncate name at 100 bytes. - len = (int)STRLEN(p); - if (len > 100) + namelen = (int)STRLEN(name); + if (namelen > 100) { - len -= 100; + namelen -= 100; if (has_mbyte) - len += (*mb_tail_off)(p, p + len) + 1; - p += len; + namelen += (*mb_tail_off)(name, name + namelen) + 1; + name += namelen; } - STRCPY(icon_str, p); - trans_characters(icon_str, IOSIZE); + STRCPY(buf, name); + trans_characters(buf, sizeof(buf)); } } @@ -4270,18 +4360,15 @@ build_stl_str_hl( { linenr_T lnum; colnr_T len; + size_t outputlen; // length of out[] used (excluding the NUL) char_u *p; char_u *s; - char_u *t; int byteval; #ifdef FEAT_EVAL int use_sandbox; - win_T *save_curwin; - buf_T *save_curbuf; int save_VIsual_active; #endif int empty_line; - colnr_T virtcol; long l; long n; int prevchar_isflag; @@ -4293,8 +4380,6 @@ build_stl_str_hl( int width; int itemcnt; int curitem; - int group_end_userhl; - int group_start_userhl; int groupdepth; #ifdef FEAT_EVAL int evaldepth; @@ -4306,7 +4391,6 @@ build_stl_str_hl( char_u opt; #define TMPLEN 70 char_u buf_tmp[TMPLEN]; - char_u win_tmp[TMPLEN]; char_u *usefmt = fmt; stl_hlrec_T *sp; int save_redraw_not_allowed = redraw_not_allowed; @@ -4429,7 +4513,7 @@ build_stl_str_hl( sizeof(int) * new_len); if (new_separator_locs == NULL) break; - stl_separator_locations = new_separator_locs;; + stl_separator_locations = new_separator_locs; stl_items_len = new_len; } @@ -4478,6 +4562,8 @@ build_stl_str_hl( } if (*s == ')') { + char_u *t; + s++; if (groupdepth < 1) continue; @@ -4489,9 +4575,11 @@ build_stl_str_hl( if (curitem > stl_groupitem[groupdepth] + 1 && stl_items[stl_groupitem[groupdepth]].stl_minwid == 0) { + int group_start_userhl = 0; + int group_end_userhl = 0; + // remove group if all items are empty and highlight group // doesn't change - group_start_userhl = group_end_userhl = 0; for (n = stl_groupitem[groupdepth] - 1; n >= 0; n--) { if (stl_items[n].stl_type == Highlight) @@ -4693,12 +4781,16 @@ build_stl_str_hl( case STL_FILEPATH: case STL_FULLPATH: case STL_FILENAME: + { + char_u *name; + fillable = FALSE; // don't change ' ' to fillchar - if (buf_spname(wp->w_buffer) != NULL) - vim_strncpy(NameBuff, buf_spname(wp->w_buffer), MAXPATHL - 1); + name = buf_spname(wp->w_buffer); + if (name != NULL) + vim_strncpy(NameBuff, name, MAXPATHL - 1); else { - t = (opt == STL_FULLPATH) ? wp->w_buffer->b_ffname + char_u *t = (opt == STL_FULLPATH) ? wp->w_buffer->b_ffname : wp->w_buffer->b_fname; home_replace(wp->w_buffer, t, NameBuff, MAXPATHL, TRUE); } @@ -4708,13 +4800,17 @@ build_stl_str_hl( else str = gettail(NameBuff); break; + } case STL_VIM_EXPR: // '{' { #ifdef FEAT_EVAL - char_u *block_start = s - 1; + char_u *block_start = s - 1; #endif - int reevaluate = (*s == '%'); + int reevaluate = (*s == '%'); + char_u *t; + buf_T *save_curbuf; + win_T *save_curwin; if (reevaluate) s++; @@ -4727,16 +4823,16 @@ build_stl_str_hl( break; s++; if (reevaluate) - p[-1] = 0; // remove the % at the end of %{% expr %} + p[-1] = NUL; // remove the % at the end of %{% expr %} else - *p = 0; + *p = NUL; p = t; #ifdef FEAT_EVAL vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), "%d", curbuf->b_fnum); set_internal_string_var((char_u *)"g:actual_curbuf", buf_tmp); - vim_snprintf((char *)win_tmp, sizeof(win_tmp), "%d", curwin->w_id); - set_internal_string_var((char_u *)"g:actual_curwin", win_tmp); + vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), "%d", curwin->w_id); + set_internal_string_var((char_u *)"g:actual_curwin", buf_tmp); save_curbuf = curbuf; save_curwin = curwin; @@ -4755,7 +4851,7 @@ build_stl_str_hl( do_unlet((char_u *)"g:actual_curbuf", TRUE); do_unlet((char_u *)"g:actual_curwin", TRUE); - if (str != NULL && *str != 0) + if (str != NULL && *str != NUL) { if (*skipdigits(str) == NUL) { @@ -4767,7 +4863,7 @@ build_stl_str_hl( // If the output of the expression needs to be evaluated // replace the %{} block with the result of evaluation - if (reevaluate && str != NULL && *str != 0 + if (reevaluate && str != NULL && *str != NUL && strchr((const char *)str, '%') != NULL && evaldepth < MAX_STL_EVAL_DEPTH) { @@ -4777,25 +4873,29 @@ build_stl_str_hl( size_t new_fmt_len = parsed_usefmt + str_length + fmt_length + 3; char_u *new_fmt = (char_u *)alloc(new_fmt_len * sizeof(char_u)); - char_u *new_fmt_p = new_fmt; - - new_fmt_p = (char_u *)memcpy(new_fmt_p, usefmt, parsed_usefmt) - + parsed_usefmt; - new_fmt_p = (char_u *)memcpy(new_fmt_p , str, str_length) - + str_length; - new_fmt_p = (char_u *)memcpy(new_fmt_p, "%}", 2) + 2; - new_fmt_p = (char_u *)memcpy(new_fmt_p , s, fmt_length) - + fmt_length; - *new_fmt_p = 0; - new_fmt_p = NULL; - - if (usefmt != fmt) - vim_free(usefmt); - VIM_CLEAR(str); - usefmt = new_fmt; - s = usefmt + parsed_usefmt; - evaldepth++; - continue; + + if (new_fmt != NULL) + { + char_u *new_fmt_p = new_fmt; + + new_fmt_p = (char_u *)memcpy(new_fmt_p, usefmt, parsed_usefmt) + + parsed_usefmt; + new_fmt_p = (char_u *)memcpy(new_fmt_p , str, str_length) + + str_length; + new_fmt_p = (char_u *)memcpy(new_fmt_p, "%}", 2) + 2; + new_fmt_p = (char_u *)memcpy(new_fmt_p , s, fmt_length) + + fmt_length; + *new_fmt_p = 0; + new_fmt_p = NULL; + + if (usefmt != fmt) + vim_free(usefmt); + VIM_CLEAR(str); + usefmt = new_fmt; + s = usefmt + parsed_usefmt; + evaldepth++; + continue; + } } #endif break; @@ -4816,7 +4916,9 @@ build_stl_str_hl( case STL_VIRTCOL: case STL_VIRTCOL_ALT: - virtcol = wp->w_virtcol + 1; + { + colnr_T virtcol = wp->w_virtcol + 1; + // Don't display %V if it's the same as %c. if (opt == STL_VIRTCOL_ALT && (virtcol == (colnr_T)((State & MODE_INSERT) == 0 @@ -4824,10 +4926,10 @@ build_stl_str_hl( break; num = (long)virtcol; break; + } case STL_PERCENTAGE: - num = (int)(((long)wp->w_cursor.lnum * 100L) / - (long)wp->w_buffer->b_ml.ml_line_count); + num = calc_percentage((long)wp->w_cursor.lnum, (long)wp->w_buffer->b_ml.ml_line_count); break; case STL_ALTPERCENT: @@ -4842,8 +4944,8 @@ build_stl_str_hl( case STL_ARGLISTSTAT: fillable = FALSE; - buf_tmp[0] = 0; - if (append_arg_number(wp, buf_tmp, (int)sizeof(buf_tmp), FALSE)) + buf_tmp[0] = NUL; + if (append_arg_number(wp, buf_tmp, sizeof(buf_tmp), FALSE) > 0) str = buf_tmp; break; @@ -4917,6 +5019,8 @@ build_stl_str_hl( if (*wp->w_buffer->b_p_ft != NUL && STRLEN(wp->w_buffer->b_p_ft) < TMPLEN - 2) { + char_u *t; + vim_snprintf((char *)buf_tmp, sizeof(buf_tmp), ",%s", wp->w_buffer->b_p_ft); for (t = buf_tmp; *t != 0; t++) @@ -4959,26 +5063,30 @@ build_stl_str_hl( break; case STL_HIGHLIGHT: - t = s; - while (*s != '#' && *s != NUL) - ++s; - if (*s == '#') { - stl_items[curitem].stl_type = Highlight; - stl_items[curitem].stl_start = p; - stl_items[curitem].stl_minwid = -syn_namen2id(t, (int)(s - t)); - curitem++; + char_u *t = s; + + while (*s != '#' && *s != NUL) + ++s; + if (*s == '#') + { + stl_items[curitem].stl_type = Highlight; + stl_items[curitem].stl_start = p; + stl_items[curitem].stl_minwid = -syn_namen2id(t, (int)(s - t)); + curitem++; + } + if (*s != NUL) + ++s; + continue; } - if (*s != NUL) - ++s; - continue; } stl_items[curitem].stl_start = p; stl_items[curitem].stl_type = Normal; if (str != NULL && *str) { - t = str; + char_u *t = str; + if (itemisflag) { if ((t[0] && t[1]) @@ -5033,13 +5141,13 @@ build_stl_str_hl( } else if (num >= 0) { - int nbase = (base == 'D' ? 10 : (base == 'O' ? 8 : 16)); - char_u nstr[20]; + int nbase = (base == 'D' ? 10 : (base == 'O' ? 8 : 16)); + char_u nstr[20]; + char_u *t = nstr; if (p + 20 >= out + outlen) break; // not sufficient space prevchar_isitem = TRUE; - t = nstr; if (opt == STL_VIRTCOL_ALT) { *t++ = '-'; @@ -5050,12 +5158,13 @@ build_stl_str_hl( *t++ = '0'; *t++ = '*'; *t++ = nbase == 16 ? base : (char_u)(nbase == 8 ? 'o' : 'd'); - *t = 0; + *t = NUL; for (n = num, l = 1; n >= nbase; n /= nbase) l++; if (opt == STL_VIRTCOL_ALT) l++; + if (l > maxwid) { l += 2; @@ -5065,14 +5174,13 @@ build_stl_str_hl( *t++ = '>'; *t++ = '%'; *t = t[-3]; - *++t = 0; - vim_snprintf((char *)p, outlen - (p - out), (char *)nstr, - 0, num, n); + *++t = NUL; + p += vim_snprintf_safelen((char *)p, outlen - (p - out), + (char *)nstr, 0, num, n); } else - vim_snprintf((char *)p, outlen - (p - out), (char *)nstr, - minwid, num); - p += STRLEN(p); + p += vim_snprintf_safelen((char *)p, outlen - (p - out), + (char *)nstr, minwid, num); } else stl_items[curitem].stl_type = Empty; @@ -5085,6 +5193,7 @@ build_stl_str_hl( curitem++; } *p = NUL; + outputlen = (size_t)(p - out); itemcnt = curitem; #ifdef FEAT_EVAL @@ -5141,10 +5250,12 @@ build_stl_str_hl( break; itemcnt = l; *s++ = '>'; - *s = 0; + *s = NUL; } else { + char_u *end = out + outputlen; + if (has_mbyte) { n = 0; @@ -5157,7 +5268,8 @@ build_stl_str_hl( else n = width - maxwidth + 1; p = s + n; - STRMOVE(s + 1, p); + mch_memmove(s + 1, p, (size_t)(end - p) + 1); // +1 for NUL + end -= (size_t)(p - (s + 1)); *s = '<'; --n; // count the '<' @@ -5172,14 +5284,15 @@ build_stl_str_hl( // Fill up for half a double-wide character. while (++width < maxwidth) { - s = s + STRLEN(s); + s = end; MB_CHAR2BYTES(fillchar, s); *s = NUL; + end = s; } } width = maxwidth; } - else if (width < maxwidth && STRLEN(out) + maxwidth - width + 1 < outlen) + else if (width < maxwidth && outputlen + maxwidth - width + 1 < outlen) { // Find how many separators there are, which we will use when // figuring out how many groups there are. @@ -5280,7 +5393,7 @@ build_stl_str_hl( #endif // FEAT_STL_OPT /* - * Get relative cursor position in window into "buf[buflen]", in the localized + * Get relative cursor position in window into "buf[]", in the localized * percentage form like %99, 99%; using "Top", "Bot" or "All" when appropriate. */ int @@ -5291,7 +5404,6 @@ get_rel_pos( { long above; // number of lines above window long below; // number of lines below window - int len; if (buflen < 3) // need at least 3 chars for writing return 0; @@ -5305,42 +5417,33 @@ get_rel_pos( #endif below = wp->w_buffer->b_ml.ml_line_count - wp->w_botline + 1; if (below <= 0) - len = vim_snprintf((char *)buf, buflen, "%s", (above == 0) ? _("All") : _("Bot")); - else if (above <= 0) - len = vim_snprintf((char *)buf, buflen, "%s", _("Top")); - else - { - int perc = (above > 1000000L) - ? (int)(above / ((above + below) / 100L)) - : (int)(above * 100L / (above + below)); - - // localized percentage value - len = vim_snprintf((char *)buf, buflen, _("%s%d%%"), (perc < 10) ? " " : "", perc); - } - if (len < 0) - { - buf[0] = NUL; - len = 0; - } - else if (len > buflen - 1) - len = buflen - 1; - - return len; + return (int)vim_snprintf_safelen((char *)buf, buflen, + "%s", (above == 0) ? _("All") : _("Bot")); + + if (above <= 0) + return (int)vim_snprintf_safelen((char *)buf, buflen, + "%s", _("Top")); + + int perc = calc_percentage(above, above + below); + char tmp[8]; + // localized percentage value + vim_snprintf(tmp, sizeof(tmp), _("%d%%"), perc); + return (int)vim_snprintf_safelen((char *)buf, buflen, _("%2s"), tmp); } /* - * Append (file 2 of 8) to "buf[buflen]", if editing more than one file. - * Return TRUE if it was appended. + * Append (file 2 of 8) to "buf[]", if editing more than one file. + * Return the number of characters appended. */ static int append_arg_number( win_T *wp, char_u *buf, - int buflen, + size_t buflen, int add_file) // Add "file" before the arg number { if (ARGCOUNT <= 1) // nothing to do - return FALSE; + return 0; char *msg; switch ((wp->w_arg_idx_invalid ? 1 : 0) + (add_file ? 2 : 0)) @@ -5351,10 +5454,8 @@ append_arg_number( case 3: msg = _(" (file (%d) of %d)"); break; } - char_u *p = buf + STRLEN(buf); // go to the end of the buffer - vim_snprintf((char *)p, (size_t)(buflen - (p - buf)), msg, + return (int)vim_snprintf_safelen((char *)buf, buflen, msg, wp->w_arg_idx + 1, ARGCOUNT); - return TRUE; } /* @@ -5694,17 +5795,16 @@ chk_modeline( int flags) // Same as for do_modelines(). { char_u *s; + char_u *line_end; // point to the end of the line char_u *e; - char_u *linecopy; // local copy of any modeline found int prev; - int vers; - int end; int retval = OK; - sctx_T save_current_sctx; ESTACK_CHECK_DECLARATION; prev = -1; - for (s = ml_get(lnum); *s != NUL; ++s) + s = ml_get(lnum); + line_end = s + ml_get_len(lnum); + for (; *s != NUL; ++s) { if (prev == -1 || vim_isspace(prev)) { @@ -5714,6 +5814,8 @@ chk_modeline( // Accept both "vim" and "Vim". if ((s[0] == 'v' || s[0] == 'V') && s[1] == 'i' && s[2] == 'm') { + int vers; + if (s[3] == '<' || s[3] == '=' || s[3] == '>') e = s + 4; else @@ -5735,14 +5837,23 @@ chk_modeline( if (*s) { + size_t len; + char_u *linecopy; // local copy of any modeline found + int end; + do // skip over "ex:", "vi:" or "vim:" ++s; while (s[-1] != ':'); - s = linecopy = vim_strsave(s); // copy the line, it will change + len = (size_t)(line_end - s); // remember the line length + // so we can restore 'line_end' + // after the copy + s = linecopy = vim_strnsave(s, len); // copy the line, it will change if (linecopy == NULL) return FAIL; + line_end = s + len; // restore 'line_end' + // prepare for emsg() estack_push(ETYPE_MODELINE, (char_u *)"modelines", lnum); ESTACK_CHECK_SETUP; @@ -5760,7 +5871,10 @@ chk_modeline( */ for (e = s; *e != ':' && *e != NUL; ++e) if (e[0] == '\\' && e[1] == ':') - STRMOVE(e, e + 1); + { + mch_memmove(e, e + 1, (size_t)(line_end - (e + 1)) + 1); // +1 for NUL + --line_end; + } if (*e == NUL) end = TRUE; @@ -5777,15 +5891,15 @@ chk_modeline( if (*e != ':') // no terminating ':'? break; end = TRUE; - s = vim_strchr(s, ' ') + 1; + s += (*(s + 2) == ' ') ? 3 : 4; } *e = NUL; // truncate the set command if (*s != NUL) // skip over an empty "::" { int secure_save = secure; + sctx_T save_current_sctx = current_sctx; - save_current_sctx = current_sctx; current_sctx.sc_version = 1; #ifdef FEAT_EVAL current_sctx.sc_sid = SID_MODELINE; @@ -5803,7 +5917,8 @@ chk_modeline( if (retval == FAIL) // stop if error found break; } - s = e + 1; // advance to next part + s = (e == line_end) ? e : e + 1; // advance to next part + // careful not to go off the end } ESTACK_CHECK_NOW; diff --git a/src/change.c b/src/change.c index a87764bc2f..5c92ff5dfa 100644 --- a/src/change.c +++ b/src/change.c @@ -142,6 +142,9 @@ changed_internal(void) ml_setflags(curbuf); check_status(curbuf); redraw_tabline = TRUE; +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif need_maketitle = TRUE; // set window title later } @@ -917,6 +920,9 @@ unchanged(buf_T *buf, int ff, int always_inc_changedtick) save_file_ff(buf); check_status(buf); redraw_tabline = TRUE; +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif need_maketitle = TRUE; // set window title later ++CHANGEDTICK(buf); } @@ -1203,8 +1209,8 @@ ins_str(char_u *s, size_t slen) mch_memmove(newp + col, s, slen); mch_memmove(newp + col + slen, oldp + col, (size_t)(oldlen - col + 1)); ml_replace(lnum, newp, FALSE); - inserted_bytes(lnum, col, slen); - curwin->w_cursor.col += slen; + inserted_bytes(lnum, col, (int)slen); + curwin->w_cursor.col += (colnr_T)slen; } /* diff --git a/src/cindent.c b/src/cindent.c index 2414b3fad5..e1f7446768 100644 --- a/src/cindent.c +++ b/src/cindent.c @@ -406,10 +406,10 @@ cin_islabel_skip(char_u **s) while (vim_isIDc(**s)) { - if (has_mbyte) - (*s) += (*mb_ptr2len)(*s); - else - (*s)++; + if (has_mbyte) + (*s) += (*mb_ptr2len)(*s); + else + (*s)++; } *s = cin_skipcomment(*s); @@ -590,7 +590,7 @@ cin_isdefault(char_u *s) /* * Recognize a switch label: "case .*:" or "default:". */ - static int + static int cin_iscase( char_u *s, int strict) // Allow relaxed check of case statement for JS @@ -1296,7 +1296,7 @@ cin_isfuncdecl( static int cin_isif(char_u *p) { - return (STRNCMP(p, "if", 2) == 0 && !vim_isIDc(p[2])); + return (STRNCMP(p, "if", 2) == 0 && !vim_isIDc(p[2])); } static int @@ -2415,15 +2415,15 @@ get_c_indent(void) && trypos->lnum == our_paren_pos.lnum && trypos->col == our_paren_pos.col) { - amount = get_indent_lnum(lnum); // XXX + amount = get_indent_lnum(lnum); // XXX - if (theline[0] == ')') - { - if (our_paren_pos.lnum != lnum - && cur_amount > amount) - cur_amount = amount; - amount = -1; - } + if (theline[0] == ')') + { + if (our_paren_pos.lnum != lnum + && cur_amount > amount) + cur_amount = amount; + amount = -1; + } break; } } @@ -2447,7 +2447,8 @@ get_c_indent(void) char_u *line; trypos = &our_paren_pos; - do { + do + { outermost = *trypos; curwin->w_cursor.lnum = outermost.lnum; curwin->w_cursor.col = outermost.col; @@ -3961,7 +3962,7 @@ in_cinkeys( { case '*': try_match = (*look == '*'); break; case '!': try_match = (*look == '!'); break; - default: try_match = (*look != '*'); break; + default: try_match = (*look != '*'); break; } if (*look == '*' || *look == '!') ++look; diff --git a/src/clientserver.c b/src/clientserver.c index f854a6406e..04da4a130f 100644 --- a/src/clientserver.c +++ b/src/clientserver.c @@ -461,8 +461,8 @@ cmdsrv_main( if (p == NULL) break; # elif defined(MAC_CLIENTSERVER) - if (serverReadReply(srv, &p, 0) < 0) - break; + if (serverReadReply(srv, &p, 0) < 0) + break; # else if (serverReadReply(xterm_dpy, srv, &p, TRUE, -1) < 0) break; @@ -953,7 +953,7 @@ f_remote_read(typval_T *argvars UNUSED, typval_T *rettv) r = serverGetReply((HWND)n, FALSE, TRUE, TRUE, timeout); if (r == NULL) # elif defined(MAC_CLIENTSERVER) - if (serverReadReply(serverStrToPort(serverid), &r, timeout) < 0) + if (serverReadReply(serverStrToPort(serverid), &r, timeout) < 0) # else if (check_connection() == FAIL || serverReadReply(X_DISPLAY, serverStrToWin(serverid), diff --git a/src/clipboard.c b/src/clipboard.c index 208e491a9f..9bb618a3fb 100644 --- a/src/clipboard.c +++ b/src/clipboard.c @@ -31,6 +31,32 @@ #if defined(FEAT_CLIPBOARD) || defined(PROTO) +#if defined(FEAT_WAYLAND_CLIPBOARD) +// Mime types we support sending and receiving +// Mimes with a lower index in the array are prioritized first when we are +// receiving data. +static const char *supported_mimes[] = { + VIMENC_ATOM_NAME, + VIM_ATOM_NAME, + "text/plain;charset=utf-8", + "text/plain", + "UTF8_STRING", + "STRING", + "TEXT" +}; + +static void clip_wl_receive_data(Clipboard_T *cbd, + const char *mime_type, int fd); +static void clip_wl_send_data(const char *mime_type, int fd, + wayland_selection_T); +static void clip_wl_selection_cancelled(wayland_selection_T selection); + +#if defined(USE_SYSTEM) && defined(PROTO) +static int clip_wl_owner_exists(Clipboard_T *cbd); +#endif + +#endif + /* * Selection stuff using Visual mode, for cutting and pasting text to other * windows. @@ -50,6 +76,10 @@ clip_init(int can_use) cb = &clip_star; for (;;) { + // No need to init again if cbd is already available + if (can_use && cb->available) + goto skip; + cb->available = can_use; cb->owned = FALSE; cb->start.lnum = 0; @@ -58,6 +88,7 @@ clip_init(int can_use) cb->end.col = 0; cb->state = SELECT_CLEARED; +skip: if (cb == &clip_plus) break; cb = &clip_plus; @@ -109,13 +140,27 @@ clip_update_selection(Clipboard_T *clip) static int clip_gen_own_selection(Clipboard_T *cbd) { -#ifdef FEAT_XCLIPBOARD +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_WAYLAND_CLIPBOARD) # ifdef FEAT_GUI if (gui.in_use) return clip_mch_own_selection(cbd); else # endif - return clip_xterm_own_selection(cbd); + { + if (clipmethod == CLIPMETHOD_WAYLAND) + { +#ifdef FEAT_WAYLAND_CLIPBOARD + return clip_wl_own_selection(cbd); +#endif + } + else if (clipmethod == CLIPMETHOD_X11) + { +#ifdef FEAT_XCLIPBOARD + return clip_xterm_own_selection(cbd); +#endif + } + } + return FAIL; #else return clip_mch_own_selection(cbd); #endif @@ -128,7 +173,7 @@ clip_own_selection(Clipboard_T *cbd) * Also want to check somehow that we are reading from the keyboard rather * than a mapping etc. */ -#ifdef FEAT_X11 +#if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD) // Always own the selection, we might have lost it without being // notified, e.g. during a ":sh" command. if (cbd->available) @@ -160,13 +205,26 @@ clip_own_selection(Clipboard_T *cbd) static void clip_gen_lose_selection(Clipboard_T *cbd) { -#ifdef FEAT_XCLIPBOARD +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_WAYLAND_CLIPBOARD) # ifdef FEAT_GUI if (gui.in_use) clip_mch_lose_selection(cbd); else # endif - clip_xterm_lose_selection(cbd); + { + if (clipmethod == CLIPMETHOD_WAYLAND) + { +#ifdef FEAT_WAYLAND_CLIPBOARD + clip_wl_lose_selection(cbd); +#endif + } + else if (clipmethod == CLIPMETHOD_X11) + { +#ifdef FEAT_XCLIPBOARD + clip_xterm_lose_selection(cbd); +#endif + } + } #else clip_mch_lose_selection(cbd); #endif @@ -196,9 +254,9 @@ clip_lose_selection(Clipboard_T *cbd) // windows on the current buffer. if (was_owned && (get_real_state() == MODE_VISUAL - || get_real_state() == MODE_SELECT) + || get_real_state() == MODE_SELECT) && (cbd == &clip_star ? - clip_isautosel_star() : clip_isautosel_plus()) + clip_isautosel_star() : clip_isautosel_plus()) && HL_ATTR(HLF_V) != HL_ATTR(HLF_VNC) && !exiting) { @@ -1199,13 +1257,26 @@ clip_gen_set_selection(Clipboard_T *cbd) return; } } -#ifdef FEAT_XCLIPBOARD +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_WAYLAND_CLIPBOARD) # ifdef FEAT_GUI if (gui.in_use) clip_mch_set_selection(cbd); else # endif - clip_xterm_set_selection(cbd); + { + if (clipmethod == CLIPMETHOD_WAYLAND) + { +#ifdef FEAT_WAYLAND_CLIPBOARD + clip_wl_set_selection(cbd); +#endif + } + else if (clipmethod == CLIPMETHOD_X11) + { +#ifdef FEAT_XCLIPBOARD + clip_xterm_set_selection(cbd); +#endif + } + } #else clip_mch_set_selection(cbd); #endif @@ -1214,13 +1285,26 @@ clip_gen_set_selection(Clipboard_T *cbd) static void clip_gen_request_selection(Clipboard_T *cbd) { -#ifdef FEAT_XCLIPBOARD +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_WAYLAND_CLIPBOARD) # ifdef FEAT_GUI if (gui.in_use) clip_mch_request_selection(cbd); else # endif - clip_xterm_request_selection(cbd); + { + if (clipmethod == CLIPMETHOD_WAYLAND) + { +#ifdef FEAT_WAYLAND_CLIPBOARD + clip_wl_request_selection(cbd); +#endif + } + else if (clipmethod == CLIPMETHOD_X11) + { +#ifdef FEAT_XCLIPBOARD + clip_xterm_request_selection(cbd); +#endif + } + } #else clip_mch_request_selection(cbd); #endif @@ -1235,7 +1319,8 @@ clip_x11_owner_exists(Clipboard_T *cbd) } #endif -#if (defined(FEAT_X11) && defined(USE_SYSTEM)) || defined(PROTO) +#if ((defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD)) \ + && defined(USE_SYSTEM)) || defined(PROTO) int clip_gen_owner_exists(Clipboard_T *cbd UNUSED) { @@ -1245,7 +1330,22 @@ clip_gen_owner_exists(Clipboard_T *cbd UNUSED) return clip_gtk_owner_exists(cbd); else # endif - return clip_x11_owner_exists(cbd); + { + if (clipmethod == CLIPMETHOD_WAYLAND) + { +#ifdef FEAT_WAYLAND_CLIPBOARD + return clip_wl_owner_exists(cbd); +#endif + } + else if (clipmethod == CLIPMETHOD_X11) + { +#ifdef FEAT_XCLIPBOARD + return clip_x11_owner_exists(cbd); +#endif + } + else + return FALSE; + } #else return TRUE; #endif @@ -2225,11 +2325,557 @@ adjust_clip_reg(int *rp) && clip_plus.available) ? '+' : '*'; } if ((!clip_star.available && *rp == '*') || - (!clip_plus.available && *rp == '+')) + (!clip_plus.available && *rp == '+')) { msg_warn_missing_clipboard(); *rp = 0; } } +#if defined(FEAT_WAYLAND_CLIPBOARD) || defined(PROTO) + +/* + * Read data from a file descriptor and write it to the given clipboard. + */ + static void +clip_wl_receive_data(Clipboard_T *cbd, const char *mime_type, int fd) +{ + char_u *start, *buf, *tmp, *final, *enc; + int motion_type = MAUTO; + ssize_t r = 0; + size_t total = 0, max_total = 4096; // Initial buffer size, 4096 + // bytes seems reasonable. +#ifndef HAVE_SELECT + struct pollfd pfd + + pfd.fd = fd, + pfd.events = POLLIN +#else + fd_set rfds; + struct timeval tv; + + FD_ZERO(&rfds); + FD_SET(fd, &rfds); + tv.tv_sec = 0; + tv.tv_usec = p_wtm * 1000; +#endif + + // Make pipe (read end) non-blocking + if (fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK) == -1) + return; + + if ((buf = alloc_clear(max_total)) == NULL) + return; + start = buf; + + // Only poll before reading when we first start, then we do non-blocking + // reads and check for EAGAIN or EINTR to signal to poll again. + goto poll_data; + + while (errno = 0, TRUE) + { + r = read(fd, start, max_total - 1 - total); + + if (r == 0) + break; + else if (r < 0) + { + if (errno == EAGAIN || errno == EINTR) + { +poll_data: +#ifndef HAVE_SELECT + if (poll(&pfd, 1, p_wtm) > 0) +#else + if (select(fd + 1, &rfds, NULL, NULL, &tv) > 0) +#endif + continue; + } + break; + } + + start += r; + total += (size_t)r; + + // Realloc if we are at the end of the buffer + if (total >= max_total - 1) + { + tmp = vim_realloc(buf, max_total * 2); + if (tmp == NULL) + break; + max_total *= 2; // Double buffer size each time + buf = tmp; + start = buf + total; + // Zero out the newly allocated memory part + vim_memset(buf + total, 0, max_total - total); + } + } + + if (total == 0) + { + clip_free_selection(cbd); // Nothing received, clear register + vim_free(buf); + return; + } + + final = buf; + + if (STRCMP(mime_type, VIM_ATOM_NAME) == 0 && total >= 2) + { + motion_type = *final++;; + total--; + } + else if (STRCMP(mime_type, VIMENC_ATOM_NAME) == 0 && total >= 3) + { + vimconv_T conv; + int convlen; + + // first byte is motion type + motion_type = *final++; + total--; + + // Get encoding of selection + enc = final; + + // Skip the encoding type including null terminator in final text + final += STRLEN(final) + 1; + + // Subtract pointers to get length of encoding; + total -= final - enc; + + conv.vc_type = CONV_NONE; + convert_setup(&conv, enc, p_enc); + if (conv.vc_type != CONV_NONE) + { + convlen = total; + tmp = string_convert(&conv, final, &convlen); + total = convlen; + if (tmp != NULL) + final = tmp; + convert_setup(&conv, NULL, NULL); + } + } + + clip_yank_selection(motion_type, final, (long)total, cbd); + vim_free(buf); +} + +/* + * Get the current selection and fill the respective register for cbd with the + * data. + */ + void +clip_wl_request_selection(Clipboard_T *cbd) +{ + wayland_selection_T selection; + garray_T *mime_types; + int len; + int fd; + const char *chosen_mime = NULL; + + if (cbd == &clip_star) + selection = WAYLAND_SELECTION_PRIMARY; + else if (cbd == &clip_plus) + selection = WAYLAND_SELECTION_REGULAR; + else + return; + + // Get mime types that the source client offers + mime_types = wayland_cb_get_mime_types(selection); + + if (mime_types == NULL || mime_types->ga_len == 0) + { + // Selection is empty/cleared + clip_free_selection(cbd); + return; + } + + len = ARRAY_LENGTH(supported_mimes); + + // Loop through and pick the one we want to receive from + for (int i = 0; i < len && chosen_mime == NULL; i++) + { + for (int k = 0; k < mime_types->ga_len && chosen_mime == NULL; k++) + { + char *mime_type = ((char**)mime_types->ga_data)[k]; + + if (STRCMP(mime_type, supported_mimes[i]) == 0) + chosen_mime = supported_mimes[i]; + } + } + if (chosen_mime == NULL) + return; + + fd = wayland_cb_receive_data(chosen_mime, selection); + + if (fd == -1) + return; + + // Start reading the file descriptor returned + clip_wl_receive_data(cbd, chosen_mime, fd); + + close(fd); +} + +/* + * Write data from either the clip or plus register, depending on the given + * selection, to the file descriptor that the receiving client will read from. + */ + static void +clip_wl_send_data( + const char *mime_type, + int fd, + wayland_selection_T selection) +{ + Clipboard_T *cbd; + long_u length; + char_u *string; + ssize_t written = 0; + size_t total = 0; + int did_vimenc = TRUE; + int did_motion_type = TRUE; + int motion_type; + int skip_len_check = FALSE; +#ifndef HAVE_SELECT + struct pollfd pfd + + pfd.fd = fd, + pfd.events = POLLOUT +#else + fd_set wfds; + struct timeval tv; + + FD_ZERO(&wfds); + FD_SET(fd, &wfds); + tv.tv_sec = 0; + tv.tv_usec = p_wtm * 1000; +#endif + if (selection == WAYLAND_SELECTION_REGULAR) + cbd = &clip_plus; + else if (selection == WAYLAND_SELECTION_PRIMARY) + cbd = &clip_star; + else + return; + + // Shouldn't happen unless there is a bug. + if (!cbd->owned) + return; + + // Get the current selection + clip_get_selection(cbd); + motion_type = clip_convert_selection(&string, &length, cbd); + + if (motion_type < 0) + goto exit; + + if (STRCMP(mime_type, VIMENC_ATOM_NAME) == 0) + { + did_vimenc = FALSE; + did_motion_type = FALSE; + } + else if (STRCMP(mime_type, VIM_ATOM_NAME) == 0) + did_motion_type = FALSE; + + while ((total < (size_t)length || skip_len_check) && +#ifndef HAVE_SELECT + poll(&pfd, 1, p_wtm) > 0) +#else + select(fd + 1, NULL, &wfds, NULL, &tv) > 0) +#endif + { + // First byte sent is motion type for vim specific formats + if (!did_motion_type) + { + if (total == 1) + { + total = 0; + did_motion_type = TRUE; + continue; + } + // We cast to char so that we only send one byte + written = write( fd, (char_u*)&motion_type, 1); + skip_len_check = TRUE; + } + else if (!did_vimenc) + { + // For the vimenc format, after the first byte is the encoding type, + // which is null terminated. Make sure we write that before writing + // the actual selection. + if (total == STRLEN(p_enc) + 1) + { + total = 0; + did_vimenc = TRUE; + continue; + } + // Include null terminator + written = write(fd, p_enc + total, STRLEN(p_enc) + 1 - total); + skip_len_check = TRUE; + } + else + { + // write the actual selection to the fd + written = write(fd, string + total, length - total); + if (skip_len_check) + skip_len_check = FALSE; + } + + if (written == -1) + break; + total += written; + } +exit: + vim_free(string); +} + +/* + * Called if another client gains ownership of the given selection. If so then + * lose the selection internally. + */ + static void +clip_wl_selection_cancelled(wayland_selection_T selection) +{ + if (selection == WAYLAND_SELECTION_REGULAR) + clip_lose_selection(&clip_plus); + else if (selection == WAYLAND_SELECTION_PRIMARY) + clip_lose_selection(&clip_star); +} + +/* + * Own the selection that cbd corresponds to. Start listening for requests from + * other Wayland clients so they can receive data from us. Returns OK on success + * and FAIL on failure. + */ + int +clip_wl_own_selection(Clipboard_T *cbd) +{ + wayland_selection_T selection; + + if (cbd == &clip_star) + selection = WAYLAND_SELECTION_PRIMARY; + else if (cbd == &clip_plus) + selection = WAYLAND_SELECTION_REGULAR; + else + return FAIL; + + return wayland_cb_own_selection( + clip_wl_send_data, + clip_wl_selection_cancelled, + supported_mimes, + sizeof(supported_mimes)/sizeof(*supported_mimes), + selection); +} + +/* + * Disown the selection that cbd corresponds to. Note that the the cancelled + * event is not sent when the data source is destroyed. + */ + void +clip_wl_lose_selection(Clipboard_T *cbd) +{ + if (cbd == &clip_plus) + wayland_cb_lose_selection(WAYLAND_SELECTION_REGULAR); + else if (cbd == &clip_star) + wayland_cb_lose_selection(WAYLAND_SELECTION_PRIMARY); + + /* wayland_cb_lose_selection(selection); */ +} + +/* + * Send the current selection to the clipboard. Do nothing for Wayland because + * we will fill in the selection only when requested by another client. + */ + void +clip_wl_set_selection(Clipboard_T *cbd UNUSED) +{ +} + +#if defined(USE_SYSTEM) && defined(PROTO) +/* + * Return TRUE if we own the selection corresponding to cbd + */ + static int +clip_wl_owner_exists(Clipboard_T *cbd) +{ + if (cbd == &clip_plus) + return wayland_cb_selection_is_owned(WAYLAND_SELECTION_REGULAR); + else if (cbd == &clip_star) + return wayland_cb_selection_is_owned(WAYLAND_SELECTION_PRIMARY); +} +#endif + +#endif // FEAT_WAYLAND_CLIPBOARD + + +/* + * Returns the first method for accessing the clipboard that is available/works, + * depending on the order of values in str. + */ + static clipmethod_T +get_clipmethod(char_u *str) +{ + int len = (int)STRLEN(str) + 1; + char_u *buf = alloc(len); + + if (buf == NULL) + return CLIPMETHOD_FAIL; + + clipmethod_T ret = CLIPMETHOD_FAIL; + char_u *p = str; + + while (*p != NUL) + { + clipmethod_T method = CLIPMETHOD_NONE; + + (void)copy_option_part(&p, buf, len, ","); + + if (STRCMP(buf, "wayland") == 0) + { +#ifdef FEAT_WAYLAND_CLIPBOARD + if (wayland_cb_is_ready()) + method = CLIPMETHOD_WAYLAND; +#endif + } + else if (STRCMP(buf, "x11") == 0) + { +#ifdef FEAT_XCLIPBOARD + // x_IOerror_handler() in os_unix.c should set xterm_dpy to NULL if + // we lost connection to the X server. + if (xterm_dpy != NULL) + { + // If the X connection is lost then that handler will longjmp + // somewhere else, in that case we will call choose_clipmethod() + // again from there, and this if block won't be executed since + // xterm_dpy will be set to NULL. + xterm_update(); + method = CLIPMETHOD_X11; + } +#endif + } + else + { + ret = CLIPMETHOD_FAIL; + goto exit; + } + + // Keep on going in order to catch errors + if (method != CLIPMETHOD_NONE && ret == CLIPMETHOD_FAIL) + ret = method; + } + + // No match found, use "none". + ret = (ret == CLIPMETHOD_FAIL) ? CLIPMETHOD_NONE : ret; + +exit: + vim_free(buf); + return ret; +} + + +/* + * Returns name of clipmethod in a statically allocated string. + */ + static char * +clipmethod_to_str(clipmethod_T method) +{ + switch(method) + { + case CLIPMETHOD_WAYLAND: + return "wayland"; + case CLIPMETHOD_X11: + return "x11"; + default: + return "none"; + } +} + +/* + * Sets the current clipmethod to use given by `get_clipmethod()`. Returns an + * error message on failure else NULL. + */ + char * +choose_clipmethod(void) +{ + // We call get_clipmethod first so that we can catch any errors, even if + // clipmethod is useless + clipmethod_T method = get_clipmethod(p_cpm); + + if (method == CLIPMETHOD_FAIL) + return e_invalid_argument; + +// If GUI is running or we are not on a system with Wayland or X11, then always +// return CLIPMETHOD_NONE. System or GUI clipboard handling always overrides. +#if defined(FEAT_XCLIPBOARD) || defined(FEAT_WAYLAND_CLIPBOARD) +#if defined(FEAT_GUI) + if (gui.in_use) + { +#ifdef FEAT_WAYLAND + // We only interact with Wayland for the clipboard, we can just deinit + // everything. + wayland_uninit_client(); +#endif + + method = CLIPMETHOD_NONE; + goto lose_sel_exit; + } +#endif +#else + // If on a system like windows or macos, then clipmethod is irrelevant, we + // use their way of accessing the clipboard. + method = CLIPMETHOD_NONE; + goto exit; +#endif + + // Deinitialize clipboard if there is no way to access clipboard + if (method == CLIPMETHOD_NONE) + clip_init(FALSE); + // If we have a clipmethod that works now, then initialize clipboard + else if (clipmethod == CLIPMETHOD_NONE + && method != CLIPMETHOD_NONE) + { + clip_init(TRUE); + did_warn_clipboard = FALSE; + } + + // Disown clipboard if we are switching to a new method + if (clipmethod != CLIPMETHOD_NONE && method != clipmethod) + { +#if (defined(FEAT_XCLIPBOARD) || defined(FEAT_WAYLAND_CLIPBOARD)) \ + && defined(FEAT_GUI) +lose_sel_exit: +#endif + if (clip_star.owned) + clip_lose_selection(&clip_star); + if (clip_plus.owned) + clip_lose_selection(&clip_plus); + } + +#if !defined(FEAT_XCLIPBOARD) && !defined(FEAT_WAYLAND_CLIPBOARD) +exit: +#endif + + clipmethod = method; + +#ifdef FEAT_EVAL + set_vim_var_string(VV_CLIPMETHOD, (char_u*)clipmethod_to_str(method), -1); +#endif + + return NULL; +} + +/* + * Call choose_clipmethod(). + */ + void +ex_clipreset(exarg_T *eap UNUSED) +{ + clipmethod_T prev = clipmethod; + + choose_clipmethod(); + + if (clipmethod == CLIPMETHOD_NONE) + smsg(_("Could not find a way to access the clipboard.")); + else if (clipmethod != prev) + smsg(_("Switched to clipboard method '%s'."), + clipmethod_to_str(clipmethod)); +} + #endif // FEAT_CLIPBOARD diff --git a/src/cmdexpand.c b/src/cmdexpand.c index dbd4cfa7fb..3c3d1f2275 100644 --- a/src/cmdexpand.c +++ b/src/cmdexpand.c @@ -14,6 +14,8 @@ #include "vim.h" static int cmd_showtail; // Only show path tail in lists ? +static int may_expand_pattern = FALSE; +static pos_T pre_incsearch_pos; // Cursor position when incsearch started static void set_context_for_wildcard_arg(exarg_T *eap, char_u *arg, int usefilter, expand_T *xp, int *complp); static int ExpandFromContext(expand_T *xp, char_u *, char_u ***, int *, int); @@ -24,6 +26,7 @@ static int expand_shellcmd(char_u *filepat, char_u ***matches, int *numMatches, static int ExpandUserDefined(char_u *pat, expand_T *xp, regmatch_T *regmatch, char_u ***matches, int *numMatches); static int ExpandUserList(expand_T *xp, char_u ***matches, int *numMatches); #endif +static int expand_pattern_in_buf(char_u *pat, int dir, char_u ***matches, int *numMatches); // "compl_match_array" points the currently displayed list of entries in the // popup menu. It is NULL when there is no popup menu. @@ -32,6 +35,8 @@ static int compl_match_arraysize; // First column in cmdline of the matched item for completion. static int compl_startcol; static int compl_selected; +// cmdline before expansion +static char_u *cmdline_orig = NULL; #define SHOW_MATCH(m) (showtail ? showmatches_gettail(matches[m]) : matches[m]) @@ -42,29 +47,38 @@ static int compl_selected; static int cmdline_fuzzy_completion_supported(expand_T *xp) { - return (vim_strchr(p_wop, WOP_FUZZY) != NULL - && xp->xp_context != EXPAND_BOOL_SETTINGS - && xp->xp_context != EXPAND_COLORS - && xp->xp_context != EXPAND_COMPILER - && xp->xp_context != EXPAND_DIRECTORIES - && xp->xp_context != EXPAND_DIRS_IN_CDPATH - && xp->xp_context != EXPAND_FILES - && xp->xp_context != EXPAND_FILES_IN_PATH - && xp->xp_context != EXPAND_FILETYPE - && xp->xp_context != EXPAND_FINDFUNC - && xp->xp_context != EXPAND_HELP - && xp->xp_context != EXPAND_KEYMAP - && xp->xp_context != EXPAND_OLD_SETTING - && xp->xp_context != EXPAND_STRING_SETTING - && xp->xp_context != EXPAND_SETTING_SUBTRACT - && xp->xp_context != EXPAND_OWNSYNTAX - && xp->xp_context != EXPAND_PACKADD - && xp->xp_context != EXPAND_RUNTIME - && xp->xp_context != EXPAND_SHELLCMD - && xp->xp_context != EXPAND_SHELLCMDLINE - && xp->xp_context != EXPAND_TAGS - && xp->xp_context != EXPAND_TAGS_LISTFILES - && xp->xp_context != EXPAND_USER_LIST); + switch (xp->xp_context) + { + case EXPAND_BOOL_SETTINGS: + case EXPAND_COLORS: + case EXPAND_COMPILER: + case EXPAND_DIRECTORIES: + case EXPAND_DIRS_IN_CDPATH: + case EXPAND_FILES: + case EXPAND_FILES_IN_PATH: + case EXPAND_FILETYPE: + case EXPAND_FILETYPECMD: + case EXPAND_FINDFUNC: + case EXPAND_HELP: + case EXPAND_KEYMAP: + case EXPAND_OLD_SETTING: + case EXPAND_STRING_SETTING: + case EXPAND_SETTING_SUBTRACT: + case EXPAND_OWNSYNTAX: + case EXPAND_PACKADD: + case EXPAND_RUNTIME: + case EXPAND_SHELLCMD: + case EXPAND_SHELLCMDLINE: + case EXPAND_TAGS: + case EXPAND_TAGS_LISTFILES: + case EXPAND_USER_LIST: + return FALSE; + + default: + break; + } + + return vim_strchr(p_wop, WOP_FUZZY) != NULL; } /* @@ -222,14 +236,13 @@ nextwild( int escape) // if TRUE, escape the returned matches { cmdline_info_T *ccline = get_cmdline_info(); - int i, j; - char_u *p1; - char_u *p2; - int difflen; - int v; + int i; + char_u *p; + int from_wildtrigger_func = options & WILD_FUNC_TRIGGER; if (xp->xp_numfiles == -1) { + pre_incsearch_pos = xp->xp_pre_incsearch_pos; #ifdef FEAT_EVAL if (ccline->input_fn && ccline->xp_context == EXPAND_COMMANDS) { @@ -239,7 +252,9 @@ nextwild( else #endif { + may_expand_pattern = options & WILD_MAY_EXPAND_PATTERN; set_expand_context(xp); + may_expand_pattern = FALSE; } cmd_showtail = expand_showtail(xp); } @@ -255,66 +270,81 @@ nextwild( return FAIL; } + i = (int)(xp->xp_pattern - ccline->cmdbuff); + xp->xp_pattern_len = ccline->cmdpos - i; + + // Skip showing matches if prefix is invalid during wildtrigger() + if (from_wildtrigger_func && xp->xp_context == EXPAND_COMMANDS + && xp->xp_pattern_len == 0) + return FAIL; + // If cmd_silent is set then don't show the dots, because redrawcmd() below // won't remove them. - if (!cmd_silent) + if (!cmd_silent && !from_wildtrigger_func) { msg_puts("..."); // show that we are busy out_flush(); } - i = (int)(xp->xp_pattern - ccline->cmdbuff); - xp->xp_pattern_len = ccline->cmdpos - i; - if (type == WILD_NEXT || type == WILD_PREV || type == WILD_PAGEUP || type == WILD_PAGEDOWN) { // Get next/previous match for a previous expanded pattern. - p2 = ExpandOne(xp, NULL, NULL, 0, type); + p = ExpandOne(xp, NULL, NULL, 0, type); } else { - if (cmdline_fuzzy_completion_supported(xp)) - // If fuzzy matching, don't modify the search string - p1 = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len); + char_u *tmp; + + if (cmdline_fuzzy_completion_supported(xp) + || xp->xp_context == EXPAND_PATTERN_IN_BUF) + // Don't modify the search string + tmp = vim_strnsave(xp->xp_pattern, xp->xp_pattern_len); else - p1 = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); + tmp = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); // Translate string into pattern and expand it. - if (p1 == NULL) - p2 = NULL; + if (tmp == NULL) + p = NULL; else { int use_options = options | WILD_HOME_REPLACE|WILD_ADD_SLASH|WILD_SILENT; if (use_options & WILD_KEEP_SOLE_ITEM) use_options &= ~WILD_KEEP_SOLE_ITEM; - if (escape) use_options |= WILD_ESCAPE; - if (p_wic) use_options += WILD_ICASE; - p2 = ExpandOne(xp, p1, + + p = ExpandOne(xp, tmp, vim_strnsave(&ccline->cmdbuff[i], xp->xp_pattern_len), use_options, type); - vim_free(p1); + vim_free(tmp); // longest match: make sure it is not shorter, happens with :help - if (p2 != NULL && type == WILD_LONGEST) + if (p != NULL && type == WILD_LONGEST) { + int j; + for (j = 0; j < xp->xp_pattern_len; ++j) - if (ccline->cmdbuff[i + j] == '*' - || ccline->cmdbuff[i + j] == '?') - break; - if ((int)STRLEN(p2) < j) - VIM_CLEAR(p2); + { + char_u c = ccline->cmdbuff[i + j]; + if (c == '*' || c == '?') + break; + } + if ((int)STRLEN(p) < j) + VIM_CLEAR(p); } } } - if (p2 != NULL && !got_int) + if (p != NULL && !got_int) { - difflen = (int)STRLEN(p2) - xp->xp_pattern_len; + size_t plen = STRLEN(p); + int difflen; + int v; + + difflen = (int)plen - xp->xp_pattern_len; if (ccline->cmdlen + difflen + 4 > ccline->cmdbufflen) { v = realloc_cmdbuff(ccline->cmdlen + difflen + 4); @@ -327,27 +357,28 @@ nextwild( mch_memmove(&ccline->cmdbuff[ccline->cmdpos + difflen], &ccline->cmdbuff[ccline->cmdpos], (size_t)(ccline->cmdlen - ccline->cmdpos + 1)); - mch_memmove(&ccline->cmdbuff[i], p2, STRLEN(p2)); + mch_memmove(&ccline->cmdbuff[i], p, plen); ccline->cmdlen += difflen; ccline->cmdpos += difflen; } } - vim_free(p2); redrawcmd(); cursorcmd(); // When expanding a ":map" command and no matches are found, assume that // the key is supposed to be inserted literally - if (xp->xp_context == EXPAND_MAPPINGS && p2 == NULL) + if (xp->xp_context == EXPAND_MAPPINGS && p == NULL) return FAIL; - if (xp->xp_numfiles <= 0 && p2 == NULL) + if (xp->xp_numfiles <= 0 && p == NULL) beep_flush(); else if (xp->xp_numfiles == 1 && !(options & WILD_KEEP_SOLE_ITEM)) // free expanded pattern (void)ExpandOne(xp, NULL, NULL, 0, WILD_FREE); + vim_free(p); + return OK; } @@ -367,8 +398,11 @@ cmdline_pum_create( int columns; // Add all the completion matches + compl_match_array = ALLOC_MULT(pumitem_T, numMatches); + if (compl_match_array == NULL) + return EXPAND_UNSUCCESSFUL; + compl_match_arraysize = numMatches; - compl_match_array = ALLOC_MULT(pumitem_T, compl_match_arraysize); for (i = 0; i < numMatches; i++) { compl_match_array[i].pum_text = SHOW_MATCH(i); @@ -380,7 +414,7 @@ cmdline_pum_create( } // Compute the popup menu starting column - compl_startcol = vim_strsize(ccline->cmdbuff) + 1; + compl_startcol = ccline == NULL ? 0 : vim_strsize(ccline->cmdbuff) + 1; columns = vim_strsize(xp->xp_pattern); if (showtail) { @@ -392,6 +426,7 @@ cmdline_pum_create( // no default selection compl_selected = -1; + pum_clear(); cmdline_pum_display(); return EXPAND_OK; @@ -432,6 +467,7 @@ cmdline_pum_remove(cmdline_info_T *cclp UNUSED) pum_undisplay(); VIM_CLEAR(compl_match_array); + compl_match_arraysize = 0; p_lz = FALSE; // avoid the popup menu hanging around update_screen(0); p_lz = save_p_lz; @@ -487,12 +523,14 @@ cmdline_compl_is_fuzzy(void) /* * Return the number of characters that should be skipped in a status match. - * These are backslashes used for escaping. Do show backslashes in help tags. + * These are backslashes used for escaping. Do show backslashes in help tags + * and in search pattern completion matches. */ static int skip_status_match_char(expand_T *xp, char_u *s) { - if ((rem_backslash(s) && xp->xp_context != EXPAND_HELP) + if ((rem_backslash(s) && xp->xp_context != EXPAND_HELP + && xp->xp_context != EXPAND_PATTERN_IN_BUF) #ifdef FEAT_MENU || ((xp->xp_context == EXPAND_MENUS || xp->xp_context == EXPAND_MENUNAMES) @@ -664,7 +702,7 @@ win_redr_status_matches( } else #endif - for ( ; *s != NUL; ++s) + for ( ; *s != NUL; ++s) { s += skip_status_match_char(xp, s); clen += ptr2cells(s); @@ -923,14 +961,14 @@ find_longest_match(expand_T *xp, int options) if (has_mbyte) { mb_len = (*mb_ptr2len)(&xp->xp_files[0][len]); - c0 =(* mb_ptr2char)(&xp->xp_files[0][len]); + c0 = (*mb_ptr2char)(&xp->xp_files[0][len]); } else c0 = xp->xp_files[0][len]; for (i = 1; i < xp->xp_numfiles; ++i) { if (has_mbyte) - ci =(* mb_ptr2char)(&xp->xp_files[i][len]); + ci = (*mb_ptr2char)(&xp->xp_files[i][len]); else ci = xp->xp_files[i][len]; if (p_fic && (xp->xp_context == EXPAND_DIRECTORIES @@ -1008,8 +1046,6 @@ ExpandOne( { char_u *ss = NULL; int orig_saved = FALSE; - int i; - long_u len; // first handle the case of using an old match if (mode == WILD_NEXT || mode == WILD_PREV @@ -1059,35 +1095,41 @@ ExpandOne( // and the result probably won't be used. if (mode == WILD_ALL && xp->xp_numfiles > 0 && !got_int) { - len = 0; - for (i = 0; i < xp->xp_numfiles; ++i) + size_t ss_size = 0; + char *prefix = ""; + char *suffix = (options & WILD_USE_NL) ? "\n" : " "; + int n = xp->xp_numfiles - 1; + int i; + + if (xp->xp_prefix == XP_PREFIX_NO) { - if (i > 0) - { - if (xp->xp_prefix == XP_PREFIX_NO) - len += 2; // prefix "no" - else if (xp->xp_prefix == XP_PREFIX_INV) - len += 3; // prefix "inv" - } - len += (long_u)STRLEN(xp->xp_files[i]) + 1; + prefix = "no"; + ss_size = STRLEN_LITERAL("no") * n; } - ss = alloc(len); + else if (xp->xp_prefix == XP_PREFIX_INV) + { + prefix = "inv"; + ss_size = STRLEN_LITERAL("inv") * n; + } + + for (i = 0; i < xp->xp_numfiles; ++i) + ss_size += STRLEN(xp->xp_files[i]) + 1; // +1 for the suffix + ++ss_size; // +1 for the NUL + + ss = alloc(ss_size); if (ss != NULL) { - *ss = NUL; + size_t ss_len = 0; + for (i = 0; i < xp->xp_numfiles; ++i) { - if (i > 0) - { - if (xp->xp_prefix == XP_PREFIX_NO) - STRCAT(ss, "no"); - else if (xp->xp_prefix == XP_PREFIX_INV) - STRCAT(ss, "inv"); - } - STRCAT(ss, xp->xp_files[i]); - - if (i != xp->xp_numfiles - 1) - STRCAT(ss, (options & WILD_USE_NL) ? "\n" : " "); + ss_len += vim_snprintf_safelen( + (char *)ss + ss_len, + ss_size - ss_len, + "%s%s%s", + (i > 0) ? prefix : "", + (char *)xp->xp_files[i], + (i < n) ? suffix : ""); } } } @@ -1128,6 +1170,12 @@ ExpandCleanup(expand_T *xp) VIM_CLEAR(xp->xp_orig); } + void +clear_cmdline_orig(void) +{ + VIM_CLEAR(cmdline_orig); +} + /* * Display one line of completion matches. Multiple matches are displayed in * each line (used by wildmode=list and CTRL-D) @@ -1238,6 +1286,13 @@ showmatches(expand_T *xp, int wildmenu UNUSED) int attr; int showtail; + // Save cmdline before expansion + if (ccline->cmdbuff != NULL) + { + vim_free(cmdline_orig); + cmdline_orig = vim_strnsave(ccline->cmdbuff, ccline->cmdlen); + } + if (xp->xp_numfiles == -1) { set_expand_context(xp); @@ -1577,23 +1632,40 @@ addstar( * names in expressions, eg :while s^I * EXPAND_ENV_VARS Complete environment variable names * EXPAND_USER Complete user names + * EXPAND_PATTERN_IN_BUF Complete pattern in '/', '?', ':s', ':g', etc. */ void set_expand_context(expand_T *xp) { - cmdline_info_T *ccline = get_cmdline_info(); + cmdline_info_T *ccline = get_cmdline_info(); - // only expansion for ':', '>' and '=' command-lines + // Handle search commands: '/' or '?' + if ((ccline->cmdfirstc == '/' || ccline->cmdfirstc == '?') + && may_expand_pattern) + { + xp->xp_context = EXPAND_PATTERN_IN_BUF; + xp->xp_search_dir = (ccline->cmdfirstc == '/') ? FORWARD : BACKWARD; + xp->xp_pattern = ccline->cmdbuff; + xp->xp_pattern_len = ccline->cmdpos; +#ifdef FEAT_SEARCH_EXTRA + search_first_line = 0; // Search entire buffer +#endif + return; + } + + // Only handle ':', '>', or '=' command-lines, or expression input if (ccline->cmdfirstc != ':' #ifdef FEAT_EVAL && ccline->cmdfirstc != '>' && ccline->cmdfirstc != '=' && !ccline->input_fn #endif - ) + ) { xp->xp_context = EXPAND_NOTHING; return; } + + // Fallback to command-line expansion set_cmd_context(xp, ccline->cmdbuff, ccline->cmdlen, ccline->cmdpos, TRUE); } @@ -2042,6 +2114,18 @@ set_context_in_lang_cmd(expand_T *xp, char_u *arg) } #endif +static enum +{ + EXP_FILETYPECMD_ALL, // expand all :filetype values + EXP_FILETYPECMD_PLUGIN, // expand plugin on off + EXP_FILETYPECMD_INDENT, // expand indent on off + EXP_FILETYPECMD_ONOFF, // expand on off +} filetype_expand_what; + +#define EXPAND_FILETYPECMD_PLUGIN 0x01 +#define EXPAND_FILETYPECMD_INDENT 0x02 +#define EXPAND_FILETYPECMD_ONOFF 0x04 + #ifdef FEAT_EVAL static enum { @@ -2127,6 +2211,81 @@ set_context_in_scriptnames_cmd(expand_T *xp, char_u *arg) } #endif +/* + * Set the completion context for the :filetype command. Always returns NULL. + */ + static char_u * +set_context_in_filetype_cmd(expand_T *xp, char_u *arg) +{ + char_u *p; + int val = 0; + + xp->xp_context = EXPAND_FILETYPECMD; + xp->xp_pattern = arg; + filetype_expand_what = EXP_FILETYPECMD_ALL; + + p = skipwhite(arg); + if (*p == NUL) + return NULL; + + for (;;) + { + if (STRNCMP(p, "plugin", 6) == 0) + { + val |= EXPAND_FILETYPECMD_PLUGIN; + p = skipwhite(p + 6); + continue; + } + if (STRNCMP(p, "indent", 6) == 0) + { + val |= EXPAND_FILETYPECMD_INDENT; + p = skipwhite(p + 6); + continue; + } + break; + } + + if ((val & EXPAND_FILETYPECMD_PLUGIN) && (val & EXPAND_FILETYPECMD_INDENT)) + filetype_expand_what = EXP_FILETYPECMD_ONOFF; + else if ((val & EXPAND_FILETYPECMD_PLUGIN)) + filetype_expand_what = EXP_FILETYPECMD_INDENT; + else if ((val & EXPAND_FILETYPECMD_INDENT)) + filetype_expand_what = EXP_FILETYPECMD_PLUGIN; + + xp->xp_pattern = p; + + return NULL; +} + +/* + * Sets the completion context for commands that involve a search pattern + * and a line range (e.g., :s, :g, :v). + */ + static void +set_context_with_pattern(expand_T *xp) +{ + int skiplen = 0; + cmdline_info_T *ccline = get_cmdline_info(); +#ifdef FEAT_SEARCH_EXTRA + int dummy, patlen, retval; + + ++emsg_off; + retval = parse_pattern_and_range(&pre_incsearch_pos, &dummy, &skiplen, + &patlen); + --emsg_off; + + // Check if cursor is within search pattern + if (!retval || ccline->cmdpos <= skiplen + || ccline->cmdpos > skiplen + patlen) + return; +#endif + + xp->xp_pattern = ccline->cmdbuff + skiplen; + xp->xp_pattern_len = ccline->cmdpos - skiplen; + xp->xp_context = EXPAND_PATTERN_IN_BUF; + xp->xp_search_dir = FORWARD; +} + /* * Set the completion context in 'xp' for command 'cmd' with index 'cmdidx'. * The argument to the command is 'arg' and the argument flags is 'argt'. @@ -2145,6 +2304,8 @@ set_context_by_cmdname( int compl, int forceit) { + char_u *nextcmd; + switch (cmdidx) { case CMD_find: @@ -2227,10 +2388,18 @@ set_context_by_cmdname( case CMD_global: case CMD_vglobal: - return find_cmd_after_global_cmd(arg); + nextcmd = find_cmd_after_global_cmd(arg); + if (!nextcmd && may_expand_pattern) + set_context_with_pattern(xp); + return nextcmd; + case CMD_and: case CMD_substitute: - return find_cmd_after_substitute_cmd(arg); + nextcmd = find_cmd_after_substitute_cmd(arg); + if (!nextcmd && may_expand_pattern) + set_context_with_pattern(xp); + return nextcmd; + case CMD_isearch: case CMD_dsearch: case CMD_ilist: @@ -2470,6 +2639,11 @@ set_context_by_cmdname( xp->xp_pattern = arg; break; + case CMD_retab: + xp->xp_context = EXPAND_RETAB; + xp->xp_pattern = arg; + break; + case CMD_messages: xp->xp_context = EXPAND_MESSAGES; xp->xp_pattern = arg; @@ -2508,6 +2682,8 @@ set_context_by_cmdname( case CMD_scriptnames: return set_context_in_scriptnames_cmd(xp, arg); #endif + case CMD_filetype: + return set_context_in_filetype_cmd(xp, arg); default: break; @@ -2815,11 +2991,9 @@ expand_cmdline( // If fuzzy matching, don't modify the search string file_str = vim_strsave(xp->xp_pattern); else - { file_str = addstar(xp->xp_pattern, xp->xp_pattern_len, xp->xp_context); - if (file_str == NULL) - return EXPAND_UNSUCCESSFUL; - } + if (file_str == NULL) + return EXPAND_UNSUCCESSFUL; if (p_wic) options += WILD_ICASE; @@ -2849,36 +3023,69 @@ expand_files_and_dirs( int options) { int free_pat = FALSE; - int i; int ret = FAIL; // for ":set path=" and ":set tags=" halve backslashes for escaped // space if (xp->xp_backslash != XP_BS_NONE) { + size_t pat_len; + char_u *pat_end; + char_u *p; + free_pat = TRUE; - pat = vim_strsave(pat); - for (i = 0; pat[i]; ++i) - if (pat[i] == '\\') + + pat_len = STRLEN(pat); + pat = vim_strnsave(pat, pat_len); + if (pat == NULL) + return ret; + + pat_end = pat + pat_len; + for (p = pat; *p != NUL; ++p) + { + char_u *from; + + if (*p != '\\') + continue; + + if (xp->xp_backslash & XP_BS_THREE + && *(p + 1) == '\\' + && *(p + 2) == '\\' + && *(p + 3) == ' ') { - if (xp->xp_backslash & XP_BS_THREE - && pat[i + 1] == '\\' - && pat[i + 2] == '\\' - && pat[i + 3] == ' ') - STRMOVE(pat + i, pat + i + 3); - else if (xp->xp_backslash & XP_BS_ONE - && pat[i + 1] == ' ') - STRMOVE(pat + i, pat + i + 1); - else if ((xp->xp_backslash & XP_BS_COMMA) - && pat[i + 1] == '\\' - && pat[i + 2] == ',') - STRMOVE(pat + i, pat + i + 2); + from = p + 3; + mch_memmove(p, from, + (size_t)(pat_end - from) + 1); // +1 for NUL + pat_end -= 3; + } + else if (xp->xp_backslash & XP_BS_ONE + && *(p + 1) == ' ') + { + from = p + 1; + mch_memmove(p, from, + (size_t)(pat_end - from) + 1); // +1 for NUL + --pat_end; + } + else if (xp->xp_backslash & XP_BS_COMMA) + { + if (*(p + 1) == '\\' && *(p + 2) == ',') + { + from = p + 2; + mch_memmove(p, from, + (size_t)(pat_end - from) + 1); // +1 for NUL + pat_end -= 2; + } #ifdef BACKSLASH_IN_FILENAME - else if ((xp->xp_backslash & XP_BS_COMMA) - && pat[i + 1] == ',') - STRMOVE(pat + i, pat + i + 1); + else if (*(p + 1) == ',') + { + from = p + 1; + mch_memmove(p, from, + (size_t)(pat_end - from) + 1); // +1 for NUL + --pat_end; + } #endif } + } } if (xp->xp_context == EXPAND_FINDFUNC) @@ -2908,7 +3115,7 @@ expand_files_and_dirs( #ifdef BACKSLASH_IN_FILENAME if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) { - int j; + int j; for (j = 0; j < *numMatches; ++j) { @@ -2942,6 +3149,39 @@ get_behave_arg(expand_T *xp UNUSED, int idx) return NULL; } +/* + * Function given to ExpandGeneric() to obtain the possible arguments of the + * ":filetype {plugin,indent}" command. + */ + static char_u * +get_filetypecmd_arg(expand_T *xp UNUSED, int idx) +{ + if (idx < 0) + return NULL; + + if (filetype_expand_what == EXP_FILETYPECMD_ALL && idx < 4) + { + char *opts_all[] = {"indent", "plugin", "on", "off"}; + return (char_u *)opts_all[idx]; + } + if (filetype_expand_what == EXP_FILETYPECMD_PLUGIN && idx < 3) + { + char *opts_plugin[] = {"plugin", "on", "off"}; + return (char_u *)opts_plugin[idx]; + } + if (filetype_expand_what == EXP_FILETYPECMD_INDENT && idx < 3) + { + char *opts_indent[] = {"indent", "on", "off"}; + return (char_u *)opts_indent[idx]; + } + if (filetype_expand_what == EXP_FILETYPECMD_ONOFF && idx < 2) + { + char *opts_onoff[] = {"on", "off"}; + return (char_u *)opts_onoff[idx]; + } + return NULL; +} + #ifdef FEAT_EVAL /* * Function given to ExpandGeneric() to obtain the possible arguments of the @@ -2951,10 +3191,10 @@ get_behave_arg(expand_T *xp UNUSED, int idx) static char_u * get_breakadd_arg(expand_T *xp UNUSED, int idx) { - char *opts[] = {"expr", "file", "func", "here"}; - if (idx >= 0 && idx <= 3) { + char *opts[] = {"expr", "file", "func", "here"}; + // breakadd {expr, file, func, here} if (breakpt_expand_what == EXP_BREAKPT_ADD) return (char_u *)opts[idx]; @@ -2992,6 +3232,18 @@ get_scriptnames_arg(expand_T *xp UNUSED, int idx) } #endif +/* + * Function given to ExpandGeneric() to obtain the possible arguments of the + * ":retab {-indentonly}" option. + */ + static char_u * +get_retab_arg(expand_T *xp UNUSED, int idx) +{ + if (idx == 0) + return (char_u *)"-indentonly"; + return NULL; +} + /* * Function given to ExpandGeneric() to obtain the possible arguments of the * ":messages {clear}" command. @@ -3033,6 +3285,7 @@ ExpandOther( { {EXPAND_COMMANDS, get_command_name, FALSE, TRUE}, {EXPAND_BEHAVE, get_behave_arg, TRUE, TRUE}, + {EXPAND_FILETYPECMD, get_filetypecmd_arg, TRUE, TRUE}, {EXPAND_MAPCLEAR, get_mapclear_arg, TRUE, TRUE}, {EXPAND_MESSAGES, get_messages_arg, TRUE, TRUE}, {EXPAND_HISTORY, get_history_arg, TRUE, TRUE}, @@ -3081,6 +3334,7 @@ ExpandOther( {EXPAND_BREAKPOINT, get_breakadd_arg, TRUE, TRUE}, {EXPAND_SCRIPTNAMES, get_scriptnames_arg, TRUE, FALSE}, #endif + {EXPAND_RETAB, get_retab_arg, TRUE, TRUE}, #ifdef FEAT_GUI_MACVIM {EXPAND_MACACTION, get_macaction_name, FALSE, FALSE}, #endif @@ -3226,6 +3480,9 @@ ExpandFromContext( return ExpandPackAddDir(pat, numMatches, matches); if (xp->xp_context == EXPAND_RUNTIME) return expand_runtime_cmd(pat, numMatches, matches); + if (xp->xp_context == EXPAND_PATTERN_IN_BUF) + return expand_pattern_in_buf(pat, xp->xp_search_dir, + matches, numMatches); // When expanding a function name starting with s:, match the nr_ // prefix. @@ -3479,28 +3736,17 @@ ExpandGenericExt( */ static void expand_shellcmd_onedir( - char_u *buf, - char_u *s, - size_t l, - char_u *pat, + char_u *pathed_pattern, // fully pathed pattern + size_t pathlen, // length of the path portion of pathed_pattern + // (0 if no path). char_u ***matches, int *numMatches, int flags, hashtab_T *ht, garray_T *gap) { - int ret; - hash_T hash; - hashitem_T *hi; - - vim_strncpy(buf, s, l); - add_pathsep(buf); - l = STRLEN(buf); - vim_strncpy(buf + l, pat, MAXPATHL - 1 - l); - // Expand matches in one directory of $PATH. - ret = expand_wildcards(1, &buf, numMatches, matches, flags); - if (ret != OK) + if (expand_wildcards(1, &pathed_pattern, numMatches, matches, flags) != OK) return; if (ga_grow(gap, *numMatches) == FAIL) @@ -3511,17 +3757,22 @@ expand_shellcmd_onedir( for (int i = 0; i < *numMatches; ++i) { - char_u *name = (*matches)[i]; + char_u *name = (*matches)[i]; + size_t namelen = STRLEN(name); - if (STRLEN(name) > l) + if (namelen > pathlen) { + hash_T hash; + hashitem_T *hi; + // Check if this name was already found. - hash = hash_hash(name + l); - hi = hash_lookup(ht, name + l, hash); + hash = hash_hash(name + pathlen); + hi = hash_lookup(ht, name + pathlen, hash); if (HASHITEM_EMPTY(hi)) { // Remove the path that was prepended. - STRMOVE(name, name + l); + mch_memmove(name, name + pathlen, + (size_t)(namelen - pathlen) + 1); // +1 for NUL ((char_u **)gap->ga_data)[gap->ga_len++] = name; hash_add_item(ht, hi, name, hash); name = NULL; @@ -3544,12 +3795,11 @@ expand_shellcmd( int flagsarg) // EW_ flags { char_u *pat; - int i; + size_t patlen; char_u *path = NULL; int mustfree = FALSE; garray_T ga; char_u *buf; - size_t l; char_u *s, *e; int flags = flagsarg; int did_curdir = FALSE; @@ -3560,16 +3810,31 @@ expand_shellcmd( return FAIL; // for ":set path=" and ":set tags=" halve backslashes for escaped space - pat = vim_strsave(filepat); + patlen = STRLEN(filepat); + pat = vim_strnsave(filepat, patlen); if (pat == NULL) { vim_free(buf); return FAIL; } - for (i = 0; pat[i]; ++i) - if (pat[i] == '\\' && pat[i + 1] == ' ') - STRMOVE(pat + i, pat + i + 1); + // Replace "\ " with " ". + e = pat + patlen; + for (s = pat; *s != NUL; ++s) + { + char_u *p; + + if (*s != '\\') + continue; + + p = s + 1; + if (*p == ' ') + { + mch_memmove(s, p, (size_t)(e - p) + 1); // +1 for NUL + --e; + } + } + patlen = (size_t)(e - pat); flags |= EW_FILE | EW_EXEC | EW_SHELLCMD; @@ -3592,37 +3857,65 @@ expand_shellcmd( hash_init(&found_ht); for (s = path; ; s = e) { -#if defined(MSWIN) - e = vim_strchr(s, ';'); -#else - e = vim_strchr(s, ':'); -#endif - if (e == NULL) - e = s + STRLEN(s); + size_t pathlen; // length of the path portion of buf + // (including trailing slash). + size_t seplen; if (*s == NUL) { if (did_curdir) break; + // Find directories in the current directory, path is empty. did_curdir = TRUE; flags |= EW_DIR; + + e = s; + pathlen = 0; + seplen = 0; } - else if (STRNCMP(s, ".", (int)(e - s)) == 0) + else { - did_curdir = TRUE; - flags |= EW_DIR; +#if defined(MSWIN) + e = vim_strchr(s, ';'); +#else + e = vim_strchr(s, ':'); +#endif + if (e == NULL) + e = s + STRLEN(s); + + pathlen = (size_t)(e - s); + if (STRNCMP(s, ".", pathlen) == 0) + { + did_curdir = TRUE; + flags |= EW_DIR; + } + else + // Do not match directories inside a $PATH item. + flags &= ~EW_DIR; + + seplen = !after_pathsep(s, e) ? STRLEN_LITERAL(PATHSEPSTR) : 0; } - else - // Do not match directories inside a $PATH item. - flags &= ~EW_DIR; - l = e - s; - if (l > MAXPATHL - 5) - break; + // Make sure that the pathed pattern (ie the path and pattern concatenated + // together) will fit inside the buffer. If not skip it and move on to the + // next path. + if (pathlen + seplen + patlen + 1 <= MAXPATHL) + { + if (pathlen > 0) + { + vim_strncpy(buf, s, pathlen); + if (seplen > 0) + { + STRCPY(buf + pathlen, PATHSEPSTR); + pathlen += seplen; + } + } + STRCPY(buf + pathlen, pat); - expand_shellcmd_onedir(buf, s, l, pat, matches, numMatches, flags, - &found_ht, &ga); + expand_shellcmd_onedir(buf, pathlen, matches, numMatches, flags, + &found_ht, &ga); + } if (*e != NUL) ++e; @@ -3745,16 +4038,24 @@ ExpandUserDefined( if (match) { + char_u *p = vim_strnsave(s, (size_t)(e - s)); + if (p == NULL) + break; + if (ga_grow(&ga, 1) == FAIL) + { + vim_free(p); break; + } + if (!fuzzy) - ((char_u **)ga.ga_data)[ga.ga_len] = vim_strnsave(s, e - s); + ((char_u **)ga.ga_data)[ga.ga_len] = p; else { fuzmatch_str_T *fuzmatch = &((fuzmatch_str_T *)ga.ga_data)[ga.ga_len]; fuzmatch->idx = ga.ga_len; - fuzmatch->str = vim_strnsave(s, e - s); + fuzmatch->str = p; fuzmatch->score = score; } ++ga.ga_len; @@ -3806,14 +4107,22 @@ ExpandUserList( // Loop over the items in the list. FOR_ALL_LIST_ITEMS(retlist, li) { + char_u *p; + if (li->li_tv.v_type != VAR_STRING || li->li_tv.vval.v_string == NULL) continue; // Skip non-string items and empty strings + p = vim_strsave(li->li_tv.vval.v_string); + if (p == NULL) + break; + if (ga_grow(&ga, 1) == FAIL) + { + vim_free(p); break; + } - ((char_u **)ga.ga_data)[ga.ga_len] = - vim_strsave(li->li_tv.vval.v_string); + ((char_u **)ga.ga_data)[ga.ga_len] = p; ++ga.ga_len; } list_unref(retlist); @@ -3839,9 +4148,10 @@ globpath( { expand_T xpc; char_u *buf; - int i; - int num_p; - char_u **p; + size_t pathlen; // length of the path portion of buf + // (including trailing slash) + size_t seplen; + size_t filelen; buf = alloc(MAXPATHL); if (buf == NULL) @@ -3850,34 +4160,51 @@ globpath( ExpandInit(&xpc); xpc.xp_context = dirs ? EXPAND_DIRECTORIES : EXPAND_FILES; + filelen = STRLEN(file); + +#if defined(MSWIN) + // Using the platform's path separator (\) makes vim incorrectly + // treat it as an escape character, use '/' instead. + #define TMP_PATHSEPSTR "/" +#else + #define TMP_PATHSEPSTR PATHSEPSTR +#endif + // Loop over all entries in {path}. while (*path != NUL) { // Copy one item of the path to buf[] and concatenate the file name. - copy_option_part(&path, buf, MAXPATHL, ","); - if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL) + pathlen = (size_t)copy_option_part(&path, buf, MAXPATHL, ","); + seplen = (*buf != NUL && !after_pathsep(buf, buf + pathlen)) + ? STRLEN_LITERAL(TMP_PATHSEPSTR) + : 0; + + if (pathlen + seplen + filelen + 1 <= MAXPATHL) { -#if defined(MSWIN) - // Using the platform's path separator (\) makes vim incorrectly - // treat it as an escape character, use '/' instead. - if (*buf != NUL && !after_pathsep(buf, buf + STRLEN(buf))) - STRCAT(buf, "/"); -#else - add_pathsep(buf); -#endif - STRCAT(buf, file); + int num_p; + char_u **p; + + if (seplen > 0) + { + STRCPY(buf + pathlen, TMP_PATHSEPSTR); + pathlen += seplen; + } + STRCPY(buf + pathlen, file); + if (ExpandFromContext(&xpc, buf, &p, &num_p, WILD_SILENT|expand_options) != FAIL && num_p > 0) { ExpandEscape(&xpc, buf, num_p, p, WILD_SILENT|expand_options); if (ga_grow(ga, num_p) == OK) + { // take over the pointers and put them in "ga" - for (i = 0; i < num_p; ++i) + for (int i = 0; i < num_p; ++i) { ((char_u **)ga->ga_data)[ga->ga_len] = p[i]; ++ga->ga_len; } + } vim_free(p); } } @@ -3885,6 +4212,7 @@ globpath( vim_free(buf); } +#undef TMP_PATHSEPSTR /* * Translate some keys pressed when 'wildmenu' is used. @@ -4149,6 +4477,11 @@ wildmenu_cleanup(cmdline_info_T *cclp UNUSED) RedrawingDisabled = 0; #endif +#if defined(FEAT_SEARCH_EXTRA) || defined(PROTO) + // Clear highlighting applied during wildmenu activity + set_no_hlsearch(TRUE); +#endif + if (wild_menu_showing == WM_SCROLLED) { // Entered command line, move it up @@ -4223,19 +4556,20 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) } else { - xpc.xp_pattern = pat; + char_u *pattern_start; + + xpc.xp_pattern = pattern_start = pat; xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); xpc.xp_line = pat; xpc.xp_context = cmdcomplete_str_to_type(type); - if (xpc.xp_context == EXPAND_NOTHING) + switch (xpc.xp_context) { + case EXPAND_NOTHING: semsg(_(e_invalid_argument_str), type); return; - } - if (xpc.xp_context == EXPAND_USER_DEFINED) - { + case EXPAND_USER_DEFINED: // Must be "custom,funcname" pattern if (STRNCMP(type, "custom,", 7) != 0) { @@ -4244,10 +4578,9 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) } xpc.xp_arg = type + 7; - } + break; - if (xpc.xp_context == EXPAND_USER_LIST) - { + case EXPAND_USER_LIST: // Must be "customlist,funcname" pattern if (STRNCMP(type, "customlist,", 11) != 0) { @@ -4256,48 +4589,57 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) } xpc.xp_arg = type + 11; - } + break; # if defined(FEAT_MENU) - if (xpc.xp_context == EXPAND_MENUS) - { + case EXPAND_MENUS: set_context_in_menu_cmd(&xpc, (char_u *)"menu", xpc.xp_pattern, FALSE); - xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - } + xpc.xp_pattern_len -= (int)(xpc.xp_pattern - pattern_start); + break; # endif + # ifdef FEAT_CSCOPE - if (xpc.xp_context == EXPAND_CSCOPE) - { + case EXPAND_CSCOPE: set_context_in_cscope_cmd(&xpc, xpc.xp_pattern, CMD_cscope); - xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - } + xpc.xp_pattern_len -= (int)(xpc.xp_pattern - pattern_start); + break; # endif + # ifdef FEAT_SIGNS - if (xpc.xp_context == EXPAND_SIGN) - { + case EXPAND_SIGN: set_context_in_sign_cmd(&xpc, xpc.xp_pattern); - xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - } + xpc.xp_pattern_len -= (int)(xpc.xp_pattern - pattern_start); + break; # endif - if (xpc.xp_context == EXPAND_RUNTIME) - { + + case EXPAND_RUNTIME: set_context_in_runtime_cmd(&xpc, xpc.xp_pattern); - xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); - } - if (xpc.xp_context == EXPAND_SHELLCMDLINE) + xpc.xp_pattern_len -= (int)(xpc.xp_pattern - pattern_start); + break; + + case EXPAND_SHELLCMDLINE: { int context = EXPAND_SHELLCMDLINE; set_context_for_wildcard_arg(NULL, xpc.xp_pattern, FALSE, &xpc, - &context); - xpc.xp_pattern_len = (int)STRLEN(xpc.xp_pattern); + &context); + xpc.xp_pattern_len -= (int)(xpc.xp_pattern - pattern_start); + break; + } + + case EXPAND_FILETYPECMD: + filetype_expand_what = EXP_FILETYPECMD_ALL; + break; + + default: + break; } } if (cmdline_fuzzy_completion_supported(&xpc)) - // when fuzzy matching, don't modify the search string - pat = vim_strsave(xpc.xp_pattern); + // when fuzzy matching, don't modify the search string + pat = vim_strnsave(xpc.xp_pattern, xpc.xp_pattern_len); else - pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); + pat = addstar(xpc.xp_pattern, xpc.xp_pattern_len, xpc.xp_context); if (rettv_list_alloc(rettv) == OK && pat != NULL) { @@ -4311,4 +4653,383 @@ f_getcompletion(typval_T *argvars, typval_T *rettv) vim_free(pat); ExpandCleanup(&xpc); } + +/* + * "getcompletiontype()" function + */ + void +f_getcompletiontype(typval_T *argvars, typval_T *rettv) +{ + char_u *pat; + expand_T xpc; + int cmdline_len; + + rettv->v_type = VAR_STRING; + rettv->vval.v_string = NULL; + + if (check_for_string_arg(argvars, 0) == FAIL) + return; + + pat = tv_get_string(&argvars[0]); + ExpandInit(&xpc); + + cmdline_len = (int)STRLEN(pat); + set_cmd_context(&xpc, pat, cmdline_len, cmdline_len, FALSE); + rettv->vval.v_string = cmdcomplete_type_to_str(xpc.xp_context, xpc.xp_arg); + + ExpandCleanup(&xpc); +} + +/* + * "cmdcomplete_info()" function + */ + void +f_cmdcomplete_info(typval_T *argvars UNUSED, typval_T *rettv) +{ + cmdline_info_T *ccline = get_cmdline_info(); + dict_T *retdict; + list_T *li; + int idx; + int ret = OK; + + if (rettv_dict_alloc(rettv) == FAIL || ccline == NULL + || ccline->xpc == NULL || ccline->xpc->xp_files == NULL) + return; + retdict = rettv->vval.v_dict; + ret = dict_add_string(retdict, "cmdline_orig", cmdline_orig); + if (ret == OK) + ret = dict_add_number(retdict, "pum_visible", pum_visible()); + if (ret == OK) + ret = dict_add_number(retdict, "selected", ccline->xpc->xp_selected); + if (ret == OK) + { + li = list_alloc(); + if (li == NULL) + return; + ret = dict_add_list(retdict, "matches", li); + for (idx = 0; ret == OK && idx < ccline->xpc->xp_numfiles; idx++) + list_append_string(li, ccline->xpc->xp_files[idx], -1); + } +} #endif // FEAT_EVAL + +/* + * Copy a substring from the current buffer (curbuf), spanning from the given + * 'start' position to the word boundary after 'end' position. + * The copied string is stored in '*match', and the actual end position of the + * matched text is returned in '*match_end'. + */ + static int +copy_substring_from_pos(pos_T *start, pos_T *end, char_u **match, + pos_T *match_end) +{ + char_u *word_end; + char_u *line, *start_line, *end_line; + int segment_len; + linenr_T lnum; + garray_T ga; + int exacttext = vim_strchr(p_wop, WOP_EXACTTEXT) != NULL; + + if (start->lnum > end->lnum + || (start->lnum == end->lnum && start->col >= end->col)) + return FAIL; // invalid range + + // Use a growable string (ga) + ga_init2(&ga, 1, 128); + + // Append start line from start->col to end + start_line = ml_get(start->lnum); + char_u *start_ptr = start_line + start->col; + int is_single_line = start->lnum == end->lnum; + + segment_len = is_single_line ? (end->col - start->col) + : (int)(ml_get_len(start->lnum) - start->col); + if (ga_grow(&ga, segment_len + 2) != OK) + return FAIL; + + ga_concat_len(&ga, start_ptr, segment_len); + if (!is_single_line) + { + if (exacttext) + ga_concat_len(&ga, (char_u *)"\\n", 2); + else + ga_append(&ga, '\n'); + } + + // Append full lines between start and end + if (!is_single_line) + { + for (lnum = start->lnum + 1; lnum < end->lnum; lnum++) + { + line = ml_get(lnum); + if (ga_grow(&ga, ml_get_len(lnum) + 2) != OK) + return FAIL; + ga_concat(&ga, line); + if (exacttext) + ga_concat_len(&ga, (char_u *)"\\n", 2); + else + ga_append(&ga, '\n'); + } + } + + // Append partial end line (up to word end) + end_line = ml_get(end->lnum); + word_end = find_word_end(end_line + end->col); + segment_len = (int)(word_end - end_line); + if (ga_grow(&ga, segment_len) != OK) + return FAIL; + ga_concat_len(&ga, end_line + (is_single_line ? end->col : 0), + segment_len - (is_single_line ? end->col : 0)); + + // Null-terminate + if (ga_grow(&ga, 1) != OK) + return FAIL; + ga_append(&ga, NUL); + + *match = (char_u *)ga.ga_data; + match_end->lnum = end->lnum; + match_end->col = segment_len; + + return OK; +} + +/* + * Returns TRUE if the given string `str` matches the regex pattern `pat`. + * Honors the 'ignorecase' (p_ic) and 'smartcase' (p_scs) settings to determine + * case sensitivity. + */ + static int +is_regex_match(char_u *pat, char_u *str) +{ + regmatch_T regmatch; + int result; + + regmatch.regprog = vim_regcomp(pat, RE_MAGIC + RE_STRING); + if (regmatch.regprog == NULL) + return FALSE; + regmatch.rm_ic = p_ic; + if (p_ic && p_scs) + regmatch.rm_ic = !pat_has_uppercase(pat); + + result = vim_regexec_nl(®match, str, (colnr_T)0); + + vim_regfree(regmatch.regprog); + return result; +} + +/* + * Constructs a new match string by appending text from the buffer (starting at + * end_match_pos) to the given pattern `pat`. The result is a concatenation of + * `pat` and the word following end_match_pos. + * If 'lowercase' is TRUE, the appended text is converted to lowercase before + * being combined. Returns the newly allocated match string, or NULL on failure. + */ + static char_u * +concat_pattern_with_buffer_match( + char_u *pat, + int pat_len, + pos_T *end_match_pos, + int lowercase UNUSED) +{ + char_u *line = ml_get(end_match_pos->lnum); + char_u *word_end = find_word_end(line + end_match_pos->col); + int match_len = (int)(word_end - (line + end_match_pos->col)); + char_u *match = alloc(match_len + pat_len + 1); // +1 for NUL + + if (match == NULL) + return NULL; + mch_memmove(match, pat, pat_len); + if (match_len > 0) + { +#if defined(FEAT_EVAL) || defined(FEAT_SPELL) || defined(PROTO) + if (lowercase) + { + char_u *mword = vim_strnsave(line + end_match_pos->col, + match_len); + if (mword == NULL) + goto cleanup; + char_u *lower = strlow_save(mword); + vim_free(mword); + if (lower == NULL) + goto cleanup; + mch_memmove(match + pat_len, lower, match_len); + vim_free(lower); + } + else +#endif + mch_memmove(match + pat_len, line + end_match_pos->col, match_len); + } + match[pat_len + match_len] = NUL; + return match; + +#if defined(FEAT_EVAL) || defined(FEAT_SPELL) || defined(PROTO) +cleanup: + vim_free(match); + return NULL; +#endif +} + +/* + * Search for strings matching "pat" in the specified range and return them. + * Returns OK on success, FAIL otherwise. + */ + static int +expand_pattern_in_buf( + char_u *pat, // pattern to match + int dir, // direction: FORWARD or BACKWARD + char_u ***matches, // return: array with matched strings + int *numMatches) // return: number of matches +{ + pos_T cur_match_pos, prev_match_pos, end_match_pos, word_end_pos; + garray_T ga; + int found_new_match; + int looped_around = FALSE; + int pat_len; + int has_range = FALSE; + int compl_started = FALSE; + int search_flags; + char_u *match, *full_match; + int exacttext = vim_strchr(p_wop, WOP_EXACTTEXT) != NULL; + +#ifdef FEAT_SEARCH_EXTRA + has_range = search_first_line != 0; +#endif + + *matches = NULL; + *numMatches = 0; + + if (pat == NULL || *pat == NUL) + return FAIL; + + pat_len = (int)STRLEN(pat); + CLEAR_FIELD(cur_match_pos); + CLEAR_FIELD(prev_match_pos); +#ifdef FEAT_SEARCH_EXTRA + if (has_range) + cur_match_pos.lnum = search_first_line; + else +#endif + cur_match_pos = pre_incsearch_pos; + + search_flags = SEARCH_OPT | SEARCH_NOOF | SEARCH_PEEK | SEARCH_NFMSG + | (has_range ? SEARCH_START : 0); + + ga_init2(&ga, sizeof(char_u *), 10); // Use growable array of char_u* + + for (;;) + { + ++emsg_off; + ++msg_silent; + found_new_match = searchit(NULL, curbuf, &cur_match_pos, + &end_match_pos, dir, pat, pat_len, 1L, + search_flags, RE_LAST, NULL); + --msg_silent; + --emsg_off; + + if (found_new_match == FAIL) + break; + +#ifdef FEAT_SEARCH_EXTRA + // If in range mode, check if match is within the range + if (has_range && (cur_match_pos.lnum < search_first_line + || cur_match_pos.lnum > search_last_line)) + break; +#endif + + if (compl_started) + { + // If we've looped back to an earlier match, stop + if ((dir == FORWARD && LTOREQ_POS(cur_match_pos, prev_match_pos)) || + (dir == BACKWARD && LTOREQ_POS(prev_match_pos, cur_match_pos))) + { + if (looped_around) + break; + else + looped_around = TRUE; + } + } + + compl_started = TRUE; + prev_match_pos = cur_match_pos; + + // Abort if user typed a character or interrupted + if (char_avail() || got_int) + { + if (got_int) + { + (void)vpeekc(); // Remove from input stream + got_int = FALSE; // Don't abandon the command line + } + goto cleanup; + } + + // searchit() can return line number +1 past the last line when + // searching for "foo\n" if "foo" is at end of buffer. + if (end_match_pos.lnum > curbuf->b_ml.ml_line_count) + { + cur_match_pos.lnum = 1; + cur_match_pos.col = 0; + cur_match_pos.coladd = 0; + continue; + } + + // Extract the matching text prepended to completed word + if (!copy_substring_from_pos(&cur_match_pos, &end_match_pos, &full_match, + &word_end_pos)) + break; + + if (exacttext) + match = full_match; + else + { + // Construct a new match from completed word appended to pattern itself + match = concat_pattern_with_buffer_match(pat, pat_len, &end_match_pos, + FALSE); + + // The regex pattern may include '\C' or '\c'. First, try matching the + // buffer word as-is. If it doesn't match, try again with the lowercase + // version of the word to handle smartcase behavior. + if (match == NULL || !is_regex_match(match, full_match)) + { + vim_free(match); + match = concat_pattern_with_buffer_match(pat, pat_len, + &end_match_pos, TRUE); + if (match == NULL || !is_regex_match(match, full_match)) + { + vim_free(match); + vim_free(full_match); + continue; + } + } + vim_free(full_match); + } + + // Include this match if it is not a duplicate + for (int i = 0; i < ga.ga_len; ++i) + { + if (STRCMP(match, ((char_u **)ga.ga_data)[i]) == 0) + { + VIM_CLEAR(match); + break; + } + } + if (match != NULL) + { + if (ga_grow(&ga, 1) == FAIL) + goto cleanup; + ((char_u **)ga.ga_data)[ga.ga_len++] = match; + if (ga.ga_len > TAG_MANY) + break; + } + if (has_range) + cur_match_pos = word_end_pos; + } + + *matches = (char_u **)ga.ga_data; + *numMatches = ga.ga_len; + return OK; + +cleanup: + ga_clear_strings(&ga); + return FAIL; +} diff --git a/src/config.h.in b/src/config.h.in index 79cb37c467..1b8495515f 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -9,6 +9,9 @@ /* Define unless no X support found */ #undef HAVE_X11 +/* Define unless no Wayland support found */ +#undef HAVE_WAYLAND + /* Define when terminfo support found */ #undef TERMINFO @@ -505,6 +508,9 @@ /* Define if we have flock() */ #undef HAVE_FLOCK +/* Define if we have shm_open() */ +#undef HAVE_SHM_OPEN + /* Define to inline symbol or empty */ #undef inline diff --git a/src/config.mk.in b/src/config.mk.in index 846cd8b1a9..55b92fcc30 100644 --- a/src/config.mk.in +++ b/src/config.mk.in @@ -38,6 +38,11 @@ X_PRE_LIBS = @X_PRE_LIBS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIB@ +WAYLAND_LIBS = @WAYLAND_LIBS@ +WAYLAND_SRC = @WAYLAND_SRC@ +WAYLAND_OBJ = @WAYLAND_OBJ@ +WAYLAND_CFLAGS = @WAYLAND_CFLAGS@ + XDIFF_OBJS_USED = @XDIFF_OBJS_USED@ LUA_LIBS = @LUA_LIBS@ diff --git a/src/configure.ac b/src/configure.ac index b15a773d5f..ca84982680 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -25,6 +25,10 @@ AC_EXEEXT AC_HEADER_SYS_WAIT +if test -z "$PKG_CONFIG"; then + AC_PATH_TOOL(PKG_CONFIG, pkg-config, no) +fi + dnl Check that the C99 features that Vim uses are supported: if test x"$ac_cv_prog_cc_c99" != xno; then dnl If the compiler doesn't explicitly support C99, then check @@ -2567,6 +2571,59 @@ AC_ARG_ENABLE(fontset, AC_MSG_RESULT($enable_fontset) dnl defining FEAT_XFONTSET is delayed, so that it can be disabled for no GUI +AC_MSG_CHECKING(if shm_open is available) +cppflags_save=$CPPFLAGS +CPPFLAGS="$CPPFLAGS $X_CFLAGS" +AC_LINK_IFELSE([AC_LANG_PROGRAM( + [#include + #include + #include ], [shm_open("/test", O_CREAT, 0600);])], + AC_MSG_RESULT(yes); AC_DEFINE(HAVE_SHM_OPEN), + AC_MSG_RESULT(no)) +CPPFLAGS=$cppflags_save + +AC_MSG_CHECKING(--with-wayland argument) +AC_ARG_WITH(wayland, + [ --with-wayland Include support for the Wayland protocol.], + [with_wayland=$withval], + AS_IF([test "x$features" = xtiny], + [with_wayland=no + AC_MSG_RESULT([cannot use wayland with tiny features])], + [with_wayland=yes + AC_MSG_RESULT([yes])])) + +if test "$with_wayland" = yes; then +cflags_save=$CFLAGS + AC_MSG_CHECKING(for wayland) + if "$PKG_CONFIG" --exists 'wayland-client'; then + AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_WAYLAND) + WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client` + CFLAGS="$CFLAGS $WAYLAND_CFLAGS" + WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client` + WAYLAND_SRC=" \ + auto/wayland/wlr-data-control-unstable-v1.c \ + auto/wayland/ext-data-control-v1.c \ + auto/wayland/xdg-shell.c \ + auto/wayland/primary-selection-unstable-v1.c \ + wayland.c" + WAYLAND_OBJ=" \ + objects/wlr-data-control-unstable-v1.o \ + objects/ext-data-control-v1.o \ + objects/xdg-shell.o \ + objects/primary-selection-unstable-v1.o \ + objects/wayland.o" + AC_SUBST(WAYLAND_CFLAGS) + AC_SUBST(WAYLAND_LIBS) + AC_SUBST(WAYLAND_SRC) + AC_SUBST(WAYLAND_OBJ) + else + AC_MSG_RESULT(no) + with_wayland=no + fi +CFLAGS=$cflags_save +fi + test -z "$with_x" && with_x=yes test "${enable_gui-yes}" != no -a "x$MACOS_X" != "xyes" -a "x$QNX" != "xyes" && with_x=yes if test "$with_x" = no; then @@ -2871,62 +2928,66 @@ dnl Test for GTK, and define GTK_CFLAGS, GTK_LIBDIR and GTK_LIBS dnl AC_DEFUN(AM_PATH_GTK, [ - if test "X$GTK_CONFIG" != "Xno" -o "X$PKG_CONFIG" != "Xno"; then + dnl Even if we don't end up using the pkg-config name, the min_gtk_version + dnl will be used when compiling the gtktest program below. + min_gtk_version="$1" + + dnl Attempt to source flags from pkg-config if it is installed. + if test "$PKG_CONFIG" != "no"; then + AS_CASE([$min_gtk_version], + [2.*], [gtk_pkg_name="gtk+-2.0"], + [3.*], [gtk_pkg_name="gtk+-3.0"], + [AC_MSG_FAILURE([The configure script does not know which pkg-config name to use for GTK $min_gtk_version"])]) + + AC_MSG_CHECKING([for pkg-config $gtk_pkg_name]) + AS_IF(["$PKG_CONFIG" --exists "$gtk_pkg_name"], + [ + AC_MSG_RESULT(found) + AC_MSG_CHECKING([for GTK - version >= $min_gtk_version]) + dnl We should be using PKG_CHECK_MODULES() instead of this hack. + dnl But I guess the dependency on pkgconfig.m4 is not wanted or + dnl something like that. + GTK_CFLAGS=`$PKG_CONFIG --cflags $gtk_pkg_name` + GTK_LIBDIR=`$PKG_CONFIG --libs-only-L $gtk_pkg_name` + GTK_LIBS=`$PKG_CONFIG --libs $gtk_pkg_name` + gtk_major_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` + gtk_minor_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` + gtk_micro_version=`$PKG_CONFIG --modversion $gtk_pkg_name | \ + sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` + AC_MSG_RESULT([yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version]) + ], + [ + GTK_CFLAGS="" + GTK_LIBDIR="" + GTK_LIBS="" + AC_MSG_RESULT([no; consider installing your distro GTK -dev package]) + if test "$fail_if_missing" = "yes" -a "$gui_auto" != "yes"; then + AC_MSG_ERROR([pkg-config could not find $gtk_pkg_name]) + fi + ]) + fi + + dnl Regardless of whether we sources the GTK compilation flags from + dnl pkg-config above versus the user specifying them in CFLAGS and LIBS, try + dnl to compile the test program. + dnl + dnl Default to outcome flag to "yes" because disabling the check should be + dnl considered the same as assuming it would succeed. + gtktest_success="yes" + if test "$enable_gtktest" = "yes"; then { - no_gtk="" - if (test "X$SKIP_GTK2" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ - && $PKG_CONFIG --exists gtk+-2.0; then - { - min_gtk_version=ifelse([$1], ,2.2.0,$1) - AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) - dnl We should be using PKG_CHECK_MODULES() instead of this hack. - dnl But I guess the dependency on pkgconfig.m4 is not wanted or - dnl something like that. - GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-2.0` - GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-2.0` - GTK_LIBS=`$PKG_CONFIG --libs gtk+-2.0` - gtk_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` - gtk_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - gtk_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - } - elif (test "X$SKIP_GTK3" != "XYES" -a "X$PKG_CONFIG" != "Xno") \ - && $PKG_CONFIG --exists gtk+-3.0; then - { - min_gtk_version=ifelse([$1], ,3.0.0,$1) - AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) - - GTK_CFLAGS=`$PKG_CONFIG --cflags gtk+-3.0` - GTK_LIBDIR=`$PKG_CONFIG --libs-only-L gtk+-3.0` - GTK_LIBS=`$PKG_CONFIG --libs gtk+-3.0` - gtk_major_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\1/'` - gtk_minor_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\2/'` - gtk_micro_version=`$PKG_CONFIG --modversion gtk+-3.0 | \ - sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\)/\3/'` - } - else - dnl Put some text before the "no" to hint at installing the gtk-dev - dnl packages. - AC_MSG_CHECKING(for GTK -dev package) - no_gtk=yes - fi + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" - if test "x$enable_gtktest" = "xyes" -a "x$no_gtk" = "x"; then - { - ac_save_CFLAGS="$CFLAGS" - ac_save_LIBS="$LIBS" - CFLAGS="$CFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" - - dnl - dnl Now check if the installed GTK is sufficiently new. - dnl - rm -f conf.gtktest - AC_RUN_IFELSE([AC_LANG_SOURCE([ + dnl + dnl Now check if the installed GTK is sufficiently new. + dnl + AC_MSG_CHECKING([ability to compile GTK test program]) + AC_RUN_IFELSE([AC_LANG_SOURCE([ #include #include #if STDC_HEADERS @@ -2937,62 +2998,53 @@ AC_DEFUN(AM_PATH_GTK, int main () { -int major, minor, micro; -char *tmp_version; - -system ("touch conf.gtktest"); - -/* HP/UX 9 (%@#!) writes to sscanf strings */ -tmp_version = g_strdup("$min_gtk_version"); -if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { - printf("%s, bad version string\n", "$min_gtk_version"); - g_free(tmp_version); - exit(1); - } - -g_free(tmp_version); - -if ((gtk_major_version > major) || - ((gtk_major_version == major) && (gtk_minor_version > minor)) || - ((gtk_major_version == major) && (gtk_minor_version == minor) && - (gtk_micro_version >= micro))) -{ - return 0; -} -return 1; + int ex_major = $gtk_major_version; + int ex_minor = $gtk_minor_version; + int ex_micro = $gtk_micro_version; + + #if $gtk_major_version == 2 + guint ob_major = gtk_major_version; + guint ob_minor = gtk_minor_version; + guint ob_micro = gtk_micro_version; + #else + guint ob_major = gtk_get_major_version(); + guint ob_minor = gtk_get_minor_version(); + guint ob_micro = gtk_get_micro_version(); + #endif + + if ((ob_major > ex_major) || + ((ob_major == ex_major) + && (ob_minor > ex_minor)) || + ((ob_major == ex_major) + && (ob_minor == ex_minor) + && (ob_micro >= ex_micro))) + return 0; + else + return 1; } -])],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) - CFLAGS="$ac_save_CFLAGS" - LIBS="$ac_save_LIBS" - } - fi - if test "x$no_gtk" = x ; then - if test "x$enable_gtktest" = "xyes"; then - AC_MSG_RESULT(yes; found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version) - else - AC_MSG_RESULT(found version $gtk_major_version.$gtk_minor_version.$gtk_micro_version) - fi - ifelse([$2], , :, [$2]) - else - { - AC_MSG_RESULT(no) - GTK_CFLAGS="" - GTK_LIBS="" - ifelse([$3], , :, [$3]) - if test "$fail_if_missing" = "yes" -a "X$gui_auto" != "Xyes"; then - AC_MSG_ERROR([could not configure GTK]) - fi - } - fi +])], + [gtktest_success="yes"; AC_MSG_RESULT(yes)], + [gtktest_success="no"; AC_MSG_RESULT(no)], + [echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" } + fi + + if test "$gtktest_success" = "yes"; then + ifelse([$2], , :, [$2]) else + dnl Reset flags sourced from pkg-config if the compilation test failed. GTK_CFLAGS="" + GTK_LIBDIR="" GTK_LIBS="" - ifelse([$3], , :, [$3]) + if test "$fail_if_missing" = "yes" -a "$gui_auto" != "yes"; then + AC_MSG_ERROR([Failed to compile GTK test program.]) + fi fi + AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) - rm -f conf.gtktest ]) dnl --------------------------------------------------------------------------- @@ -3065,16 +3117,39 @@ AC_DEFUN([GNOME_INIT],[ GNOME_INIT_HOOK([],fail) ]) -if test "X$PKG_CONFIG" = "X"; then - AC_PATH_TOOL(PKG_CONFIG, pkg-config, no) -fi +dnl --------------------------------------------------------------------------- +dnl Check for GTK3. If it succeeds, skip the check for GTK2. +dnl --------------------------------------------------------------------------- +if test -z "$SKIP_GTK3"; then + AC_MSG_CHECKING(--disable-gtktest argument) + AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], + , enable_gtktest=yes) + if test "x$enable_gtktest" = "xyes" ; then + AC_MSG_RESULT(gtk test enabled) + else + AC_MSG_RESULT(gtk test disabled) + fi + if test "x$PKG_CONFIG" != "xno"; then + AM_PATH_GTK(3.0.0, + [GUI_LIB_LOC="$GTK_LIBDIR" + GTK_LIBNAME="$GTK_LIBS" + GUI_INC_LOC="$GTK_CFLAGS"]) + if test -n "$GTK_CFLAGS"; then + SKIP_GTK2=YES + SKIP_GNOME=YES + SKIP_MOTIF=YES + GUITYPE=GTK + AC_SUBST(GTK_LIBNAME) + AC_DEFINE(USE_GTK3) + fi + fi +fi dnl --------------------------------------------------------------------------- dnl Check for GTK2. If it fails, then continue on for Motif as before... dnl --------------------------------------------------------------------------- if test -z "$SKIP_GTK2"; then - AC_MSG_CHECKING(--disable-gtktest argument) AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], , enable_gtktest=yes) @@ -3087,21 +3162,14 @@ if test -z "$SKIP_GTK2"; then if test "x$PKG_CONFIG" != "xno"; then dnl First try finding version 2.2.0 or later. The 2.0.x series has dnl problems (bold fonts, --remote doesn't work). - dnl Disable checking for GTK3 here, otherwise it's found when GTK2 is not - dnl found. - save_skip_gtk3=$SKIP_GTK3 - SKIP_GTK3=YES AM_PATH_GTK(2.2.0, [GUI_LIB_LOC="$GTK_LIBDIR" GTK_LIBNAME="$GTK_LIBS" - GUI_INC_LOC="$GTK_CFLAGS"], ) - if test "x$GTK_CFLAGS" != "x"; then - SKIP_GTK3=YES + GUI_INC_LOC="$GTK_CFLAGS"]) + if test -n "$GTK_CFLAGS"; then SKIP_MOTIF=YES GUITYPE=GTK AC_SUBST(GTK_LIBNAME) - else - SKIP_GTK3=$save_skip_gtk3 fi fi if test "x$GUITYPE" = "xGTK"; then @@ -3121,41 +3189,6 @@ if test -z "$SKIP_GTK2"; then fi fi - -dnl --------------------------------------------------------------------------- -dnl Check for GTK3. -dnl --------------------------------------------------------------------------- -if test -z "$SKIP_GTK3"; then - - AC_MSG_CHECKING(--disable-gtktest argument) - AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], - , enable_gtktest=yes) - if test "x$enable_gtktest" = "xyes" ; then - AC_MSG_RESULT(gtk test enabled) - else - AC_MSG_RESULT(gtk test disabled) - fi - - if test "x$PKG_CONFIG" != "xno"; then - save_skip_gtk2=$SKIP_GTK2 - SKIP_GTK2=YES - AM_PATH_GTK(3.0.0, - [GUI_LIB_LOC="$GTK_LIBDIR" - GTK_LIBNAME="$GTK_LIBS" - GUI_INC_LOC="$GTK_CFLAGS"], ) - if test "x$GTK_CFLAGS" != "x"; then - SKIP_GTK2=YES - SKIP_GNOME=YES - SKIP_MOTIF=YES - GUITYPE=GTK - AC_SUBST(GTK_LIBNAME) - AC_DEFINE(USE_GTK3) - else - SKIP_GTK2=$save_skip_gtk2 - fi - fi -fi - dnl Check the version of Gdk-Pixbuf. If the version is 2.31 or later and dnl glib-compile-resources is found in PATH, use GResource. if test "x$GUITYPE" = "xGTK"; then @@ -3628,7 +3661,6 @@ CPPFLAGS=$cppflags_save fi dnl Checks for typedefs, structures, and compiler characteristics. -AC_PROG_GCC_TRADITIONAL AC_C_CONST AC_C_VOLATILE AC_TYPE_MODE_T @@ -5026,4 +5058,4 @@ dnl write output files AC_CONFIG_FILES(auto/config.mk:config.mk.in) AC_OUTPUT -dnl vim: set sw=2 tw=78 ts=8 fo+=l: +dnl vim: set sw=2 tw=78 fo+=l: diff --git a/src/debugger.c b/src/debugger.c index 5508ea33fc..cb0b86f76d 100644 --- a/src/debugger.c +++ b/src/debugger.c @@ -395,9 +395,9 @@ do_showbacktrace(char_u *cmd) } if (SOURCING_LNUM != 0) - smsg(_("line %ld: %s"), (long)SOURCING_LNUM, cmd); + smsg(_("line %ld: %s"), (long)SOURCING_LNUM, cmd); else - smsg(_("cmd: %s"), cmd); + smsg(_("cmd: %s"), cmd); } /* diff --git a/src/diff.c b/src/diff.c index 3adcdb7dba..d86dbf1530 100644 --- a/src/diff.c +++ b/src/diff.c @@ -42,6 +42,7 @@ static int diff_need_update = FALSE; // ex_diffupdate needs to be called #define DIFF_INLINE_SIMPLE 0x4000 // inline highlight with simple algorithm #define DIFF_INLINE_CHAR 0x8000 // inline highlight with character diff #define DIFF_INLINE_WORD 0x10000 // inline highlight with word diff +#define DIFF_ANCHOR 0x20000 // use 'diffanchors' to anchor the diff #define ALL_WHITE_DIFF (DIFF_IWHITE | DIFF_IWHITEALL | DIFF_IWHITEEOL) #define ALL_INLINE (DIFF_INLINE_NONE | DIFF_INLINE_SIMPLE | DIFF_INLINE_CHAR | DIFF_INLINE_WORD) #define ALL_INLINE_DIFF (DIFF_INLINE_CHAR | DIFF_INLINE_WORD) @@ -59,6 +60,8 @@ static int diff_bin_works = MAYBE; // TRUE when "diff --binary" works, FALSE // checked yet #endif +#define MAX_DIFF_ANCHORS 20 + // used for diff input typedef struct { char_u *din_fname; // used for external diff @@ -113,6 +116,7 @@ static int parse_diff_ed(char_u *line, diffhunk_T *hunk); static int parse_diff_unified(char_u *line, diffhunk_T *hunk); static int xdiff_out_indices(long start_a, long count_a, long start_b, long count_b, void *priv); static int xdiff_out_unified(void *priv, mmbuffer_t *mb, int nbuf); +static int parse_diffanchors(int check_only, buf_T *buf, linenr_T *anchors, int *num_anchors); #define FOR_ALL_DIFFBLOCKS_IN_TAB(tp, dp) \ for ((dp) = (tp)->tp_first_diff; (dp) != NULL; (dp) = (dp)->df_next) @@ -410,10 +414,22 @@ diff_mark_adjust_tp( // 1. change completely above line1: nothing to do if (last >= line1 - 1) { + if (diff_busy) + { + // Currently in the middle of updating diff blocks. All we want + // is to adjust the line numbers and nothing else. + if (dp->df_lnum[idx] > line2) + dp->df_lnum[idx] += amount_after; + + // Advance to next entry. + dprev = dp; + dp = dp->df_next; + continue; + } + // 6. change below line2: only adjust for amount_after; also when // "deleted" became zero when deleted all lines between two diffs - if (dp->df_lnum[idx] - (deleted + inserted != 0) > line2 - - (dp->is_linematched ? 1 : 0)) + if (dp->df_lnum[idx] - (deleted + inserted != 0) > line2) { if (amount_after == 0) break; // nothing left to change @@ -516,7 +532,7 @@ diff_mark_adjust_tp( } // check if this block touches the previous one, may merge them. - if (dprev != NULL && !dp->is_linematched + if (dprev != NULL && !dp->is_linematched && !diff_busy && dprev->df_lnum[idx] + dprev->df_count[idx] == dp->df_lnum[idx]) { @@ -720,7 +736,7 @@ diff_redraw( #endif // A change may have made filler lines invalid, need to take care of // that for other windows. - n = diff_check(wp, wp->w_topline); + n = diff_check_fill(wp, wp->w_topline); if ((wp != curwin && wp->w_topfill > 0) || n > 0) { if (wp->w_topfill > n) @@ -781,9 +797,9 @@ diff_write_buffer(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end) char_u *ptr; if (end < 0) - end = buf->b_ml.ml_line_count; + end = buf->b_ml.ml_line_count; - if (buf->b_ml.ml_flags & ML_EMPTY) + if (buf->b_ml.ml_flags & ML_EMPTY || end < start) { din->din_mmfile.ptr = NULL; din->din_mmfile.size = 0; @@ -868,31 +884,55 @@ diff_write_buffer(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end) * Return FAIL for failure. */ static int -diff_write(buf_T *buf, diffin_T *din) +diff_write(buf_T *buf, diffin_T *din, linenr_T start, linenr_T end) { int r; + int save_ml_flags; char_u *save_ff; int save_cmod_flags; if (din->din_fname == NULL) - return diff_write_buffer(buf, din, 1, -1); + return diff_write_buffer(buf, din, start, end); + + if (end < 0) + end = buf->b_ml.ml_line_count; // Always use 'fileformat' set to "unix". + save_ml_flags = buf->b_ml.ml_flags; save_ff = buf->b_p_ff; buf->b_p_ff = vim_strsave((char_u *)FF_UNIX); save_cmod_flags = cmdmod.cmod_flags; // Writing the buffer is an implementation detail of performing the diff, // so it shouldn't update the '[ and '] marks. cmdmod.cmod_flags |= CMOD_LOCKMARKS; + if (end < start) + { + // The line range specifies a completely empty file. + end = start; + buf->b_ml.ml_flags |= ML_EMPTY; + } r = buf_write(buf, din->din_fname, NULL, - (linenr_T)1, buf->b_ml.ml_line_count, + start, end, NULL, FALSE, FALSE, FALSE, TRUE); cmdmod.cmod_flags = save_cmod_flags; free_string_option(buf->b_p_ff); buf->b_p_ff = save_ff; + buf->b_ml.ml_flags = save_ml_flags; return r; } + static int +lnum_compare(const void *s1, const void *s2) +{ + linenr_T lnum1 = *(linenr_T*)s1; + linenr_T lnum2 = *(linenr_T*)s2; + if (lnum1 < lnum2) + return -1; + if (lnum1 > lnum2) + return 1; + return 0; +} + /* * Update the diffs for all buffers involved. */ @@ -934,31 +974,113 @@ diff_try_update( buf_check_timestamp(buf, FALSE); } - // Write the first buffer to a tempfile or mmfile_t. - buf = curtab->tp_diffbuf[idx_orig]; - if (diff_write(buf, &dio->dio_orig) == FAIL) - goto theend; - - // Make a difference between the first buffer and every other. - for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new) + // Parse and sort diff anchors if enabled + int num_anchors = INT_MAX; + linenr_T anchors[DB_COUNT][MAX_DIFF_ANCHORS]; + CLEAR_FIELD(anchors); + if (diff_flags & DIFF_ANCHOR) { - buf = curtab->tp_diffbuf[idx_new]; - if (buf == NULL || buf->b_ml.ml_mfp == NULL) - continue; // skip buffer that isn't loaded + for (int idx = 0; idx < DB_COUNT; idx++) + { + if (curtab->tp_diffbuf[idx] == NULL) + continue; + int buf_num_anchors = 0; + if (parse_diffanchors(FALSE, + curtab->tp_diffbuf[idx], + anchors[idx], + &buf_num_anchors) != OK) + { + emsg(_(e_failed_to_find_all_diff_anchors)); + num_anchors = 0; + CLEAR_FIELD(anchors); + break; + } + if (buf_num_anchors < num_anchors) + num_anchors = buf_num_anchors; + + if (buf_num_anchors > 0) + qsort((void *)anchors[idx], + (size_t)buf_num_anchors, + sizeof(linenr_T), + lnum_compare); + } + } + if (num_anchors == INT_MAX) + num_anchors = 0; + + // Split the files into multiple sections by anchors. Each section starts + // from one anchor (inclusive) and ends at the next anchor (exclusive). + // Diff each section separately before combining the results. If we don't + // have any anchors, we will have one big section of the entire file. + for (int anchor_i = 0; anchor_i <= num_anchors; anchor_i++) + { + diff_T *orig_diff = NULL; + if (anchor_i != 0) + { + orig_diff = curtab->tp_first_diff; + curtab->tp_first_diff = NULL; + } + linenr_T lnum_start = (anchor_i == 0) ? 1 : anchors[idx_orig][anchor_i - 1]; + linenr_T lnum_end = (anchor_i == num_anchors) ? -1 : anchors[idx_orig][anchor_i] - 1; - // Write the other buffer and diff with the first one. - if (diff_write(buf, &dio->dio_new) == FAIL) - continue; - if (diff_file(dio) == FAIL) - continue; + // Write the first buffer to a tempfile or mmfile_t. + buf = curtab->tp_diffbuf[idx_orig]; + if (diff_write(buf, &dio->dio_orig, lnum_start, lnum_end) == FAIL) + { + if (orig_diff != NULL) + { + // Clean up in-progress diff blocks + curtab->tp_first_diff = orig_diff; + diff_clear(curtab); + } + goto theend; + } + + // Make a difference between the first buffer and every other. + for (idx_new = idx_orig + 1; idx_new < DB_COUNT; ++idx_new) + { + buf = curtab->tp_diffbuf[idx_new]; + if (buf == NULL || buf->b_ml.ml_mfp == NULL) + continue; // skip buffer that isn't loaded + + lnum_start = anchor_i == 0 ? 1 : anchors[idx_new][anchor_i - 1]; + lnum_end = anchor_i == num_anchors ? -1 : anchors[idx_new][anchor_i] - 1; - // Read the diff output and add each entry to the diff list. - diff_read(idx_orig, idx_new, dio); + // Write the other buffer and diff with the first one. + if (diff_write(buf, &dio->dio_new, lnum_start, lnum_end) == FAIL) + continue; + if (diff_file(dio) == FAIL) + continue; + + // Read the diff output and add each entry to the diff list. + diff_read(idx_orig, idx_new, dio); + + clear_diffin(&dio->dio_new); + clear_diffout(&dio->dio_diff); + } + clear_diffin(&dio->dio_orig); - clear_diffin(&dio->dio_new); - clear_diffout(&dio->dio_diff); + if (anchor_i != 0) + { + // Combine the new diff blocks with the existing ones + for (diff_T *dp = curtab->tp_first_diff; dp != NULL; dp = dp->df_next) + { + for (int idx = 0; idx < DB_COUNT; idx++) + { + if (anchors[idx][anchor_i - 1] > 0) + dp->df_lnum[idx] += anchors[idx][anchor_i - 1] - 1; + } + } + if (orig_diff != NULL) + { + diff_T *last_diff = orig_diff; + while (last_diff->df_next != NULL) + last_diff = last_diff->df_next; + last_diff->df_next = curtab->tp_first_diff; + curtab->tp_first_diff = orig_diff; + } + } } - clear_diffin(&dio->dio_orig); theend: vim_free(dio->dio_orig.din_fname); @@ -2025,10 +2147,15 @@ get_max_diff_length(const diff_T *dp) return maxlength; } +/* + * Find the first diff block that includes the specified line. Also find the + * next diff block that's not in the current chain of adjacent blocks that are + * all touching each other directly. + */ static void find_top_diff_block( diff_T **thistopdiff, - diff_T **nextblockblock, + diff_T **next_adjacent_blocks, int fromidx, int topline) { @@ -2071,61 +2198,17 @@ find_top_diff_block( // block, set the marker of the next block and finish the iteration if (*thistopdiff) { - (*nextblockblock) = topdiff->df_next; + (*next_adjacent_blocks) = topdiff->df_next; break; } } } } - static void -count_filler_lines_and_topline( - int *curlinenum_to, - int *linesfiller, - const diff_T *thistopdiff, - const int toidx, - int virtual_lines_passed) -{ - const diff_T *curdif = thistopdiff; - int ch_virtual_lines = 0; - int isfiller = FALSE; - - while (virtual_lines_passed > 0) - { - if (ch_virtual_lines) - { - virtual_lines_passed--; - ch_virtual_lines--; - if (!isfiller) - (*curlinenum_to)++; - else - (*linesfiller)++; - } - else - { - (*linesfiller) = 0; - if (curdif) - { - ch_virtual_lines = get_max_diff_length(curdif); - isfiller = (curdif->df_count[toidx] ? FALSE : TRUE); - } - if (isfiller) - { - while (curdif && curdif->df_next && - curdif->df_lnum[toidx] == - curdif->df_next->df_lnum[toidx] && - curdif->df_next->df_count[toidx] == 0) - { - curdif = curdif->df_next; - ch_virtual_lines += get_max_diff_length(curdif); - } - } - if (curdif) - curdif = curdif->df_next; - } - } -} - +/* + * Calculates topline/topfill of a target diff window to fit the source diff + * window. + */ static void calculate_topfill_and_topline( const int fromidx, @@ -2135,15 +2218,19 @@ calculate_topfill_and_topline( int *topfill, linenr_T *topline) { - // 1. find the position from the top of the diff block, and the start - // of the next diff block + // find the position from the top of the diff block, and the next diff + // block that's no longer adjacent to the current block. "Adjacency" means + // a chain of diff blocks that are directly touching each other, allowed by + // linematch and diff anchors. diff_T *thistopdiff = NULL; - diff_T *nextblockblock = NULL; + diff_T *next_adjacent_blocks = NULL; int virtual_lines_passed = 0; - find_top_diff_block(&thistopdiff, &nextblockblock, fromidx, from_topline); + find_top_diff_block(&thistopdiff, &next_adjacent_blocks, fromidx, from_topline); - // count the virtual lines that have been passed + // count the virtual lines (either filler or concrete line) that have been + // passed in the source buffer. There could be multiple diff blocks if + // there are adjacent empty blocks (count == 0 at fromidx). diff_T *curdif = thistopdiff; while (curdif && (curdif->df_lnum[fromidx] + curdif->df_count[fromidx]) <= from_topline) @@ -2153,73 +2240,48 @@ calculate_topfill_and_topline( curdif = curdif->df_next; } - if (curdif != nextblockblock) + if (curdif != next_adjacent_blocks) virtual_lines_passed += from_topline - curdif->df_lnum[fromidx]; virtual_lines_passed -= from_topfill; - // count the same amount of virtual lines in the toidx buffer - int curlinenum_to = thistopdiff->df_lnum[toidx]; - int linesfiller = 0; - - count_filler_lines_and_topline(&curlinenum_to, &linesfiller, thistopdiff, - toidx, virtual_lines_passed); - - // count the number of filler lines that would normally be above this line - int maxfiller = 0; - for (diff_T *dpfillertest = thistopdiff; dpfillertest != NULL; - dpfillertest = dpfillertest->df_next) - { - if (dpfillertest->df_lnum[toidx] == curlinenum_to) - { - while (dpfillertest && dpfillertest->df_lnum[toidx] == - curlinenum_to) - { - maxfiller += dpfillertest->df_count[toidx] ? 0 : - get_max_diff_length(dpfillertest); - dpfillertest = dpfillertest->df_next; - } - break; - } - } - (*topfill) = maxfiller - linesfiller; - (*topline) = curlinenum_to; -} + // clamp negative values in case from_topfill hasn't been updated yet and + // is larger than total virtual lines, which could happen when setting + // diffopt multiple times + if (virtual_lines_passed < 0) + virtual_lines_passed = 0; - static int -linematched_filler_lines(diff_T *dp, int idx, linenr_T lnum, int *linestatus) -{ - int filler_lines_d1 = 0; + // move the same amount of virtual lines in the target buffer to find the + // cursor's line number + int curlinenum_to = thistopdiff->df_lnum[toidx]; - while (dp && dp->df_next && - lnum == (dp->df_lnum[idx] + dp->df_count[idx]) && - dp->df_next->df_lnum[idx] == lnum) + int virt_lines_left = virtual_lines_passed; + curdif = thistopdiff; + while (virt_lines_left > 0 && curdif != NULL && curdif != next_adjacent_blocks) { - if (dp->df_count[idx] == 0) - filler_lines_d1 += get_max_diff_length(dp); - dp = dp->df_next; + curlinenum_to += MIN(virt_lines_left, curdif->df_count[toidx]); + virt_lines_left -= MIN(virt_lines_left, get_max_diff_length(curdif)); + curdif = curdif->df_next; } - if (dp->df_count[idx] == 0) - filler_lines_d1 += get_max_diff_length(dp); - - if (lnum < dp->df_lnum[idx] + dp->df_count[idx]) + // count the total number of virtual lines between the top diff block and + // the found line in the target buffer + int max_virt_lines = 0; + for (diff_T *dp = thistopdiff; dp != NULL; dp = dp->df_next) { - int j = 0; - - for (int i = 0; i < DB_COUNT; i++) + if (dp->df_lnum[toidx] + dp->df_count[toidx] <= curlinenum_to) + max_virt_lines += get_max_diff_length(dp); + else { - if (curtab->tp_diffbuf[i] != NULL) - { - if (dp->df_count[i]) - j++; - } - // is this an added line or a changed line? - if (linestatus) - (*linestatus) = (j == 1) ? -2 : -1; + if (dp->df_lnum[toidx] <= curlinenum_to) + max_virt_lines += curlinenum_to - dp->df_lnum[toidx]; + break; } } - return filler_lines_d1; + if (diff_flags & DIFF_FILLER) + // should always be non-negative as max_virt_lines is larger + (*topfill) = max_virt_lines - virtual_lines_passed; + (*topline) = curlinenum_to; } // Apply results from the linematch algorithm and apply to 'dp' by splitting it @@ -2340,18 +2402,19 @@ run_linematch_algorithm(diff_T *dp) /* * Check diff status for line "lnum" in buffer "buf": - * Returns 0 for nothing special - * Returns -1 for a line that should be highlighted as changed. - * Returns -2 for a line that should be highlighted as added/deleted. * Returns > 0 for inserting that many filler lines above it (never happens - * when 'diffopt' doesn't contain "filler"). + * when 'diffopt' doesn't contain "filler"). Otherwise returns 0. + * + * "linestatus" (can be NULL) will be set to: + * 0 for nothing special. + * -1 for a line that should be highlighted as changed. + * -2 for a line that should be highlighted as added/deleted. + * * This should only be used for windows where 'diff' is set. - * When diffopt contains linematch, a changed/added/deleted line - * may also have filler lines above it. In such a case, the possibilities - * are no longer mutually exclusive. The number of filler lines is - * returned from diff_check, and the integer 'linestatus' passed by - * pointer is set to -1 to indicate a changed line, and -2 to indicate an - * added line + * + * Note that it's possible for a changed/added/deleted line to also have filler + * lines above it. This happens when using linematch or using diff anchors (at + * the anchored lines). */ int diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) @@ -2363,6 +2426,9 @@ diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) buf_T *buf = wp->w_buffer; int cmp; + if (linestatus != NULL) + *linestatus = 0; + if (curtab->tp_diff_invalid) ex_diffupdate(NULL); // update after a big change @@ -2395,10 +2461,34 @@ diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) if (lnum >= wp->w_topline && lnum < wp->w_botline && !dp->is_linematched && diff_linematch(dp) && diff_check_sanity(curtab, dp)) - run_linematch_algorithm(dp); + run_linematch_algorithm(dp); - if (dp->is_linematched) - return linematched_filler_lines(dp, idx, lnum, linestatus); + // Insert filler lines above the line just below the change. Will return 0 + // when this buf had the max count. + int num_fill = 0; + while (lnum == dp->df_lnum[idx] + dp->df_count[idx]) + { + // Only calculate fill lines if 'diffopt' contains "filler". Otherwise + // returns 0 filler lines. + if (diff_flags & DIFF_FILLER) + { + maxcount = get_max_diff_length(dp); + num_fill += maxcount - dp->df_count[idx]; + } + + // If there are adjacent blocks (e.g. linematch or anchor), loop + // through them. It's possible for multiple adjacent blocks to + // contribute to filler lines. + // This also helps us find the last diff block in the list of adjacent + // blocks which is necessary when it is a change/inserted line right + // after added lines. + if (dp->df_next != NULL + && lnum >= dp->df_next->df_lnum[idx] + && lnum <= dp->df_next->df_lnum[idx] + dp->df_next->df_count[idx]) + dp = dp->df_next; + else + break; + } if (lnum < dp->df_lnum[idx] + dp->df_count[idx]) { @@ -2416,7 +2506,11 @@ diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) else { if (dp->df_count[i] != dp->df_count[idx]) - return -1; // nr of lines changed. + { + if (linestatus) + *linestatus = -1; // nr of lines changed. + return num_fill; + } cmp = TRUE; } } @@ -2428,7 +2522,11 @@ diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) if (i != idx && curtab->tp_diffbuf[i] != NULL && dp->df_count[i] != 0) if (!diff_equal_entry(dp, idx, i)) - return -1; + { + if (linestatus) + *linestatus = -1; + return num_fill; + } } // If there is no buffer with zero lines then there is no difference // any longer. Happens when making a change (or undo) that removes @@ -2436,24 +2534,12 @@ diff_check_with_linestatus(win_T *wp, linenr_T lnum, int *linestatus) // updating the window. Just report the text as unchanged. Other // windows might still show the change though. if (zero == FALSE) - return 0; - return -2; + return num_fill; + if (linestatus) + *linestatus = -2; + return num_fill; } - - // If 'diffopt' doesn't contain "filler", return 0. - if (!(diff_flags & DIFF_FILLER)) - return 0; - - // Insert filler lines above the line just below the change. Will return - // 0 when this buf had the max count. - maxcount = get_max_diff_length(dp); - return maxcount - dp->df_count[idx]; -} - - int -diff_check(win_T *wp, linenr_T lnum) -{ - return diff_check_with_linestatus(wp, lnum, NULL); + return num_fill; } /* @@ -2578,7 +2664,7 @@ diff_check_fill(win_T *wp, linenr_T lnum) // be quick when there are no filler lines if (!(diff_flags & DIFF_FILLER)) return 0; - n = diff_check(wp, lnum); + n = diff_check_with_linestatus(wp, lnum, NULL); if (n <= 0) return 0; return n; @@ -2596,8 +2682,6 @@ diff_set_topline(win_T *fromwin, win_T *towin) int fromidx; int toidx; diff_T *dp; - int max_count; - int i; fromidx = diff_buf_idx(frombuf); if (fromidx == DB_COUNT) @@ -2629,66 +2713,11 @@ diff_set_topline(win_T *fromwin, win_T *towin) towin->w_topline = lnum + (dp->df_lnum[toidx] - dp->df_lnum[fromidx]); if (lnum >= dp->df_lnum[fromidx]) { - if (dp->is_linematched) - { - calculate_topfill_and_topline(fromidx, toidx, - fromwin->w_topline, - fromwin->w_topfill, - &towin->w_topfill, - &towin->w_topline); - } - else - { - // Inside a change: compute filler lines. With three or more - // buffers we need to know the largest count. - max_count = 0; - for (i = 0; i < DB_COUNT; ++i) - if (curtab->tp_diffbuf[i] != NULL - && max_count < dp->df_count[i]) - max_count = dp->df_count[i]; - - if (dp->df_count[toidx] == dp->df_count[fromidx]) - { - // same number of lines: use same filler count - towin->w_topfill = fromwin->w_topfill; - } - else if (dp->df_count[toidx] > dp->df_count[fromidx]) - { - if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) - { - // more lines in towin and fromwin doesn't show diff - // lines, only filler lines - if (max_count - fromwin->w_topfill >= dp->df_count[toidx]) - { - // towin also only shows filler lines - towin->w_topline = dp->df_lnum[toidx] - + dp->df_count[toidx]; - towin->w_topfill = fromwin->w_topfill; - } - else - // towin still has some diff lines to show - towin->w_topline = dp->df_lnum[toidx] - + max_count - fromwin->w_topfill; - } - } - else if (towin->w_topline >= dp->df_lnum[toidx] - + dp->df_count[toidx]) - { - // less lines in towin and no diff lines to show: compute - // filler lines - towin->w_topline = dp->df_lnum[toidx] + dp->df_count[toidx]; - if (diff_flags & DIFF_FILLER) - { - if (lnum == dp->df_lnum[fromidx] + dp->df_count[fromidx]) - // fromwin is also out of diff lines - towin->w_topfill = fromwin->w_topfill; - else - // fromwin has some diff lines - towin->w_topfill = dp->df_lnum[fromidx] + - max_count - lnum; - } - } - } + calculate_topfill_and_topline(fromidx, toidx, + fromwin->w_topline, + fromwin->w_topfill, + &towin->w_topfill, + &towin->w_topline); } } @@ -2716,6 +2745,100 @@ diff_set_topline(win_T *fromwin, win_T *towin) #endif } +/* + * Parse the diff anchors. If "check_only" is set, will only make sure the + * syntax is correct. + */ + static int +parse_diffanchors(int check_only, buf_T *buf, linenr_T *anchors, int *num_anchors) +{ + int i; + char_u *dia = (*buf->b_p_dia == NUL) ? p_dia : buf->b_p_dia; + + buf_T *orig_curbuf = curbuf; + win_T *orig_curwin = curwin; + + win_T *bufwin = NULL; + if (check_only) + bufwin = curwin; + else + { + // Find the first window tied to this buffer and ignore the rest. Will + // only matter for window-specific addresses like `.` or `''`. + FOR_ALL_WINDOWS(bufwin) + if (bufwin->w_buffer == buf && bufwin->w_p_diff) + break; + if (bufwin == NULL) + return FAIL; // should not really happen + } + + for (i = 0; i < MAX_DIFF_ANCHORS && *dia != NUL; i++) + { + if (*dia == ',') // don't allow empty values + return FAIL; + + curbuf = buf; + curwin = bufwin; + linenr_T lnum = get_address(NULL, &dia, ADDR_LINES, check_only, TRUE, FALSE, 1); + curbuf = orig_curbuf; + curwin = orig_curwin; + + if (dia == NULL) // error detected + return FAIL; + if (*dia != ',' && *dia != NUL) + return FAIL; + + if (!check_only + && (lnum == MAXLNUM || lnum <= 0 || lnum > buf->b_ml.ml_line_count + 1)) + { + emsg(_(e_invalid_range)); + return FAIL; + } + + if (anchors != NULL) + anchors[i] = lnum; + + if (*dia == ',') + dia++; + } + if (i == MAX_DIFF_ANCHORS && *dia != NUL) + { + semsg(_(e_cannot_have_more_than_nr_diff_anchors), MAX_DIFF_ANCHORS); + return FAIL; + } + if (num_anchors != NULL) + *num_anchors = i; + return OK; +} + +/* + * This is called when 'diffanchors' is changed. + */ + int +diffanchors_changed(int buflocal) +{ + int result = parse_diffanchors(TRUE, curbuf, NULL, NULL); + if (result == OK && (diff_flags & DIFF_ANCHOR)) + { + tabpage_T *tp; + FOR_ALL_TABPAGES(tp) + { + if (!buflocal) + tp->tp_diff_invalid = TRUE; + else + { + for (int idx = 0; idx < DB_COUNT; ++idx) + if (tp->tp_diffbuf[idx] == curbuf) + { + tp->tp_diff_invalid = TRUE; + break; + } + } + } + } + return result; +} + /* * This is called when 'diffopt' is changed. */ @@ -2740,6 +2863,11 @@ diffopt_changed(void) p += 6; diff_flags_new |= DIFF_FILLER; } + else if (STRNCMP(p, "anchor", 6) == 0) + { + p += 6; + diff_flags_new |= DIFF_ANCHOR; + } else if (STRNCMP(p, "context:", 8) == 0 && VIM_ISDIGIT(p[8])) { p += 8; @@ -2873,6 +3001,9 @@ diffopt_changed(void) p += 10; linematch_lines_new = getdigits(&p); diff_flags_new |= DIFF_LINEMATCH; + + // linematch does not make sense without filler set + diff_flags_new |= DIFF_FILLER; } if (*p != ',' && *p != NUL) @@ -3229,7 +3360,7 @@ diff_refine_inline_char_highlight(diff_T *dp_orig, garray_T *linemap, int idx1) } /* - * Find the inline difference within a diff block among differnt buffers. Do + * Find the inline difference within a diff block among different buffers. Do * this by splitting each block's content into characters or words, and then * use internal xdiff to calculate the per-character/word diff. The result is * stored in dp instead of returned by the function. @@ -3260,6 +3391,11 @@ diff_find_change_inline_diff( diff_T *orig_diff = curtab->tp_first_diff; curtab->tp_first_diff = NULL; + // diff_read() also uses curtab->tp_diffbuf to determine what's an active + // buffer + buf_T *(orig_diffbuf[DB_COUNT]); + memcpy(orig_diffbuf, curtab->tp_diffbuf, sizeof(orig_diffbuf)); + // Buffers to populate mmfile 1/2 that would be passed to xdiff as memory // files. Use a grow array as it is not obvious how much exact space we // need. @@ -3281,7 +3417,12 @@ diff_find_change_inline_diff( continue; // skip buffer that isn't loaded if (dp->df_count[i] == 0) - continue; // skip buffer that don't have any texts in this block + { + // skip buffers that don't have any texts in this block so we don't + // end up marking the entire block as modified in multi-buffer diff + curtab->tp_diffbuf[i] = NULL; + continue; + } if (file1_idx == -1) file1_idx = i; @@ -3309,10 +3450,17 @@ diff_find_change_inline_diff( char_u *s; for (s = curline; *s != NUL;) { - // Always use the first buffer's 'iskeyword' to have a consistent diff int new_in_keyword = FALSE; if (diff_flags & DIFF_INLINE_WORD) - new_in_keyword = vim_iswordp_buf(s, curtab->tp_diffbuf[file1_idx]); + { + // Always use the first buffer's 'iskeyword' to have a + // consistent diff. + // For multibyte chars, only treat alphanumeric chars + // (class 2) as "word", as other classes such as emojis and + // CJK ideographs do not usually benefit from word diff as + // Vim doesn't have a good way to segment them. + new_in_keyword = (mb_get_class_buf(s, curtab->tp_diffbuf[file1_idx]) == 2); + } if (in_keyword && !new_in_keyword) { ga_append(curstr, NL); @@ -3488,7 +3636,7 @@ diff_find_change_inline_diff( CLEAR_FIELD(change); for (int i = 0; i < DB_COUNT; i++) { - if (new_diff->df_lnum[i] == 0) + if (new_diff->df_lnum[i] <= 0) // should never be < 0. Checking just for safety. continue; linenr_T diff_lnum = new_diff->df_lnum[i] - 1; // use zero-index linenr_T diff_lnum_end = diff_lnum + new_diff->df_count[i]; @@ -3537,6 +3685,7 @@ diff_find_change_inline_diff( diff_clear(curtab); curtab->tp_first_diff = orig_diff; + memcpy(curtab->tp_diffbuf, orig_diffbuf, sizeof(orig_diffbuf)); ga_clear(&file1_str); ga_clear(&file2_str); @@ -3567,15 +3716,8 @@ diff_find_change( // search for a change that includes "lnum" in the list of diffblocks. FOR_ALL_DIFFBLOCKS_IN_TAB(curtab, dp) - if (lnum <= dp->df_lnum[idx] + dp->df_count[idx]) + if (lnum < dp->df_lnum[idx] + dp->df_count[idx]) break; - if (dp->is_linematched) - { - while (dp && dp->df_next - && lnum == dp->df_count[idx] + dp->df_lnum[idx] - && dp->df_next->df_lnum[idx] == lnum) - dp = dp->df_next; - } if (dp == NULL || diff_check_sanity(curtab, dp) == FAIL) return FALSE; @@ -3867,10 +4009,13 @@ ex_diffgetput(exarg_T *eap) { // Make it possible that ":diffget" on the last line gets line below // the cursor line when there is no difference above the cursor. - if (eap->cmdidx == CMD_diffget - && eap->line1 == curbuf->b_ml.ml_line_count - && diff_check(curwin, eap->line1) == 0 - && (eap->line1 == 1 || diff_check(curwin, eap->line1 - 1) == 0)) + int linestatus = 0; + if (eap->line1 == curbuf->b_ml.ml_line_count + && (diff_check_with_linestatus(curwin, eap->line1, &linestatus) == 0 + && linestatus == 0) + && (eap->line1 == 1 || + (diff_check_with_linestatus(curwin, eap->line1 - 1, &linestatus) >= 0 + && linestatus == 0))) ++eap->line2; else if (eap->line1 > 0) --eap->line1; @@ -3913,9 +4058,11 @@ ex_diffgetput(exarg_T *eap) { if (!eap->addr_count) { - // handle the case with adjacent diff blocks - while (dp->is_linematched - && dp->df_next + // Handle the case with adjacent diff blocks (e.g. using linematch + // or anchors) at/above the cursor. Since a range wasn't specified, + // we just want to grab one diff block rather than all of them in + // the vicinity. + while (dp->df_next && dp->df_next->df_lnum[idx_cur] == dp->df_lnum[idx_cur] + dp->df_count[idx_cur] && dp->df_next->df_lnum[idx_cur] == eap->line1 + off + 1) @@ -4105,6 +4252,18 @@ ex_diffgetput(exarg_T *eap) check_cursor(); changed_line_abv_curs(); +#ifdef FEAT_FOLDING + // If all diffs are gone, update folds in all diff windows. + if (curtab->tp_first_diff == NULL) + { + win_T *wp; + + FOR_ALL_WINDOWS_IN_TAB(curtab, wp) + if (wp->w_p_diff && wp->w_p_fdm[0] == 'd' && wp->w_p_fen) + foldUpdateAll(wp); + } +#endif + if (diff_need_update) // redraw already done by ex_diffupdate() diff_need_update = FALSE; @@ -4526,7 +4685,6 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) static int change_end = 0; static hlf_T hlID = (hlf_T)0; int cache_results = TRUE; - int filler_lines; int col; diffline_T diffline; @@ -4541,7 +4699,7 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { // Remember the results if using simple since it's recalculated per // call. Otherwise just call diff_find_change() every time since - // internally the result is cached interally. + // internally the result is cached internally. cache_results = FALSE; } @@ -4556,10 +4714,10 @@ f_diff_hlID(typval_T *argvars UNUSED, typval_T *rettv UNUSED) { // New line, buffer, change: need to get the values. int linestatus = 0; - filler_lines = diff_check_with_linestatus(curwin, lnum, &linestatus); - if (filler_lines < 0 || linestatus < 0) + diff_check_with_linestatus(curwin, lnum, &linestatus); + if (linestatus < 0) { - if (filler_lines == -1 || linestatus == -1) + if (linestatus == -1) { change_start = MAXCOL; change_end = -1; diff --git a/src/dosinst.c b/src/dosinst.c index 116cc8fa40..3c2dc15720 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -2695,8 +2695,8 @@ request_choice(void) printf("\n\nInstall will do for you:\n"); for (i = 0; i < choice_count; ++i) - if (choices[i].active) - printf("%2d %s\n", i + 1, choices[i].text); + if (choices[i].active) + printf("%2d %s\n", i + 1, choices[i].text); printf("To change an item, enter its number\n\n"); printf("Enter item number, h (help), d (do it) or q (quit): "); } diff --git a/src/drawline.c b/src/drawline.c index fcfb495bad..f1f3175c31 100644 --- a/src/drawline.c +++ b/src/drawline.c @@ -388,7 +388,8 @@ handle_lnum_col( // If 'signcolumn' is set to 'number' and a sign is present // in 'lnum', then display the sign instead of the line // number. - if ((*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u') && sign_present) + if ((*wp->w_p_scl == 'n' && *(wp->w_p_scl + 1) == 'u') && sign_present + && wlv->sattr.sat_text != NULL) get_sign_display_info(TRUE, wp, wlv); else #endif @@ -1475,9 +1476,9 @@ win_line( CLEAR_FIELD(line_changes); - if (wlv.filler_lines < 0 || linestatus < 0) + if (linestatus < 0) { - if (wlv.filler_lines == -1 || linestatus == -1) + if (linestatus == -1) { if (diff_find_change(wp, lnum, &line_changes)) { @@ -1508,9 +1509,6 @@ win_line( else wlv.diff_hlf = HLF_ADD; - if (linestatus == 0) - wlv.filler_lines = 0; - area_highlighting = TRUE; } @@ -2771,6 +2769,13 @@ win_line( #endif // no more cells to skip skip_cells = 0; +#ifdef FEAT_TERMINAL + if (term_show_buffer(wp->w_buffer) + && wlv.vcol == 0 + && wlv.win_attr == term_get_attr(wp, lnum, -1)) + // reset highlighting attribute + wlv.win_attr = 0; +#endif } if (has_mbyte) @@ -4383,7 +4388,7 @@ win_line( == 2 || (*mb_off2cells)( LineOffset[wlv.screen_row - 1] - + (int)Columns - 2, + + (int)topframe->fr_width - 2, LineOffset[wlv.screen_row] + screen_Columns) == 2))) { @@ -4393,17 +4398,17 @@ win_line( // auto-wrap, we overwrite the character. if (screen_cur_col != wp->w_width) screen_char(LineOffset[wlv.screen_row - 1] - + (unsigned)Columns - 1, - wlv.screen_row - 1, (int)(Columns - 1)); + + (unsigned)topframe->fr_width - 1, + wlv.screen_row - 1, (int)(topframe->fr_width - 1)); // When there is a multi-byte character, just output a // space to keep it simple. if (has_mbyte && MB_BYTE2LEN(ScreenLines[LineOffset[ - wlv.screen_row - 1] + (Columns - 1)]) > 1) + wlv.screen_row - 1] + (topframe->fr_width - 1)]) > 1) out_char(' '); else out_char(ScreenLines[LineOffset[wlv.screen_row - 1] - + (Columns - 1)]); + + (topframe->fr_width - 1)]); // force a redraw of the first char on the next line ScreenAttrs[LineOffset[wlv.screen_row]] = (sattr_T)-1; screen_start(); // don't know where cursor is now diff --git a/src/drawscreen.c b/src/drawscreen.c index b833b08d0b..85544c18db 100644 --- a/src/drawscreen.c +++ b/src/drawscreen.c @@ -209,6 +209,9 @@ update_screen(int type_arg) redraw_cmdline = TRUE; redraw_tabline = TRUE; } +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif } msg_scrolled = 0; need_wait_return = FALSE; @@ -265,6 +268,11 @@ update_screen(int type_arg) if (redraw_tabline || type >= UPD_NOT_VALID) draw_tabline(); +#if defined(FEAT_TABPANEL) + if (redraw_tabpanel || type >= UPD_NOT_VALID) + draw_tabpanel(); +#endif + #ifdef FEAT_SYN_HL // Correct stored syntax highlighting info for changes in each displayed // buffer. Each buffer must only be done once. @@ -532,7 +540,6 @@ win_redr_status(win_T *wp, int ignore_pum UNUSED) screen_puts(p, row, wp->w_wincol, attr); screen_fill(row, row + 1, plen + wp->w_wincol, this_ru_col + wp->w_wincol, fillchar, fillchar, attr); - if ((NameBufflen = get_keymap_str(wp, (char_u *)"<%s>", NameBuff, MAXPATHL)) > 0 && (this_ru_col - plen) > (NameBufflen + 1)) screen_puts(NameBuff, row, (int)(this_ru_col - NameBufflen @@ -620,6 +627,11 @@ showruler(int always) // Redraw the tab pages line if needed. if (redraw_tabline) draw_tabline(); + +#if defined(FEAT_TABPANEL) + if (redraw_tabpanel) + draw_tabpanel(); +#endif } void @@ -722,7 +734,10 @@ win_redr_ruler(win_T *wp, int always, int ignore_pum) wp->w_p_list = TRUE; } - bufferlen = vim_snprintf((char *)buffer, RULER_BUF_LEN, "%ld,", + // row number, column number is appended + // l10n: leave as-is unless a space after the comma is preferred + // l10n: do not add any row/column label, due to the limited space + bufferlen = vim_snprintf((char *)buffer, RULER_BUF_LEN, _("%ld,"), (wp->w_buffer->b_ml.ml_flags & ML_EMPTY) ? 0L : (long)(wp->w_cursor.lnum)); @@ -1026,8 +1041,8 @@ redraw_win_toolbar(win_T *wp) } wp->w_winbar_items[item_idx].wb_menu = NULL; // end marker - screen_line(wp, wp->w_winrow, wp->w_wincol, wp->w_width, wp->w_width, -1, - 0); + screen_line(wp, wp->w_winrow, wp->w_wincol, wp->w_width, + wp->w_width, -1, 0); } #endif @@ -1361,8 +1376,8 @@ fold_line( } #endif - screen_line(wp, row + W_WINROW(wp), wp->w_wincol, - wp->w_width, wp->w_width, -1, 0); + screen_line(wp, row + W_WINROW(wp), wp->w_wincol, wp->w_width, wp->w_width, + -1, 0); // Update w_cline_height and w_cline_folded if the cursor line was // updated (saves a call to plines() later). @@ -2596,13 +2611,16 @@ win_update(win_T *wp) for (k = 0; k < Rows; ++k) if (enc_utf8) - if ((*mb_off2cells)(LineOffset[k] + Columns - 2, + if ((*mb_off2cells)(LineOffset[k] + topframe->fr_width - 2, LineOffset[k] + screen_Columns) > 1) - screen_draw_rectangle(k, Columns - 2, 1, 2, FALSE); + screen_draw_rectangle(k, topframe->fr_width - 2, 1, 2, + FALSE); else - screen_draw_rectangle(k, Columns - 1, 1, 1, FALSE); + screen_draw_rectangle(k, topframe->fr_width - 1, 1, 1, + FALSE); else - screen_char(LineOffset[k] + Columns - 1, k, Columns - 1); + screen_char(LineOffset[k] + topframe->fr_width - 1, k, + Columns - 1); } #endif @@ -2672,7 +2690,7 @@ win_update(win_T *wp) // Last line isn't finished: Display "@@@" at the end. screen_fill(W_WINROW(wp) + wp->w_height - 1, W_WINROW(wp) + wp->w_height, - start_col < wp->w_wincol ? wp->w_wincol : start_col, + (start_col < wp->w_wincol ? wp->w_wincol : start_col), (int)W_ENDCOL(wp), symbol, symbol, HL_ATTR(HLF_AT)); set_empty_rows(wp, srow); @@ -2898,6 +2916,11 @@ update_debug_sign(buf_T *buf, linenr_T lnum) win_redr_status(wp, FALSE); } +#if defined(FEAT_TABPANEL) + if (redraw_tabpanel) + draw_tabpanel(); +#endif + update_finish(); } #endif @@ -2930,6 +2953,11 @@ updateWindow(win_T *wp) if (redraw_tabline) draw_tabline(); +#if defined(FEAT_TABPANEL) + if (redraw_tabpanel) + draw_tabpanel(); +#endif + if (wp->w_redr_status || p_ru # ifdef FEAT_STL_OPT || *p_stl != NUL || *wp->w_p_stl != NUL @@ -3332,6 +3360,11 @@ redraw_statuslines(void) win_redr_status(wp, FALSE); if (redraw_tabline) draw_tabline(); + +#if defined(FEAT_TABPANEL) + if (redraw_tabpanel) + draw_tabpanel(); +#endif } /* diff --git a/src/edit.c b/src/edit.c index 7dfed1665e..b1f0cb6271 100644 --- a/src/edit.c +++ b/src/edit.c @@ -608,7 +608,16 @@ edit( if (c != K_IGNORE && c != K_NOP) vungetc(c); count = 0; - nomove = TRUE; + + if (!bt_prompt(curwin->w_buffer) +#ifdef FEAT_TERMINAL + && !bt_terminal(curwin->w_buffer) +#endif + && stop_insert_mode) + // :stopinsert command via callback or via server command + nomove = FALSE; + else + nomove = TRUE; ins_compl_prep(ESC); goto doESCkey; } @@ -684,7 +693,7 @@ edit( && stop_arrow() == OK) { ins_compl_delete(); - ins_compl_insert(FALSE, FALSE); + ins_compl_insert(FALSE); } // Delete preinserted text when typing special chars else if (IS_WHITE_NL_OR_NUL(c) && ins_compl_preinsert_effect()) @@ -920,6 +929,8 @@ edit( break; case Ctrl_R: // insert the contents of a register + if (ctrl_x_mode_register() && !ins_compl_active()) + goto docomplete; ins_reg(); auto_format(FALSE, TRUE); inserted_space = FALSE; @@ -1411,6 +1422,11 @@ edit( ) did_cursorhold = FALSE; + // Check if we need to cancel completion mode because the window + // or tab page was changed + if (ins_compl_active() && !ins_compl_win_active(curwin)) + ins_compl_cancel(); + // If the cursor was moved we didn't just insert a space if (arrow_used) inserted_space = FALSE; @@ -2190,7 +2206,7 @@ insertchar( i -= middle_len; // Check some expected things before we go on - if (i >= 0 && lead_end[end_len - 1] == end_comment_pending) + if (i >= 0 && end_len > 0 && lead_end[end_len - 1] == end_comment_pending) { // Backspace over all the stuff we want to replace backspace_until_column(i); @@ -2971,7 +2987,7 @@ stuff_inserted( do { - stuffReadbuffLen(insert.string, insert.length); + stuffReadbuffLen(insert.string, (long)insert.length); // a trailing "0" is inserted as "048", "^" as "^" switch (last) { @@ -3031,7 +3047,7 @@ get_last_insert_save(void) return NULL; if (insert.length > 0 && s[insert.length - 1] == ESC) // remove trailing ESC - s[insert.length - 1] = NUL; + s[--insert.length] = NUL; return s; } @@ -5477,7 +5493,7 @@ do_insert_char_pre(int c) // Lock the text to avoid weird things from happening. ++textlock; - set_vim_var_string(VV_CHAR, buf, buflen); // set v:char + set_vim_var_string(VV_CHAR, buf, (int)buflen); // set v:char res = NULL; if (ins_apply_autocmds(EVENT_INSERTCHARPRE)) diff --git a/src/errors.h b/src/errors.h index 2d1cd99f18..771a8b0200 100644 --- a/src/errors.h +++ b/src/errors.h @@ -2308,7 +2308,7 @@ EXTERN char e_cant_rename_viminfo_file_to_str[] INIT(= N_("E886: Can't rename viminfo file to %s!")); #endif #if defined(FEAT_PYTHON) || defined(FEAT_PYTHON3) -EXTERN char e_sorry_this_command_is_disabled_python_side_module_could_not_be_loaded[] +EXTERN char e_sorry_this_command_is_disabled_python_site_module_could_not_be_loaded[] INIT(= N_("E887: Sorry, this command is disabled, the Python's site module could not be loaded.")); #endif EXTERN char e_nfa_regexp_cannot_repeat_str[] @@ -2890,8 +2890,8 @@ EXTERN char e_assert_fails_fourth_argument[] INIT(= N_("E1115: \"assert_fails()\" fourth argument must be a number")); EXTERN char e_assert_fails_fifth_argument[] INIT(= N_("E1116: \"assert_fails()\" fifth argument must be a string")); -EXTERN char e_cannot_use_bang_with_nested_def[] - INIT(= N_("E1117: Cannot use ! with nested :def")); +EXTERN char e_cannot_use_bang_with_nested_def_str[] + INIT(= N_("E1117: Cannot use ! with nested %s")); EXTERN char e_cannot_change_locked_list[] INIT(= N_("E1118: Cannot change locked list")); EXTERN char e_cannot_change_locked_list_item[] @@ -3629,8 +3629,14 @@ EXTERN char e_uninitialized_object_var_reference[] INIT(= N_("E1430: Uninitialized object variable '%s' referenced")); EXTERN char e_abstract_method_str_direct[] INIT(= N_("E1431: Abstract method \"%s\" in class \"%s\" cannot be accessed directly")); -#endif -// E1432 - E1499 unused (reserved for Vim9 class support) +EXTERN char e_generic_method_str_override_with_concrete_method_in_class_str[] + INIT(= N_("E1432: Overriding generic method \"%s\" in class \"%s\" with a concrete method")); +EXTERN char e_concrete_method_str_override_with_generic_method_in_class_str[] + INIT(= N_("E1433: Overriding concrete method \"%s\" in class \"%s\" with a generic method")); +EXTERN char e_generic_method_str_type_arguments_mismatch_in_class_str[] + INIT(= N_("E1434: Mismatched number of type variables for generic method \"%s\" in class \"%s\"")); +#endif +// E1435 - E1499 unused (reserved for Vim9 class support) EXTERN char e_cannot_mix_positional_and_non_positional_str[] INIT(= N_("E1500: Cannot mix positional and non-positional arguments: %s")); EXTERN char e_fmt_arg_nr_unused_str[] @@ -3721,3 +3727,55 @@ EXTERN char e_variadic_tuple_must_end_with_list_type_str[] EXTERN char e_cannot_use_variadic_tuple_in_concatenation[] INIT(= N_("E1540: Cannot use a variadic tuple in concatenation")); #endif +EXTERN char e_unicode_val_too_large[] + INIT(= N_("E1541: Value too large, max Unicode codepoint is U+10FFFF")); +#ifdef FEAT_QUICKFIX +EXTERN char e_cannot_have_negative_or_zero_number_of_quickfix[] + INIT(= N_("E1542: Cannot have a negative or zero number of quickfix/location lists")); +EXTERN char e_cannot_have_more_than_hundred_quickfix[] + INIT(= N_("E1543: Cannot have more than a hundred quickfix/location lists")); +EXTERN char e_failed_resizing_quickfix_stack[] + INIT(= N_("E1544: Failed resizing the quickfix/location list stack")); +EXTERN char e_no_quickfix_stack[] + INIT(= N_("E1545: Quickfix list stack unavailable")); +#endif +EXTERN char e_cannot_switch_to_a_closing_buffer[] + INIT(= N_("E1546: Cannot switch to a closing buffer")); +EXTERN char e_cannot_not_support_redrawtabpanel[] + INIT(= N_("E1547: This version of Vim does support :redrawtabpanel")); +#ifdef FEAT_WAYLAND +EXTERN char e_wayland_connection_unavailable[] + INIT(= N_("E1548: Wayland connection is unavailable")); +#endif +#if defined(FEAT_DIFF) +EXTERN char e_cannot_have_more_than_nr_diff_anchors[] + INIT(= N_("E1549: Cannot have more than %d diff anchors")); +EXTERN char e_failed_to_find_all_diff_anchors[] + INIT(= N_("E1550: Failed to find all diff anchors")); +#endif +#ifdef FEAT_PROP_POPUP +EXTERN char e_cannot_open_a_popup_window_to_a_closing_buffer[] + INIT(= N_("E1551: Cannot open a popup window to a closing buffer")); +#endif +#ifdef FEAT_EVAL +EXTERN char e_type_var_name_must_start_with_uppercase_letter_str[] + INIT(= N_("E1552: Type variable name must start with an uppercase letter: %s")); +EXTERN char e_missing_comma_in_generic_function_str[] + INIT(= N_("E1553: Missing comma after type in generic function: %s")); +EXTERN char e_missing_closing_angle_bracket_in_generic_function_str[] + INIT(= N_("E1554: Missing '>' in generic function: %s")); +EXTERN char e_empty_type_list_for_generic_function_str[] + INIT(= N_("E1555: Empty type list specified for generic function '%s'")); +EXTERN char e_too_many_types_for_generic_function_str[] + INIT(= N_("E1556: Too many types specified for generic function '%s'")); +EXTERN char e_not_enough_types_for_generic_function_str[] + INIT(= N_("E1557: Not enough types specified for generic function '%s'")); +EXTERN char e_unknown_generic_function_str[] + INIT(= N_("E1558: Unknown generic function: %s")); +EXTERN char e_generic_func_missing_type_args_str[] + INIT(= N_("E1559: Type arguments missing for generic function '%s'")); +EXTERN char e_not_a_generic_function_str[] + INIT(= N_("E1560: Not a generic function: %s")); +EXTERN char e_duplicate_type_var_name_str[] + INIT(= N_("E1561: Duplicate type variable name: %s")); +#endif diff --git a/src/eval.c b/src/eval.c index e89116452c..604b471d19 100644 --- a/src/eval.c +++ b/src/eval.c @@ -1620,12 +1620,12 @@ get_lval_tuple( * The method index, method function pointer and method type are returned in * "lp". */ - static void + static int get_lval_oc_method( lval_T *lp, class_T *cl, char_u *key, - char_u *key_end, + char_u **key_end, vartype_T v_type) { // Look for a method with this name. @@ -1637,8 +1637,13 @@ get_lval_oc_method( ufunc_T *fp; fp = method_lookup(cl, round == 1 ? VAR_CLASS : VAR_OBJECT, - key, key_end - key, &m_idx); + key, *key_end - key, &m_idx); lp->ll_oi = m_idx; + + // process generic method (if present) + if (fp && (fp = eval_generic_func(fp, key, key_end)) == NULL) + return FAIL; + if (fp != NULL) { lp->ll_ufunc = fp; @@ -1646,6 +1651,8 @@ get_lval_oc_method( break; } } + + return OK; } /* @@ -1711,7 +1718,7 @@ get_lval_oc_variable( get_lval_class_or_obj( lval_T *lp, char_u *key, - char_u *key_end, + char_u **key_end, vartype_T v_type, class_T *cl_exec, int flags, @@ -1747,19 +1754,20 @@ get_lval_class_or_obj( lp->ll_valtype = NULL; if (flags & GLV_PREFER_FUNC) - get_lval_oc_method(lp, cl, key, key_end, v_type); + if (get_lval_oc_method(lp, cl, key, key_end, v_type) == FAIL) + return FAIL; // Look for object/class member variable if (lp->ll_valtype == NULL) { - if (get_lval_oc_variable(lp, cl, key, key_end, v_type, cl_exec, flags) + if (get_lval_oc_variable(lp, cl, key, *key_end, v_type, cl_exec, flags) == FAIL) return FAIL; } if (lp->ll_valtype == NULL) { - member_not_found_msg(cl, v_type, key, key_end - key); + member_not_found_msg(cl, v_type, key, *key_end - key); return FAIL; } @@ -2039,7 +2047,7 @@ get_lval_subscript( } else // v_type == VAR_CLASS || v_type == VAR_OBJECT { - if (get_lval_class_or_obj(lp, key, p, v_type, cl_exec, flags, + if (get_lval_class_or_obj(lp, key, &p, v_type, cl_exec, flags, quiet) == FAIL) goto done; } @@ -2213,7 +2221,7 @@ get_lval( // parse the type after the name lp->ll_type = parse_type(&tp, &SCRIPT_ITEM(current_sctx.sc_sid)->sn_type_list, - !quiet); + NULL, NULL, !quiet); if (lp->ll_type == NULL && !quiet) return NULL; lp->ll_name_end = tp; @@ -2284,7 +2292,7 @@ get_lval( { where_T where = WHERE_INIT; - // In a vim9 script, do type check and make sure the variable is + // In a Vim9 script, do type check and make sure the variable is // writable. if (check_typval_type(lp->ll_valtype, rettv, where) == FAIL) return NULL; @@ -3179,6 +3187,8 @@ eval_func( funcexe.fe_basetv = basetv; funcexe.fe_check_type = type; funcexe.fe_found_var = found_var; + if (evalarg != NULL) + funcexe.fe_cctx = evalarg->eval_cctx; ret = get_func_tv(s, len, rettv, arg, evalarg, &funcexe); } vim_free(s); @@ -4725,7 +4735,7 @@ eval8( { ++*arg; ga_init2(&type_list, sizeof(type_T *), 10); - want_type = parse_type(arg, &type_list, TRUE); + want_type = parse_type(arg, &type_list, NULL, NULL, TRUE); if (want_type == NULL && (evaluate || **arg != '>')) { clear_type_list(&type_list); @@ -4973,7 +4983,7 @@ eval9_nested_expr( if (vim9script) { - ret = get_lambda_tv(arg, rettv, TRUE, evalarg); + ret = get_lambda_tv(arg, rettv, TRUE, evalarg, NULL); if (ret == OK && evaluate) { ufunc_T *ufunc = rettv->vval.v_partial->pt_func; @@ -5000,6 +5010,8 @@ eval9_nested_expr( else { ret = eval1(arg, rettv, evalarg); // recursive! + if (ret != OK) + return ret; *arg = skipwhite_and_linebreak(*arg, evalarg); @@ -5060,7 +5072,8 @@ eval9_var_func_name( semsg(_(e_cannot_use_s_colon_in_vim9_script_str), s); ret = FAIL; } - else if ((vim9script ? **arg : *skipwhite(*arg)) == '(') + else if ((vim9script ? **arg : *skipwhite(*arg)) == '(' + || (vim9script && generic_func_call(arg))) { // "name(..." recursive! *arg = skipwhite(*arg); @@ -5077,6 +5090,12 @@ eval9_var_func_name( *name_start = s; ret = eval_variable(s, len, 0, rettv, NULL, EVAL_VAR_VERBOSE + EVAL_VAR_IMPORT); + + // skip the generic function arguments (if present) + // they are already processed by eval_variable + if (ret == OK && vim9script && **arg == '<' + && rettv->v_type == VAR_FUNC) + ret = skip_generic_func_type_args(arg); } } else @@ -5228,7 +5247,7 @@ eval9( case '{': if (vim9script) ret = NOTDONE; else - ret = get_lambda_tv(arg, rettv, vim9script, evalarg); + ret = get_lambda_tv(arg, rettv, vim9script, evalarg, NULL); if (ret == NOTDONE) ret = eval_dict(arg, rettv, evalarg, FALSE); break; @@ -5436,6 +5455,8 @@ call_func_rettv( funcexe.fe_partial = pt; funcexe.fe_selfdict = selfdict; funcexe.fe_basetv = basetv; + if (evalarg != NULL) + funcexe.fe_cctx = evalarg->eval_cctx; ret = get_func_tv(s, -1, rettv, arg, evalarg, &funcexe); theend: @@ -5469,7 +5490,7 @@ eval_lambda( if (**arg == '{') { // ->{lambda}() - ret = get_lambda_tv(arg, rettv, FALSE, evalarg); + ret = get_lambda_tv(arg, rettv, FALSE, evalarg, NULL); } else { @@ -5661,6 +5682,15 @@ eval_index( ; if (keylen == 0) return FAIL; + if (vim9script && key[keylen] == '<') + { + // skip generic type arguments + char_u *p = &key[keylen]; + + if (skip_generic_func_type_args(&p) == FAIL) + return FAIL; + keylen = p - key; + } *arg = key + keylen; } else @@ -6023,7 +6053,8 @@ partial_free(partial_T *pt) } else func_ptr_unref(pt->pt_func); - object_unref(pt->pt_obj); + if (pt->pt_obj != NULL) + object_unref(pt->pt_obj); // "out_up" is no longer used, decrement refcount on partial that owns it. partial_unref(pt->pt_outer.out_up_partial); @@ -7371,7 +7402,19 @@ handle_subscript( else { rettv->v_type = VAR_FUNC; - rettv->vval.v_string = vim_strnsave(ufunc->uf_name, ufunc->uf_namelen); + if (**arg == '<') + { + char_u *s = get_generic_func_name(ufunc, arg); + if (s != NULL) + rettv->vval.v_string = s; + else + ret = FAIL; + } + else + { + rettv->vval.v_string = + vim_strnsave(ufunc->uf_name, ufunc->uf_namelen); + } } continue; } diff --git a/src/evalfunc.c b/src/evalfunc.c index 79be5d8b8a..a58c6367b8 100644 --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -305,7 +305,7 @@ arg_object(type_T *type, type_T *decl_type UNUSED, argcontext_T *context) if (type->tt_type == VAR_OBJECT || type_any_or_unknown(type)) return OK; - arg_type_mismatch(&t_object, type, context->arg_idx + 1); + arg_type_mismatch(&t_object_any, type, context->arg_idx + 1); return FAIL; } @@ -2089,6 +2089,8 @@ static funcentry_T global_functions[] = ret_number, f_cindent}, {"clearmatches", 0, 1, FEARG_1, arg1_number, ret_void, f_clearmatches}, + {"cmdcomplete_info",0, 0, 0, NULL, + ret_dict_any, f_cmdcomplete_info}, {"col", 1, 2, FEARG_1, arg2_string_or_list_number, ret_number, f_col}, {"complete", 2, 2, FEARG_2, arg2_number_list, @@ -2099,6 +2101,8 @@ static funcentry_T global_functions[] = ret_number_bool, f_complete_check}, {"complete_info", 0, 1, FEARG_1, arg1_list_string, ret_dict_any, f_complete_info}, + {"complete_match", 0, 2, 0, NULL, + ret_list_any, f_complete_match}, {"confirm", 1, 4, FEARG_1, arg4_string_string_number_string, ret_number, f_confirm}, {"copy", 1, 1, FEARG_1, NULL, @@ -2273,6 +2277,8 @@ static funcentry_T global_functions[] = ret_string, f_getcmdwintype}, {"getcompletion", 2, 3, FEARG_1, arg3_string_string_bool, ret_list_string, f_getcompletion}, + {"getcompletiontype", 1, 1, FEARG_1, arg1_string, + ret_string, f_getcompletiontype}, {"getcurpos", 0, 1, FEARG_1, arg1_number, ret_list_number, f_getcurpos}, {"getcursorcharpos", 0, 1, FEARG_1, arg1_number, @@ -3121,6 +3127,8 @@ static funcentry_T global_functions[] = ret_string, f_visualmode}, {"wildmenumode", 0, 0, 0, NULL, ret_number, f_wildmenumode}, + {"wildtrigger", 0, 0, 0, NULL, + ret_void, f_wildtrigger}, {"win_execute", 2, 3, FEARG_2, arg23_win_execute, ret_string, f_win_execute}, {"win_findbuf", 1, 1, FEARG_1, arg1_number, @@ -3942,6 +3950,17 @@ f_call(typval_T *argvars, typval_T *rettv) emsg_funcname(e_unknown_function_str, func); return; } + if (*p == '<') + { + // generic function + char_u *s = append_generic_func_type_args(tofree, STRLEN(tofree), + &p); + if (s != NULL) + { + vim_free(tofree); + tofree = s; + } + } func = tofree; } @@ -5159,6 +5178,7 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) partial_T *arg_pt = NULL; char_u *trans_name = NULL; int is_global = FALSE; + char_u *start_bracket = NULL; if (in_vim9script() && (check_for_string_or_func_arg(argvars, 0) == FAIL @@ -5196,6 +5216,12 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) name = s; trans_name = save_function_name(&name, &is_global, FALSE, TFN_INT | TFN_QUIET | TFN_NO_AUTOLOAD | TFN_NO_DEREF, NULL); + if (*name == '<') + { + // generic function + start_bracket = name; + skip_generic_func_type_args(&name); + } if (*name != NUL) s = NULL; } @@ -5338,6 +5364,9 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) else if (is_funcref) { pt->pt_func = find_func(trans_name, is_global); + if (IS_GENERIC_FUNC(pt->pt_func) && start_bracket != NULL) + pt->pt_func = eval_generic_func(pt->pt_func, s, + &start_bracket); func_ptr_ref(pt->pt_func); vim_free(name); } @@ -5360,8 +5389,19 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref) { // result is a VAR_FUNC rettv->v_type = VAR_FUNC; - rettv->vval.v_string = name; - func_ref(name); + if (start_bracket == NULL) + { + rettv->vval.v_string = name; + func_ref(name); + } + else + { + // generic function + STRCPY(IObuff, name); + STRCAT(IObuff, start_bracket); + rettv->vval.v_string = vim_strsave(IObuff); + vim_free(name); + } } } theend: @@ -5579,41 +5619,41 @@ f_get(typval_T *argvars, typval_T *rettv) f_getcellpixels(typval_T *argvars UNUSED, typval_T *rettv) { if (rettv_list_alloc(rettv) == FAIL) - return; + return; #if defined(FEAT_GUI) if (gui.in_use) { - // success pixel size and no gui. + // success pixel size and no gui. #ifdef FEAT_GUI_MACVIM - struct cellsize cs; - gui_mch_calc_cell_size(&cs); - list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_xpixel); - list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_ypixel); + struct cellsize cs; + gui_mch_calc_cell_size(&cs); + list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_xpixel); + list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_ypixel); #else - list_append_number(rettv->vval.v_list, (varnumber_T)gui.char_width); - list_append_number(rettv->vval.v_list, (varnumber_T)gui.char_height); + list_append_number(rettv->vval.v_list, (varnumber_T)gui.char_width); + list_append_number(rettv->vval.v_list, (varnumber_T)gui.char_height); #endif } else #endif { - struct cellsize cs; + struct cellsize cs; #if defined(UNIX) - mch_calc_cell_size(&cs); + mch_calc_cell_size(&cs); #else - // Non-Unix CUIs are not supported, so set this to -1x-1. - cs.cs_xpixel = -1; - cs.cs_ypixel = -1; + // Non-Unix CUIs are not supported, so set this to -1x-1. + cs.cs_xpixel = -1; + cs.cs_ypixel = -1; #endif - // failed get pixel size. - if (cs.cs_xpixel == -1) - return; + // failed get pixel size. + if (cs.cs_xpixel == -1) + return; - // success pixel size and no gui. - list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_xpixel); - list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_ypixel); + // success pixel size and no gui. + list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_xpixel); + list_append_number(rettv->vval.v_list, (varnumber_T)cs.cs_ypixel); } } @@ -7440,6 +7480,13 @@ f_has(typval_T *argvars, typval_T *rettv) 0 #endif }, + {"tabpanel", +#if defined(FEAT_TABPANEL) + 1, +#else + 0, +#endif + }, {"tag_binary", 1}, // graduated feature {"tcl", #if defined(FEAT_TCL) && !defined(DYNAMIC_TCL) @@ -7521,7 +7568,8 @@ f_has(typval_T *argvars, typval_T *rettv) #endif }, {"unnamedplus", -#if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) +#if defined(FEAT_CLIPBOARD) && (defined(FEAT_X11) \ + || defined(FEAT_WAYLAND_CLIPBOARD)) 1 #else 0 @@ -7558,6 +7606,20 @@ f_has(typval_T *argvars, typval_T *rettv) 1 #else 0 +#endif + }, + {"wayland", +#ifdef FEAT_WAYLAND + 1 +#else + 0 +#endif + }, + {"wayland_clipboard", +#ifdef FEAT_WAYLAND_CLIPBOARD + 1 +#else + 0 #endif }, {"wildignore", 1}, @@ -8865,19 +8927,18 @@ f_line(typval_T *argvars, typval_T *rettv) { if (switch_win_noblock(&switchwin, wp, tp, TRUE) == OK) { + // With 'splitkeep' != cursor and in diff mode, prevent that the + // window scrolls and keep the topline. + if (*p_spk != 'c' #ifdef FEAT_DIFF - // in diff mode, prevent that the window scrolls - // and keep the topline - if (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff) - skip_update_topline = TRUE; + || (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff) #endif + ) + skip_update_topline = TRUE; check_cursor(); fp = var2fpos(&argvars[0], TRUE, &fnum, FALSE); } -#ifdef FEAT_DIFF - if (curwin->w_p_diff && switchwin.sw_curwin->w_p_diff) - skip_update_topline = FALSE; -#endif + skip_update_topline = FALSE; restore_win_noblock(&switchwin, TRUE); } } @@ -9207,7 +9268,7 @@ get_matches_in_str( if (d == NULL) return FAIL; if (list_append_dict(mlist, d) == FAIL) - return FAIL;; + return FAIL; if (dict_add_number(d, matchbuf ? "lnum" : "idx", idx) == FAIL) return FAIL; diff --git a/src/evalvars.c b/src/evalvars.c index 987b6dcbaf..a75300b1b4 100644 --- a/src/evalvars.c +++ b/src/evalvars.c @@ -163,6 +163,8 @@ static struct vimvar {VV_NAME("t_enumvalue", VAR_NUMBER), NULL, VV_RO}, {VV_NAME("stacktrace", VAR_LIST), &t_list_dict_any, VV_RO}, {VV_NAME("t_tuple", VAR_NUMBER), NULL, VV_RO}, + {VV_NAME("wayland_display", VAR_STRING), NULL, VV_RO}, + {VV_NAME("clipmethod", VAR_STRING), NULL, VV_RO}, // MacVim-specific value go here {VV_NAME("os_appearance", VAR_NUMBER), NULL, VV_RO}, }; @@ -3196,6 +3198,20 @@ eval_variable( int has_g_prefix = STRNCMP(name, "g:", 2) == 0; ufunc_T *ufunc = find_func(name, FALSE); + if (ufunc != NULL && cc == '<') + { + // handle generic function + char_u *argp = name + len; + name[len] = cc; + ufunc = eval_generic_func(ufunc, name, &argp); + name[len] = NUL; + if (ufunc == NULL) + { + ret = FAIL; + goto done; + } + } + // In Vim9 script we can get a function reference by using the // function name. For a global non-autoload function "g:" is // required. @@ -3207,9 +3223,22 @@ eval_variable( { rettv->v_type = VAR_FUNC; if (has_g_prefix) + { // Keep the "g:", otherwise script-local may be // assumed. - rettv->vval.v_string = vim_strsave(name); + if (cc != '<') + rettv->vval.v_string = vim_strsave(name); + else + { + // append the generic function arguments + char_u *argp = name + len; + name[len] = cc; + rettv->vval.v_string = + append_generic_func_type_args(name, len, + &argp); + name[len] = NUL; + } + } else rettv->vval.v_string = vim_strnsave(ufunc->uf_name, ufunc->uf_namelen); if (rettv->vval.v_string != NULL) diff --git a/src/evalwindow.c b/src/evalwindow.c index f8b903d505..613df0f251 100644 --- a/src/evalwindow.c +++ b/src/evalwindow.c @@ -106,8 +106,8 @@ win_id2wp_tp(int id, tabpage_T **tpp) } #ifdef FEAT_PROP_POPUP // popup windows are in separate lists - FOR_ALL_TABPAGES(tp) - FOR_ALL_POPUPWINS_IN_TAB(tp, wp) + FOR_ALL_TABPAGES(tp) + FOR_ALL_POPUPWINS_IN_TAB(tp, wp) if (wp->w_id == id) { if (tpp != NULL) diff --git a/src/ex_cmdidxs.h b/src/ex_cmdidxs.h index ad31d7e2f0..e061371c5d 100644 --- a/src/ex_cmdidxs.h +++ b/src/ex_cmdidxs.h @@ -8,29 +8,29 @@ static const unsigned short cmdidxs1[26] = /* a */ 0, /* b */ 21, /* c */ 45, - /* d */ 112, - /* e */ 138, - /* f */ 167, - /* g */ 184, - /* h */ 190, - /* i */ 200, - /* j */ 221, - /* k */ 223, - /* l */ 228, - /* m */ 291, - /* n */ 311, - /* o */ 331, - /* p */ 343, - /* q */ 384, - /* r */ 387, - /* s */ 407, - /* t */ 477, - /* u */ 524, - /* v */ 535, - /* w */ 556, - /* x */ 570, - /* y */ 580, - /* z */ 581 + /* d */ 113, + /* e */ 139, + /* f */ 168, + /* g */ 185, + /* h */ 191, + /* i */ 201, + /* j */ 222, + /* k */ 224, + /* l */ 229, + /* m */ 292, + /* n */ 312, + /* o */ 332, + /* p */ 344, + /* q */ 385, + /* r */ 388, + /* s */ 409, + /* t */ 479, + /* u */ 526, + /* v */ 538, + /* w */ 559, + /* x */ 574, + /* y */ 584, + /* z */ 585 }; /* @@ -43,7 +43,7 @@ static const unsigned char cmdidxs2[26][26] = { /* a b c d e f g h i j k l m n o p q r s t u v w x y z */ /* a */ { 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 6, 7, 0, 0, 0, 8, 17, 0, 18, 0, 0, 0, 0, 0 }, /* b */ { 2, 0, 0, 5, 6, 8, 0, 0, 0, 0, 0, 9, 10, 11, 12, 13, 0, 14, 0, 0, 0, 0, 23, 0, 0, 0 }, - /* c */ { 3, 12, 16, 18, 20, 22, 25, 0, 0, 0, 0, 33, 38, 41, 47, 57, 59, 60, 61, 0, 63, 0, 66, 0, 0, 0 }, + /* c */ { 3, 12, 16, 18, 20, 22, 25, 0, 0, 0, 0, 33, 39, 42, 48, 58, 60, 61, 62, 0, 64, 0, 67, 0, 0, 0 }, /* d */ { 0, 0, 0, 0, 0, 0, 0, 0, 9, 19, 0, 20, 0, 0, 21, 0, 0, 23, 24, 0, 0, 0, 0, 0, 0, 0 }, /* e */ { 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 9, 11, 12, 0, 0, 0, 0, 0, 0, 0, 23, 0, 24, 0, 0 }, /* f */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0 }, @@ -58,15 +58,15 @@ static const unsigned char cmdidxs2[26][26] = /* o */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 5, 0, 0, 0, 0, 0, 0, 9, 0, 11, 0, 0, 0 }, /* p */ { 1, 3, 4, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 10, 0, 0, 17, 18, 27, 0, 29, 0, 30, 0 }, /* q */ { 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - /* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 14, 19, 0, 0, 0, 0 }, + /* r */ { 0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 15, 20, 0, 0, 0, 0 }, /* s */ { 2, 6, 15, 0, 19, 23, 0, 25, 26, 0, 0, 29, 31, 35, 39, 41, 0, 50, 0, 51, 0, 64, 65, 0, 66, 0 }, /* t */ { 2, 0, 19, 0, 24, 26, 0, 27, 0, 29, 0, 30, 34, 37, 39, 40, 0, 41, 43, 0, 44, 0, 0, 0, 46, 0 }, - /* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + /* u */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* v */ { 1, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 12, 15, 0, 0, 0, 0, 18, 0, 19, 0, 0, 0, 0, 0 }, - /* w */ { 2, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 0, 0, 8, 0, 9, 10, 0, 0, 0, 12, 13, 0, 0, 0, 0 }, + /* w */ { 2, 0, 0, 0, 0, 0, 0, 3, 4, 0, 0, 8, 0, 9, 0, 10, 11, 0, 0, 0, 13, 14, 0, 0, 0, 0 }, /* x */ { 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 0, 0, 0, 7, 0, 0, 8, 0, 0, 0, 0, 0 }, /* y */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, /* z */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; -static const int command_count = 598; +static const int command_count = 602; diff --git a/src/ex_cmds.c b/src/ex_cmds.c index e1e6c4ee7c..5d9b722136 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -643,6 +643,231 @@ ex_sort(exarg_T *eap) emsg(_(e_interrupted)); } +/* + * ":uniq". + */ + void +ex_uniq(exarg_T *eap) +{ + regmatch_T regmatch; + int len; + linenr_T lnum; + long maxlen = 0; + linenr_T count = eap->line2 - eap->line1 + 1; + char_u *p; + char_u *s; + char_u save_c = 0; // temporary character storage + int keep_only_unique = FALSE; + int keep_only_not_unique = eap->forceit ? TRUE : FALSE; + long deleted = 0; + colnr_T start_col; + colnr_T end_col; + int change_occurred = FALSE; // Buffer contents changed. + + // Uniq one line is really quick! + if (count <= 1) + return; + + if (u_save((linenr_T)(eap->line1 - 1), (linenr_T)(eap->line2 + 1)) == FAIL) + return; + sortbuf1 = NULL; + regmatch.regprog = NULL; + + sort_abort = sort_ic = sort_lc = sort_rx = sort_nr = 0; + sort_flt = 0; + + for (p = eap->arg; *p != NUL; ++p) + { + if (VIM_ISWHITE(*p)) + ; + else if (*p == 'i') + sort_ic = TRUE; + else if (*p == 'l') + sort_lc = TRUE; + else if (*p == 'r') + sort_rx = TRUE; + else if (*p == 'u') + { + // 'u' is only valid when '!' is not given. + if (!keep_only_not_unique) + keep_only_unique = TRUE; + } + else if (*p == '"') // comment start + break; + else if (eap->nextcmd == NULL && check_nextcmd(p) != NULL) + { + eap->nextcmd = check_nextcmd(p); + break; + } + else if (!ASCII_ISALPHA(*p) && regmatch.regprog == NULL) + { + s = skip_regexp_err(p + 1, *p, TRUE); + if (s == NULL) + goto uniqend; + *s = NUL; + // Use last search pattern if uniq pattern is empty. + if (s == p + 1) + { + if (last_search_pat() == NULL) + { + emsg(_(e_no_previous_regular_expression)); + goto uniqend; + } + regmatch.regprog = vim_regcomp(last_search_pat(), RE_MAGIC); + } + else + regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC); + if (regmatch.regprog == NULL) + goto uniqend; + p = s; // continue after the regexp + regmatch.rm_ic = p_ic; + } + else + { + semsg(_(e_invalid_argument_str), p); + goto uniqend; + } + } + + // Find the length of the longest line. + for (lnum = eap->line1; lnum <= eap->line2; ++lnum) + { + len = ml_get_len(lnum); + if (maxlen < len) + maxlen = len; + + if (got_int) + goto uniqend; + } + + // Allocate a buffer that can hold the longest line. + sortbuf1 = alloc(maxlen + 1); + if (sortbuf1 == NULL) + goto uniqend; + + // Delete lines according to options. + int match_continue = FALSE; + int next_is_unmatch = FALSE; + int is_match; + linenr_T done_lnum = eap->line1 - 1; + linenr_T delete_lnum = 0; + for (linenr_T i = 0; i < count; ++i) + { + linenr_T get_lnum = eap->line1 + i; + + s = ml_get(get_lnum); + len = ml_get_len(get_lnum); + + start_col = 0; + end_col = len; + if (regmatch.regprog != NULL && vim_regexec(®match, s, 0)) + { + if (sort_rx) + { + start_col = (colnr_T)(regmatch.startp[0] - s); + end_col = (colnr_T)(regmatch.endp[0] - s); + } + else + start_col = (colnr_T)(regmatch.endp[0] - s); + } + else + if (regmatch.regprog != NULL) + end_col = 0; + if (end_col > 0) + { + save_c = s[end_col]; + s[end_col] = NUL; + } + + is_match = i > 0 ? !string_compare(&s[start_col], sortbuf1) : FALSE; + delete_lnum = 0; + if (next_is_unmatch) + { + is_match = FALSE; + next_is_unmatch = FALSE; + } + + if (!keep_only_unique && !keep_only_not_unique) + { + if (is_match) + delete_lnum = get_lnum; + else + STRCPY(sortbuf1, &s[start_col]); + } + else if (keep_only_not_unique) + { + if (is_match) + { + done_lnum = get_lnum - 1; + delete_lnum = get_lnum; + match_continue = TRUE; + } + else + { + if (i > 0 && !match_continue && get_lnum - 1 > done_lnum) + { + delete_lnum = get_lnum - 1; + next_is_unmatch = TRUE; + } + else if (i >= count - 1) + delete_lnum = get_lnum; + match_continue = FALSE; + STRCPY(sortbuf1, &s[start_col]); + } + } + else // keep_only_unique + { + if (is_match) + { + if (!match_continue) + delete_lnum = get_lnum - 1; + else + delete_lnum = get_lnum; + match_continue = TRUE; + } + else + { + if (i == 0 && match_continue) + delete_lnum = get_lnum; + match_continue = FALSE; + STRCPY(sortbuf1, &s[start_col]); + } + } + + if (end_col > 0) + s[end_col] = save_c; + + if (delete_lnum > 0) + { + ml_delete(delete_lnum); + i -= get_lnum - delete_lnum + 1; + count--; + deleted++; + change_occurred = TRUE; + } + + fast_breakcheck(); + if (got_int) + goto uniqend; + } + + // Adjust marks for deleted lines and prepare for displaying. + mark_adjust(eap->line2 - deleted, eap->line2, (long)MAXLNUM, -deleted); + msgmore(-deleted); + + if (change_occurred) + changed_lines(eap->line1, 0, eap->line2 + 1, -deleted); + + curwin->w_cursor.lnum = eap->line1; + beginline(BL_WHITE | BL_FIX); + +uniqend: + vim_free(sortbuf1); + vim_regfree(regmatch.regprog); + if (got_int) + emsg(_(e_interrupted)); +} + /* * :move command - move lines line1-line2 to line dest * @@ -1854,6 +2079,9 @@ ex_file(exarg_T *eap) if (rename_buffer(eap->arg) == FAIL) return; redraw_tabline = TRUE; +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif } // print file name if no argument or 'F' is not in 'shortmess' @@ -2100,6 +2328,9 @@ do_write(exarg_T *eap) { curbuf->b_p_ro = FALSE; redraw_tabline = TRUE; +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif } } @@ -2743,9 +2974,9 @@ do_ecmd( } if (buf == NULL) goto theend; - // autocommands try to edit a file that is going to be removed, - // abort - if (buf_locked(buf)) + // autocommands try to edit a closing buffer, which like splitting, can + // result in more windows displaying it; abort + if (buf->b_locked_split) { // window was split, but not editing the new buffer, // reset b_nwindows again @@ -2753,6 +2984,7 @@ do_ecmd( && curwin->w_buffer != NULL && curwin->w_buffer->b_nwindows > 1) --curwin->w_buffer->b_nwindows; + emsg(_(e_cannot_switch_to_a_closing_buffer)); goto theend; } if (curwin->w_alt_fnum == buf->b_fnum && prev_alt_fnum != 0) diff --git a/src/ex_cmds.h b/src/ex_cmds.h index 3a2ba59ae7..61a9ce34b5 100644 --- a/src/ex_cmds.h +++ b/src/ex_cmds.h @@ -353,6 +353,9 @@ EXCMD(CMD_chistory, "chistory", qf_history, EXCMD(CMD_clist, "clist", qf_list, EX_BANG|EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK, ADDR_NONE), +EXCMD(CMD_clipreset, "clipreset", ex_clipreset, + EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK, + ADDR_NONE), EXCMD(CMD_clast, "clast", ex_cc, EX_RANGE|EX_COUNT|EX_TRLBAR|EX_BANG, ADDR_UNSIGNED), @@ -486,7 +489,7 @@ EXCMD(CMD_diffupdate, "diffupdate", ex_diffupdate, EX_BANG|EX_TRLBAR, ADDR_NONE), EXCMD(CMD_diffget, "diffget", ex_diffgetput, - EX_RANGE|EX_EXTRA|EX_TRLBAR|EX_MODIFY, + EX_RANGE|EX_ZEROR|EX_EXTRA|EX_TRLBAR|EX_MODIFY, ADDR_LINES), EXCMD(CMD_diffoff, "diffoff", ex_diffoff, EX_BANG|EX_TRLBAR, @@ -495,7 +498,7 @@ EXCMD(CMD_diffpatch, "diffpatch", ex_diffpatch, EX_EXTRA|EX_FILE1|EX_TRLBAR|EX_MODIFY, ADDR_NONE), EXCMD(CMD_diffput, "diffput", ex_diffgetput, - EX_RANGE|EX_EXTRA|EX_TRLBAR, + EX_RANGE|EX_ZEROR|EX_EXTRA|EX_TRLBAR, ADDR_LINES), EXCMD(CMD_diffsplit, "diffsplit", ex_diffsplit, EX_EXTRA|EX_FILE1|EX_TRLBAR, @@ -1298,6 +1301,9 @@ EXCMD(CMD_redrawstatus, "redrawstatus", ex_redrawstatus, EXCMD(CMD_redrawtabline, "redrawtabline", ex_redrawtabline, EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK, ADDR_NONE), +EXCMD(CMD_redrawtabpanel, "redrawtabpanel", ex_redrawtabpanel, + EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK, + ADDR_NONE), EXCMD(CMD_registers, "registers", ex_display, EX_EXTRA|EX_NOTRLCOM|EX_TRLBAR|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK, ADDR_NONE), @@ -1703,6 +1709,9 @@ EXCMD(CMD_unabbreviate, "unabbreviate", ex_abbreviate, EXCMD(CMD_unhide, "unhide", ex_buffer_all, EX_RANGE|EX_COUNT|EX_TRLBAR, ADDR_OTHER), +EXCMD(CMD_uniq, "uniq", ex_uniq, + EX_RANGE|EX_DFLALL|EX_WHOLEFOLD|EX_BANG|EX_EXTRA|EX_NOTRLCOM|EX_MODIFY, + ADDR_LINES), EXCMD(CMD_unlet, "unlet", ex_unlet, EX_BANG|EX_EXTRA|EX_NEEDARG|EX_SBOXOK|EX_CMDWIN|EX_LOCK_OK, ADDR_NONE), @@ -1808,6 +1817,9 @@ EXCMD(CMD_windo, "windo", ex_listdo, EXCMD(CMD_winpos, "winpos", ex_winpos, EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK, ADDR_NONE), +EXCMD(CMD_wlrestore, "wlrestore", ex_wlrestore, + EX_EXTRA|EX_TRLBAR|EX_CMDWIN|EX_LOCK_OK|EX_BANG, + ADDR_NONE), EXCMD(CMD_wnext, "wnext", ex_wnext, EX_RANGE|EX_BANG|EX_FILE1|EX_ARGOPT|EX_TRLBAR, ADDR_OTHER), diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 19021b5ab6..256469a886 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -66,7 +66,6 @@ static int getargopt(exarg_T *eap); #endif static linenr_T default_address(exarg_T *eap); -static linenr_T get_address(exarg_T *, char_u **, cmd_addr_T addr_type, int skip, int silent, int to_other_file, int address_count); static void address_default_all(exarg_T *eap); static void get_flags(exarg_T *eap); #if !defined(FEAT_PERL) \ @@ -248,6 +247,7 @@ static void ex_later(exarg_T *eap); static void ex_redir(exarg_T *eap); static void ex_redrawstatus(exarg_T *eap); static void ex_redrawtabline(exarg_T *eap); +static void ex_redrawtabpanel(exarg_T *eap); static void close_redir(void); static void ex_mark(exarg_T *eap); static void ex_startinsert(exarg_T *eap); @@ -373,6 +373,12 @@ static void ex_folddo(exarg_T *eap); #if !defined(FEAT_X11) || !defined(FEAT_XCLIPBOARD) # define ex_xrestore ex_ni #endif +#if !defined(FEAT_WAYLAND) +# define ex_wlrestore ex_ni +#endif +#if !defined(FEAT_CLIPBOARD) +# define ex_clipreset ex_ni +#endif #if !defined(FEAT_PROP_POPUP) # define ex_popupclear ex_ni #endif @@ -473,36 +479,38 @@ restore_dbg_stuff(struct dbg_stuff *dsp) /* * Check if ffname differs from fnum. - * fnum is a buffer number. 0 == current buffer, 1-or-more must be a valid buffer ID. + * fnum is a buffer number. 0 == current buffer, 1-or-more must be a valid + * buffer ID. * ffname is a full path to where a buffer lives on-disk or would live on-disk. * */ static int is_other_file(int fnum, char_u *ffname) { - if (fnum != 0) - { - if (fnum == curbuf->b_fnum) - return FALSE; + if (fnum != 0) + { + if (fnum == curbuf->b_fnum) + return FALSE; - return TRUE; - } + return TRUE; + } - if (ffname == NULL) - return TRUE; + if (ffname == NULL) + return TRUE; - if (*ffname == NUL) - return FALSE; + if (*ffname == NUL) + return FALSE; - // TODO: Need a reliable way to know whether a buffer is meant to live on-disk - // !curbuf->b_dev_valid is not always available (example: missing on Windows) - if (curbuf->b_sfname != NULL - && *curbuf->b_sfname != NUL) - // This occurs with unsaved buffers. In which case `ffname` - // actually corresponds to curbuf->b_sfname - return fnamecmp(ffname, curbuf->b_sfname) != 0; + // TODO: Need a reliable way to know whether a buffer is meant to live + // on-disk !curbuf->b_dev_valid is not always available (example: missing + // on Windows) + if (curbuf->b_sfname != NULL + && *curbuf->b_sfname != NUL) + // This occurs with unsaved buffers. In which case `ffname` actually + // corresponds to curbuf->b_sfname + return fnamecmp(ffname, curbuf->b_sfname) != 0; - return otherfile(ffname); + return otherfile(ffname); } /* @@ -2721,7 +2729,7 @@ static char ex_error_buf[MSG_BUF_LEN]; * Uses a static buffer, only the last error will be kept. * "msg" will be translated, caller should use N_(). */ - char * + char * ex_errmsg(char *msg, char_u *arg) { vim_snprintf(ex_error_buf, MSG_BUF_LEN, _(msg), arg); @@ -3713,6 +3721,16 @@ find_ex_command( // "&option" can be followed by "->" or "=", check below } + if (*p == '<' && vim9) + { + // generic function + if (skip_generic_func_type_args(&p) == FAIL) + { + eap->cmdidx = CMD_SIZE; + return p; + } + } + swp = skipwhite(p); if ( @@ -4355,7 +4373,7 @@ default_address(exarg_T *eap) * * Return MAXLNUM when no Ex address was found. */ - static linenr_T + linenr_T get_address( exarg_T *eap UNUSED, char_u **ptr, @@ -4549,7 +4567,7 @@ get_address( else curwin->w_cursor.col = 0; searchcmdlen = 0; - flags = silent ? 0 : SEARCH_HIS | SEARCH_MSG; + flags = silent ? SEARCH_KEEP : SEARCH_HIS | SEARCH_MSG; if (!do_search(NULL, c, c, cmd, STRLEN(cmd), 1L, flags, NULL)) { curwin->w_cursor = pos; @@ -4853,7 +4871,8 @@ invalid_range(exarg_T *eap) case ADDR_LINES: if (eap->line2 > curbuf->b_ml.ml_line_count #ifdef FEAT_DIFF - + (eap->cmdidx == CMD_diffget) + + (eap->cmdidx == CMD_diffget || + eap->cmdidx == CMD_diffput) #endif ) return _(e_invalid_range); @@ -5981,7 +6000,7 @@ get_command_name(expand_T *xp UNUSED, int idx) return expand_user_command_name(idx); // the following are no real commands if (STRNCMP(cmdnames[idx].cmd_name, "{", 1) == 0 || - STRNCMP(cmdnames[idx].cmd_name, "}", 1) == 0) + STRNCMP(cmdnames[idx].cmd_name, "}", 1) == 0) return (char_u *)""; return cmdnames[idx].cmd_name; } @@ -8027,7 +8046,7 @@ post_chdir(cdscope_T scope) } last_chdir_reason = NULL; - shorten_fnames(TRUE); + shorten_fnames(vim_strchr(p_cpo, CPO_NOSYMLINKS) == NULL); } /* @@ -9006,6 +9025,29 @@ ex_redrawtabline(exarg_T *eap UNUSED) out_flush(); } +/* + * ":redrawtabpanel": force redraw of the tabpanel + */ + static void +ex_redrawtabpanel(exarg_T *eap UNUSED) +{ + int save_RedrawingDisabled = RedrawingDisabled; + RedrawingDisabled = 0; + + int save_p_lz = p_lz; + p_lz = FALSE; + +#if defined(FEAT_TABPANEL) + draw_tabpanel(); +#else + emsg(_(e_cannot_not_support_redrawtabpanel)); +#endif + + RedrawingDisabled = save_RedrawingDisabled; + p_lz = save_p_lz; + out_flush(); +} + static void close_redir(void) { @@ -9342,6 +9384,12 @@ ex_stopinsert(exarg_T *eap UNUSED) { restart_edit = 0; stop_insert_mode = TRUE; +#if defined(FEAT_CLIENTSERVER) || defined(FEAT_EVAL) + // when called from remote_expr in insert mode, make sure insert mode is + // ended by adding K_NOP to the typeahead buffer + if (vgetc_busy) + ins_char_typebuf(K_NOP, 0); +#endif clearmode(); } @@ -10385,5 +10433,5 @@ get_pressedreturn(void) void set_pressedreturn(int val) { - ex_pressedreturn = val; + ex_pressedreturn = val; } diff --git a/src/ex_getln.c b/src/ex_getln.c index b1da407c33..56c2abaf1d 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -103,7 +103,7 @@ empty_pattern_magic(char_u *p, size_t len, magic_T magic_val) // remove trailing \v and the like while (len >= 2 && p[len - 2] == '\\' && vim_strchr((char_u *)"mMvVcCZ", p[len - 1]) != NULL) - len -= 2; + len -= 2; // true, if the pattern is empty, or the pattern ends with \| and magic is // set (or it ends with '|' and very magic is set) @@ -204,67 +204,55 @@ set_search_match(pos_T *t) } /* - * Return TRUE when 'incsearch' highlighting is to be done. - * Sets search_first_line and search_last_line to the address range. - * May change the last search pattern. + * Parses the :[range]s/foo like commands and returns details needed for + * incsearch and wildmenu completion. + * Returns TRUE if pattern is valid. + * Sets skiplen, patlen, search_first_line, and search_last_line. */ - static int -do_incsearch_highlighting( - int firstc, - int *search_delim, - incsearch_state_T *is_state, - int *skiplen, - int *patlen) + int +parse_pattern_and_range( + pos_T *incsearch_start, + int *search_delim, + int *skiplen, + int *patlen) { - char_u *cmd; + char_u *cmd, *p, *end; cmdmod_T dummy_cmdmod; - char_u *p; - int delim_optional = FALSE; - int delim; - char_u *end; - char *dummy; exarg_T ea; pos_T save_cursor; + int delim_optional = FALSE; + int delim; int use_last_pat; - int retval = FALSE; magic_T magic = 0; + char *dummy; *skiplen = 0; *patlen = ccline.cmdlen; - if (!p_is || cmd_silent) - return FALSE; - - // by default search all lines + // Default range search_first_line = 0; search_last_line = MAXLNUM; - if (firstc == '/' || firstc == '?') - { - *search_delim = firstc; - return TRUE; - } - if (firstc != ':') - return FALSE; - - ++emsg_off; CLEAR_FIELD(ea); ea.line1 = 1; ea.line2 = 1; ea.cmd = ccline.cmdbuff; ea.addr_type = ADDR_LINES; + // Skip over command modifiers parse_command_modifiers(&ea, &dummy, &dummy_cmdmod, TRUE); + // Skip over the range to find the command. cmd = skip_range(ea.cmd, TRUE, NULL); + if (vim_strchr((char_u *)"sgvl", *cmd) == NULL) - goto theend; + return FALSE; - // Skip over "substitute" to find the pattern separator. + // Skip over command name to find pattern separator for (p = cmd; ASCII_ISALPHA(*p); ++p) ; if (*skipwhite(p) == NUL) - goto theend; + return FALSE; if (STRNCMP(cmd, "substitute", p - cmd) == 0 || STRNCMP(cmd, "smagic", p - cmd) == 0 @@ -276,7 +264,8 @@ do_incsearch_highlighting( else if (*cmd == 's' && cmd[1] == 'n') magic_overruled = OPTION_MAGIC_OFF; } - else if (STRNCMP(cmd, "sort", MAX(p - cmd, 3)) == 0) + else if (STRNCMP(cmd, "sort", MAX(p - cmd, 3)) == 0 + || STRNCMP(cmd, "uniq", MAX(p - cmd, 3)) == 0) { // skip over ! and flags if (*p == '!') @@ -284,83 +273,113 @@ do_incsearch_highlighting( while (ASCII_ISALPHA(*(p = skipwhite(p)))) ++p; if (*p == NUL) - goto theend; + return FALSE; } else if (STRNCMP(cmd, "vimgrep", MAX(p - cmd, 3)) == 0 - || STRNCMP(cmd, "vimgrepadd", MAX(p - cmd, 8)) == 0 - || STRNCMP(cmd, "lvimgrep", MAX(p - cmd, 2)) == 0 - || STRNCMP(cmd, "lvimgrepadd", MAX(p - cmd, 9)) == 0 - || STRNCMP(cmd, "global", p - cmd) == 0) + || STRNCMP(cmd, "vimgrepadd", MAX(p - cmd, 8)) == 0 + || STRNCMP(cmd, "lvimgrep", MAX(p - cmd, 2)) == 0 + || STRNCMP(cmd, "lvimgrepadd", MAX(p - cmd, 9)) == 0 + || STRNCMP(cmd, "global", p - cmd) == 0) { - // skip over "!" + // skip optional "!" if (*p == '!') { p++; if (*skipwhite(p) == NUL) - goto theend; + return FALSE; } if (*cmd != 'g') delim_optional = TRUE; } else - goto theend; + return FALSE; p = skipwhite(p); delim = (delim_optional && vim_isIDc(*p)) ? ' ' : *p++; *search_delim = delim; - end = skip_regexp_ex(p, delim, magic_isset(), NULL, NULL, &magic); + end = skip_regexp_ex(p, delim, magic_isset(), NULL, NULL, &magic); use_last_pat = end == p && *end == delim; if (end == p && !use_last_pat) - goto theend; + return FALSE; - // Don't do 'hlsearch' highlighting if the pattern matches everything. + // Skip if the pattern matches everything (e.g., for 'hlsearch') if (!use_last_pat) { char c = *end; - int empty; + int empty; *end = NUL; empty = empty_pattern_magic(p, (size_t)(end - p), magic); *end = c; if (empty) - goto theend; + return FALSE; } - // found a non-empty pattern or // + // Found a non-empty pattern or // *skiplen = (int)(p - ccline.cmdbuff); *patlen = (int)(end - p); - // parse the address range + // Parse the address range save_cursor = curwin->w_cursor; - curwin->w_cursor = is_state->search_start; + curwin->w_cursor = *incsearch_start; + parse_cmd_address(&ea, &dummy, TRUE); + if (ea.addr_count > 0) { - // Allow for reverse match. - if (ea.line2 < ea.line1) - { - search_first_line = ea.line2; - search_last_line = ea.line1; - } - else - { - search_first_line = ea.line1; - search_last_line = ea.line2; - } + int reverse_match = ea.line2 < ea.line1; + search_first_line = reverse_match ? ea.line2 : ea.line1; + search_last_line = reverse_match ? ea.line1 : ea.line2; } else if (cmd[0] == 's' && cmd[1] != 'o') - { // :s defaults to the current line - search_first_line = curwin->w_cursor.lnum; - search_last_line = curwin->w_cursor.lnum; - } + search_first_line = search_last_line = curwin->w_cursor.lnum; curwin->w_cursor = save_cursor; - retval = TRUE; -theend: + return TRUE; +} + +/* + * Return TRUE when 'incsearch' highlighting is to be done. + * Sets search_first_line and search_last_line to the address range. + * May change the last search pattern. + */ + static int +do_incsearch_highlighting( + int firstc, + int *search_delim, + incsearch_state_T *is_state, + int *skiplen, + int *patlen) +{ + int retval = FALSE; + + *skiplen = 0; + *patlen = ccline.cmdlen; + + if (!p_is || cmd_silent) + return FALSE; + + // By default search all lines + search_first_line = 0; + search_last_line = MAXLNUM; + + if (firstc == '/' || firstc == '?') + { + *search_delim = firstc; + return TRUE; + } + + if (firstc != ':') + return FALSE; + + ++emsg_off; + retval = parse_pattern_and_range(&is_state->search_start, search_delim, + skiplen, patlen); --emsg_off; + return retval; } @@ -904,7 +923,8 @@ cmdline_wildchar_complete( int *did_wild_list, int *wim_index_p, expand_T *xp, - int *gotesc) + int *gotesc, + pos_T *pre_incsearch_pos) { int wim_index = *wim_index_p; int res; @@ -937,6 +957,16 @@ cmdline_wildchar_complete( } else // typed p_wc first time { + if (c == p_wc || c == p_wcm || c == K_WILD) + { + options |= WILD_MAY_EXPAND_PATTERN; + if (c == K_WILD) + options |= WILD_FUNC_TRIGGER; + if (pre_incsearch_pos) + xp->xp_pre_incsearch_pos = *pre_incsearch_pos; + else + xp->xp_pre_incsearch_pos = curwin->w_cursor; + } wim_index = 0; j = ccline.cmdpos; // if 'wildmode' first contains "longest", get longest @@ -1367,7 +1397,7 @@ cmdline_browse_history( for (;;) { // one step backwards - if (c == K_UP|| c == K_S_UP || c == Ctrl_P + if (c == K_UP || c == K_S_UP || c == Ctrl_P || c == K_PAGEUP || c == K_KPAGEUP) { if (hiscnt == get_hislen()) // first time @@ -1605,7 +1635,6 @@ getcmdline_int( int res; int save_msg_scroll = msg_scroll; int save_State = State; // remember State when called - int prev_cmdpos = -1; int some_key_typed = FALSE; // one of the keys was typed // mouse drag and release events are ignored, unless they are // preceded with a mouse down event @@ -1620,6 +1649,8 @@ getcmdline_int( int did_save_ccline = FALSE; int cmdline_type; int wild_type = 0; + int event_cmdlineleavepre_triggered = FALSE; + char_u *prev_cmdbuff = NULL; // one recursion level deeper ++depth; @@ -1663,6 +1694,7 @@ getcmdline_int( ExpandInit(&xpc); ccline.xpc = &xpc; + clear_cmdline_orig(); #ifdef FEAT_RIGHTLEFT if (curwin->w_p_rl && *curwin->w_p_rlc == 's' @@ -1788,8 +1820,11 @@ getcmdline_int( */ for (;;) { - int trigger_cmdlinechanged = TRUE; - int end_wildmenu; + int trigger_cmdlinechanged = TRUE; + int end_wildmenu; + int prev_cmdpos = ccline.cmdpos; + + VIM_CLEAR(prev_cmdbuff); redir_off = TRUE; // Don't redirect the typed command. // Repeated, because a ":redir" inside @@ -1806,6 +1841,13 @@ getcmdline_int( // Trigger SafeState if nothing is pending. may_trigger_safestate(xpc.xp_numfiles <= 0); + if (ccline.cmdbuff != NULL) + { + prev_cmdbuff = vim_strnsave(ccline.cmdbuff, ccline.cmdpos); + if (prev_cmdbuff == NULL) + goto returncmd; + } + // Get a character. Ignore K_IGNORE and K_NOP, they should not do // anything, such as stop completion. do @@ -1915,6 +1957,21 @@ getcmdline_int( } } + // Trigger CmdlineLeavePre autocommand + if (KeyTyped && (c == '\n' || c == '\r' || c == K_KENTER || c == ESC +#ifdef UNIX + || c == intr_char +#endif + || c == Ctrl_C)) + { + trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVEPRE); + event_cmdlineleavepre_triggered = TRUE; +#if defined(FEAT_SEARCH_EXTRA) || defined(PROTO) + if ((c == ESC || c == Ctrl_C) && (wim_flags[0] & WIM_LIST)) + set_no_hlsearch(TRUE); +#endif + } + // The wildmenu is cleared if the pressed key is not used for // navigating the wild menu (i.e. the key is not 'wildchar' or // 'wildcharm' or Ctrl-N or Ctrl-P or Ctrl-A or Ctrl-L). @@ -2003,13 +2060,25 @@ getcmdline_int( } } - // Completion for 'wildchar' or 'wildcharm' key. - if ((c == p_wc && !gotesc && KeyTyped) || c == p_wcm) + // Completion for 'wildchar', 'wildcharm', and wildtrigger() + if ((c == p_wc && !gotesc && KeyTyped) || c == p_wcm || c == K_WILD) { + if (c == K_WILD) + ++emsg_silent; // Silence the bell res = cmdline_wildchar_complete(c, firstc != '@', &did_wild_list, - &wim_index, &xpc, &gotesc); + &wim_index, &xpc, &gotesc, +#ifdef FEAT_SEARCH_EXTRA + &is_state.search_start +#else + NULL +#endif + ); + if (c == K_WILD) + --emsg_silent; if (res == CMDLINE_CHANGED) goto cmdline_changed; + if (c == K_WILD) + goto cmdline_not_changed; } gotesc = FALSE; @@ -2042,6 +2111,16 @@ getcmdline_int( // further. if (wild_type == WILD_CANCEL || wild_type == WILD_APPLY) { +#ifdef FEAT_SEARCH_EXTRA + // Apply search highlighting + if (wild_type == WILD_APPLY) + { + if (is_state.winid != curwin->w_id) + init_incsearch_state(&is_state); + if (KeyTyped || vpeekc() == NUL) + may_do_incsearch_highlighting(firstc, count, &is_state); + } +#endif wild_type = 0; goto cmdline_not_changed; } @@ -2522,22 +2601,19 @@ getcmdline_int( // If the window changed incremental search state is not valid. if (is_state.winid != curwin->w_id) init_incsearch_state(&is_state); + if (xpc.xp_context == EXPAND_NOTHING && (KeyTyped || vpeekc() == NUL)) + may_do_incsearch_highlighting(firstc, count, &is_state); #endif // Trigger CmdlineChanged autocommands. - if (trigger_cmdlinechanged) + if (trigger_cmdlinechanged + && (ccline.cmdpos != prev_cmdpos + || (prev_cmdbuff != NULL && STRNCMP(prev_cmdbuff, + ccline.cmdbuff, prev_cmdpos) != 0))) trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINECHANGED); // Trigger CursorMovedC autocommands. if (ccline.cmdpos != prev_cmdpos) - { trigger_cmd_autocmd(cmdline_type, EVENT_CURSORMOVEDC); - prev_cmdpos = ccline.cmdpos; - } - -#ifdef FEAT_SEARCH_EXTRA - if (xpc.xp_context == EXPAND_NOTHING && (KeyTyped || vpeekc() == NUL)) - may_do_incsearch_highlighting(firstc, count, &is_state); -#endif #ifdef FEAT_RIGHTLEFT if (cmdmsg_rl @@ -2556,6 +2632,9 @@ getcmdline_int( } returncmd: + // Trigger CmdlineLeavePre autocommands if not already triggered. + if (!event_cmdlineleavepre_triggered) + trigger_cmd_autocmd(cmdline_type, EVENT_CMDLINELEAVEPRE); #ifdef FEAT_RIGHTLEFT cmdmsg_rl = FALSE; @@ -2572,6 +2651,7 @@ getcmdline_int( ExpandCleanup(&xpc); ccline.xpc = NULL; + clear_cmdline_orig(); #ifdef FEAT_SEARCH_EXTRA finish_incsearch_highlighting(gotesc, &is_state, FALSE); @@ -2642,6 +2722,8 @@ getcmdline_int( restore_cmdline(&save_ccline); else ccline.cmdbuff = NULL; + + vim_free(prev_cmdbuff); return p; } } @@ -4253,14 +4335,13 @@ get_cmdline_completion_pattern(void) } /* - * Get the current command-line completion type. + * Get the command-line completion type. */ static char_u * get_cmdline_completion(void) { - cmdline_info_T *p; - char_u *buffer; - int xp_context; + cmdline_info_T *p; + int xp_context; if (cmdline_star > 0) return NULL; @@ -4279,20 +4360,7 @@ get_cmdline_completion(void) if (xp_context == EXPAND_UNSUCCESSFUL) return NULL; - char_u *cmd_compl = cmdcomplete_type_to_str(xp_context); - if (cmd_compl == NULL) - return NULL; - - if (xp_context == EXPAND_USER_LIST || xp_context == EXPAND_USER_DEFINED) - { - buffer = alloc(STRLEN(cmd_compl) + STRLEN(p->xpc->xp_arg) + 2); - if (buffer == NULL) - return NULL; - sprintf((char *)buffer, "%s,%s", cmd_compl, p->xpc->xp_arg); - return buffer; - } - - return vim_strsave(cmd_compl); + return cmdcomplete_type_to_str(xp_context, p->xpc->xp_arg); } /* @@ -5061,3 +5129,30 @@ get_user_input( cmd_silent = cmd_silent_save; } #endif + +/* + * "wildtrigger()" function + */ + void +f_wildtrigger(typval_T *argvars UNUSED, typval_T *rettv UNUSED) +{ + if (!(State & MODE_CMDLINE) || char_avail() || wild_menu_showing + || cmdline_pum_active()) + return; + + int cmd_type = get_cmdline_type(); + + if (cmd_type == ':' || cmd_type == '/' || cmd_type == '?') + { + // Add K_WILD as a single special key + char_u key_string[4]; + + key_string[0] = K_SPECIAL; + key_string[1] = KS_EXTRA; + key_string[2] = KE_WILD; + key_string[3] = NUL; + + // Insert it into the typeahead buffer + ins_typebuf(key_string, REMAP_NONE, 0, TRUE, FALSE); + } +} diff --git a/src/feature.h b/src/feature.h index 2af0205f71..1573487fc7 100644 --- a/src/feature.h +++ b/src/feature.h @@ -498,7 +498,7 @@ || defined(FEAT_GUI_MSWIN) \ || (defined(FEAT_GUI_MOTIF) && defined(HAVE_XPM)) \ || defined(FEAT_GUI_PHOTON) \ - || defined(FEAT_GUI_MACVIM) \ + || defined(FEAT_GUI_MACVIM) \ || defined(FEAT_GUI_HAIKU)) # define FEAT_TOOLBAR @@ -532,6 +532,13 @@ # define FEAT_GUI_TABLINE #endif +/* + * +tabpanel Tab SideBar + */ +#ifdef FEAT_HUGE +# define FEAT_TABPANEL +#endif + /* * +browse ":browse" command. * or just the ":browse" command modifier @@ -817,6 +824,14 @@ # define WANT_X11 #endif +/* + * +wayland Unix only. Include code for the Wayland protocol, + * only works if HAVE_WAYLAND is defined. + */ +#if defined(FEAT_NORMAL) && defined(UNIX) +# define WANT_WAYLAND +#endif + /* * XSMP - X11 Session Management Protocol * It may be preferred to disable this if the GUI supports it (e.g., @@ -917,11 +932,19 @@ # endif #endif +#if defined(FEAT_NORMAL) && defined(UNIX) \ + && defined(HAVE_WAYLAND) && defined(WANT_WAYLAND) +# define FEAT_WAYLAND_CLIPBOARD +# ifndef FEAT_CLIPBOARD +# define FEAT_CLIPBOARD +# endif +#endif + /* * +dnd Drag'n'drop support. Always used for the GTK+ GUI and MacVim. */ #if defined(FEAT_CLIPBOARD) && (defined(FEAT_GUI_GTK) \ - || defined(FEAT_GUI_MACVIM)) + || defined(FEAT_GUI_MACVIM)) # define FEAT_DND #endif @@ -1034,12 +1057,6 @@ * +tgetent */ -/* - * The Netbeans feature requires +eval. - */ -#if !defined(FEAT_EVAL) && defined(FEAT_NETBEANS_INTG) -# undef FEAT_NETBEANS_INTG -#endif /* * The +channel feature requires +eval. @@ -1048,6 +1065,13 @@ # undef FEAT_JOB_CHANNEL #endif +/* + * The Netbeans feature requires +eval and +job_channel + */ +#if (!defined(FEAT_EVAL) || !defined(FEAT_JOB_CHANNEL)) && defined(FEAT_NETBEANS_INTG) +# undef FEAT_NETBEANS_INTG +#endif + /* * +terminal ":terminal" command. Runs a terminal in a window. * requires +channel diff --git a/src/fileio.c b/src/fileio.c index 6b973ba7f9..71153b332e 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -3189,7 +3189,8 @@ msg_add_lines( if (shortmess(SHM_LINES)) vim_snprintf((char *)IObuff + len, IOSIZE - (size_t)len, - "%s%ldL, %lldB", insert_space ? " " : "", lnum, (varnumber_T)nchars); + // l10n: L as in line, B as in byte + _("%s%ldL, %lldB"), insert_space ? " " : "", lnum, (varnumber_T)nchars); else { len += vim_snprintf((char *)IObuff + len, IOSIZE - (size_t)len, @@ -3534,6 +3535,9 @@ shorten_fnames(int force) } status_redraw_all(); redraw_tabline = TRUE; +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif #if defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX) popup_update_preview_title(); #endif @@ -5389,14 +5393,13 @@ vim_tempname( long nr; long off; # endif + size_t itmplen; // Expand $TMP, leave room for "/v1100000/999999999". // Skip the directory check if the expansion fails. - expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20); + itmplen = expand_env((char_u *)tempdirs[i], itmp, TEMPNAMELEN - 20); if (itmp[0] != '$' && mch_isdir(itmp)) { - size_t itmplen = STRLEN(itmp); - // directory exists if (!after_pathsep(itmp, itmp + itmplen)) { @@ -5517,6 +5520,8 @@ vim_tempname( // "sh". NOTE: This also checks 'shellcmdflag' to help those people who // didn't set 'shellslash' but only if not using PowerShell. retval = utf16_to_enc(itmp, NULL); + if (retval == NULL) + return NULL; shname = gettail(p_sh); if ((*p_shcf == '-' && !(strstr((char *)shname, "powershell") != NULL || strstr((char *)shname, "pwsh") != NULL )) diff --git a/src/findfile.c b/src/findfile.c index 2bd1e7eb99..0f5f2dc624 100644 --- a/src/findfile.c +++ b/src/findfile.c @@ -162,19 +162,19 @@ typedef struct ff_visited_list_hdr */ typedef struct ff_search_ctx_T { - ff_stack_T *ffsc_stack_ptr; - ff_visited_list_hdr_T *ffsc_visited_list; - ff_visited_list_hdr_T *ffsc_dir_visited_list; - ff_visited_list_hdr_T *ffsc_visited_lists_list; - ff_visited_list_hdr_T *ffsc_dir_visited_lists_list; - string_T ffsc_file_to_search; - string_T ffsc_start_dir; - string_T ffsc_fix_path; - string_T ffsc_wc_path; - int ffsc_level; - string_T *ffsc_stopdirs_v; - int ffsc_find_what; - int ffsc_tagfile; + ff_stack_T *ffsc_stack_ptr; + ff_visited_list_hdr_T *ffsc_visited_list; + ff_visited_list_hdr_T *ffsc_dir_visited_list; + ff_visited_list_hdr_T *ffsc_visited_lists_list; + ff_visited_list_hdr_T *ffsc_dir_visited_lists_list; + string_T ffsc_file_to_search; + string_T ffsc_start_dir; + string_T ffsc_fix_path; + string_T ffsc_wc_path; + int ffsc_level; + string_T *ffsc_stopdirs_v; + int ffsc_find_what; + int ffsc_tagfile; } ff_search_ctx_T; // locally needed functions @@ -1166,7 +1166,8 @@ vim_findfile(void *search_ctx_arg) if (*suf == NUL) break; file_path.length = len + copy_option_part(&suf, - file_path.string + len, MAXPATHL - len, ","); + file_path.string + len, + (int)(MAXPATHL - len), ","); } } } @@ -1819,11 +1820,10 @@ find_file_in_path_option( // copy file name into NameBuff, expanding environment variables save_char = ptr[len]; ptr[len] = NUL; - expand_env_esc(ptr, NameBuff, MAXPATHL, FALSE, TRUE, NULL); + file_to_findlen = expand_env_esc(ptr, NameBuff, MAXPATHL, FALSE, TRUE, NULL); ptr[len] = save_char; vim_free(*file_to_find); - file_to_findlen = STRLEN(NameBuff); *file_to_find = vim_strnsave(NameBuff, file_to_findlen); if (*file_to_find == NULL) // out of memory { diff --git a/src/float.c b/src/float.c index 9e8074de8e..4c8e5fe10a 100644 --- a/src/float.c +++ b/src/float.c @@ -41,7 +41,7 @@ string2float( *value = INFINITY; return 3; } - if (STRNICMP(text, "-inf", 3) == 0) + if (STRNICMP(text, "-inf", 4) == 0) { *value = -INFINITY; return 4; diff --git a/src/fold.c b/src/fold.c index b165dc9b0e..4824a807ce 100644 --- a/src/fold.c +++ b/src/fold.c @@ -3576,7 +3576,7 @@ put_folds_recurse(FILE *fd, garray_T *gap, linenr_T off) // Do nested folds first, they will be created closed. if (put_folds_recurse(fd, &fp->fd_nested, off + fp->fd_top) == FAIL) return FAIL; - if (fprintf(fd, "%ld,%ldfold", fp->fd_top + off, + if (fprintf(fd, "sil! %ld,%ldfold", fp->fd_top + off, fp->fd_top + off + fp->fd_len - 1) < 0 || put_eol(fd) == FAIL) return FAIL; @@ -3609,9 +3609,10 @@ put_foldopen_recurse( if (fp->fd_nested.ga_len > 0) { // open nested folds while this fold is open + // ignore errors if (fprintf(fd, "%ld", fp->fd_top + off) < 0 || put_eol(fd) == FAIL - || put_line(fd, "normal! zo") == FAIL) + || put_line(fd, "sil! normal! zo") == FAIL) return FAIL; if (put_foldopen_recurse(fd, wp, &fp->fd_nested, off + fp->fd_top) @@ -3652,7 +3653,7 @@ put_fold_open_close(FILE *fd, fold_T *fp, linenr_T off) { if (fprintf(fd, "%ld", fp->fd_top + off) < 0 || put_eol(fd) == FAIL - || fprintf(fd, "normal! z%c", + || fprintf(fd, "sil! normal! z%c", fp->fd_flags == FD_CLOSED ? 'c' : 'o') < 0 || put_eol(fd) == FAIL) return FAIL; diff --git a/src/getchar.c b/src/getchar.c index ef78a35f2a..c1fc013210 100644 --- a/src/getchar.c +++ b/src/getchar.c @@ -2612,7 +2612,7 @@ parse_queued_messages(void) // If memory allocation fails during startup we'll exit but curbuf or // curwin could be NULL. if (curbuf == NULL || curwin == NULL) - return; + return; old_curbuf_fnum = curbuf->b_fnum; old_curwin_id = curwin->w_id; diff --git a/src/globals.h b/src/globals.h index 11eacd5ce2..35c141ca9b 100644 --- a/src/globals.h +++ b/src/globals.h @@ -540,8 +540,8 @@ EXTERN int garbage_collect_at_exit INIT(= FALSE); #define t_super (static_types[84]) #define t_const_super (static_types[85]) -#define t_object (static_types[86]) -#define t_const_object (static_types[87]) +#define t_object_any (static_types[86]) +#define t_const_object_any (static_types[87]) #define t_class (static_types[88]) #define t_const_class (static_types[89]) @@ -731,7 +731,7 @@ EXTERN type_T static_types[96] {VAR_CLASS, 0, 0, TTFLAG_STATIC, &t_bool, NULL, NULL}, {VAR_CLASS, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, &t_bool, NULL, NULL}, - // 86: t_object + // 86: t_object_any {VAR_OBJECT, 0, 0, TTFLAG_STATIC, NULL, NULL, NULL}, {VAR_OBJECT, 0, 0, TTFLAG_STATIC|TTFLAG_CONST, NULL, NULL, NULL}, @@ -971,9 +971,9 @@ EXTERN int gui_win_y INIT(= -1); #endif #ifdef FEAT_CLIPBOARD -EXTERN Clipboard_T clip_star; // PRIMARY selection in X11 -# ifdef FEAT_X11 -EXTERN Clipboard_T clip_plus; // CLIPBOARD selection in X11 +EXTERN Clipboard_T clip_star; // PRIMARY selection in X11/Wayland +# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD) +EXTERN Clipboard_T clip_plus; // CLIPBOARD selection in X11/Wayland # else # define clip_plus clip_star // there is only one clipboard # define ONE_CLIPBOARD @@ -1012,9 +1012,10 @@ EXTERN win_T *curwin; // currently active window #define AUCMD_WIN_COUNT 5 typedef struct { - win_T *auc_win; // Window used in aucmd_prepbuf(). When not NULL the - // window has been allocated. - int auc_win_used; // This auc_win is being used. + // Window used in aucmd_prepbuf(). When not NULL the window has been + // allocated. + win_T *auc_win; + int auc_win_used; // This auc_win is being used. } aucmdwin_T; EXTERN aucmdwin_T aucmd_win[AUCMD_WIN_COUNT]; @@ -1055,6 +1056,10 @@ EXTERN tabpage_T *curtab; EXTERN tabpage_T *lastused_tabpage; EXTERN int redraw_tabline INIT(= FALSE); // need to redraw tabline +#if defined(FEAT_TABPANEL) +EXTERN int redraw_tabpanel INIT(= FALSE); // need to redraw tabpanel +#endif + /* * All buffers are linked in a list. 'firstbuf' points to the first entry, * 'lastbuf' to the last entry and 'curbuf' to the currently active buffer. @@ -1611,7 +1616,7 @@ EXTERN int autocmd_bufnr INIT(= 0); // fnum for on cmdline EXTERN char_u *autocmd_match INIT(= NULL); // name for on cmdline EXTERN int aucmd_cmdline_changed_count INIT(= 0); -EXTERN int did_cursorhold INIT(= FALSE); // set when CursorHold t'gerd +EXTERN int did_cursorhold INIT(= TRUE); // set when CursorHold t'gerd EXTERN pos_T last_cursormoved // for CursorMoved event # ifdef DO_INIT = {0, 0, 0} @@ -2068,3 +2073,23 @@ EXTERN char_u showcmd_buf[SHOWCMD_BUFLEN]; #ifdef FEAT_TERMGUICOLORS EXTERN int p_tgc_set INIT(= FALSE); #endif + +// If we've already warned about missing/unavailable clipboard +EXTERN int did_warn_clipboard INIT(= FALSE); + +#ifdef FEAT_CLIPBOARD +EXTERN clipmethod_T clipmethod INIT(= CLIPMETHOD_NONE); +#endif + +#ifdef FEAT_WAYLAND + +// Don't connect to Wayland compositor if TRUE +EXTERN int wayland_no_connect INIT(= FALSE); + +// Wayland display name (ex. wayland-0). Can be NULL +EXTERN char *wayland_display_name INIT(= NULL); + +// Wayland display file descriptor; set by wayland_init_client() +EXTERN int wayland_display_fd; + +#endif diff --git a/src/gui.c b/src/gui.c index a9230d6144..e375a8c977 100644 --- a/src/gui.c +++ b/src/gui.c @@ -146,6 +146,9 @@ gui_start(char_u *arg UNUSED) emsg(msg); #endif } + else + // Reset clipmethod to CLIPMETHOD_NONE + choose_clipmethod(); vim_free(old_term); @@ -357,7 +360,7 @@ gui_read_child_pipe(int fd) if (bytes_read < 0) return GUI_CHILD_IO_ERROR; buffer[bytes_read] = NUL; - if (strcmp(buffer, "ok") == 0) + if (STRCMP(buffer, "ok") == 0) return GUI_CHILD_OK; return GUI_CHILD_FAILED; } @@ -1426,7 +1429,7 @@ gui_update_cursor( gui_position_menu(void) { # if !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \ - || defined(FEAT_GUI_MACVIM)) + || defined(FEAT_GUI_MACVIM)) if (gui.menu_is_active && gui.in_use) gui_mch_set_menu_pos(0, 0, gui.menu_width, gui.menu_height); # endif @@ -1454,7 +1457,7 @@ gui_position_components(int total_width UNUSED) text_area_y = 0; #if defined(FEAT_MENU) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) \ - || defined(FEAT_GUI_MACVIM)) + || defined(FEAT_GUI_MACVIM)) gui.menu_width = total_width; if (gui.menu_is_active) text_area_y += gui.menu_height; @@ -2365,6 +2368,8 @@ gui_outstr_nowrap( # endif ) { + size_t slen = 2; // 2 spaces by default + # ifdef FEAT_NETBEANS_INTG if (*s == MULTISIGN_BYTE) multi_sign = TRUE; @@ -2373,14 +2378,16 @@ gui_outstr_nowrap( if (*curwin->w_p_scl == 'n' && *(curwin->w_p_scl + 1) == 'u' && (curwin->w_p_nu || curwin->w_p_rnu)) { - sprintf((char *)extra, "%*c ", number_width(curwin), ' '); - s = extra; + int n = number_width(curwin); + + slen = MIN(n, (int)sizeof(extra) - 1); } - else - s = (char_u *)" "; + vim_memset(extra, ' ', slen); + extra[slen] = NUL; + s = extra; if (len == 1 && col > 0) --col; - len = (int)STRLEN(s); + len = (int)slen; if (len > 2) // right align sign icon in the number column signcol = col + len - 3; @@ -3803,10 +3810,6 @@ get_tabline_label( tabpage_T *tp, int tooltip) // TRUE: get tooltip { - int modified = FALSE; - char_u buf[40]; - int wincount; - win_T *wp; char_u **opt; // Use 'guitablabel' or 'guitabtooltip' if it's set. @@ -3852,26 +3855,42 @@ get_tabline_label( // use a default label. if (**opt == NUL || *NameBuff == NUL) { + win_T *wp; + int wincount = 0; + int modified = FALSE; + // Get the buffer name into NameBuff[] and shorten it. get_trans_bufname(tp == curtab ? curbuf : tp->tp_curwin->w_buffer); if (!tooltip) shorten_dir(NameBuff); - wp = (tp == curtab) ? firstwin : tp->tp_firstwin; - for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount) + FOR_ALL_WINDOWS_IN_TAB(tp, wp) + { + ++wincount; if (bufIsChanged(wp->w_buffer)) modified = TRUE; + } + if (modified || wincount > 1) { + char_u buf[40] = "+ "; // Tentatively assume modified only + size_t buflen = 2; + size_t NameBufflen = STRLEN(NameBuff); + if (wincount > 1) - vim_snprintf((char *)buf, sizeof(buf), "%d", wincount); - else - buf[0] = NUL; - if (modified) - STRCAT(buf, "+"); - STRCAT(buf, " "); - STRMOVE(NameBuff + STRLEN(buf), NameBuff); - mch_memmove(NameBuff, buf, STRLEN(buf)); + buflen = vim_snprintf_safelen( + (char *)buf, + sizeof(buf), + "%d%s ", + wincount, + modified ? "+" : ""); + + // Make sure resulting NameBuff will not exceed its bounds. + if (NameBufflen + buflen < MAXPATHL) + { + mch_memmove(NameBuff + buflen, NameBuff, NameBufflen + 1); // +1 for NUL + mch_memmove(NameBuff, buf, buflen); + } } } } @@ -4348,7 +4367,7 @@ gui_update_scrollbars( h = (sb->height + sb->status_height) * gui.char_height; y = sb->top * gui.char_height + gui.border_offset; #if defined(FEAT_MENU) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MOTIF) \ - || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MACVIM)) + || defined(FEAT_GUI_PHOTON) || defined(FEAT_GUI_MACVIM)) if (gui.menu_is_active) y += gui.menu_height; #endif @@ -4951,6 +4970,7 @@ xy2win(int x, int y, mouse_find_T popup) return NULL; } # else + if (row < 0 || col < 0) // before first window return NULL; # endif @@ -5223,10 +5243,11 @@ get_find_dialog_text( text = arg; if (text != NULL) { - text = vim_strsave(text); + int len = (int)STRLEN(text); + + text = vim_strnsave(text, len); if (text != NULL) { - int len = (int)STRLEN(text); int i; // Remove "\V" diff --git a/src/gui_gtk_x11.c b/src/gui_gtk_x11.c index f9d593f916..c000a1181f 100644 --- a/src/gui_gtk_x11.c +++ b/src/gui_gtk_x11.c @@ -2767,57 +2767,19 @@ mainwin_realize(GtkWidget *widget UNUSED, gpointer data UNUSED) static GdkCursor * create_blank_pointer(void) { - GdkWindow *root_window = NULL; -#if GTK_CHECK_VERSION(3,0,0) - GdkPixbuf *blank_mask; -#else - GdkPixmap *blank_mask; -#endif GdkCursor *cursor; + #if GTK_CHECK_VERSION(3,0,0) - GdkRGBA color = { 0.0, 0.0, 0.0, 0.0 }; + GdkDisplay *disp = gtk_widget_get_display(gui.mainwin); + cursor = gdk_cursor_new_from_name(disp, "none"); #else + // Create a pseudo blank pointer, which is in fact one pixel by one pixel + // in size. + GdkWindow *root_window = NULL; GdkColor color = { 0, 0, 0, 0 }; + GdkPixmap *blank_mask; char blank_data[] = { 0x0 }; -#endif - -#if GTK_CHECK_VERSION(3,12,0) - { - GdkWindow * const win = gtk_widget_get_window(gui.mainwin); - GdkScreen * const scrn = gdk_window_get_screen(win); - root_window = gdk_screen_get_root_window(scrn); - } -#else root_window = gtk_widget_get_root_window(gui.mainwin); -#endif - - // Create a pseudo blank pointer, which is in fact one pixel by one pixel - // in size. -#if GTK_CHECK_VERSION(3,0,0) - { - cairo_surface_t *surf; - cairo_t *cr; - - surf = cairo_image_surface_create(CAIRO_FORMAT_A1, 1, 1); - cr = cairo_create(surf); - - cairo_set_source_rgba(cr, - color.red, - color.green, - color.blue, - color.alpha); - cairo_rectangle(cr, 0, 0, 1, 1); - cairo_fill(cr); - cairo_destroy(cr); - - blank_mask = gdk_pixbuf_get_from_surface(surf, 0, 0, 1, 1); - cairo_surface_destroy(surf); - - cursor = gdk_cursor_new_from_pixbuf(gdk_window_get_display(root_window), - blank_mask, 0, 0); - g_object_unref(blank_mask); - } -#else blank_mask = gdk_bitmap_create_from_data(root_window, blank_data, 1, 1); cursor = gdk_cursor_new_from_pixmap(blank_mask, blank_mask, &color, &color, 0, 0); @@ -4569,6 +4531,7 @@ gui_mch_open(void) pixel_width = (guint)(gui_get_base_width() + Columns * gui.char_width); pixel_height = (guint)(gui_get_base_height() + Rows * gui.char_height); + // For GTK2 changing the size of the form widget doesn't cause window // resizing. if (gtk_socket_id == 0) @@ -7242,6 +7205,28 @@ gui_mch_mousehide(int hide) #if defined(FEAT_MOUSESHAPE) || defined(PROTO) +# if GTK_CHECK_VERSION(3,0,0) +static const char * mshape_css_names[] = +{ + "default", // arrow aka GDK_LEFT_PTR + "blank", // blank aka GDK_CURSOR_IS_PIXMAP + "text", // beam aka GDK_XTERM + "ns-resize", // updown aka GDK_SB_V_DOUBLE_ARROW + "nwse-resize", // udsizing aka GDK_SIZING + "ew-resize", // leftright aka GDK_SB_H_DOUBLE_ARROW + "ew-resize", // lrsizing aka GDK_SIZING + "progress", // busy aka GDK_WATCH + "not-allowed", // no aka GDK_X_CURSOR + "crosshair", // crosshair aka GDK_CROSSHAIR + "pointer", // hand1 aka GDK_HAND1 + "pointer", // hand2 aka GDK_HAND2 + "default", // pencil aka GDK_PENCIL (no css analogue) + "help", // question aka GDK_QUESTION_ARROW + "default", // right-arrow aka GDK_RIGHT_PTR (no css analogue) + "default", // up-arrow aka GDK_CENTER_PTR (no css analogue) + "default" // GDK_LEFT_PTR (no css analogue) +}; +# else // Table for shape IDs. Keep in sync with the mshape_names[] table in // misc2.c! static const int mshape_ids[] = @@ -7264,12 +7249,17 @@ static const int mshape_ids[] = GDK_CENTER_PTR, // up-arrow GDK_LEFT_PTR // last one }; +# endif // GTK_CHECK_VERSION(3,0,0) void mch_set_mouse_shape(int shape) { - int id; GdkCursor *c; + int id; // Only id or css_name is used. +# if GTK_CHECK_VERSION(3,0,0) + const char *css_name = "default"; + GdkDisplay *disp; +# endif if (gtk_widget_get_window(gui.drawarea) == NULL) return; @@ -7287,12 +7277,22 @@ mch_set_mouse_shape(int shape) else id &= ~1; // they are always even (why?) } +# if GTK_CHECK_VERSION(3,0,0) + else if (shape < (int)ARRAY_LENGTH(mshape_css_names)) + css_name = mshape_css_names[shape]; +# else else if (shape < (int)ARRAY_LENGTH(mshape_ids)) id = mshape_ids[shape]; +# endif else return; +# if GTK_CHECK_VERSION(3,0,0) + disp = gtk_widget_get_display(gui.drawarea); + c = gdk_cursor_new_from_name(disp, css_name); +# else c = gdk_cursor_new_for_display( gtk_widget_get_display(gui.drawarea), (GdkCursorType)id); +# endif gdk_window_set_cursor(gtk_widget_get_window(gui.drawarea), c); # if GTK_CHECK_VERSION(3,0,0) g_object_unref(G_OBJECT(c)); diff --git a/src/gui_haiku.cc b/src/gui_haiku.cc index d083226547..3865a4f4df 100644 --- a/src/gui_haiku.cc +++ b/src/gui_haiku.cc @@ -2091,7 +2091,8 @@ VimDialog::VimDialog(int type, const char *title, const char *message, float buttonsHeight = 0; BString strButtons(buttons); strButtons.RemoveAll("&"); - do { + do + { int32 end = strButtons.FindFirst('\n'); if (end != B_ERROR) strButtons.SetByteAt(end, '\0'); @@ -3819,7 +3820,9 @@ gui_mch_font_dialog(font_family* family, font_style* style, float* size) #if defined(FEAT_GUI_DIALOG) // gui.vimWindow->Unlock(); VimSelectFontDialog *dialog = new VimSelectFontDialog(family, style, size); - return dialog->Go(); + bool ret = dialog->Go(); + delete dialog; + return ret; #else return NOFONT; #endif // FEAT_GUI_DIALOG @@ -4916,7 +4919,9 @@ gui_mch_dialog( { VimDialog *dialog = new VimDialog(type, (char*)title, (char*)message, (char*)buttons, dfltbutton, (char*)textfield, ex_cmd); - return dialog->Go(); + bool ret = dialog->Go(); + delete dialog; + return ret; } #endif // FEAT_GUI_DIALOG diff --git a/src/gui_motif.c b/src/gui_motif.c index ed721b52d0..94633b1878 100644 --- a/src/gui_motif.c +++ b/src/gui_motif.c @@ -1377,7 +1377,7 @@ gui_motif_update_mousemodel(vimmenu_T *menu) // When GUI hasn't started the menus have not been created. if (!gui.in_use) - return; + return; while (menu) { diff --git a/src/gui_w32.c b/src/gui_w32.c index 78f252a8b7..a29fa91b0a 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -2157,7 +2157,8 @@ static void process_message_usual_key(UINT vk, const MSG *pmsg) * Experimental implementation, introduced in v8.2.4807 * "processing key event in Win32 GUI is not ideal" */ -static void process_message_usual_key_experimental(UINT vk, const MSG *pmsg) + static void +process_message_usual_key_experimental(UINT vk, const MSG *pmsg) { WCHAR ch[8]; int len; @@ -2237,7 +2238,8 @@ static void process_message_usual_key_experimental(UINT vk, const MSG *pmsg) /* * "Classic" implementation, existing prior to v8.2.4807 */ -static void process_message_usual_key_classic(UINT vk, const MSG *pmsg) + static void +process_message_usual_key_classic(UINT vk, const MSG *pmsg) { char_u string[40]; @@ -3673,12 +3675,11 @@ gui_mch_exit(int rc UNUSED) static char_u * logfont2name(LOGFONTW lf) { - char *p; - char *res; char *charset_name; char *quality_name; char *font_name; - int points; + size_t res_size; + char *res; font_name = (char *)utf16_to_enc(lf.lfFaceName, NULL); if (font_name == NULL) @@ -3686,43 +3687,48 @@ logfont2name(LOGFONTW lf) charset_name = charset_id2name((int)lf.lfCharSet); quality_name = quality_id2name((int)lf.lfQuality); - res = alloc(strlen(font_name) + 30 - + (charset_name == NULL ? 0 : strlen(charset_name) + 2) - + (quality_name == NULL ? 0 : strlen(quality_name) + 2)); + res_size = STRLEN(font_name) + 30 + + (charset_name == NULL ? 0 : STRLEN(charset_name) + 2) + + (quality_name == NULL ? 0 : STRLEN(quality_name) + 2); + res = alloc(res_size); if (res != NULL) { - p = res; + char *p; + int points; + size_t res_len; + + // replace spaces in font_name with underscores. + for (p = font_name; *p != NUL; ++p) + { + if (isspace(*p)) + *p = '_'; + } + // make a normal font string out of the lf thing: points = pixels_to_points( lf.lfHeight < 0 ? -lf.lfHeight : lf.lfHeight, TRUE); if (lf.lfWeight == FW_NORMAL || lf.lfWeight == FW_BOLD) - sprintf((char *)p, "%s:h%d", font_name, points); + res_len = vim_snprintf_safelen( + (char *)res, res_size, "%s:h%d", font_name, points); else - sprintf((char *)p, "%s:h%d:W%ld", font_name, points, lf.lfWeight); - while (*p) - { - if (*p == ' ') - *p = '_'; - ++p; - } - if (lf.lfItalic) - STRCAT(p, ":i"); - if (lf.lfWeight == FW_BOLD) - STRCAT(p, ":b"); - if (lf.lfUnderline) - STRCAT(p, ":u"); - if (lf.lfStrikeOut) - STRCAT(p, ":s"); + res_len = vim_snprintf_safelen( + (char *)res, res_size, "%s:h%d:W%ld", font_name, points, lf.lfWeight); + + res_len += vim_snprintf_safelen( + (char *)res + res_len, + res_size - res_len, + "%s%s%s%s", + lf.lfItalic ? ":i" : "", + lf.lfWeight ? ":b" : "", + lf.lfUnderline ? ":u" : "", + lf.lfStrikeOut ? ":s" : ""); + if (charset_name != NULL) - { - STRCAT(p, ":c"); - STRCAT(p, charset_name); - } + res_len += vim_snprintf_safelen((char *)res + res_len, + res_size - res_len, ":c%s", charset_name); if (quality_name != NULL) - { - STRCAT(p, ":q"); - STRCAT(p, quality_name); - } + vim_snprintf((char *)res + res_len, + res_size - res_len, ":q%s", quality_name); } vim_free(font_name); @@ -4975,9 +4981,10 @@ _OnNotify(HWND hwnd, UINT id, NMHDR *hdr) else { LPNMTTDISPINFO lpdi = (LPNMTTDISPINFO)hdr; + size_t len = STRLEN(str); - if (STRLEN(str) < sizeof(lpdi->szText) - || ((tt_text = vim_strsave(str)) == NULL)) + if (len < sizeof(lpdi->szText) + || ((tt_text = vim_strnsave(str, len)) == NULL)) vim_strncpy((char_u *)lpdi->szText, str, sizeof(lpdi->szText) - 1); else @@ -5020,7 +5027,6 @@ _OnMenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) == MF_HILITE && (State & MODE_CMDLINE) == 0) { - UINT idButton; vimmenu_T *pMenu; static int did_menu_tip = FALSE; @@ -5032,17 +5038,23 @@ _OnMenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) did_menu_tip = FALSE; } - idButton = (UINT)LOWORD(wParam); - pMenu = gui_mswin_find_menu(root_menu, idButton); - if (pMenu != NULL && pMenu->strings[MENU_INDEX_TIP] != 0 - && GetMenuState(s_menuBar, pMenu->id, MF_BYCOMMAND) != -1) + pMenu = gui_mswin_find_menu(root_menu, (UINT)LOWORD(wParam)); + if (pMenu != NULL && pMenu->strings[MENU_INDEX_TIP] != NULL) { - ++msg_hist_off; - msg((char *)pMenu->strings[MENU_INDEX_TIP]); - --msg_hist_off; - setcursor(); - out_flush(); - did_menu_tip = TRUE; + MENUITEMINFO menuinfo; + + menuinfo.cbSize = sizeof(MENUITEMINFO); + menuinfo.fMask = MIIM_ID; // We only want to check if the menu item exists, + // so retrieve something simple. + if (GetMenuItemInfo(s_menuBar, pMenu->id, FALSE, &menuinfo)) + { + ++msg_hist_off; + msg((char *)pMenu->strings[MENU_INDEX_TIP]); + --msg_hist_off; + setcursor(); + out_flush(); + did_menu_tip = TRUE; + } } return 0L; } @@ -5051,7 +5063,7 @@ _OnMenuSelect(HWND hwnd, WPARAM wParam, LPARAM lParam) #endif static BOOL -_OnGetDpiScaledSize(HWND hwnd, UINT dpi, SIZE *size) +_OnGetDpiScaledSize(HWND hwnd UNUSED, UINT dpi, SIZE *size) { int old_width, old_height; int new_width, new_height; @@ -5372,13 +5384,11 @@ gui_mch_do_spawn(char_u *arg) { if (*p == L'"') { - while (*p && *p != L'"') - ++p; - if (*p) - ++p; + // Skip quoted strings + while (*++p && *p != L'"'); } - else - ++p; + + ++p; } cmd = p; } @@ -5394,7 +5404,12 @@ gui_mch_do_spawn(char_u *arg) if (session == NULL) goto error; savebg = p_bg; - p_bg = vim_strsave((char_u *)"light"); // Set 'bg' to "light". + p_bg = vim_strnsave((char_u *)"light", 5); // Set 'bg' to "light". + if (p_bg == NULL) + { + p_bg = savebg; + goto error; + } ret = write_session_file(session); vim_free(p_bg); p_bg = savebg; @@ -7127,8 +7142,11 @@ dialog_callback( GetDlgItemTextW(hwnd, DLG_NONBUTTON_CONTROL + 2, wp, IOSIZE); p = utf16_to_enc(wp, NULL); - vim_strncpy(s_textfield, p, IOSIZE); - vim_free(p); + if (p != NULL) + { + vim_strncpy(s_textfield, p, IOSIZE); + vim_free(p); + } vim_free(wp); } @@ -9057,7 +9075,7 @@ test_gui_w32_sendevent_mouse(dict_T *args) if (dict_get_bool(args, "cell", FALSE)) { // calculate the middle of the character cell - // Note: Cell coordinates are 1-based from vimscript + // Note: Cell coordinates are 1-based from Vim script int pY = (row - 1) * gui.char_height + gui.char_height / 2; int pX = (col - 1) * gui.char_width + gui.char_width / 2; gui_mouse_moved(pX, pY); diff --git a/src/gui_xim.c b/src/gui_xim.c index 7c787e9087..6cd9b909e8 100644 --- a/src/gui_xim.c +++ b/src/gui_xim.c @@ -295,7 +295,7 @@ im_add_to_input(char_u *str, int len) } # ifndef FEAT_GUI_MACVIM - static void + static void im_preedit_window_set_position(void) { int x, y, width, height; diff --git a/src/gui_xmebw.c b/src/gui_xmebw.c index 3d9519eeb0..440c1b96ad 100644 --- a/src/gui_xmebw.c +++ b/src/gui_xmebw.c @@ -505,7 +505,7 @@ draw_shadows(XmEnhancedButtonWidget eb) Boolean etched_in; if (!eb->primitive.shadow_thickness) - return; + return; if ((eb->core.width <= 2 * eb->primitive.highlight_thickness) || (eb->core.height <= 2 * eb->primitive.highlight_thickness)) @@ -748,9 +748,9 @@ draw_label(XmEnhancedButtonWidget eb, XEvent *event, Region region) static void Enter(Widget wid, - XEvent *event, - String *params UNUSED, - Cardinal *num_params UNUSED) + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget) wid; XmPushButtonCallbackStruct call_value; @@ -837,9 +837,9 @@ Enter(Widget wid, static void Leave(Widget wid, - XEvent *event, - String *params UNUSED, - Cardinal *num_params UNUSED) + XEvent *event, + String *params UNUSED, + Cardinal *num_params UNUSED) { XmEnhancedButtonWidget eb = (XmEnhancedButtonWidget)wid; XmPushButtonCallbackStruct call_value; diff --git a/src/highlight.c b/src/highlight.c index 5221962488..90ad03c286 100644 --- a/src/highlight.c +++ b/src/highlight.c @@ -249,6 +249,9 @@ static char *(highlight_init_both[]) = { "TabLineSel term=bold cterm=bold gui=bold"), CENT("TabLineFill term=reverse cterm=reverse", "TabLineFill term=reverse cterm=reverse gui=reverse"), + "default link TabPanel TabLine", + "default link TabPanelSel TabLineSel", + "default link TabPanelFill TabLineFill", #ifdef FEAT_GUI "Cursor guibg=fg guifg=bg", "lCursor guibg=fg guifg=bg", // should be different, but what? @@ -3686,6 +3689,8 @@ syn_id2attr(int hl_id) hl_group_T *sgp; hl_id = syn_get_final_id(hl_id); + // shouldn't happen + assert(hl_id > 0); sgp = &HL_TABLE()[hl_id - 1]; // index is ID minus one #ifdef FEAT_GUI @@ -3713,6 +3718,8 @@ syn_id2colors(int hl_id, guicolor_T *fgp, guicolor_T *bgp) hl_group_T *sgp; hl_id = syn_get_final_id(hl_id); + // shouldn't happen + assert(hl_id > 0); sgp = &HL_TABLE()[hl_id - 1]; // index is ID minus one *fgp = sgp->sg_gui_fg; @@ -3731,6 +3738,8 @@ syn_id2cterm_bg(int hl_id, int *fgp, int *bgp) hl_group_T *sgp; hl_id = syn_get_final_id(hl_id); + // shouldn't happen + assert(hl_id > 0); sgp = &HL_TABLE()[hl_id - 1]; // index is ID minus one *fgp = sgp->sg_cterm_fg - 1; *bgp = sgp->sg_cterm_bg - 1; diff --git a/src/if_cscope.c b/src/if_cscope.c index 6b0f920923..86bfbd81b8 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -548,8 +548,7 @@ cs_add_common( if ((fname = alloc(MAXPATHL + 1)) == NULL) goto add_err; - expand_env((char_u *)arg1, (char_u *)fname, MAXPATHL); - len = STRLEN(fname); + len = expand_env((char_u *)arg1, (char_u *)fname, MAXPATHL); fbuf = (char_u *)fname; (void)modify_fname((char_u *)":p", FALSE, &usedlen, (char_u **)&fname, &fbuf, &len); @@ -829,6 +828,7 @@ cs_create_connection(int i) int cmdlen; int len; char *prog, *cmd, *ppath = NULL; + size_t proglen; #ifdef MSWIN int fd; SECURITY_ATTRIBUTES sa; @@ -916,10 +916,10 @@ cs_create_connection(int i) goto err_closing; #endif } - expand_env(p_csprg, (char_u *)prog, MAXPATHL); + proglen = expand_env(p_csprg, (char_u *)prog, MAXPATHL); // alloc space to hold the cscope command - cmdlen = (int)(strlen(prog) + strlen(csinfo[i].fname) + 32); + cmdlen = (int)(proglen + strlen(csinfo[i].fname) + 32); if (csinfo[i].ppath) { // expand the prepend path for env var's @@ -933,9 +933,7 @@ cs_create_connection(int i) goto err_closing; #endif } - expand_env((char_u *)csinfo[i].ppath, (char_u *)ppath, MAXPATHL); - - cmdlen += (int)strlen(ppath); + cmdlen += (int)expand_env((char_u *)csinfo[i].ppath, (char_u *)ppath, MAXPATHL); } if (csinfo[i].flags) diff --git a/src/if_py_both.h b/src/if_py_both.h index ed66254ff3..7fc055db53 100644 --- a/src/if_py_both.h +++ b/src/if_py_both.h @@ -2409,18 +2409,18 @@ DictionaryUpdate(DictionaryObject *self, PyObject *args, PyObject *kwargs) Py_DECREF(item); - if (PySequence_Fast_GET_SIZE(fast) != 2) + if (PySequence_Size(fast) != 2) { Py_DECREF(iterator); Py_DECREF(fast); PyErr_FORMAT(PyExc_ValueError, N_("expected sequence element of size 2, " "but got sequence of size %d"), - (int) PySequence_Fast_GET_SIZE(fast)); + (int) PySequence_Size(fast)); return NULL; } - keyObject = PySequence_Fast_GET_ITEM(fast, 0); + keyObject = PySequence_GetItem(fast, 0); if (!(key = StringToChars(keyObject, &todecref))) { @@ -2442,7 +2442,7 @@ DictionaryUpdate(DictionaryObject *self, PyObject *args, PyObject *kwargs) } di->di_tv.v_type = VAR_UNKNOWN; - valObject = PySequence_Fast_GET_ITEM(fast, 1); + valObject = PySequence_GetItem(fast, 1); if (ConvertFromPyObject(valObject, &di->di_tv) == -1) { diff --git a/src/if_python.c b/src/if_python.c index ace5935396..e0f4b67f37 100644 --- a/src/if_python.c +++ b/src/if_python.c @@ -210,9 +210,6 @@ struct PyMethodDef { Py_ssize_t a; }; # define PySequence_Size dll_PySequence_Size # define PySequence_GetItem dll_PySequence_GetItem # define PySequence_Fast dll_PySequence_Fast -# define PyTuple_Size dll_PyTuple_Size -# define PyTuple_GetItem dll_PyTuple_GetItem -# define PyTuple_Type (*dll_PyTuple_Type) # define PySlice_GetIndicesEx dll_PySlice_GetIndicesEx # define PyImport_ImportModule dll_PyImport_ImportModule # define PyDict_New dll_PyDict_New @@ -556,9 +553,6 @@ static struct {"PySequence_Check", (PYTHON_PROC*)&dll_PySequence_Check}, {"PySequence_GetItem", (PYTHON_PROC*)&dll_PySequence_GetItem}, {"PySequence_Fast", (PYTHON_PROC*)&dll_PySequence_Fast}, - {"PyTuple_GetItem", (PYTHON_PROC*)&dll_PyTuple_GetItem}, - {"PyTuple_Size", (PYTHON_PROC*)&dll_PyTuple_Size}, - {"PyTuple_Type", (PYTHON_PROC*)&dll_PyTuple_Type}, {"PySlice_GetIndicesEx", (PYTHON_PROC*)&dll_PySlice_GetIndicesEx}, {"PyImport_ImportModule", (PYTHON_PROC*)&dll_PyImport_ImportModule}, {"PyDict_GetItemString", (PYTHON_PROC*)&dll_PyDict_GetItemString}, @@ -968,7 +962,7 @@ Python_Init(void) site = PyImport_ImportModule("site"); if (site == NULL) { - emsg(_(e_sorry_this_command_is_disabled_python_side_module_could_not_be_loaded)); + emsg(_(e_sorry_this_command_is_disabled_python_site_module_could_not_be_loaded)); goto fail; } Py_DECREF(site); diff --git a/src/if_ruby.c b/src/if_ruby.c index a018dcde98..b769adfa2f 100644 --- a/src/if_ruby.c +++ b/src/if_ruby.c @@ -107,7 +107,10 @@ # undef SIZEOF_TIME_T #endif +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wunused-parameter" #include +#pragma GCC diagnostic pop #include // See above. @@ -386,12 +389,12 @@ static void (*dll_rb_debug_rstring_null_ptr) (const char*); # endif static VALUE (*dll_rb_define_class_under) (VALUE, const char*, VALUE); static void (*dll_rb_define_const) (VALUE,const char*,VALUE); -static void (*dll_rb_define_global_function) (const char*,VALUE(*)(),int); -static void (*dll_rb_define_method) (VALUE,const char*,VALUE(*)(),int); +static void (*dll_rb_define_global_function) (const char*,VALUE(*)(int,VALUE*,VALUE),int); +static void (*dll_rb_define_method) (VALUE,const char*,VALUE(*)(ANYARGS),int); static VALUE (*dll_rb_define_module) (const char*); -static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(),int); -static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(),int); -static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(),void(*)()); +static void (*dll_rb_define_module_function) (VALUE,const char*,VALUE(*)(VALUE,VALUE),int); +static void (*dll_rb_define_singleton_method) (VALUE,const char*,VALUE(*)(ANYARGS),int); +static void (*dll_rb_define_virtual_variable) (const char*,VALUE(*)(ID,VALUE*),void(*)()); static VALUE *dll_rb_stdout; static VALUE *dll_rb_stderr; static VALUE *dll_rb_eArgError; @@ -1720,10 +1723,10 @@ ruby_io_init(void) rb_stdout = rb_obj_alloc(rb_cObject); rb_stderr = rb_obj_alloc(rb_cObject); - rb_define_singleton_method(rb_stdout, "write", vim_message, 1); - rb_define_singleton_method(rb_stdout, "flush", f_nop, 0); - rb_define_singleton_method(rb_stderr, "write", vim_message, 1); - rb_define_singleton_method(rb_stderr, "flush", f_nop, 0); + rb_define_singleton_method(rb_stdout, "write", (void*)vim_message, 1); + rb_define_singleton_method(rb_stdout, "flush", (void*)f_nop, 0); + rb_define_singleton_method(rb_stderr, "write", (void*)vim_message, 1); + rb_define_singleton_method(rb_stderr, "flush", (void*)f_nop, 0); rb_define_global_function("p", f_p, -1); } @@ -1757,36 +1760,36 @@ ruby_vim_init(void) rb_eStandardError); cBuffer = rb_define_class_under(mVIM, "Buffer", rb_cObject); - rb_define_singleton_method(cBuffer, "current", buffer_s_current, 0); - rb_define_singleton_method(cBuffer, "count", buffer_s_count, 0); - rb_define_singleton_method(cBuffer, "[]", buffer_s_aref, 1); - rb_define_method(cBuffer, "name", buffer_name, 0); - rb_define_method(cBuffer, "number", buffer_number, 0); - rb_define_method(cBuffer, "count", buffer_count, 0); - rb_define_method(cBuffer, "length", buffer_count, 0); - rb_define_method(cBuffer, "[]", buffer_aref, 1); - rb_define_method(cBuffer, "[]=", buffer_aset, 2); - rb_define_method(cBuffer, "delete", buffer_delete, 1); - rb_define_method(cBuffer, "append", buffer_append, 2); + rb_define_singleton_method(cBuffer, "current", (void*)buffer_s_current, 0); + rb_define_singleton_method(cBuffer, "count", (void*)buffer_s_count, 0); + rb_define_singleton_method(cBuffer, "[]", (void*)buffer_s_aref, 1); + rb_define_method(cBuffer, "name", (void*)buffer_name, 0); + rb_define_method(cBuffer, "number", (void*)buffer_number, 0); + rb_define_method(cBuffer, "count", (void*)buffer_count, 0); + rb_define_method(cBuffer, "length", (void*)buffer_count, 0); + rb_define_method(cBuffer, "[]", (void*)buffer_aref, 1); + rb_define_method(cBuffer, "[]=", (void*)buffer_aset, 2); + rb_define_method(cBuffer, "delete", (void*)buffer_delete, 1); + rb_define_method(cBuffer, "append", (void*)buffer_append, 2); // Added line manipulation functions // SegPhault - 03/07/05 - rb_define_method(cBuffer, "line_number", current_line_number, 0); - rb_define_method(cBuffer, "line", line_s_current, 0); - rb_define_method(cBuffer, "line=", set_current_line, 1); + rb_define_method(cBuffer, "line_number", (void*)current_line_number, 0); + rb_define_method(cBuffer, "line", (void*)line_s_current, 0); + rb_define_method(cBuffer, "line=", (void*)set_current_line, 1); cVimWindow = rb_define_class_under(mVIM, "Window", rb_cObject); - rb_define_singleton_method(cVimWindow, "current", window_s_current, 0); - rb_define_singleton_method(cVimWindow, "count", window_s_count, 0); - rb_define_singleton_method(cVimWindow, "[]", window_s_aref, 1); - rb_define_method(cVimWindow, "buffer", window_buffer, 0); - rb_define_method(cVimWindow, "height", window_height, 0); - rb_define_method(cVimWindow, "height=", window_set_height, 1); - rb_define_method(cVimWindow, "width", window_width, 0); - rb_define_method(cVimWindow, "width=", window_set_width, 1); - rb_define_method(cVimWindow, "cursor", window_cursor, 0); - rb_define_method(cVimWindow, "cursor=", window_set_cursor, 1); + rb_define_singleton_method(cVimWindow, "current", (void*)window_s_current, 0); + rb_define_singleton_method(cVimWindow, "count", (void*)window_s_count, 0); + rb_define_singleton_method(cVimWindow, "[]", (void*)window_s_aref, 1); + rb_define_method(cVimWindow, "buffer", (void*)window_buffer, 0); + rb_define_method(cVimWindow, "height", (void*)window_height, 0); + rb_define_method(cVimWindow, "height=", (void*)window_set_height, 1); + rb_define_method(cVimWindow, "width", (void*)window_width, 0); + rb_define_method(cVimWindow, "width=", (void*)window_set_width, 1); + rb_define_method(cVimWindow, "cursor", (void*)window_cursor, 0); + rb_define_method(cVimWindow, "cursor=", (void*)window_set_cursor, 1); rb_define_virtual_variable("$curbuf", buffer_s_current_getter, 0); rb_define_virtual_variable("$curwin", window_s_current_getter, 0); diff --git a/src/indent.c b/src/indent.c index 6951cfcdb1..7a2c16d3c4 100644 --- a/src/indent.c +++ b/src/indent.c @@ -524,7 +524,7 @@ set_indent( char_u *s; int todo; int ind_len; // measured in characters - int line_len; + int line_len; // size of the line (including the NUL) int doit = FALSE; int ind_done = 0; // measured in spaces #ifdef FEAT_VARTABS @@ -540,6 +540,7 @@ set_indent( todo = size; ind_len = 0; p = oldline = ml_get_curline(); + line_len = ml_get_curline_len() + 1; // Calculate the buffer size for the new indent, and check to see if it // isn't already set @@ -660,8 +661,10 @@ set_indent( if (flags & SIN_INSERT) p = oldline; else + { p = skipwhite(p); - line_len = (int)STRLEN(p) + 1; + line_len -= (int)(p - oldline); + } // If 'preserveindent' and 'expandtab' are both set keep the original // characters and allocate accordingly. We will fill the rest with spaces @@ -1330,7 +1333,7 @@ change_indent( // MODE_VREPLACE state needs to know what the line was like before changing if (State & VREPLACE_FLAG) { - orig_line = vim_strsave(ml_get_curline()); // Deal with NULL below + orig_line = vim_strnsave(ml_get_curline(), ml_get_curline_len()); // Deal with NULL below orig_col = curwin->w_cursor.col; } @@ -1508,7 +1511,7 @@ change_indent( return; // Save new line - new_line = vim_strsave(ml_get_curline()); + new_line = vim_strnsave(ml_get_curline(), ml_get_curline_len()); if (new_line == NULL) return; @@ -1713,21 +1716,29 @@ ex_retab(exarg_T *eap) char_u *new_ts_str; // string value of tab argument #else int temp; - int new_ts; + int new_ts = 0; #endif int save_list; linenr_T first_line = 0; // first changed line linenr_T last_line = 0; // last changed line + int is_indent_only = 0; // Only process leading whitespace save_list = curwin->w_p_list; curwin->w_p_list = 0; // don't want list mode here + ptr = eap->arg; + if (STRNCMP(ptr, "-indentonly", 11) == 0 && IS_WHITE_OR_NUL(ptr[11])) + { + is_indent_only = 1; + ptr = skipwhite(ptr + 11); + } + #ifdef FEAT_VARTABS - new_ts_str = eap->arg; - if (tabstop_set(eap->arg, &new_vts_array) == FAIL) + new_ts_str = ptr; + if (tabstop_set(ptr, &new_vts_array) == FAIL) return; - while (vim_isdigit(*(eap->arg)) || *(eap->arg) == ',') - ++(eap->arg); + while (vim_isdigit(*ptr) || *ptr == ',') + ++ptr; // This ensures that either new_vts_array and new_ts_str are freshly // allocated, or new_vts_array points to an existing array and new_ts_str @@ -1738,19 +1749,26 @@ ex_retab(exarg_T *eap) new_ts_str = NULL; } else - new_ts_str = vim_strnsave(new_ts_str, eap->arg - new_ts_str); + new_ts_str = vim_strnsave(new_ts_str, ptr - new_ts_str); #else - ptr = eap->arg; - new_ts = getdigits(&ptr); - if (new_ts < 0 && *eap->arg == '-') - { - emsg(_(e_argument_must_be_positive)); - return; - } - if (new_ts < 0 || new_ts > TABSTOP_MAX) + if (ptr[0] != NUL && (ptr[0] != '0' || ptr[1] != NUL)) { - semsg(_(e_invalid_argument_str), eap->arg); - return; + char_u *end; + + if (strtol((char *)ptr, (char **)&end, 10) <= 0) + { + if (ptr != end) + emsg(_(e_argument_must_be_positive)); + else + semsg(_(e_invalid_argument_str), ptr); + return; + } + new_ts = getdigits(&ptr); + if (new_ts < 0 || new_ts > TABSTOP_MAX) + { + semsg(_(e_invalid_argument_str), eap->arg); + return; + } } if (new_ts == 0) new_ts = curbuf->b_p_ts; @@ -1758,6 +1776,7 @@ ex_retab(exarg_T *eap) for (lnum = eap->line1; !got_int && lnum <= eap->line2; ++lnum) { ptr = ml_get(lnum); + old_len = ml_get_len(lnum); col = 0; vcol = 0; did_undo = FALSE; @@ -1821,7 +1840,6 @@ ex_retab(exarg_T *eap) // len is actual number of white characters used len = num_spaces + num_tabs; - old_len = (long)STRLEN(ptr); new_len = old_len - col + start_col + len + 1; if (new_len <= 0 || new_len >= MAXCOL) { @@ -1845,11 +1863,15 @@ ex_retab(exarg_T *eap) first_line = lnum; last_line = lnum; ptr = new_line; + old_len = new_len - 1; col = start_col + len; } } got_tab = FALSE; num_spaces = 0; + + if (is_indent_only) + break; } if (ptr[col] == NUL) break; @@ -2000,8 +2022,7 @@ lisp_match(char_u *p) while (*word != NUL) { - (void)copy_option_part(&word, buf, LSIZE, ","); - len = (int)STRLEN(buf); + len = copy_option_part(&word, buf, LSIZE, ","); if (STRNCMP(buf, p, len) == 0 && IS_WHITE_OR_NUL(p[len])) return TRUE; } diff --git a/src/insexpand.c b/src/insexpand.c index 4bd0da0918..dd1a117867 100644 --- a/src/insexpand.c +++ b/src/insexpand.c @@ -38,6 +38,7 @@ # define CTRL_X_LOCAL_MSG 15 // only used in "ctrl_x_msgs" # define CTRL_X_EVAL 16 // for builtin function complete() # define CTRL_X_CMDLINE_CTRL_X 17 // CTRL-X typed in CTRL_X_CMDLINE +# define CTRL_X_REGISTER 18 // complete words from registers # define CTRL_X_MSG(i) ctrl_x_msgs[(i) & ~CTRL_X_WANT_IDENT] @@ -45,7 +46,7 @@ static char *ctrl_x_msgs[] = { N_(" Keyword completion (^N^P)"), // CTRL_X_NORMAL, ^P/^N compl. - N_(" ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)"), + N_(" ^X mode (^]^D^E^F^I^K^L^N^O^P^Rs^U^V^Y)"), NULL, // CTRL_X_SCROLL: depends on state N_(" Whole line completion (^L^N^P)"), N_(" File name completion (^F^N^P)"), @@ -62,28 +63,30 @@ static char *ctrl_x_msgs[] = N_(" Keyword Local completion (^N^P)"), NULL, // CTRL_X_EVAL doesn't use msg. N_(" Command-line completion (^V^N^P)"), + N_(" Register completion (^N^P)"), }; #if defined(FEAT_COMPL_FUNC) || defined(FEAT_EVAL) static char *ctrl_x_mode_names[] = { - "keyword", - "ctrl_x", - "scroll", - "whole_line", - "files", - "tags", - "path_patterns", - "path_defines", - "unknown", // CTRL_X_FINISHED - "dictionary", - "thesaurus", - "cmdline", - "function", - "omni", - "spell", - NULL, // CTRL_X_LOCAL_MSG only used in "ctrl_x_msgs" - "eval", - "cmdline", + "keyword", + "ctrl_x", + "scroll", + "whole_line", + "files", + "tags", + "path_patterns", + "path_defines", + "unknown", // CTRL_X_FINISHED + "dictionary", + "thesaurus", + "cmdline", + "function", + "omni", + "spell", + NULL, // CTRL_X_LOCAL_MSG only used in "ctrl_x_msgs" + "eval", + "cmdline", + "register", }; #endif @@ -105,10 +108,11 @@ struct compl_S // cp_flags has CP_FREE_FNAME int cp_flags; // CP_ values int cp_number; // sequence number - int cp_score; // fuzzy match score + int cp_score; // fuzzy match score or proximity score int cp_in_match_array; // collected by compl_match_array int cp_user_abbr_hlattr; // highlight attribute for abbr int cp_user_kind_hlattr; // highlight attribute for kind + int cp_cpt_source_idx; // index of this match's source in 'cpt' option }; // values for cp_flags @@ -124,7 +128,7 @@ struct compl_S * "compl_first_match" points to the start of the list. * "compl_curr_match" points to the currently selected entry. * "compl_shown_match" is different from compl_curr_match during - * ins_compl_get_exp(). + * ins_compl_get_exp(), when new matches are added to the list. * "compl_old_match" points to previous "compl_curr_match". */ static compl_T *compl_first_match = NULL; @@ -171,7 +175,10 @@ static int compl_started = FALSE; static int ctrl_x_mode = CTRL_X_NORMAL; static int compl_matches = 0; // number of completion matches -static string_T compl_pattern = {NULL, 0}; +static string_T compl_pattern = {NULL, 0}; // search pattern for matching items +#ifdef FEAT_COMPL_FUNC +static string_T cpt_compl_pattern = {NULL, 0}; // pattern returned by func in 'cpt' +#endif static int compl_direction = FORWARD; static int compl_shows_dir = FORWARD; static int compl_pending = 0; // > 1 for postponed CTRL-N @@ -188,6 +195,9 @@ static string_T compl_orig_text = {NULL, 0}; // text as it was before static int compl_cont_mode = 0; static expand_T compl_xp; +static win_T *compl_curr_win = NULL; // win where completion is active +static buf_T *compl_curr_buf = NULL; // buf where completion is active + // List of flags for method of completion. static int compl_cont_status = 0; # define CONT_ADDING 1 // "normal" or "adding" expansion @@ -208,6 +218,19 @@ static int compl_selected_item = -1; static int *compl_fuzzy_scores; +// Define the structure for completion source (in 'cpt' option) information +typedef struct cpt_source_T +{ + int cs_refresh_always; // Whether 'refresh:always' is set for func + int cs_startcol; // Start column returned by func + int cs_max_matches; // Max items to display from this source +} cpt_source_T; + +#define STARTCOL_NONE -9 +static cpt_source_T *cpt_sources_array; // Pointer to the array of completion sources +static int cpt_sources_count; // Total number of completion sources specified in the 'cpt' option +static int cpt_sources_index = -1; // Index of the current completion source being expanded + // "compl_match_array" points the currently displayed list of entries in the // popup menu. It is NULL when there is no popup menu. static pumitem_T *compl_match_array = NULL; @@ -227,7 +250,14 @@ static void ins_compl_fixRedoBufForLeader(char_u *ptr_arg); # if defined(FEAT_COMPL_FUNC) || defined(FEAT_EVAL) static void ins_compl_add_list(list_T *list); static void ins_compl_add_dict(dict_T *dict); +static int get_userdefined_compl_info(colnr_T curs_col, callback_T *cb, int *startcol); +static void get_cpt_func_completion_matches(callback_T *cb); +static callback_T *get_callback_if_cpt_func(char_u *p); # endif +static int setup_cpt_sources(void); +static int is_cpt_func_refresh_always(void); +static void cpt_sources_clear(void); +static void cpt_compl_refresh(void); static int ins_compl_key2dir(int c); static int ins_compl_pum_key(int c); static int ins_compl_key2count(int c); @@ -236,6 +266,8 @@ static unsigned quote_meta(char_u *dest, char_u *str, int len); static int ins_compl_has_multiple(void); static void ins_compl_expand_multiple(char_u *str); static void ins_compl_longest_insert(char_u *prefix); +static void ins_compl_make_linear(void); +static int ins_compl_make_cyclic(void); #ifdef FEAT_SPELL static void spell_back_to_badword(void); @@ -305,6 +337,8 @@ static int ctrl_x_mode_eval(void) { return ctrl_x_mode == CTRL_X_EVAL; } int ctrl_x_mode_line_or_eval(void) { return ctrl_x_mode == CTRL_X_WHOLE_LINE || ctrl_x_mode == CTRL_X_EVAL; } +int ctrl_x_mode_register(void) + { return ctrl_x_mode == CTRL_X_REGISTER; } /* * Whether other than default completion has been selected. @@ -435,7 +469,7 @@ has_compl_option(int dict_opt) vim_is_ctrl_x_key(int c) { // Always allow ^R - let its results then be checked - if (c == Ctrl_R) + if (c == Ctrl_R && ctrl_x_mode != CTRL_X_REGISTER) return TRUE; // Accept and if the popup menu is visible. @@ -454,7 +488,7 @@ vim_is_ctrl_x_key(int c) || c == Ctrl_N || c == Ctrl_T || c == Ctrl_V || c == Ctrl_Q || c == Ctrl_U || c == Ctrl_O || c == Ctrl_S || c == Ctrl_K || c == 's' - || c == Ctrl_Z); + || c == Ctrl_Z || c == Ctrl_R); case CTRL_X_SCROLL: return (c == Ctrl_Y || c == Ctrl_E); case CTRL_X_WHOLE_LINE: @@ -486,6 +520,8 @@ vim_is_ctrl_x_key(int c) return (c == Ctrl_S || c == Ctrl_P || c == Ctrl_N); case CTRL_X_EVAL: return (c == Ctrl_P || c == Ctrl_N); + case CTRL_X_REGISTER: + return (c == Ctrl_R || c == Ctrl_P || c == Ctrl_N); } internal_error("vim_is_ctrl_x_key()"); return FALSE; @@ -549,11 +585,11 @@ ins_compl_accept_char(int c) */ static char_u * ins_compl_infercase_gettext( - char_u *str, - int char_len, - int compl_char_len, - int min_len, - char_u **tofree) + char_u *str, + int char_len, + int compl_char_len, + int min_len, + char_u **tofree) { int *wca; // Wide character array. char_u *p; @@ -774,6 +810,15 @@ cfc_has_mode(void) return FALSE; } +/* + * Returns TRUE if matches should be sorted based on proximity to the cursor. + */ + static int +is_nearest_active(void) +{ + return (get_cot_flags() & (COT_NEAREST | COT_FUZZY)) == COT_NEAREST; +} + /* * Add a match to the list of matches. The arguments are: * str - text of the match to add @@ -831,7 +876,11 @@ ins_compl_add( && STRNCMP(match->cp_str.string, str, len) == 0 && ((int)match->cp_str.length <= len || match->cp_str.string[len] == NUL)) + { + if (is_nearest_active() && score > 0 && score < match->cp_score) + match->cp_score = score; return NOTDONE; + } match = match->cp_next; } while (match != NULL && !is_first_match(match)); } @@ -873,12 +922,11 @@ ins_compl_add( match->cp_user_abbr_hlattr = user_hl ? user_hl[0] : -1; match->cp_user_kind_hlattr = user_hl ? user_hl[1] : -1; match->cp_score = score; + match->cp_cpt_source_idx = cpt_sources_index; if (cptext != NULL) { - int i; - - for (i = 0; i < CPT_COUNT; ++i) + for (int i = 0; i < CPT_COUNT; ++i) { if (cptext[i] != NULL && *cptext[i] != NUL) match->cp_text[i] = vim_strsave(cptext[i]); @@ -905,13 +953,13 @@ ins_compl_add( { if (current->cp_score < score) { - match->cp_next = current; - match->cp_prev = current->cp_prev; - if (current->cp_prev) + match->cp_next = current; + match->cp_prev = current->cp_prev; + if (current->cp_prev) current->cp_prev->cp_next = match; - current->cp_prev = match; - inserted = TRUE; - break; + current->cp_prev = match; + inserted = TRUE; + break; } prev = current; current = current->cp_next; @@ -1114,11 +1162,10 @@ ins_compl_add_matches( char_u **matches, int icase) { - int i; int add_r = OK; int dir = compl_direction; - for (i = 0; i < num_matches && add_r != FAIL; i++) + for (int i = 0; i < num_matches && add_r != FAIL; i++) { add_r = ins_compl_add(matches[i], -1, NULL, NULL, NULL, dir, CP_FAST | (icase ? CP_ICASE : 0), FALSE, NULL, 0); @@ -1191,12 +1238,10 @@ get_cot_flags(void) static void ins_compl_upd_pum(void) { - int h; - if (compl_match_array == NULL) return; - h = curwin->w_cline_height; + int h = curwin->w_cline_height; // Update the screen later, before drawing the popup menu over it. pum_call_update_screen(); if (h != curwin->w_cline_height) @@ -1321,16 +1366,175 @@ trigger_complete_changed_event(int cur) #endif /* - * pumitem qsort compare func + * Helper functions for mergesort_list(). + */ + static void* +cp_get_next(void *node) +{ + return ((compl_T*)node)->cp_next; +} + + static void +cp_set_next(void *node, void *next) +{ + ((compl_T*)node)->cp_next = (compl_T*)next; +} + + static void* +cp_get_prev(void* node) +{ + return ((compl_T*)node)->cp_prev; +} + + static void +cp_set_prev(void* node, void* prev) +{ + ((compl_T*)node)->cp_prev = (compl_T*)prev; +} + + static int +cp_compare_fuzzy(const void* a, const void* b) +{ + int score_a = ((compl_T*)a)->cp_score; + int score_b = ((compl_T*)b)->cp_score; + return (score_b > score_a) ? 1 : (score_b < score_a) ? -1 : 0; +} + + static int +cp_compare_nearest(const void* a, const void* b) +{ + int score_a = ((compl_T*)a)->cp_score; + int score_b = ((compl_T*)b)->cp_score; + if (score_a == 0 || score_b == 0) + return 0; + return (score_a > score_b) ? 1 : (score_a < score_b) ? -1 : 0; +} + +/* + * Constructs a new string by prepending text from the current line (from + * startcol to compl_col) to the given source string. Stores the result in + * dest. Returns OK or FAIL. */ static int -ins_compl_fuzzy_cmp(const void *a, const void *b) +prepend_startcol_text(string_T *dest, string_T *src, int startcol) +{ + int prepend_len = compl_col - startcol; + int new_length = prepend_len + (int)src->length; + + dest->length = (size_t)new_length; + dest->string = alloc(new_length + 1); // +1 for NUL + if (dest->string == NULL) + { + dest->length = 0; + return FAIL; + } + + char_u *line = ml_get(curwin->w_cursor.lnum); + + mch_memmove(dest->string, line + startcol, prepend_len); + mch_memmove(dest->string + prepend_len, src->string, src->length); + dest->string[new_length] = NUL; + return OK; +} + +/* + * Returns the completion leader string adjusted for a specific source's + * startcol. If the source's startcol is before compl_col, prepends text from + * the buffer line to the original compl_leader. + */ + static string_T * +get_leader_for_startcol(compl_T *match, int cached) +{ + static string_T adjusted_leader = {NULL, 0}; + + if (match == NULL) + { + VIM_CLEAR_STRING(adjusted_leader); + return NULL; + } + + if (cpt_sources_array == NULL || compl_leader.string == NULL) + goto theend; + + int cpt_idx = match->cp_cpt_source_idx; + if (cpt_idx < 0 || compl_col <= 0) + goto theend; + int startcol = cpt_sources_array[cpt_idx].cs_startcol; + + if (startcol >= 0 && startcol < compl_col) + { + int prepend_len = compl_col - startcol; + int new_length = prepend_len + (int)compl_leader.length; + if (cached && (size_t)new_length == adjusted_leader.length + && adjusted_leader.string != NULL) + return &adjusted_leader; + + VIM_CLEAR_STRING(adjusted_leader); + if (prepend_startcol_text(&adjusted_leader, &compl_leader, + startcol) != OK) + goto theend; + + return &adjusted_leader; + } +theend: + return &compl_leader; +} + +/* + * Set fuzzy score. + */ + static void +set_fuzzy_score(void) +{ + compl_T *compl; + + if (!compl_first_match + || compl_leader.string == NULL || compl_leader.length == 0) + return; + + (void)get_leader_for_startcol(NULL, TRUE); // Clear the cache + + compl = compl_first_match; + do + { + compl->cp_score = fuzzy_match_str(compl->cp_str.string, + get_leader_for_startcol(compl, TRUE)->string); + compl = compl->cp_next; + } while (compl != NULL && !is_first_match(compl)); +} + +/* + * Sort completion matches, excluding the node that contains the leader. + */ + static void +sort_compl_match_list(int (*compare)(const void *, const void *)) { - const int sa = (*(pumitem_T *)a).pum_score; - const int sb = (*(pumitem_T *)b).pum_score; - const int ia = (*(pumitem_T *)a).pum_idx; - const int ib = (*(pumitem_T *)b).pum_idx; - return sa == sb ? (ia == ib ? 0 : (ia < ib ? -1 : 1)) : (sa < sb ? 1 : -1); + compl_T *compl; + + if (!compl_first_match || is_first_match(compl_first_match->cp_next)) + return; + + compl = compl_first_match->cp_prev; + ins_compl_make_linear(); + if (compl_shows_dir_forward()) + { + compl_first_match->cp_next->cp_prev = NULL; + compl_first_match->cp_next = mergesort_list(compl_first_match->cp_next, + cp_get_next, cp_set_next, cp_get_prev, cp_set_prev, compare); + compl_first_match->cp_next->cp_prev = compl_first_match; + } + else + { + compl->cp_prev->cp_next = NULL; + compl_first_match = mergesort_list(compl_first_match, cp_get_next, + cp_set_next, cp_get_prev, cp_set_prev, compare); + compl_T *tail = compl_first_match; + while (tail->cp_next != NULL) + tail = tail->cp_next; + tail->cp_next = compl; + compl->cp_prev = tail; + } + (void)ins_compl_make_cyclic(); } /* @@ -1347,19 +1551,19 @@ ins_compl_build_pum(void) int shown_match_ok = FALSE; int i = 0; int cur = -1; - int max_fuzzy_score = 0; unsigned int cur_cot_flags = get_cot_flags(); int compl_no_select = (cur_cot_flags & COT_NOSELECT) != 0; int fuzzy_filter = (cur_cot_flags & COT_FUZZY) != 0; - int fuzzy_sort = fuzzy_filter && !(cur_cot_flags & COT_NOSORT); - compl_T *match_head = NULL; compl_T *match_tail = NULL; compl_T *match_next = NULL; + int *match_count = NULL; + int is_forward = compl_shows_dir_forward(); + int is_cpt_completion = (cpt_sources_array != NULL); + string_T *leader; // Need to build the popup menu list. compl_match_arraysize = 0; - compl = compl_first_match; // If the current match is the original text don't find the first // match after it, don't highlight anything. @@ -1372,64 +1576,83 @@ ins_compl_build_pum(void) compl_shown_match = compl_no_select ? compl_first_match : compl_first_match->cp_next; + if (is_cpt_completion) + { + match_count = ALLOC_CLEAR_MULT(int, cpt_sources_count); + if (match_count == NULL) + return -1; + } + + (void)get_leader_for_startcol(NULL, TRUE); // Clear the cache + + compl = compl_first_match; do { compl->cp_in_match_array = FALSE; - // When 'completeopt' contains "fuzzy" and leader is not NULL or empty, - // set the cp_score for later comparisons. - if (fuzzy_filter && compl_leader.string != NULL && compl_leader.length > 0) - compl->cp_score = fuzzy_match_str(compl->cp_str.string, compl_leader.string); + + // Apply 'smartcase' behavior during normal mode + if (ctrl_x_mode_normal() && !p_inf && compl_leader.string + && !ignorecase(compl_leader.string) && !fuzzy_filter) + compl->cp_flags &= ~CP_ICASE; + + leader = get_leader_for_startcol(compl, TRUE); if (!match_at_original_text(compl) - && (compl_leader.string == NULL - || ins_compl_equal(compl, compl_leader.string, (int)compl_leader.length) + && (leader->string == NULL + || ins_compl_equal(compl, leader->string, + (int)leader->length) || (fuzzy_filter && compl->cp_score > 0))) { - ++compl_match_arraysize; - compl->cp_in_match_array = TRUE; - if (match_head == NULL) - match_head = compl; - else - match_tail->cp_match_next = compl; - match_tail = compl; - - if (!shown_match_ok && !fuzzy_filter) + // Limit number of items from each source if max_items is set. + int match_limit_exceeded = FALSE; + int cur_source = compl->cp_cpt_source_idx; + if (is_forward && cur_source != -1 && is_cpt_completion) { - if (compl == compl_shown_match || did_find_shown_match) - { - // This item is the shown match or this is the - // first displayed item after the shown match. - compl_shown_match = compl; - did_find_shown_match = TRUE; - shown_match_ok = TRUE; - } - else - // Remember this displayed match for when the - // shown match is just below it. - shown_compl = compl; - cur = i; + match_count[cur_source]++; + int max_matches = cpt_sources_array[cur_source].cs_max_matches; + if (max_matches > 0 && match_count[cur_source] > max_matches) + match_limit_exceeded = TRUE; } - else if (fuzzy_filter) + + if (!match_limit_exceeded) { - if (i == 0) - shown_compl = compl; - // Update the maximum fuzzy score and the shown match - // if the current item's score is higher - if (fuzzy_sort && compl->cp_score > max_fuzzy_score) + ++compl_match_arraysize; + compl->cp_in_match_array = TRUE; + if (match_head == NULL) + match_head = compl; + else + match_tail->cp_match_next = compl; + match_tail = compl; + + if (!shown_match_ok && !fuzzy_filter) { - did_find_shown_match = TRUE; - max_fuzzy_score = compl->cp_score; - if (!compl_no_select) + if (compl == compl_shown_match || did_find_shown_match) + { + // This item is the shown match or this is the + // first displayed item after the shown match. compl_shown_match = compl; + did_find_shown_match = TRUE; + shown_match_ok = TRUE; + } + else + // Remember this displayed match for when the + // shown match is just below it. + shown_compl = compl; + cur = i; } - - if (!shown_match_ok && compl == compl_shown_match) + else if (fuzzy_filter) { - cur = i; - shown_match_ok = TRUE; + if (i == 0) + shown_compl = compl; + + if (!shown_match_ok && compl == compl_shown_match) + { + cur = i; + shown_match_ok = TRUE; + } } + i++; } - i++; } if (compl == compl_shown_match && !fuzzy_filter) @@ -1452,10 +1675,12 @@ ins_compl_build_pum(void) compl = compl->cp_next; } while (compl != NULL && !is_first_match(compl)); + vim_free(match_count); + if (compl_match_arraysize == 0) return -1; - if (fuzzy_filter && !fuzzy_sort && !compl_no_select && !shown_match_ok) + if (fuzzy_filter && !compl_no_select && !shown_match_ok) { compl_shown_match = shown_compl; shown_match_ok = TRUE; @@ -1474,7 +1699,7 @@ ins_compl_build_pum(void) ? compl->cp_text[CPT_ABBR] : compl->cp_str.string; compl_match_array[i].pum_kind = compl->cp_text[CPT_KIND]; compl_match_array[i].pum_info = compl->cp_text[CPT_INFO]; - compl_match_array[i].pum_score = compl->cp_score; + compl_match_array[i].pum_cpt_source_idx = compl->cp_cpt_source_idx; compl_match_array[i].pum_user_abbr_hlattr = compl->cp_user_abbr_hlattr; compl_match_array[i].pum_user_kind_hlattr = compl->cp_user_kind_hlattr; compl_match_array[i++].pum_extra = compl->cp_text[CPT_MENU] != NULL @@ -1484,16 +1709,6 @@ ins_compl_build_pum(void) compl = match_next; } - if (fuzzy_sort && compl_leader.string != NULL && compl_leader.length > 0) - { - for (i = 0; i < compl_match_arraysize; i++) - compl_match_array[i].pum_idx = i; - // sort by the largest score of fuzzy match - qsort(compl_match_array, (size_t)compl_match_arraysize, - sizeof(pumitem_T), ins_compl_fuzzy_cmp); - shown_match_ok = TRUE; - } - if (!shown_match_ok) // no displayed match at all cur = -1; @@ -1524,6 +1739,7 @@ ins_compl_show_pum(void) { // popup menu already exists, only need to find the current item. for (i = 0; i < compl_match_arraysize; ++i) + { if (compl_match_array[i].pum_text == compl_shown_match->cp_str.string || compl_match_array[i].pum_text == compl_shown_match->cp_text[CPT_ABBR]) @@ -1531,6 +1747,7 @@ ins_compl_show_pum(void) cur = i; break; } + } } if (compl_match_array == NULL) @@ -1633,11 +1850,10 @@ ins_compl_dictionaries( if (ctrl_x_mode_line_or_eval()) { char_u *pat_esc = vim_strsave_escaped(pat, (char_u *)"\\"); - size_t len; if (pat_esc == NULL) goto theend; - len = STRLEN(pat_esc) + 10; + size_t len = STRLEN(pat_esc) + 10; ptr = alloc(len); if (ptr == NULL) { @@ -1719,10 +1935,10 @@ ins_compl_dictionaries( */ static int thesaurus_add_words_in_line( - char_u *fname, - char_u **buf_arg, - int dir, - char_u *skip_word) + char_u *fname, + char_u **buf_arg, + int dir, + char_u *skip_word) { int status = OK; char_u *ptr; @@ -1797,7 +2013,7 @@ ins_compl_files( if (in_fuzzy_collect) { leader = ins_compl_leader(); - leader_len = ins_compl_leader_len(); + leader_len = (int)ins_compl_leader_len(); } for (i = 0; i < count && !got_int && !compl_interrupted; i++) @@ -1883,11 +2099,15 @@ ins_compl_files( find_word_start(char_u *ptr) { if (has_mbyte) + { while (*ptr != NUL && *ptr != '\n' && mb_get_class(ptr) <= 1) ptr += (*mb_ptr2len)(ptr); + } else + { while (*ptr != NUL && *ptr != '\n' && !vim_iswordc(*ptr)) ++ptr; + } return ptr; } @@ -1898,11 +2118,9 @@ find_word_start(char_u *ptr) char_u * find_word_end(char_u *ptr) { - int start_class; - if (has_mbyte) { - start_class = mb_get_class(ptr); + int start_class = mb_get_class(ptr); if (start_class > 1) while (*ptr != NUL) { @@ -1924,14 +2142,30 @@ find_word_end(char_u *ptr) char_u * find_line_end(char_u *ptr) { - char_u *s; - - s = ptr + STRLEN(ptr); + char_u *s = ptr + STRLEN(ptr); while (s > ptr && (s[-1] == CAR || s[-1] == NL)) --s; return s; } +/* + * Free a completion item in the list + */ + static void +ins_compl_item_free(compl_T *match) +{ + VIM_CLEAR_STRING(match->cp_str); + // several entries may use the same fname, free it just once. + if (match->cp_flags & CP_FREE_FNAME) + vim_free(match->cp_fname); + for (int i = 0; i < CPT_COUNT; ++i) + vim_free(match->cp_text[i]); +#ifdef FEAT_EVAL + clear_tv(&match->cp_user_data); +#endif + vim_free(match); +} + /* * Free the list of completions */ @@ -1939,7 +2173,6 @@ find_line_end(char_u *ptr) ins_compl_free(void) { compl_T *match; - int i; VIM_CLEAR_STRING(compl_pattern); VIM_CLEAR_STRING(compl_leader); @@ -1955,16 +2188,7 @@ ins_compl_free(void) { match = compl_curr_match; compl_curr_match = compl_curr_match->cp_next; - VIM_CLEAR_STRING(match->cp_str); - // several entries may use the same fname, free it just once. - if (match->cp_flags & CP_FREE_FNAME) - vim_free(match->cp_fname); - for (i = 0; i < CPT_COUNT; ++i) - vim_free(match->cp_text[i]); -#ifdef FEAT_EVAL - clear_tv(&match->cp_user_data); -#endif - vim_free(match); + ins_compl_item_free(match); } while (compl_curr_match != NULL && !is_first_match(compl_curr_match)); compl_first_match = compl_curr_match = NULL; compl_shown_match = NULL; @@ -1983,11 +2207,14 @@ ins_compl_clear(void) compl_matches = 0; compl_selected_item = -1; compl_ins_end_col = 0; + compl_curr_win = NULL; + compl_curr_buf = NULL; VIM_CLEAR_STRING(compl_pattern); VIM_CLEAR_STRING(compl_leader); edit_submode_extra = NULL; VIM_CLEAR_STRING(compl_orig_text); compl_enter_selects = FALSE; + cpt_sources_clear(); #ifdef FEAT_EVAL // clear v:completed_item set_vim_var_dict(VV_COMPLETED_ITEM, dict_alloc_lock(VAR_FIXED)); @@ -2007,22 +2234,15 @@ ins_compl_active(void) * Return True when wp is the actual completion window */ int -ins_compl_win_active(win_T *wp UNUSED) +ins_compl_win_active(win_T *wp) { - return ins_compl_active() -#if defined(FEAT_QUICKFIX) - && (!wp->w_p_pvw -# ifdef FEAT_PROP_POPUP - && !(wp->w_popup_flags & POPF_INFO) -# endif - ) -#endif - ; + return ins_compl_active() && wp == compl_curr_win + && wp->w_buffer == compl_curr_buf; } /* - * Selected one of the matches. When FALSE the match was edited or using the - * longest common string. + * Selected one of the matches. When FALSE, the match was either edited or + * using the longest common string. */ int ins_compl_used_match(void) @@ -2174,13 +2394,21 @@ ins_compl_need_restart(void) static void ins_compl_new_leader(void) { + int cur_cot_flags = get_cot_flags(); + int save_w_wrow = curwin->w_wrow; + int save_w_leftcol = curwin->w_leftcol; + ins_compl_del_pum(); ins_compl_delete(); ins_compl_insert_bytes(compl_leader.string + get_compl_len(), -1); compl_used_match = FALSE; if (compl_started) + { ins_compl_set_original_text(compl_leader.string, compl_leader.length); + if (is_cpt_func_refresh_always()) + cpt_compl_refresh(); + } else { #ifdef FEAT_SPELL @@ -2198,22 +2426,43 @@ ins_compl_new_leader(void) out_flush_cursor(FALSE, FALSE); } #endif + save_w_wrow = curwin->w_wrow; + save_w_leftcol = curwin->w_leftcol; compl_restarting = TRUE; - if (ins_complete(Ctrl_N, TRUE) == FAIL) + if (ins_complete(Ctrl_N, FALSE) == FAIL) compl_cont_status = 0; compl_restarting = FALSE; } + // When 'cot' contains "fuzzy" set the cp_score and maybe sort + if (cur_cot_flags & COT_FUZZY) + { + set_fuzzy_score(); + // Sort the matches linked list based on fuzzy score + if (!(cur_cot_flags & COT_NOSORT)) + { + sort_compl_match_list(cp_compare_fuzzy); + if ((cur_cot_flags & (COT_NOINSERT | COT_NOSELECT)) == COT_NOINSERT + && compl_first_match) + { + compl_shown_match = compl_first_match; + if (compl_shows_dir_forward()) + compl_shown_match = compl_first_match->cp_next; + } + } + } + compl_enter_selects = !compl_used_match && compl_selected_item != -1; // Show the popup menu with a different set of matches. - ins_compl_show_pum(); + if (!compl_interrupted) + show_pum(save_w_wrow, save_w_leftcol); // Don't let Enter select the original text when there is no popup menu. if (compl_match_array == NULL) compl_enter_selects = FALSE; else if (ins_compl_has_preinsert() && compl_leader.length > 0) - ins_compl_insert(FALSE, TRUE); + ins_compl_insert(TRUE); } /* @@ -2234,7 +2483,7 @@ get_compl_len(void) void ins_compl_addleader(int c) { - int cc; + int cc; if (ins_compl_preinsert_effect()) ins_compl_delete(); @@ -2293,6 +2542,7 @@ ins_compl_restart(void) compl_matches = 0; compl_cont_status = 0; compl_cont_mode = 0; + cpt_sources_clear(); } /* @@ -2380,7 +2630,7 @@ ins_compl_addfrommatch(void) static int set_ctrl_x_mode(int c) { - int retval = FALSE; + int retval = FALSE; switch (c) { @@ -2408,8 +2658,11 @@ set_ctrl_x_mode(int c) ctrl_x_mode = CTRL_X_DICTIONARY; break; case Ctrl_R: - // Register insertion without exiting CTRL-X mode - // Simply allow ^R to happen without affecting ^X mode + // When CTRL-R is followed by '=', don't trigger register completion + // This allows expressions like =func() to work normally + if (vpeekc() == '=') + break; + ctrl_x_mode = CTRL_X_REGISTER; break; case Ctrl_T: // complete words from a thesaurus @@ -2542,7 +2795,7 @@ ins_compl_stop(int c, int prev_mode, int retval) char_u *word = NULL; // Remove pre-inserted text when present. - if (ins_compl_preinsert_effect()) + if (ins_compl_preinsert_effect() && ins_compl_win_active(curwin)) ins_compl_delete(); // Get here when we have finished typing a sequence of ^N and @@ -2630,9 +2883,6 @@ ins_compl_stop(int c, int prev_mode, int retval) retval = TRUE; } - if ((c == Ctrl_W || c == Ctrl_U) && ins_compl_preinsert_effect()) - ins_compl_delete(); - auto_format(FALSE, TRUE); // Trigger the CompleteDonePre event to give scripts a chance to @@ -2669,6 +2919,15 @@ ins_compl_stop(int c, int prev_mode, int retval) return retval; } +/* + * Cancel completion. + */ + int +ins_compl_cancel(void) +{ + return ins_compl_stop(' ', ctrl_x_mode, TRUE); +} + /* * Prepare for Insert mode completion, or stop it. * Called just after typing a character in Insert mode. @@ -2677,8 +2936,8 @@ ins_compl_stop(int c, int prev_mode, int retval) int ins_compl_prep(int c) { - int retval = FALSE; - int prev_mode = ctrl_x_mode; + int retval = FALSE; + int prev_mode = ctrl_x_mode; // Forget any previous 'special' messages if this is actually // a ^X mode key - bar ^R, in which case we wait to see what it gives us. @@ -2848,8 +3107,8 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg) static buf_T * ins_compl_next_buf(buf_T *buf, int flag) { - static win_T *wp = NULL; - int skip_buffer; + static win_T *wp = NULL; + int skip_buffer; if (flag == 'w') // just windows { @@ -2859,11 +3118,11 @@ ins_compl_next_buf(buf_T *buf, int flag) while (TRUE) { - // Move to next window (wrap to first window if at the end) - wp = (wp->w_next != NULL) ? wp->w_next : firstwin; - // Break if we're back at start or found an unscanned buffer - if (wp == curwin || !wp->w_buffer->b_scanned) - break; + // Move to next window (wrap to first window if at the end) + wp = (wp->w_next != NULL) ? wp->w_next : firstwin; + // Break if we're back at start or found an unscanned buffer + if (wp == curwin || !wp->w_buffer->b_scanned) + break; } buf = wp->w_buffer; } @@ -3005,9 +3264,7 @@ did_set_thesaurusfunc(optset_T *args UNUSED) int set_ref_in_insexpand_funcs(int copyID) { - int abort = FALSE; - - abort = set_ref_in_callback(&cfu_cb, copyID); + int abort = set_ref_in_callback(&cfu_cb, copyID); abort = abort || set_ref_in_callback(&ofu_cb, copyID); abort = abort || set_ref_in_callback(&tsrfu_cb, copyID); @@ -3050,24 +3307,30 @@ get_insert_callback(int type) /* * Execute user defined complete function 'completefunc', 'omnifunc' or * 'thesaurusfunc', and get matches in "matches". - * "type" is either CTRL_X_OMNI or CTRL_X_FUNCTION or CTRL_X_THESAURUS. + * "type" can be one of CTRL_X_OMNI, CTRL_X_FUNCTION, or CTRL_X_THESAURUS. + * Callback function "cb" is set if triggered by a function in the 'cpt' + * option; otherwise, it is NULL. */ static void -expand_by_function(int type, char_u *base) +expand_by_function(int type, char_u *base, callback_T *cb) { list_T *matchlist = NULL; dict_T *matchdict = NULL; typval_T args[3]; char_u *funcname; pos_T pos; - callback_T *cb; typval_T rettv; int save_State = State; int retval; + int is_cpt_function = (cb != NULL); - funcname = get_complete_funcname(type); - if (*funcname == NUL) - return; + if (!is_cpt_function) + { + funcname = get_complete_funcname(type); + if (*funcname == NUL) + return; + cb = get_insert_callback(type); + } // Call 'completefunc' to obtain the list of matches. args[0].v_type = VAR_NUMBER; @@ -3082,7 +3345,6 @@ expand_by_function(int type, char_u *base) // Insert mode in another buffer. ++textlock; - cb = get_insert_callback(type); retval = call_callback(cb, 0, &rettv, 2, args); // Call a function, which returns a list or dict. @@ -3139,7 +3401,7 @@ expand_by_function(int type, char_u *base) get_user_highlight_attr(char_u *hlname) { if (hlname != NULL && *hlname != NUL) - return syn_name2attr(hlname); + return syn_name2attr(hlname); return -1; } /* @@ -3295,8 +3557,8 @@ set_completion(colnr_T startcol, list_T *list) } compl_orig_text.length = (size_t)compl_length; if (ins_compl_add(compl_orig_text.string, - (int)compl_orig_text.length, NULL, NULL, NULL, 0, - flags | CP_FAST, FALSE, NULL, 0) != OK) + (int)compl_orig_text.length, NULL, NULL, NULL, 0, + flags | CP_FAST, FALSE, NULL, 0) != OK) return; ctrl_x_mode = CTRL_X_EVAL; @@ -3333,8 +3595,6 @@ set_completion(colnr_T startcol, list_T *list) void f_complete(typval_T *argvars, typval_T *rettv UNUSED) { - int startcol; - if (in_vim9script() && (check_for_number_arg(argvars, 0) == FAIL || check_for_list_arg(argvars, 1) == FAIL)) @@ -3353,7 +3613,7 @@ f_complete(typval_T *argvars, typval_T *rettv UNUSED) if (check_for_nonnull_list_arg(argvars, 1) != FAIL) { - startcol = (int)tv_get_number_chk(&argvars[0], NULL); + int startcol = (int)tv_get_number_chk(&argvars[0], NULL); if (startcol > 0) set_completion(startcol - 1, argvars[1].vval.v_list); } @@ -3387,73 +3647,230 @@ f_complete_check(typval_T *argvars UNUSED, typval_T *rettv) } /* - * Return Insert completion mode name string + * Add match item to the return list. + * Returns FAIL if out of memory, OK otherwise. */ - static char_u * -ins_compl_mode(void) + static int +add_match_to_list( + typval_T *rettv, + char_u *str, + int len, + int pos) { - if (ctrl_x_mode_not_defined_yet() || ctrl_x_mode_scroll() || compl_started) - return (char_u *)ctrl_x_mode_names[ctrl_x_mode & ~CTRL_X_WANT_IDENT]; + list_T *match; + int ret; - return (char_u *)""; + match = list_alloc(); + if (match == NULL) + return FAIL; + + if ((ret = list_append_number(match, pos + 1)) == FAIL + || (ret = list_append_string(match, str, len)) == FAIL + || (ret = list_append_list(rettv->vval.v_list, match)) == FAIL) + { + vim_free(match); + return FAIL; + } + + return OK; } /* - * Assign the sequence number to all the completion matches which don't have - * one assigned yet. + * "complete_match()" function */ - static void -ins_compl_update_sequence_numbers(void) -{ - int number = 0; - compl_T *match; + void +f_complete_match(typval_T *argvars, typval_T *rettv) +{ + linenr_T lnum; + colnr_T col; + char_u *line = NULL; + char_u *ise = NULL; + regmatch_T regmatch; + char_u *before_cursor = NULL; + char_u *cur_end = NULL; + int bytepos = 0; + char_u part[MAXPATHL]; + int ret; + + if (rettv_list_alloc(rettv) == FAIL) + return; - if (compl_dir_forward()) + ise = curbuf->b_p_ise[0] != NUL ? curbuf->b_p_ise : p_ise; + + if (argvars[0].v_type == VAR_UNKNOWN) { - // Search backwards for the first valid (!= -1) number. - // This should normally succeed already at the first loop - // cycle, so it's fast! - for (match = compl_curr_match->cp_prev; match != NULL - && !is_first_match(match); match = match->cp_prev) - if (match->cp_number != -1) - { - number = match->cp_number; - break; - } - if (match != NULL) - // go up and assign all numbers which are not assigned yet - for (match = match->cp_next; - match != NULL && match->cp_number == -1; - match = match->cp_next) - match->cp_number = ++number; + lnum = curwin->w_cursor.lnum; + col = curwin->w_cursor.col; } - else // BACKWARD + else if (argvars[1].v_type == VAR_UNKNOWN) { - // Search forwards (upwards) for the first valid (!= -1) - // number. This should normally succeed already at the - // first loop cycle, so it's fast! - for (match = compl_curr_match->cp_next; match != NULL - && !is_first_match(match); match = match->cp_next) + emsg(_(e_invalid_argument)); + return; + } + else + { + lnum = (linenr_T)tv_get_number(&argvars[0]); + col = (colnr_T)tv_get_number(&argvars[1]); + if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count) { - if (match->cp_number != -1) - { - number = match->cp_number; - break; - } + semsg(_(e_invalid_line_number_nr), lnum); + return; } - if (match != NULL) + if (col < 1 || col > ml_get_buf_len(curbuf, lnum)) { - // go down and assign all numbers which are not assigned yet - for (match = match->cp_prev; match - && match->cp_number == -1; - match = match->cp_prev) - match->cp_number = ++number; + semsg(_(e_invalid_column_number_nr), col + 1); + return; } } -} -/* - * Fill the dict of complete_info + line = ml_get_buf(curbuf, lnum, FALSE); + if (line == NULL) + return; + + before_cursor = vim_strnsave(line, col); + if (before_cursor == NULL) + return; + + if (ise == NULL || *ise == NUL) + { + regmatch.regprog = vim_regcomp((char_u *)"\\k\\+$", RE_MAGIC); + if (regmatch.regprog != NULL) + { + if (vim_regexec_nl(®match, before_cursor, (colnr_T)0)) + { + char_u *trig = vim_strnsave(regmatch.startp[0], + regmatch.endp[0] - regmatch.startp[0]); + if (trig == NULL) + { + vim_free(before_cursor); + vim_regfree(regmatch.regprog); + return; + } + + bytepos = (int)(regmatch.startp[0] - before_cursor); + ret = add_match_to_list(rettv, trig, -1, bytepos); + vim_free(trig); + if (ret == FAIL) + { + vim_free(before_cursor); + vim_regfree(regmatch.regprog); + return; + } + } + vim_regfree(regmatch.regprog); + } + } + else + { + char_u *p = ise; + char_u *p_space = NULL; + + cur_end = before_cursor + (int)STRLEN(before_cursor); + + while (*p != NUL) + { + int len = 0; + if (p_space) + { + len = p - p_space - 1; + memcpy(part, p_space + 1, len); + p_space = NULL; + } + else + { + char_u *next_comma = vim_strchr((*p == ',') ? p + 1 : p, ','); + if (next_comma && *(next_comma + 1) == ' ') + p_space = next_comma; + + len = copy_option_part(&p, part, MAXPATHL, ","); + } + + if (len > 0 && len <= col) + { + if (STRNCMP(cur_end - len, part, len) == 0) + { + bytepos = col - len; + if (add_match_to_list(rettv, part, len, bytepos) == FAIL) + { + vim_free(before_cursor); + return; + } + } + } + } + } + + vim_free(before_cursor); +} + +/* + * Return Insert completion mode name string + */ + static char_u * +ins_compl_mode(void) +{ + if (ctrl_x_mode_not_defined_yet() || ctrl_x_mode_scroll() || compl_started) + return (char_u *)ctrl_x_mode_names[ctrl_x_mode & ~CTRL_X_WANT_IDENT]; + + return (char_u *)""; +} + +/* + * Assign the sequence number to all the completion matches which don't have + * one assigned yet. + */ + static void +ins_compl_update_sequence_numbers(void) +{ + int number = 0; + compl_T *match; + + if (compl_dir_forward()) + { + // Search backwards for the first valid (!= -1) number. + // This should normally succeed already at the first loop + // cycle, so it's fast! + for (match = compl_curr_match->cp_prev; match != NULL + && !is_first_match(match); match = match->cp_prev) + if (match->cp_number != -1) + { + number = match->cp_number; + break; + } + if (match != NULL) + // go up and assign all numbers which are not assigned yet + for (match = match->cp_next; + match != NULL && match->cp_number == -1; + match = match->cp_next) + match->cp_number = ++number; + } + else // BACKWARD + { + // Search forwards (upwards) for the first valid (!= -1) + // number. This should normally succeed already at the + // first loop cycle, so it's fast! + for (match = compl_curr_match->cp_next; match != NULL + && !is_first_match(match); match = match->cp_next) + { + if (match->cp_number != -1) + { + number = match->cp_number; + break; + } + } + if (match != NULL) + { + // go down and assign all numbers which are not assigned yet + for (match = match->cp_prev; match + && match->cp_number == -1; + match = match->cp_prev) + match->cp_number = ++number; + } + } +} + +/* + * Fill the dict of complete_info */ static void fill_complete_info_dict(dict_T *di, compl_T *match, int add_match) @@ -3464,12 +3881,12 @@ fill_complete_info_dict(dict_T *di, compl_T *match, int add_match) dict_add_string(di, "kind", match->cp_text[CPT_KIND]); dict_add_string(di, "info", match->cp_text[CPT_INFO]); if (add_match) - dict_add_bool(di, "match", match->cp_in_match_array); + dict_add_bool(di, "match", match->cp_in_match_array); if (match->cp_user_data.v_type == VAR_UNKNOWN) - // Add an empty string for backwards compatibility - dict_add_string(di, "user_data", (char_u *)""); + // Add an empty string for backwards compatibility + dict_add_string(di, "user_data", (char_u *)""); else - dict_add_tv(di, "user_data", &match->cp_user_data); + dict_add_tv(di, "user_data", &match->cp_user_data); } /* @@ -3564,7 +3981,8 @@ get_complete_info(list_T *what_list, dict_T *retdict) if (compl_curr_match != NULL && compl_curr_match->cp_number == match->cp_number) selected_idx = list_idx; - list_idx += 1; + if (match->cp_in_match_array) + list_idx += 1; } match = match->cp_next; } @@ -3622,6 +4040,21 @@ thesaurus_func_complete(int type UNUSED) #endif } +/* + * Check if 'cpt' list index can be advanced to the next completion source. + */ + static int +may_advance_cpt_index(char_u *cpt) +{ + char_u *p = cpt; + + if (cpt_sources_index == -1) + return FALSE; + while (*p == ',' || *p == ' ') // Skip delimiters + p++; + return (*p != NUL); +} + /* * Return value of process_next_cpt_value() */ @@ -3649,6 +4082,7 @@ typedef struct int found_all; // found all matches of a certain type. char_u *dict; // dictionary file to search int dict_f; // "dict" is an exact file name or not + callback_T *func_cb; // callback of function in 'cpt' option } ins_compl_next_state_T; /* @@ -3676,12 +4110,14 @@ process_next_cpt_value( ins_compl_next_state_T *st, int *compl_type_arg, pos_T *start_match_pos, - int fuzzy_collect) + int fuzzy_collect, + int *advance_cpt_idx) { int compl_type = -1; int status = INS_COMPL_CPT_OK; st->found_all = FALSE; + *advance_cpt_idx = FALSE; while (*st->e_cpt == ',' || *st->e_cpt == ' ') st->e_cpt++; @@ -3762,6 +4198,15 @@ process_next_cpt_value( st->dict_f = DICT_FIRST; } } +#ifdef FEAT_COMPL_FUNC + else if (*st->e_cpt == 'F' || *st->e_cpt == 'o') + { + compl_type = CTRL_X_FUNCTION; + st->func_cb = get_callback_if_cpt_func(st->e_cpt); + if (!st->func_cb) + compl_type = -1; + } +#endif #ifdef FEAT_FIND_ID else if (*st->e_cpt == 'i') compl_type = CTRL_X_PATH_PATTERNS; @@ -3783,6 +4228,7 @@ process_next_cpt_value( // in any case e_cpt is advanced to the next entry (void)copy_option_part(&st->e_cpt, IObuff, IOSIZE, ","); + *advance_cpt_idx = may_advance_cpt_index(st->e_cpt); st->found_all = TRUE; if (compl_type == -1) @@ -3820,7 +4266,7 @@ get_next_dict_tsr_completion(int compl_type, char_u *dict, int dict_f) { #ifdef FEAT_COMPL_FUNC if (thesaurus_func_complete(compl_type)) - expand_by_function(compl_type, compl_pattern.string); + expand_by_function(compl_type, compl_pattern.string, NULL); else #endif ins_compl_dictionaries( @@ -3905,7 +4351,7 @@ fuzzy_longest_match(void) compl_T *nn_compl = NULL; if (compl_num_bests == 0) - return; + return; nn_compl = compl_first_match->cp_next->cp_next; if (nn_compl && nn_compl != compl_first_match) @@ -3927,12 +4373,12 @@ fuzzy_longest_match(void) compl_best_matches = (compl_T **)alloc(compl_num_bests * sizeof(compl_T *)); if (compl_best_matches == NULL) - return; + return; while (compl != NULL && i < compl_num_bests) { - compl_best_matches[i] = compl; - compl = compl->cp_next; - i++; + compl_best_matches[i] = compl; + compl = compl->cp_next; + i++; } prefix = compl_best_matches[0]->cp_str.string; @@ -3941,9 +4387,9 @@ fuzzy_longest_match(void) for (i = 1; i < compl_num_bests; i++) { match_str = compl_best_matches[i]->cp_str.string; - prefix_ptr = prefix; - match_ptr = match_str; - j = 0; + prefix_ptr = prefix; + match_ptr = match_str; + j = 0; while (j < prefix_len && *match_ptr != NUL && *prefix_ptr != NUL) { @@ -4116,11 +4562,11 @@ get_next_filename_completion(void) for (i = 0; i < fuzzy_indices.ga_len; ++i) { - match = matches[fuzzy_indices_data[i]]; + match = matches[fuzzy_indices_data[i]]; current_score = compl_fuzzy_scores[fuzzy_indices_data[i]]; if (ins_compl_add(match, -1, NULL, NULL, NULL, dir, - CP_FAST | ((p_fic || p_wic) ? CP_ICASE : 0), - FALSE, NULL, current_score) == OK) + CP_FAST | ((p_fic || p_wic) ? CP_ICASE : 0), + FALSE, NULL, current_score) == OK) dir = FORWARD; if (need_collect_bests) @@ -4308,6 +4754,7 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) int in_collect = (cfc_has_mode() && compl_length > 0); char_u *leader = ins_compl_leader(); int score = 0; + int in_curbuf = st->ins_buf == curbuf; // If 'infercase' is set, don't use 'smartcase' here save_p_scs = p_scs; @@ -4319,7 +4766,7 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) // buffer is a good idea, on the other hand, we always set // wrapscan for curbuf to avoid missing matches -- Acevedo,Webb save_p_ws = p_ws; - if (st->ins_buf != curbuf) + if (!in_curbuf) p_ws = FALSE; else if (*st->e_cpt == '.') p_ws = TRUE; @@ -4332,7 +4779,7 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) if (in_collect) { - found_new_match = search_for_fuzzy_match(st->ins_buf, + found_new_match = search_for_fuzzy_match(st->ins_buf, st->cur_match_pos, leader, compl_direction, start_pos, &len, &ptr, &score); } @@ -4384,7 +4831,7 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) break; // when ADDING, the text before the cursor matches, skip it - if (compl_status_adding() && st->ins_buf == curbuf + if (compl_status_adding() && in_curbuf && start_pos->lnum == st->cur_match_pos->lnum && start_pos->col == st->cur_match_pos->col) continue; @@ -4395,8 +4842,16 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) if (ptr == NULL || (ins_compl_has_preinsert() && STRCMP(ptr, compl_pattern.string) == 0)) continue; + if (is_nearest_active() && in_curbuf) + { + score = st->cur_match_pos->lnum - curwin->w_cursor.lnum; + if (score < 0) + score = -score; + score++; + } + if (ins_compl_add_infercase(ptr, len, p_ic, - st->ins_buf == curbuf ? NULL : st->ins_buf->b_sfname, + in_curbuf ? NULL : st->ins_buf->b_sfname, 0, cont_s_ipos, score) != NOTDONE) { if (in_collect && score == compl_first_match->cp_next->cp_score) @@ -4411,6 +4866,156 @@ get_next_default_completion(ins_compl_next_state_T *st, pos_T *start_pos) return found_new_match; } +#ifdef FEAT_COMPL_FUNC +/* + * Return the callback function associated with "p" if it points to a + * userfunc. + */ + static callback_T * +get_callback_if_cpt_func(char_u *p) +{ + static callback_T cb; + char_u buf[LSIZE]; + int slen; + + if (*p == 'o') + return &curbuf->b_ofu_cb; + if (*p == 'F') + { + if (*++p != ',' && *p != NUL) + { + free_callback(&cb); + slen = copy_option_part(&p, buf, LSIZE, ","); + if (slen > 0 && option_set_callback_func(buf, &cb)) + return &cb; + return NULL; + } + else + return &curbuf->b_cfu_cb; + } + return NULL; +} +#endif + +/* + * Get completion matches from register contents. + * Extracts words from all available registers and adds them to the completion list. + */ + static void +get_register_completion(void) +{ + int dir = compl_direction; + yankreg_T *reg = NULL; + void *reg_ptr = NULL; + int adding_mode = compl_status_adding(); + + for (int i = 0; i < NUM_REGISTERS; i++) + { + int regname = 0; + if (i == 0) + regname = '"'; // unnamed register + else if (i < 10) + regname = '0' + i; + else if (i == DELETION_REGISTER) + regname = '-'; +#ifdef FEAT_CLIPBOARD + else if (i == STAR_REGISTER) + regname = '*'; + else if (i == PLUS_REGISTER) + regname = '+'; +#endif + else + regname = 'a' + i - 10; + + // Skip invalid or black hole register + if (!valid_yank_reg(regname, FALSE) || regname == '_') + continue; + + reg_ptr = get_register(regname, FALSE); + if (reg_ptr == NULL) + continue; + + reg = (yankreg_T *)reg_ptr; + + for (int j = 0; j < reg->y_size; j++) + { + char_u *str = reg->y_array[j].string; + if (str == NULL) + continue; + + if (adding_mode) + { + int str_len = (int)STRLEN(str); + if (str_len == 0) + continue; + + if (!compl_orig_text.string + || (p_ic ? STRNICMP(str, compl_orig_text.string, + compl_orig_text.length) == 0 + : STRNCMP(str, compl_orig_text.string, + compl_orig_text.length) == 0)) + { + if (ins_compl_add_infercase(str, str_len, p_ic, NULL, + dir, FALSE, 0) == OK) + dir = FORWARD; + } + } + else + { + // Calculate the safe end of string to avoid null byte issues + char_u *str_end = str + STRLEN(str); + char_u *p = str; + + // Safely iterate through the string + while (p < str_end && *p != NUL) + { + char_u *old_p = p; + p = find_word_start(p); + if (p >= str_end || *p == NUL) + break; + + char_u *word_end = find_word_end(p); + + if (word_end <= p) + { + if (has_mbyte) + word_end = p + (*mb_ptr2len)(p); + else + word_end = p + 1; + } + + if (word_end > str_end) + word_end = str_end; + + int len = (int)(word_end - p); + if (len > 0 && (!compl_orig_text.string + || (p_ic ? STRNICMP(p, compl_orig_text.string, + compl_orig_text.length) == 0 + : STRNCMP(p, compl_orig_text.string, + compl_orig_text.length) == 0))) + { + if (ins_compl_add_infercase(p, len, p_ic, NULL, + dir, FALSE, 0) == OK) + dir = FORWARD; + } + + p = word_end; + + if (p <= old_p) + { + p = old_p + 1; + if (has_mbyte && p < str_end) + p = old_p + (*mb_ptr2len)(old_p); + } + } + } + } + + // Free the register copy + put_register(regname, reg_ptr); + } +} + /* * get the next set of completion matches for "type". * Returns TRUE if a new match is found. Otherwise returns FALSE. @@ -4452,8 +5057,13 @@ get_next_completion_match(int type, ins_compl_next_state_T *st, pos_T *ini) #ifdef FEAT_COMPL_FUNC case CTRL_X_FUNCTION: + if (ctrl_x_mode_normal()) // Invoked by a func in 'cpt' option + get_cpt_func_completion_matches(st->func_cb); + else + expand_by_function(type, compl_pattern.string, NULL); + break; case CTRL_X_OMNI: - expand_by_function(type, compl_pattern.string); + expand_by_function(type, compl_pattern.string, NULL); break; #endif @@ -4461,6 +5071,10 @@ get_next_completion_match(int type, ins_compl_next_state_T *st, pos_T *ini) get_next_spell_completion(st->first_match_pos.lnum); break; + case CTRL_X_REGISTER: + get_register_completion(); + break; + default: // normal ^P/^N and ^X^L found_new_match = get_next_default_completion(st, ini); if (found_new_match == FAIL && st->ins_buf == curbuf) @@ -4475,6 +5089,109 @@ get_next_completion_match(int type, ins_compl_next_state_T *st, pos_T *ini) return found_new_match; } +/* + * Strips carets followed by numbers. This suffix typically represents the + * max_matches setting. + */ + static void +strip_caret_numbers_in_place(char_u *str) +{ + char_u *read = str, *write = str, *p; + + if (str == NULL) + return; + + while (*read) + { + if (*read == '^') + { + p = read + 1; + while (vim_isdigit(*p)) + p++; + if ((*p == ',' || *p == '\0') && p != read + 1) + { + read = p; + continue; + } + else + *write++ = *read++; + } + else + *write++ = *read++; + } + *write = '\0'; +} + +/* + * Call functions specified in the 'cpt' option with findstart=1, + * and retrieve the startcol. + */ + static int +prepare_cpt_compl_funcs(void) +{ +#ifdef FEAT_COMPL_FUNC + char_u *cpt; + char_u *p; + callback_T *cb = NULL; + int idx = 0; + int startcol; + + // Make a copy of 'cpt' in case the buffer gets wiped out + cpt = vim_strsave(curbuf->b_p_cpt); + if (cpt == NULL) + return FAIL; + strip_caret_numbers_in_place(cpt); + + for (p = cpt; *p;) + { + while (*p == ',' || *p == ' ') // Skip delimiters + p++; + if (*p == NUL) + break; + + cb = get_callback_if_cpt_func(p); + if (cb) + { + if (get_userdefined_compl_info(curwin->w_cursor.col, cb, &startcol) + == FAIL) + { + if (startcol == -3) + cpt_sources_array[idx].cs_refresh_always = FALSE; + else + startcol = -2; + } + cpt_sources_array[idx].cs_startcol = startcol; + } + else + cpt_sources_array[idx].cs_startcol = STARTCOL_NONE; + + (void)copy_option_part(&p, IObuff, IOSIZE, ","); // Advance p + idx++; + } + + vim_free(cpt); + return OK; +#endif + return FAIL; +} + +/* + * Safely advance the cpt_sources_index by one. + */ + static int +advance_cpt_sources_index_safe(void) +{ + if (cpt_sources_index >= 0 && cpt_sources_index < cpt_sources_count - 1) + { + cpt_sources_index++; + return OK; + } +#ifdef FEAT_EVAL + semsg(_(e_list_index_out_of_range_nr), cpt_sources_index); +#endif + return FAIL; +} + /* * Get the next expansion(s), using "compl_pattern". * The search starts at position "ini" in curbuf and in the direction @@ -4492,6 +5209,7 @@ ins_compl_get_exp(pos_T *ini) int i; int found_new_match; int type = ctrl_x_mode; + int may_advance_cpt_idx = FALSE; if (!compl_started) { @@ -4510,6 +5228,7 @@ ins_compl_get_exp(pos_T *ini) // Make a copy of 'complete', in case the buffer is wiped out. st.e_cpt_copy = vim_strsave((compl_cont_status & CONT_LOCAL) ? (char_u *)"." : curbuf->b_p_cpt); + strip_caret_numbers_in_place(st.e_cpt_copy); st.e_cpt = st.e_cpt_copy == NULL ? (char_u *)"" : st.e_cpt_copy; st.last_match_pos = st.first_match_pos = *ini; } @@ -4520,6 +5239,11 @@ ins_compl_get_exp(pos_T *ini) st.cur_match_pos = (compl_dir_forward()) ? &st.last_match_pos : &st.first_match_pos; + if (cpt_sources_array != NULL && ctrl_x_mode_normal() + && !ctrl_x_mode_line_or_eval() + && !(compl_cont_status & CONT_LOCAL)) + cpt_sources_index = 0; + // For ^N/^P loop over all the flags/windows/buffers in 'complete'. for (;;) { @@ -4532,12 +5256,17 @@ ins_compl_get_exp(pos_T *ini) if ((ctrl_x_mode_normal() || ctrl_x_mode_line_or_eval()) && (!compl_started || st.found_all)) { - int status = process_next_cpt_value(&st, &type, ini, cfc_has_mode()); + int status = process_next_cpt_value(&st, &type, ini, + cfc_has_mode(), &may_advance_cpt_idx); if (status == INS_COMPL_CPT_END) break; if (status == INS_COMPL_CPT_CONT) + { + if (may_advance_cpt_idx && !advance_cpt_sources_index_safe()) + break; continue; + } } // If complete() was called then compl_pattern has been reset. The @@ -4548,6 +5277,9 @@ ins_compl_get_exp(pos_T *ini) // get the next set of completion matches found_new_match = get_next_completion_match(type, &st, ini); + if (may_advance_cpt_idx && !advance_cpt_sources_index_safe()) + break; + // break the loop for specialized modes (use 'complete' just for the // generic ctrl_x_mode == CTRL_X_NORMAL) or when we've found a new // match @@ -4573,7 +5305,14 @@ ins_compl_get_exp(pos_T *ini) compl_started = FALSE; } + + // For `^P` completion, reset `compl_curr_match` to the head to avoid + // mixing matches from different sources. + if (!compl_dir_forward()) + while (compl_curr_match->cp_prev) + compl_curr_match = compl_curr_match->cp_prev; } + cpt_sources_index = -1; compl_started = TRUE; if ((ctrl_x_mode_normal() || ctrl_x_mode_line_or_eval()) @@ -4600,6 +5339,9 @@ ins_compl_get_exp(pos_T *ini) } may_trigger_modechanged(); + if (is_nearest_active()) + sort_compl_match_list(cp_compare_nearest); + return i; } @@ -4610,25 +5352,36 @@ ins_compl_get_exp(pos_T *ini) static void ins_compl_update_shown_match(void) { + string_T *leader; + + (void)get_leader_for_startcol(NULL, TRUE); // Clear the cache + leader = get_leader_for_startcol(compl_shown_match, TRUE); + while (!ins_compl_equal(compl_shown_match, - compl_leader.string, (int)compl_leader.length) + leader->string, (int)leader->length) && compl_shown_match->cp_next != NULL && !is_first_match(compl_shown_match->cp_next)) + { compl_shown_match = compl_shown_match->cp_next; + leader = get_leader_for_startcol(compl_shown_match, TRUE); + } // If we didn't find it searching forward, and compl_shows_dir is // backward, find the last match. if (compl_shows_dir_backward() && !ins_compl_equal(compl_shown_match, - compl_leader.string, (int)compl_leader.length) + leader->string, (int)leader->length) && (compl_shown_match->cp_next == NULL || is_first_match(compl_shown_match->cp_next))) { while (!ins_compl_equal(compl_shown_match, - compl_leader.string, (int)compl_leader.length) + leader->string, (int)leader->length) && compl_shown_match->cp_prev != NULL && !is_first_match(compl_shown_match->cp_prev)) + { compl_shown_match = compl_shown_match->cp_prev; + leader = get_leader_for_startcol(compl_shown_match, TRUE); + } } } @@ -4646,7 +5399,7 @@ ins_compl_delete(void) int has_preinsert = ins_compl_preinsert_effect(); if (has_preinsert) { - col += ins_compl_leader_len(); + col += (int)ins_compl_leader_len(); curwin->w_cursor.col = compl_ins_end_col; } @@ -4738,12 +5491,11 @@ ins_compl_expand_multiple(char_u *str) /* * Insert the new text being completed. - * "in_compl_func" is TRUE when called from complete_check(). * "move_cursor" is used when 'completeopt' includes "preinsert" and when TRUE * cursor needs to move back from the inserted text to the compl_leader. */ void -ins_compl_insert(int in_compl_func, int move_cursor) +ins_compl_insert(int move_cursor) { int compl_len = get_compl_len(); int preinsert = ins_compl_has_preinsert(); @@ -4752,6 +5504,27 @@ ins_compl_insert(int in_compl_func, int move_cursor) size_t leader_len = ins_compl_leader_len(); char_u *has_multiple = vim_strchr(cp_str, '\n'); + // Since completion sources may provide matches with varying start + // positions, insert only the portion of the match that corresponds to the + // intended replacement range. + if (cpt_sources_array != NULL) + { + int cpt_idx = compl_shown_match->cp_cpt_source_idx; + if (cpt_idx >= 0 && compl_col >= 0) + { + int startcol = cpt_sources_array[cpt_idx].cs_startcol; + if (startcol >= 0 && startcol < (int)compl_col) + { + int skip = (int)compl_col - startcol; + if ((size_t)skip <= cp_str_len) + { + cp_str_len -= skip; + cp_str += skip; + } + } + } + } + // Make sure we don't go over the end of the string, this can happen with // illegal bytes. if (compl_len < (int)cp_str_len) @@ -4776,8 +5549,6 @@ ins_compl_insert(int in_compl_func, int move_cursor) set_vim_var_dict(VV_COMPLETED_ITEM, dict); } #endif - if (!in_compl_func) - compl_curr_match = compl_shown_match; } /* @@ -4816,40 +5587,22 @@ ins_compl_show_filename(void) } /* - * Find a completion item when 'completeopt' contains "fuzzy". + * Find the appropriate completion item when 'complete' ('cpt') includes + * a 'max_matches' postfix. In this case, we search for a match where + * 'cp_in_match_array' is set, indicating that the match is also present + * in 'compl_match_array'. */ static compl_T * -find_comp_when_fuzzy(void) +find_next_match_in_menu(void) { - int score; - char_u* str; - int target_idx = -1; - int is_forward = compl_shows_dir_forward(); - int is_backward = compl_shows_dir_backward(); - compl_T *comp = NULL; - - if ((is_forward && compl_selected_item == compl_match_arraysize - 1) - || (is_backward && compl_selected_item == 0)) - return compl_first_match != compl_shown_match ? compl_first_match : - (compl_first_match->cp_prev ? compl_first_match->cp_prev : NULL); - - if (is_forward) - target_idx = compl_selected_item + 1; - else if (is_backward) - target_idx = compl_selected_item == -1 ? compl_match_arraysize - 1 - : compl_selected_item - 1; - - score = compl_match_array[target_idx].pum_score; - str = compl_match_array[target_idx].pum_text; - - comp = compl_first_match; - do { - if (comp->cp_score == score && (str == comp->cp_str.string || str == comp->cp_text[CPT_ABBR])) - return comp; - comp = comp->cp_next; - } while (comp != NULL && !is_first_match(comp)); + int is_forward = compl_shows_dir_forward(); + compl_T *match = compl_shown_match; - return NULL; + do + match = is_forward ? match->cp_next : match->cp_prev; + while (match->cp_next && !match->cp_in_match_array + && !match_at_original_text(match)); + return match; } /* @@ -4872,18 +5625,22 @@ find_next_completion_match( int advance, int *num_matches) { - int found_end = FALSE; - compl_T *found_compl = NULL; + int found_end = FALSE; + compl_T *found_compl = NULL; unsigned int cur_cot_flags = get_cot_flags(); - int compl_no_select = (cur_cot_flags & COT_NOSELECT) != 0; - int compl_fuzzy_match = (cur_cot_flags & COT_FUZZY) != 0; + int compl_no_select = (cur_cot_flags & COT_NOSELECT) != 0; + int compl_fuzzy_match = (cur_cot_flags & COT_FUZZY) != 0; + string_T *leader; + while (--todo >= 0) { if (compl_shows_dir_forward() && compl_shown_match->cp_next != NULL) { - compl_shown_match = compl_fuzzy_match && compl_match_array != NULL - ? find_comp_when_fuzzy() : compl_shown_match->cp_next; + if (compl_match_array != NULL) + compl_shown_match = find_next_match_in_menu(); + else + compl_shown_match = compl_shown_match->cp_next; found_end = (compl_first_match != NULL && (is_first_match(compl_shown_match->cp_next) || is_first_match(compl_shown_match))); @@ -4892,8 +5649,10 @@ find_next_completion_match( && compl_shown_match->cp_prev != NULL) { found_end = is_first_match(compl_shown_match); - compl_shown_match = compl_fuzzy_match && compl_match_array != NULL - ? find_comp_when_fuzzy() : compl_shown_match->cp_prev; + if (compl_match_array != NULL) + compl_shown_match = find_next_match_in_menu(); + else + compl_shown_match = compl_shown_match->cp_prev; found_end |= is_first_match(compl_shown_match); } else @@ -4940,10 +5699,13 @@ find_next_completion_match( } found_end = FALSE; } + + leader = get_leader_for_startcol(compl_shown_match, FALSE); + if (!match_at_original_text(compl_shown_match) - && compl_leader.string != NULL + && leader->string != NULL && !ins_compl_equal(compl_shown_match, - compl_leader.string, (int)compl_leader.length) + leader->string, (int)leader->length) && !(compl_fuzzy_match && compl_shown_match->cp_score > 0)) ++todo; else @@ -4986,8 +5748,7 @@ ins_compl_next( int allow_get_expansion, int count, // repeat completion this many times; should // be at least 1 - int insert_match, // Insert the newly selected match - int in_compl_func) // called from complete_check() + int insert_match) // Insert the newly selected match { int num_matches = -1; int todo = count; @@ -5048,7 +5809,7 @@ ins_compl_next( else if (insert_match) { if (!compl_get_longest || compl_used_match) - ins_compl_insert(in_compl_func, TRUE); + ins_compl_insert(TRUE); else ins_compl_insert_bytes(compl_leader.string + get_compl_len(), -1); } @@ -5127,14 +5888,20 @@ ins_compl_check_keys(int frequency, int in_compl_func) // Check for a typed key. Do use mappings, otherwise vim_is_ctrl_x_key() // can't do its work correctly. c = vpeekc_any(); - if (c != NUL) + if (c != NUL +#ifdef FEAT_EVAL + // If test_override("char_avail", 1) was called, ignore characters + // waiting in the typeahead buffer. + && !disable_char_avail_for_testing +#endif + ) { if (vim_is_ctrl_x_key(c) && c != Ctrl_X && c != Ctrl_R) { c = safe_vgetc(); // Eat the character compl_shows_dir = ins_compl_key2dir(c); (void)ins_compl_next(FALSE, ins_compl_key2count(c), - c != K_UP && c != K_DOWN, in_compl_func); + c != K_UP && c != K_DOWN); } else { @@ -5157,7 +5924,7 @@ ins_compl_check_keys(int frequency, int in_compl_func) int todo = compl_pending > 0 ? compl_pending : -compl_pending; compl_pending = 0; - (void)ins_compl_next(FALSE, todo, TRUE, in_compl_func); + (void)ins_compl_next(FALSE, todo, TRUE); } } @@ -5193,11 +5960,9 @@ ins_compl_pum_key(int c) static int ins_compl_key2count(int c) { - int h; - if (ins_compl_pum_key(c) && c != K_UP && c != K_DOWN) { - h = pum_get_height(); + int h = pum_get_height(); if (h > 3) h -= 2; // keep some context return h; @@ -5331,8 +6096,11 @@ get_normal_compl_info(char_u *line, int startcol, colnr_T curs_col) } } else + { while (--startcol >= 0 && vim_iswordc(line[startcol])) ; + } + compl_col += ++startcol; compl_length = (int)curs_col - startcol; if (compl_length == 1) @@ -5368,6 +6136,14 @@ get_normal_compl_info(char_u *line, int startcol, colnr_T curs_col) } } + // Call functions in 'complete' with 'findstart=1' + if (ctrl_x_mode_normal() && !(compl_cont_status & CONT_LOCAL)) + { + // ^N completion, not complete() or ^X^N + if (setup_cpt_sources() == FAIL || prepare_cpt_compl_funcs() == FAIL) + return FAIL; + } + return OK; } @@ -5471,36 +6247,92 @@ get_cmdline_compl_info(char_u *line, colnr_T curs_col) return OK; } +#ifdef FEAT_COMPL_FUNC +/* + * Set global variables related to completion: + * compl_col, compl_length, compl_pattern, and cpt_compl_pattern. + */ + static int +set_compl_globals( + int startcol UNUSED, + colnr_T curs_col UNUSED, + int is_cpt_compl UNUSED) +{ + if (is_cpt_compl) + { + VIM_CLEAR_STRING(cpt_compl_pattern); + if (startcol < compl_col) + return prepend_startcol_text(&cpt_compl_pattern, &compl_orig_text, + startcol); + else + { + cpt_compl_pattern.string = vim_strnsave(compl_orig_text.string, + compl_orig_text.length); + cpt_compl_pattern.length = compl_orig_text.length; + } + } + else + { + if (startcol < 0 || startcol > curs_col) + startcol = curs_col; + + // Re-obtain line in case it has changed + char_u *line = ml_get(curwin->w_cursor.lnum); + int len = curs_col - startcol; + + compl_pattern.string = vim_strnsave(line + startcol, (size_t)len); + if (compl_pattern.string == NULL) + { + compl_pattern.length = 0; + return FAIL; + } + compl_pattern.length = (size_t)len; + compl_col = startcol; + compl_length = len; + } + + return OK; +} +#endif + /* * Get the pattern, column and length for user defined completion ('omnifunc', * 'completefunc' and 'thesaurusfunc') - * Sets the global variables: compl_col, compl_length and compl_pattern. * Uses the global variable: spell_bad_len + * Callback function "cb" is set if triggered by a function in the 'cpt' + * option; otherwise, it is NULL. + * "startcol", when not NULL, contains the column returned by function. */ static int -get_userdefined_compl_info(colnr_T curs_col UNUSED) +get_userdefined_compl_info( + colnr_T curs_col UNUSED, + callback_T *cb UNUSED, + int *startcol UNUSED) { int ret = FAIL; #ifdef FEAT_COMPL_FUNC // Call user defined function 'completefunc' with "a:findstart" // set to 1 to obtain the length of text to use for completion. - char_u *line; typval_T args[3]; int col; - char_u *funcname; + char_u *funcname = NULL; pos_T pos; int save_State = State; - callback_T *cb; + int is_cpt_function = (cb != NULL); - // Call 'completefunc' or 'omnifunc' or 'thesaurusfunc' and get pattern - // length as a string - funcname = get_complete_funcname(ctrl_x_mode); - if (*funcname == NUL) + if (!is_cpt_function) { - semsg(_(e_option_str_is_not_set), ctrl_x_mode_function() - ? "completefunc" : "omnifunc"); - return FAIL; + // Call 'completefunc' or 'omnifunc' or 'thesaurusfunc' and get pattern + // length as a string + funcname = get_complete_funcname(ctrl_x_mode); + if (*funcname == NUL) + { + semsg(_(e_option_str_is_not_set), ctrl_x_mode_function() + ? "completefunc" : "omnifunc"); + return FAIL; + } + cb = get_insert_callback(ctrl_x_mode); } args[0].v_type = VAR_NUMBER; @@ -5510,7 +6342,6 @@ get_userdefined_compl_info(colnr_T curs_col UNUSED) args[2].v_type = VAR_UNKNOWN; pos = curwin->w_cursor; ++textlock; - cb = get_insert_callback(ctrl_x_mode); col = call_callback_retnr(cb, 2, args); --textlock; @@ -5524,14 +6355,20 @@ get_userdefined_compl_info(colnr_T curs_col UNUSED) return FAIL; } + if (startcol != NULL) + *startcol = col; + // Return value -2 means the user complete function wants to cancel the // complete without an error, do the same if the function did not execute // successfully. if (col == -2 || aborting()) return FAIL; + // Return value -3 does the same as -2 and leaves CTRL-X mode. if (col == -3) { + if (is_cpt_function) + return FAIL; ctrl_x_mode = CTRL_X_NORMAL; edit_submode = NULL; if (!shortmess(SHM_COMPLETIONMENU)) @@ -5544,25 +6381,7 @@ get_userdefined_compl_info(colnr_T curs_col UNUSED) compl_opt_refresh_always = FALSE; compl_opt_suppress_empty = FALSE; - if (col < 0) - col = curs_col; - compl_col = col; - if (compl_col > curs_col) - compl_col = curs_col; - - // Setup variables for completion. Need to obtain "line" again, - // it may have become invalid. - line = ml_get(curwin->w_cursor.lnum); - compl_length = curs_col - compl_col; - compl_pattern.string = vim_strnsave(line + compl_col, (size_t)compl_length); - if (compl_pattern.string == NULL) - { - compl_pattern.length = 0; - return FAIL; - } - - compl_pattern.length = (size_t)compl_length; - ret = OK; + ret = !is_cpt_function ? set_compl_globals(col, curs_col, FALSE) : OK; #endif return ret; @@ -5578,12 +6397,13 @@ get_spell_compl_info(int startcol UNUSED, colnr_T curs_col UNUSED) { int ret = FAIL; #ifdef FEAT_SPELL - char_u *line; + char_u *line = NULL; if (spell_bad_len > 0) compl_col = curs_col - spell_bad_len; else compl_col = spell_word_start(startcol); + if (compl_col >= (colnr_T)startcol) { compl_length = 0; @@ -5621,11 +6441,13 @@ get_spell_compl_info(int startcol UNUSED, colnr_T curs_col UNUSED) static int compl_get_info(char_u *line, int startcol, colnr_T curs_col, int *line_invalid) { - if (ctrl_x_mode_normal() + if (ctrl_x_mode_normal() || ctrl_x_mode_register() || (ctrl_x_mode & CTRL_X_WANT_IDENT && !thesaurus_func_complete(ctrl_x_mode))) { - return get_normal_compl_info(line, startcol, curs_col); + if (get_normal_compl_info(line, startcol, curs_col) != OK) + return FAIL; + *line_invalid = TRUE; // 'cpt' func may have invalidated "line" } else if (ctrl_x_mode_line_or_eval()) { @@ -5642,7 +6464,7 @@ compl_get_info(char_u *line, int startcol, colnr_T curs_col, int *line_invalid) else if (ctrl_x_mode_function() || ctrl_x_mode_omni() || thesaurus_func_complete(ctrl_x_mode)) { - if (get_userdefined_compl_info(curs_col) == FAIL) + if (get_userdefined_compl_info(curs_col, NULL, NULL) != OK) return FAIL; *line_invalid = TRUE; // "line" may have become invalid } @@ -5718,7 +6540,7 @@ ins_compl_continue_search(char_u *line) if (compl_length < 1) compl_cont_status &= CONT_LOCAL; } - else if (ctrl_x_mode_line_or_eval()) + else if (ctrl_x_mode_line_or_eval() || ctrl_x_mode_register()) compl_cont_status = CONT_ADDING | CONT_N_ADDS; else compl_cont_status = 0; @@ -5730,7 +6552,7 @@ ins_compl_continue_search(char_u *line) static int ins_compl_start(void) { - char_u *line; + char_u *line = NULL; int startcol = 0; // column where searched text starts colnr_T curs_col; // cursor column int line_invalid = FALSE; @@ -5738,7 +6560,6 @@ ins_compl_start(void) int flags = CP_ORIGINAL_TEXT; // First time we hit ^N or ^P (in a row, I mean) - did_ai = FALSE; did_si = FALSE; can_si = FALSE; @@ -5784,10 +6605,10 @@ ins_compl_start(void) if (line_invalid) line = ml_get(curwin->w_cursor.lnum); - int in_fuzzy = get_cot_flags() & COT_FUZZY; if (compl_status_adding()) { - edit_submode_pre = (char_u *)_(" Adding"); + if (!shortmess(SHM_COMPLETIONMENU)) + edit_submode_pre = (char_u *)_(" Adding"); if (ctrl_x_mode_line_or_eval()) { // Insert a new line, keep indentation but ignore 'comments'. @@ -5802,7 +6623,7 @@ ins_compl_start(void) compl_col = curwin->w_cursor.col; compl_lnum = curwin->w_cursor.lnum; } - else if (ctrl_x_mode_normal() && in_fuzzy) + else if (ctrl_x_mode_normal() && cfc_has_mode()) { compl_startpos = curwin->w_cursor; compl_cont_status &= CONT_S_IPOS; @@ -5814,10 +6635,13 @@ ins_compl_start(void) compl_startpos.col = compl_col; } - if (compl_cont_status & CONT_LOCAL) - edit_submode = (char_u *)_(ctrl_x_msgs[CTRL_X_LOCAL_MSG]); - else - edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode)); + if (!shortmess(SHM_COMPLETIONMENU)) + { + if (compl_cont_status & CONT_LOCAL) + edit_submode = (char_u *)_(ctrl_x_msgs[CTRL_X_LOCAL_MSG]); + else + edit_submode = (char_u *)_(CTRL_X_MSG(ctrl_x_mode)); + } // If any of the original typed text has been changed we need to fix // the redo buffer. @@ -5842,11 +6666,14 @@ ins_compl_start(void) // showmode might reset the internal line pointers, so it must // be called before line = ml_get(), or when this address is no // longer needed. -- Acevedo. - edit_submode_extra = (char_u *)_("-- Searching..."); - edit_submode_highl = HLF_COUNT; - showmode(); - edit_submode_extra = NULL; - out_flush(); + if (!shortmess(SHM_COMPLETIONMENU)) + { + edit_submode_extra = (char_u *)_("-- Searching..."); + edit_submode_highl = HLF_COUNT; + showmode(); + edit_submode_extra = NULL; + out_flush(); + } return OK; } @@ -5962,13 +6789,15 @@ ins_complete(int c, int enable_pum) else if (insert_match && stop_arrow() == FAIL) return FAIL; + compl_curr_win = curwin; + compl_curr_buf = curwin->w_buffer; compl_shown_match = compl_curr_match; compl_shows_dir = compl_direction; // Find next match (and following matches). save_w_wrow = curwin->w_wrow; save_w_leftcol = curwin->w_leftcol; - n = ins_compl_next(TRUE, ins_compl_key2count(c), insert_match, FALSE); + n = ins_compl_next(TRUE, ins_compl_key2count(c), insert_match); // may undisplay the popup menu ins_compl_upd_pum(); @@ -6006,7 +6835,8 @@ ins_complete(int c, int enable_pum) else compl_cont_status &= ~CONT_S_IPOS; - ins_compl_show_statusmsg(); + if (!shortmess(SHM_COMPLETIONMENU)) + ins_compl_show_statusmsg(); // Show the popup menu, unless we got interrupted. if (enable_pum && !compl_interrupted) @@ -6081,11 +6911,9 @@ quote_meta(char_u *dest, char_u *src, int len) // Copy remaining bytes of a multibyte character. if (has_mbyte) { - int i, mb_len; - - mb_len = (*mb_ptr2len)(src) - 1; + int mb_len = (*mb_ptr2len)(src) - 1; if (mb_len > 0 && len >= mb_len) - for (i = 0; i < mb_len; ++i) + for (int i = 0; i < mb_len; ++i) { --len; ++src; @@ -6128,3 +6956,265 @@ spell_back_to_badword(void) start_arrow(&tpos); } #endif + +/* + * Reset the info associated with completion sources. + */ + static void +cpt_sources_clear(void) +{ + VIM_CLEAR(cpt_sources_array); + cpt_sources_index = -1; + cpt_sources_count = 0; +} + +/* + * Setup completion sources. + */ + static int +setup_cpt_sources(void) +{ + char_u buf[LSIZE]; + int slen; + int count = 0, idx = 0; + char_u *p, *cpt; + + // Make a copy of 'cpt' in case the buffer gets wiped out + cpt = vim_strsave(curbuf->b_p_cpt); + if (cpt == NULL) + return FAIL; + + for (p = cpt; *p;) + { + while (*p == ',' || *p == ' ') // Skip delimiters + p++; + if (*p) // If not end of string, count this segment + { + (void)copy_option_part(&p, buf, LSIZE, ","); // Advance p + count++; + } + } + if (count == 0) + goto theend; + + cpt_sources_clear(); + cpt_sources_count = count; + cpt_sources_array = ALLOC_CLEAR_MULT(cpt_source_T, count); + if (cpt_sources_array == NULL) + { + cpt_sources_count = 0; + vim_free(cpt); + return FAIL; + } + + for (p = cpt; *p;) + { + while (*p == ',' || *p == ' ') // Skip delimiters + p++; + if (*p) // If not end of string, count this segment + { + char_u *t; + + vim_memset(buf, 0, LSIZE); + slen = copy_option_part(&p, buf, LSIZE, ","); // Advance p + if (slen > 0 && (t = vim_strchr(buf, '^')) != NULL) + cpt_sources_array[idx].cs_max_matches = atoi((char *)t + 1); + idx++; + } + } + +theend: + vim_free(cpt); + return OK; +} + +/* + * Return TRUE if any of the completion sources have 'refresh' set to 'always'. + */ + static int +is_cpt_func_refresh_always(void) +{ +#ifdef FEAT_COMPL_FUNC + for (int i = 0; i < cpt_sources_count; i++) + if (cpt_sources_array[i].cs_refresh_always) + return TRUE; +#endif + return FALSE; +} + +/* + * Make the completion list non-cyclic. + */ + static void +ins_compl_make_linear(void) +{ + compl_T *m; + + if (compl_first_match == NULL || compl_first_match->cp_prev == NULL) + return; + m = compl_first_match->cp_prev; + m->cp_next = NULL; + compl_first_match->cp_prev = NULL; +} + +/* + * Remove the matches linked to the current completion source (as indicated by + * cpt_sources_index) from the completion list. + */ +#ifdef FEAT_COMPL_FUNC + static compl_T * +remove_old_matches(void) +{ + compl_T *sublist_start = NULL, *sublist_end = NULL, *insert_at = NULL; + compl_T *current, *next; + int compl_shown_removed = FALSE; + int forward = (compl_first_match->cp_cpt_source_idx < 0); + + compl_direction = forward ? FORWARD : BACKWARD; + compl_shows_dir = compl_direction; + + // Identify the sublist of old matches that needs removal + for (current = compl_first_match; current != NULL; current = current->cp_next) + { + if (current->cp_cpt_source_idx < cpt_sources_index && + (forward || (!forward && !insert_at))) + insert_at = current; + + if (current->cp_cpt_source_idx == cpt_sources_index) + { + if (!sublist_start) + sublist_start = current; + sublist_end = current; + if (!compl_shown_removed && compl_shown_match == current) + compl_shown_removed = TRUE; + } + + if ((forward && current->cp_cpt_source_idx > cpt_sources_index) + || (!forward && insert_at)) + break; + } + + // Re-assign compl_shown_match if necessary + if (compl_shown_removed) + { + if (forward) + compl_shown_match = compl_first_match; + else + { // Last node will have the prefix that is being completed + for (current = compl_first_match; current->cp_next != NULL; + current = current->cp_next) + ; + compl_shown_match = current; + } + } + + if (!sublist_start) // No nodes to remove + return insert_at; + + // Update links to remove sublist + if (sublist_start->cp_prev) + sublist_start->cp_prev->cp_next = sublist_end->cp_next; + else + compl_first_match = sublist_end->cp_next; + + if (sublist_end->cp_next) + sublist_end->cp_next->cp_prev = sublist_start->cp_prev; + + // Free all nodes in the sublist + sublist_end->cp_next = NULL; + for (current = sublist_start; current != NULL; current = next) + { + next = current->cp_next; + ins_compl_item_free(current); + } + + return insert_at; +} +#endif + +/* + * Retrieve completion matches using the callback function "cb" and store the + * 'refresh:always' flag. + */ +#ifdef FEAT_COMPL_FUNC + static void +get_cpt_func_completion_matches(callback_T *cb UNUSED) +{ + int startcol = cpt_sources_array[cpt_sources_index].cs_startcol; + + if (startcol == -2 || startcol == -3) + return; + + if (set_compl_globals(startcol, curwin->w_cursor.col, TRUE) == OK) + { + expand_by_function(0, cpt_compl_pattern.string, cb); + cpt_sources_array[cpt_sources_index].cs_refresh_always = + compl_opt_refresh_always; + compl_opt_refresh_always = FALSE; + } +} +#endif + +/* + * Retrieve completion matches from functions in the 'cpt' option where the + * 'refresh:always' flag is set. + */ + static void +cpt_compl_refresh(void) +{ +#ifdef FEAT_COMPL_FUNC + char_u *cpt; + char_u *p; + callback_T *cb = NULL; + int startcol, ret; + + // Make the completion list linear (non-cyclic) + ins_compl_make_linear(); + // Make a copy of 'cpt' in case the buffer gets wiped out + cpt = vim_strsave(curbuf->b_p_cpt); + strip_caret_numbers_in_place(cpt); + + cpt_sources_index = 0; + for (p = cpt; *p;) + { + while (*p == ',' || *p == ' ') // Skip delimiters + p++; + if (*p == NUL) + break; + + if (cpt_sources_array[cpt_sources_index].cs_refresh_always) + { + cb = get_callback_if_cpt_func(p); + if (cb) + { + compl_curr_match = remove_old_matches(); + ret = get_userdefined_compl_info(curwin->w_cursor.col, cb, + &startcol); + if (ret == FAIL) + { + if (startcol == -3) + cpt_sources_array[cpt_sources_index].cs_refresh_always + = FALSE; + else + startcol = -2; + } + cpt_sources_array[cpt_sources_index].cs_startcol = startcol; + if (ret == OK) + get_cpt_func_completion_matches(cb); + } + else + cpt_sources_array[cpt_sources_index].cs_startcol + = STARTCOL_NONE; + } + + (void)copy_option_part(&p, IObuff, IOSIZE, ","); // Advance p + if (may_advance_cpt_index(p)) + (void)advance_cpt_sources_index_safe(); + } + cpt_sources_index = -1; + + vim_free(cpt); + // Make the list cyclic + compl_matches = ins_compl_make_cyclic(); +#endif +} diff --git a/src/keymap.h b/src/keymap.h index c03f7328b4..f1e430fa0c 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -279,12 +279,13 @@ enum key_extra , KE_S_BS = 105 // shift + , KE_SID = 106 // special key, followed by {nr}; , KE_ESC = 107 // used for K_ESC + , KE_WILD = 108 // triggers wildmode completion #ifdef FEAT_GUI_MACVIM - , KE_SWIPELEFT = 108 // Swipe trackpad left - , KE_SWIPERIGHT = 109 // Swipe trackpad right - , KE_SWIPEUP = 110 // Swipe trackpad up - , KE_SWIPEDOWN = 111 // Swipe trackpad down - , KE_FORCECLICK = 112 // Force click on trackpad + , KE_SWIPELEFT = 109 // Swipe trackpad left + , KE_SWIPERIGHT = 110 // Swipe trackpad right + , KE_SWIPEUP = 111 // Swipe trackpad up + , KE_SWIPEDOWN = 112 // Swipe trackpad down + , KE_FORCECLICK = 113 // Force click on trackpad #endif }; @@ -498,6 +499,8 @@ enum key_extra #define K_SCRIPT_COMMAND TERMCAP2KEY(KS_EXTRA, KE_SCRIPT_COMMAND) #define K_SID TERMCAP2KEY(KS_EXTRA, KE_SID) +#define K_WILD TERMCAP2KEY(KS_EXTRA, KE_WILD) + #ifdef FEAT_GUI_MACVIM # define K_SWIPELEFT TERMCAP2KEY(KS_EXTRA, KE_SWIPELEFT) # define K_SWIPERIGHT TERMCAP2KEY(KS_EXTRA, KE_SWIPERIGHT) diff --git a/src/linematch.c b/src/linematch.c index 17e932d003..1fab282760 100644 --- a/src/linematch.c +++ b/src/linematch.c @@ -410,12 +410,16 @@ linematch_nbuffers( // create the flattened path matrix diffcmppath_T *diffcmppath = lalloc(sizeof(diffcmppath_T) * memsize, TRUE); + if (diffcmppath == NULL) + return 0; + // allocate memory here + size_t n = (size_t)pow(2.0, (double)ndiffs); for (size_t i = 0; i < memsize; i++) { diffcmppath[i].df_lev_score = 0; diffcmppath[i].df_path_n = 0; - for (size_t j = 0; j < (size_t)pow(2, (double)ndiffs); j++) + for (size_t j = 0; j < n; j++) diffcmppath[i].df_choice_mem[j] = -1; } @@ -428,6 +432,12 @@ linematch_nbuffers( diffcmppath_T *startNode = &diffcmppath[u]; *decisions = lalloc(sizeof(int) * memsize_decisions, TRUE); + if (*decisions == NULL) + { + vim_free(diffcmppath); + return 0; + } + size_t n_optimal = 0; test_charmatch_paths(startNode, 0); while (startNode->df_path_n > 0) diff --git a/src/main.c b/src/main.c index 53325838e5..3554741057 100644 --- a/src/main.c +++ b/src/main.c @@ -469,6 +469,36 @@ main #endif // NO_VIM_MAIN #endif // PROTO +#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) && defined(FEAT_CLIPBOARD) +/* + * Restore the state after a fatal X error. + */ + static void +x_restore_state(void) +{ + State = MODE_NORMAL; + VIsual_active = FALSE; + got_int = TRUE; + need_wait_return = FALSE; + global_busy = FALSE; + exmode_active = 0; + skip_redraw = FALSE; + RedrawingDisabled = 0; + no_wait_return = 0; + vgetc_busy = 0; +# ifdef FEAT_EVAL + emsg_skip = 0; +# endif + emsg_off = 0; + setmouse(); + settmode(TMODE_RAW); + starttermcap(); + scroll_start(); + redraw_later_clear(); + choose_clipmethod(); +} +#endif + /* * vim_main2() is needed for FEAT_MZSCHEME, but we define it always to keep * things simple. @@ -661,7 +691,7 @@ vim_main2(void) # endif { setup_term_clip(); - TIME_MSG("setup clipboard"); + TIME_MSG("setup x11 clipboard"); } #endif @@ -670,6 +700,27 @@ vim_main2(void) prepare_server(¶ms); #endif +#ifdef FEAT_WAYLAND +# ifdef FEAT_GUI + if (!gui.in_use) +# endif + { + if (wayland_init_client(wayland_display_name) == OK) + { + TIME_MSG("connected to Wayland display"); + +# ifdef FEAT_WAYLAND_CLIPBOARD + if (wayland_cb_init((char*)p_wse) == OK) + TIME_MSG("setup Wayland clipboard"); + } +# endif + } +#endif + +#ifdef FEAT_CLIPBOARD + choose_clipmethod(); +#endif + /* * If "-" argument given: Read file from stdin. * Do this before starting Raw mode, because it may change things that the @@ -683,7 +734,7 @@ vim_main2(void) #if defined(UNIX) || defined(VMS) // When switching screens and something caused a message from a vimrc // script, need to output an extra newline on exit. - if ((did_emsg || msg_didout) && *T_TI != NUL) + if ((did_emsg || msg_didout) && *T_TI != NUL && params.edit_type != EDIT_STDIN) newline_on_exit = TRUE; #endif @@ -762,9 +813,9 @@ vim_main2(void) // whereas this may be VIM2, which looks weird. if (params.servername != NULL && gui.in_use) { - serverRegisterName(params.servername); - vim_free(params.servername); - params.servername = NULL; + serverRegisterName(params.servername); + vim_free(params.servername); + params.servername = NULL; } # endif #endif @@ -840,9 +891,28 @@ vim_main2(void) getout(1); } - // Execute any "+", "-c" and "-S" arguments. - if (params.n_commands > 0) - exe_commands(¶ms); +#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) + // Temporarily set x_jump_env to here in case there is an X11 IO error, + // because x_jump_env is only actually set in main_loop(), before + // exe_commands(). May not be the best solution since commands passed via + // the command line can be very broad like sourcing a file, in which case + // an X IO error results in the command being partially done. In theory we + // could use SETJMP in RealWaitForChar(), but the stack frame for that may + // possibly exit and then LONGJMP is called on it. + int jump_result = SETJMP(x_jump_env); + + if (jump_result == 0) + { +#endif + // Execute any "+", "-c" and "-S" arguments. + if (params.n_commands > 0) + exe_commands(¶ms); +#if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) + } + else + // Restore state and continue just like what main_loop() does. + x_restore_state(); +#endif // Must come before the may_req_ calls. starting = 0; @@ -1088,6 +1158,13 @@ common_init_2(mparm_T *paramp) #ifdef FEAT_SIGNS init_signs(); #endif + +#ifdef FEAT_QUICKFIX + // initialize quickfix list + // don't send an error message when memory allocation fails + // do it when the user tries to access the quickfix list + qf_init_stack(); +#endif } /* @@ -1299,39 +1376,19 @@ main_loop( #if defined(FEAT_X11) && defined(FEAT_XCLIPBOARD) // Setup to catch a terminating error from the X server. Just ignore // it, restore the state and continue. This might not always work - // properly, but at least we don't exit unexpectedly when the X server - // exits while Vim is running in a console. + // properly, but at least we hopefully don't exit unexpectedly when the X + // server exits while Vim is running in a console. if (!cmdwin && !noexmode && SETJMP(x_jump_env)) - { - State = MODE_NORMAL; - VIsual_active = FALSE; - got_int = TRUE; - need_wait_return = FALSE; - global_busy = FALSE; - exmode_active = 0; - skip_redraw = FALSE; - RedrawingDisabled = 0; - no_wait_return = 0; - vgetc_busy = 0; -# ifdef FEAT_EVAL - emsg_skip = 0; -# endif - emsg_off = 0; - setmouse(); - settmode(TMODE_RAW); - starttermcap(); - scroll_start(); - redraw_later_clear(); - } + x_restore_state(); #endif clear_oparg(&oa); while (!cmdwin || cmdwin_result == 0) { #ifdef FEAT_GUI_MACVIM - // Cocoa needs an NSAutoreleasePool in place or it will leak memory. - // This particular pool gets released once every loop. - void *autoreleasePool = gui_macvim_new_autoreleasepool(); + // Cocoa needs an NSAutoreleasePool in place or it will leak memory. + // This particular pool gets released once every loop. + void *autoreleasePool = gui_macvim_new_autoreleasepool(); #endif if (stuff_empty()) @@ -1647,9 +1704,9 @@ main_loop( } #ifdef FEAT_GUI_MACVIM - // TODO! Make sure there are no continue statements that will cause - // this not to be called or MacVim will leak memory! - gui_macvim_release_autoreleasepool(autoreleasePool); + // TODO! Make sure there are no continue statements that will cause + // this not to be called or MacVim will leak memory! + gui_macvim_release_autoreleasepool(autoreleasePool); #endif } @@ -2508,6 +2565,11 @@ command_line_scan(mparm_T *parmp) case 'X': // "-X" don't connect to X server #if (defined(UNIX) || defined(VMS)) && defined(FEAT_X11) x_no_connect = TRUE; +#endif + break; + case 'Y': // "-Y" don't connect to Wayland compositor +#if defined(FEAT_WAYLAND) + wayland_no_connect = TRUE; #endif break; @@ -3715,6 +3777,9 @@ usage(void) # endif main_msg(_("-X\t\t\tDo not connect to X server")); #endif +#if defined(FEAT_WAYLAND) + main_msg(_("-Y\t\t\tDo not connect to Wayland compositor")); +#endif #ifdef FEAT_CLIENTSERVER main_msg(_("--remote \tEdit in a Vim server if possible")); main_msg(_("--remote-silent Same, don't complain if there is no server")); diff --git a/src/map.c b/src/map.c index 52283997bb..6284a9bc18 100644 --- a/src/map.c +++ b/src/map.c @@ -2180,7 +2180,18 @@ put_escstr(FILE *fd, char_u *strstart, int what) { modifiers = str[2]; str += 3; - c = *str; + + // Modifiers can be applied too to multi-byte characters. + p = mb_unescape(&str); + + if (p == NULL) + c = *str; + else + { + // retrieve codepoint (character number) from unescaped string + c = (*mb_ptr2char)(p); + --str; + } } if (c == K_SPECIAL) { diff --git a/src/mark.c b/src/mark.c index 9f6a9ccf58..778110f919 100644 --- a/src/mark.c +++ b/src/mark.c @@ -540,10 +540,9 @@ fname2fnum(xfmark_T *fm) #endif )) { - int len; + size_t len; - expand_env((char_u *)"~/", NameBuff, MAXPATHL); - len = (int)STRLEN(NameBuff); + len = expand_env((char_u *)"~/", NameBuff, MAXPATHL); vim_strncpy(NameBuff + len, fm->fname + 2, MAXPATHL - len - 1); } else @@ -784,6 +783,11 @@ show_one_mark( if (name == NULL && current) { name = mark_line(p, 15); + if (name == NULL) + { + emsg(_(e_out_of_memory)); + return; + } mustfree = TRUE; } if (!message_filtered(name)) @@ -1464,7 +1468,7 @@ add_mark(list_T *l, char_u *mname, pos_T *pos, int bufnr, char_u *fname) list_append_number(lpos, bufnr); list_append_number(lpos, pos->lnum); - list_append_number(lpos, pos->col + 1); + list_append_number(lpos, pos->col < MAXCOL ? pos->col + 1 : MAXCOL); list_append_number(lpos, pos->coladd); if (dict_add_string(d, "mark", mname) == FAIL diff --git a/src/mbyte.c b/src/mbyte.c index a38ab24f32..3255277258 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -120,14 +120,6 @@ # include #endif -#if 0 -// This has been disabled, because several people reported problems with the -// wcwidth() and iswprint() library functions, esp. for Hebrew. -# ifdef __STDC_ISO_10646__ -# define USE_WCHAR_FUNCTIONS -# endif -#endif - static int dbcs_char2len(int c); static int dbcs_char2bytes(int c, char_u *buf); static int dbcs_ptr2len(char_u *p); @@ -828,8 +820,8 @@ remove_bom(char_u *s) * Get class of pointer: * 0 for blank or NUL * 1 for punctuation - * 2 for an (ASCII) word character - * >2 for other word characters + * 2 for an alphanumeric word character + * >2 for other word characters, including CJK and emoji */ int mb_get_class(char_u *p) @@ -1593,11 +1585,7 @@ utf_char2cells(int c) #ifdef FEAT_EVAL // Use the value from setcellwidths() at 0x80 and higher, unless the // character is not printable. - if (c >= 0x80 && -# ifdef USE_WCHAR_FUNCTIONS - wcwidth(c) >= 1 && -# endif - vim_isprintc(c)) + if (c >= 0x80 && vim_isprintc(c)) { int n = cw_value(c); if (n != 0) @@ -1607,25 +1595,10 @@ utf_char2cells(int c) if (c >= 0x100) { -#ifdef USE_WCHAR_FUNCTIONS - int n; - - /* - * Assume the library function wcwidth() works better than our own - * stuff. It should return 1 for ambiguous width chars! - */ - n = wcwidth(c); - - if (n < 0) - return 6; // unprintable, displays - if (n > 1) - return n; -#else if (!utf_printable(c)) return 6; // unprintable, displays if (intable(doublewidth, sizeof(doublewidth), c)) return 2; -#endif if (p_emoji && intable(emoji_wide, sizeof(emoji_wide), c)) return 2; } @@ -2712,12 +2685,6 @@ utf_iscomposing(int c) int utf_printable(int c) { -#ifdef USE_WCHAR_FUNCTIONS - /* - * Assume the iswprint() library function works better than our own stuff. - */ - return iswprint(c); -#else // Sorted list of non-overlapping intervals. // 0xd800-0xdfff is reserved for UTF-16, actually illegal. static struct interval nonprint[] = @@ -2728,7 +2695,6 @@ utf_printable(int c) }; return !intable(nonprint, sizeof(nonprint), c); -#endif } // Sorted list of non-overlapping intervals of all Emoji characters, diff --git a/src/menu.c b/src/menu.c index 7bffb6b65b..c1970bedce 100644 --- a/src/menu.c +++ b/src/menu.c @@ -309,7 +309,7 @@ ex_menu( goto theend; } #if defined(FEAT_GUI) && !(defined(FEAT_GUI_GTK) || defined(FEAT_GUI_PHOTON) \ - || defined(FEAT_GUI_MACVIM)) + || defined(FEAT_GUI_MACVIM)) old_menu_height = gui.menu_height; # if defined(FEAT_TOOLBAR) && !defined(FEAT_GUI_MSWIN) old_toolbar_height = gui.toolbar_height; @@ -2412,7 +2412,7 @@ execute_menu(exarg_T *eap, vimmenu_T *menu, int mode_idx) // simply execute the associated Vim command. Note that if you // physically press the menu item (or the associated shortcut key), the // macaction is always invoked even if the menu isn't bound to . - if (menu->mac_action != NULL && menu->strings[idx] != NULL && menu->strings[idx][0] == NUL) + if (menu->mac_action != NULL && menu->strings[idx] != NULL && menu->strings[idx][0] == NUL) { // Count on the fact taht ex_macaction() only looks at eap->arg. old_arg = eap->arg; @@ -3100,8 +3100,8 @@ ex_macmenu(exarg_T *eap) break; } - if (STRICMP("", arg) == 0) - { + if (STRICMP("", arg) == 0) + { /* This is to let the user unset a key equivalent, thereby * freeing up that key combination to be used for a :map * command (which would otherwise not be possible since key @@ -3109,8 +3109,8 @@ ex_macmenu(exarg_T *eap) mac_key = 0; mac_mods = 0; set_key = TRUE; - continue; - } + continue; + } /* Find end of modifier list */ last_dash = arg; diff --git a/src/message.c b/src/message.c index acd6fc19c3..d28a73cf9d 100644 --- a/src/message.c +++ b/src/message.c @@ -71,8 +71,6 @@ static int msg_wait = 0; static FILE *verbose_fd = NULL; static int verbose_did_open = FALSE; -static int did_warn_clipboard = FALSE; - /* * When writing messages to the screen, there are many different situations. * A number of variables is used to remember the current state: @@ -1127,17 +1125,17 @@ messagesopt_changed(void) // Either "wait" or "hit-enter" is required if (!(messages_flags_new & (MESSAGES_HIT_ENTER | MESSAGES_WAIT))) - return FAIL; + return FAIL; // "history" must be set if (!(messages_flags_new & MESSAGES_HISTORY)) - return FAIL; + return FAIL; if (messages_history_new < 0 || messages_history_new > 10000) - return FAIL; + return FAIL; if (messages_wait_new < 0 || messages_wait_new > 10000) - return FAIL; + return FAIL; msg_flags = messages_flags_new; msg_wait = messages_wait_new; @@ -3513,7 +3511,6 @@ do_more_prompt(int typed_char) static void mch_errmsg_c(char *str) { - int len = (int)STRLEN(str); DWORD nwrite = 0; DWORD mode = 0; HANDLE h = GetStdHandle(STD_ERROR_HANDLE); @@ -3521,10 +3518,14 @@ mch_errmsg_c(char *str) if (GetConsoleMode(h, &mode) && enc_codepage >= 0 && (int)GetConsoleCP() != enc_codepage) { + int len = (int)STRLEN(str); WCHAR *w = enc_to_utf16((char_u *)str, &len); - WriteConsoleW(h, w, len, &nwrite, NULL); - vim_free(w); + if (w != NULL) + { + WriteConsoleW(h, w, len, &nwrite, NULL); + vim_free(w); + } } else { @@ -3619,19 +3620,21 @@ mch_errmsg(char *str) static void mch_msg_c(char *str) { - int len = (int)STRLEN(str); DWORD nwrite = 0; DWORD mode; HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE); - if (GetConsoleMode(h, &mode) && enc_codepage >= 0 && (int)GetConsoleCP() != enc_codepage) { + int len = (int)STRLEN(str); WCHAR *w = enc_to_utf16((char_u *)str, &len); - WriteConsoleW(h, w, len, &nwrite, NULL); - vim_free(w); + if (w != NULL) + { + WriteConsoleW(h, w, len, &nwrite, NULL); + vim_free(w); + } } else { @@ -4172,11 +4175,11 @@ msg_warn_missing_clipboard(void) if (!global_busy && !did_warn_clipboard) { #ifdef FEAT_CLIPBOARD - msg(_("W23: Clipboard register not available, using register 0")); + msg(_("W23: Clipboard register not available, using register 0")); #else - msg(_("W24: Clipboard register not available. See :h W24")); + msg(_("W24: Clipboard register not available. See :h W24")); #endif - did_warn_clipboard = TRUE; + did_warn_clipboard = TRUE; } } diff --git a/src/message_test.c b/src/message_test.c index 83767ece93..884a7a9ceb 100644 --- a/src/message_test.c +++ b/src/message_test.c @@ -34,7 +34,7 @@ // - warning: format ‘%S’ expects argument of type ‘wchar_t *’, but argument 4 has type ‘char *’ // - warning: unknown conversion type character ‘b’ in format // -// These formats are in practise only used from vim script printf() +// These formats are in practise only used from Vim script printf() // function and never as literals in C code. char *fmt_012p = "%012p"; char *fmt_5S = "%5S"; @@ -158,12 +158,12 @@ test_trunc_string_mbyte(void) /* * Test vim_snprintf() with a focus on checking that truncation is * correct when buffer is small, since it cannot be tested from - * vim script tests. Check that: + * Vim script tests. Check that: * - no buffer overflows happens (with valgrind or asan) * - output string is always NUL terminated. * * Not all formats of vim_snprintf() are checked here. They are - * checked more exhaustively in Test_printf*() vim script tests. + * checked more exhaustively in Test_printf*() Vim script tests. */ static void test_vim_snprintf(void) @@ -290,7 +290,7 @@ test_vim_snprintf(void) assert(bsize == 0 || STRNCMP(buf, "\x01\x02", bsize_int) == 0); assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0'); - // %p format is not tested in vim script tests Test_printf*() + // %p format is not tested in Vim script tests Test_printf*() // as it only makes sense in C code. // NOTE: SunOS libc doesn't use the prefix "0x" on %p. #ifdef SUN_SYSTEM diff --git a/src/misc1.c b/src/misc1.c index b458c4b018..41fd2bd106 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -1408,16 +1408,16 @@ expand_env_save_opt(char_u *src, int one) * Skips over "\ ", "\~" and "\$" (not for Win32 though). * If anything fails no expansion is done and dst equals src. */ - void + size_t expand_env( char_u *src, // input string e.g. "$HOME/vim.hlp" char_u *dst, // where to put the result int dstlen) // maximum length of the result { - expand_env_esc(src, dst, dstlen, FALSE, FALSE, NULL); + return expand_env_esc(src, dst, dstlen, FALSE, FALSE, NULL); } - void + size_t expand_env_esc( char_u *srcp, // input string e.g. "$HOME/vim.hlp" char_u *dst, // where to put the result @@ -1434,6 +1434,7 @@ expand_env_esc( int mustfree; // var was allocated, need to free it later int at_start = TRUE; // at start of a name int startstr_len = 0; + char_u *dst_start = dst; if (startstr != NULL) startstr_len = (int)STRLEN(startstr); @@ -1584,6 +1585,7 @@ expand_env_esc( */ { char_u test[MAXPATHL], paths[MAXPATHL]; + size_t testlen; char_u *path, *next_path, *ptr; stat_T st; @@ -1595,14 +1597,20 @@ expand_env_esc( next_path++); if (*next_path) *next_path++ = NUL; - STRCPY(test, path); - STRCAT(test, "/"); - STRCAT(test, dst + 1); + testlen = vim_snprintf_safelen( + (char *)test, + sizeof(test), + "%s/%s", + path, + dst + 1); if (mch_stat(test, &st) == 0) { - var = alloc(STRLEN(test) + 1); - STRCPY(var, test); - mustfree = TRUE; + var = alloc(testlen + 1); + if (var != NULL) + { + STRCPY(var, test); + mustfree = TRUE; + } break; } } @@ -1648,23 +1656,26 @@ expand_env_esc( } } - if (var != NULL && *var != NUL - && (STRLEN(var) + STRLEN(tail) + 1 < (unsigned)dstlen)) + if (var != NULL && *var != NUL) { - STRCPY(dst, var); - dstlen -= (int)STRLEN(var); c = (int)STRLEN(var); - // if var[] ends in a path separator and tail[] starts - // with it, skip a character - if (after_pathsep(dst, dst + c) + + if (c + STRLEN(tail) + 1 < (unsigned)dstlen) + { + STRCPY(dst, var); + dstlen -= c; + // if var[] ends in a path separator and tail[] starts + // with it, skip a character + if (after_pathsep(dst, dst + c) #if defined(BACKSLASH_IN_FILENAME) || defined(AMIGA) - && dst[c - 1] != ':' + && dst[c - 1] != ':' #endif - && vim_ispathsep(*tail)) - ++tail; - dst += c; - src = tail; - copy_char = FALSE; + && vim_ispathsep(*tail)) + ++tail; + dst += c; + src = tail; + copy_char = FALSE; + } } if (mustfree) vim_free(var); @@ -1699,6 +1710,8 @@ expand_env_esc( } *dst = NUL; + + return (size_t)(dst - dst_start); } /* diff --git a/src/misc2.c b/src/misc2.c index 451a20e32a..6a8fbcd948 100644 --- a/src/misc2.c +++ b/src/misc2.c @@ -1222,7 +1222,7 @@ handle_x_keys(int key) get_special_key_name(int c, int modifiers) { static char_u string[MAX_KEY_NAME_LEN + 1]; - int i, idx; + int i, idx, len; int table_idx; string[0] = '<'; @@ -1295,10 +1295,11 @@ get_special_key_name(int c, int modifiers) // Not a special key, only modifiers, output directly else { - if (has_mbyte && (*mb_char2len)(c) > 1) - idx += (*mb_char2bytes)(c, string + idx); - else if (vim_isprintc(c)) + len = (*mb_char2len)(c); + if (len == 1 && vim_isprintc(c)) string[idx++] = c; + else if (has_mbyte && len > 1) + idx += (*mb_char2bytes)(c, string + idx); else { char_u *s = transchar(c); @@ -1888,6 +1889,9 @@ set_fileformat( // This may cause the buffer to become (un)modified. check_status(curbuf); redraw_tabline = TRUE; +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif need_maketitle = TRUE; // set window title later } @@ -3207,3 +3211,127 @@ cmp_keyvalue_value_ni(const void *a, const void *b) kv2->value.length)); } +/* + * Iterative merge sort for doubly linked list. + * O(NlogN) worst case, and stable. + * - The list is divided into blocks of increasing size (1, 2, 4, 8, ...). + * - Each pair of blocks is merged in sorted order. + * - Merged blocks are reconnected to build the sorted list. + */ + void * +mergesort_list( + void *head, + void *(*get_next)(void *), + void (*set_next)(void *, void *), + void *(*get_prev)(void *), + void (*set_prev)(void *, void *), + int (*compare)(const void *, const void *)) +{ + if (!head || !get_next(head)) + return head; + + // Count length + int n = 0; + void* curr = head; + while (curr) + { + n++; + curr = get_next(curr); + } + + int size; + for (size = 1; size < n; size *= 2) + { + void* new_head = NULL; + void* tail = NULL; + curr = head; + + while (curr) + { + // Split two runs + void *left = curr; + void *right = left; + int i; + for (i = 0; i < size && right; ++i) + right = get_next(right); + + void *next = right; + for (i = 0; i < size && next; ++i) + next = get_next(next); + + // Break links + void *l_end = right ? get_prev(right) : NULL; + if (l_end) + set_next(l_end, NULL); + if (right) + set_prev(right, NULL); + + void *r_end = next ? get_prev(next) : NULL; + if (r_end) + set_next(r_end, NULL); + if (next) + set_prev(next, NULL); + + // Merge + void *merged = NULL; + void *merged_tail = NULL; + + while (left || right) + { + void *chosen = NULL; + if (!left) + { + chosen = right; + right = get_next(right); + } + else if (!right) + { + chosen = left; + left = get_next(left); + } + else if (compare(left, right) <= 0) + { + chosen = left; + left = get_next(left); + } + else + { + chosen = right; + right = get_next(right); + } + + if (merged_tail) + { + set_next(merged_tail, chosen); + set_prev(chosen, merged_tail); + merged_tail = chosen; + } + else + { + merged = merged_tail = chosen; + set_prev(chosen, NULL); + } + } + + // Connect to full list + if (!new_head) + new_head = merged; + else + { + set_next(tail, merged); + set_prev(merged, tail); + } + + // Move tail to end + while (get_next(merged_tail)) + merged_tail = get_next(merged_tail); + tail = merged_tail; + + curr = next; + } + + head = new_head; + } + + return head; +} diff --git a/src/mouse.c b/src/mouse.c index c80a8575be..c39ebd2fc8 100644 --- a/src/mouse.c +++ b/src/mouse.c @@ -233,6 +233,9 @@ do_mouse( int moved; // Has cursor moved? int in_status_line; // mouse in status line static int in_tab_line = FALSE; // mouse clicked in tab line +#if defined(FEAT_TABPANEL) + static int in_tabpanel = FALSE; // mouse clicked in tabpanel +#endif int in_sep_line; // mouse in vertical separator line int c1, c2; #if defined(FEAT_FOLDING) @@ -335,7 +338,13 @@ do_mouse( // Ignore drag and release events if we didn't get a click. if (is_click) + { got_click = TRUE; + in_tab_line = FALSE; +#if defined(FEAT_TABPANEL) + in_tabpanel = FALSE; +#endif + } else { if (!got_click) // didn't get click, ignore @@ -343,9 +352,16 @@ do_mouse( if (!is_drag) // release, reset got_click { got_click = FALSE; - if (in_tab_line) + if (in_tab_line +#if defined(FEAT_TABPANEL) + || in_tabpanel +#endif + ) { in_tab_line = FALSE; +#if defined(FEAT_TABPANEL) + in_tabpanel = FALSE; +#endif return FALSE; } } @@ -470,6 +486,80 @@ do_mouse( start_visual.lnum = 0; + // Check for clicking in the tab page panel. +#if defined(FEAT_TABPANEL) + if (mouse_row < firstwin->w_winrow + topframe->fr_height + && (mouse_col < firstwin->w_wincol + || mouse_col >= firstwin->w_wincol + topframe->fr_width)) + { + if (is_drag) + { + if (in_tabpanel) + { + c1 = get_tabpagenr_on_tabpanel(); + tabpage_move(c1 <= 0 ? 9999 : c1 < tabpage_index(curtab) + ? c1 - 1 : c1); + } + return FALSE; + } + + // click in a tab selects that tab page + if (is_click +# ifdef FEAT_CMDWIN + && cmdwin_type == 0 +# endif + ) + { + in_tabpanel = TRUE; + c1 = get_tabpagenr_on_tabpanel(); + if (c1 >= 0) + { + if ((mod_mask & MOD_MASK_MULTI_CLICK) == MOD_MASK_2CLICK) + { + // double click opens new page + end_visual_mode(); + tabpage_new(); + tabpage_move(c1 == 0 ? 9999 : c1 - 1); + } + else + { + // Go to specified tab page, or next one if not clicking + // on a label. + goto_tabpage(c1); + + // It's like clicking on the status line of a window. + if (curwin != old_curwin) + end_visual_mode(); + } + } + else + { + tabpage_T *tp; + + // Close the current or specified tab page. + if (c1 == -999) + tp = curtab; + else + tp = find_tabpage(-c1); + if (tp == curtab) + { + if (first_tabpage->tp_next != NULL) + tabpage_close(FALSE); + } + else if (tp != NULL) + tabpage_close_other(tp, FALSE); + } + } + return TRUE; + } + else if (is_drag && in_tabpanel) + { + c1 = get_tabpagenr_on_tabpanel(); + tabpage_move(c1 <= 0 ? 9999 : c1 - 1); + return FALSE; + } +#endif + if (TabPageIdxs != NULL) // only when initialized { // Check for clicking in the tab page line. @@ -487,7 +577,8 @@ do_mouse( } // click in a tab selects that tab page - if (is_click && cmdwin_type == 0 && mouse_col < Columns) + if (is_click && cmdwin_type == 0 + && mouse_col < firstwin->w_wincol + topframe->fr_width) { in_tab_line = TRUE; c1 = TabPageIdxs[mouse_col]; @@ -1747,7 +1838,7 @@ jump_to_mouse( if (!(flags & MOUSE_FOCUS)) { - if (row < 0 || col < 0) // check if it makes sense + if (row < 0 || col < 0) // check if it makes sense return IN_UNKNOWN; // find the window where the row is in and adjust "row" and "col" to be @@ -1922,16 +2013,6 @@ jump_to_mouse( // Drag the status line count = row - W_WINROW(dragwin) - dragwin->w_height + 1 - on_status_line; -#ifdef FEAT_TERMINAL - if (bt_terminal(dragwin->w_buffer)) - { - win_T *curwin_save = curwin; - curwin = dragwin; - update_topline(); - validate_cursor(); - curwin = curwin_save; - } -#endif win_drag_status_line(dragwin, count); did_drag |= count; } @@ -1996,7 +2077,7 @@ jump_to_mouse( for (first = TRUE; curwin->w_topline > 1; ) { #ifdef FEAT_DIFF - if (curwin->w_topfill < diff_check(curwin, curwin->w_topline)) + if (curwin->w_topfill < diff_check_fill(curwin, curwin->w_topline)) ++count; else #endif @@ -2008,7 +2089,7 @@ jump_to_mouse( (void)hasFolding(curwin->w_topline, &curwin->w_topline, NULL); #endif #ifdef FEAT_DIFF - if (curwin->w_topfill < diff_check(curwin, curwin->w_topline)) + if (curwin->w_topfill < diff_check_fill(curwin, curwin->w_topline)) ++curwin->w_topfill; else #endif @@ -3164,7 +3245,14 @@ mouse_find_win(int *rowp, int *colp, mouse_find_T popup UNUSED) #endif fp = topframe; + + if (*colp < firstwin->w_wincol + || *colp >= firstwin->w_wincol + fp->fr_width + || *rowp < firstwin->w_winrow) + return NULL; + *rowp -= firstwin->w_winrow; + *colp -= firstwin->w_wincol; for (;;) { if (fp->fr_layout == FR_LEAF) diff --git a/src/move.c b/src/move.c index 5d34947a58..e6e78c0727 100644 --- a/src/move.c +++ b/src/move.c @@ -201,7 +201,7 @@ redraw_for_cursorcolumn(win_T *wp) * Returns the number of columns of overlap with buffer text, excluding the * extra padding on the ledge. */ - int + int sms_marker_overlap(win_T *wp, int extra2) { if (extra2 == -1) @@ -1783,7 +1783,7 @@ scrolldown( for (int todo = line_count; todo > 0; --todo) { #ifdef FEAT_DIFF - if (curwin->w_topfill < diff_check(curwin, curwin->w_topline) + if (curwin->w_topfill < diff_check_fill(curwin, curwin->w_topline) && curwin->w_topfill < curwin->w_height - 1) { ++curwin->w_topfill; @@ -3120,6 +3120,7 @@ cursor_correct(void) ~(VALID_WROW|VALID_WCOL|VALID_CHEIGHT|VALID_CROW); } } + check_cursor_moved(curwin); curwin->w_valid |= VALID_TOPLINE; } @@ -3211,12 +3212,15 @@ static int scroll_with_sms(int dir, long count, long *curscount) // extra for scrolling backward so that consuming skipcol is symmetric. if (labs(curwin->w_topline - prev_topline) > (dir == BACKWARD)) fixdir = dir * -1; - while (curwin->w_skipcol > 0 - && curwin->w_topline < curbuf->b_ml.ml_line_count) - { - scroll_redraw(fixdir == FORWARD, 1); - *curscount += (fixdir == dir ? 1 : -1); - } + + int width1 = curwin->w_width - curwin_col_off(); + int width2 = width1 + curwin_col_off2(); + count = 1 + (curwin->w_skipcol - width1 - 1) / width2; + if (fixdir == FORWARD) + count = 1 + (linetabsize_eol(curwin, curwin->w_topline) + - curwin->w_skipcol - width1 + width2 - 1) / width2; + scroll_redraw(fixdir == FORWARD, count); + *curscount += count * (fixdir == dir ? 1 : -1); } curwin->w_p_sms = prev_sms; diff --git a/src/netbeans.c b/src/netbeans.c index d7bf08d6dd..2e32c35d8d 100644 --- a/src/netbeans.c +++ b/src/netbeans.c @@ -1747,6 +1747,9 @@ nb_do_cmd( { check_status(buf->bufp); redraw_tabline = TRUE; +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif maketitle(); update_screen(0); } diff --git a/src/normal.c b/src/normal.c index 7b64253ec3..0f4996f804 100644 --- a/src/normal.c +++ b/src/normal.c @@ -2788,7 +2788,7 @@ nv_zet(cmdarg_T *cap) } break; - // "zp", "zP" in block mode put without addind trailing spaces + // "zp", "zP" in block mode put without adding trailing spaces case 'P': case 'p': nv_put(cap); break; @@ -3076,20 +3076,11 @@ handle_tabmenu(void) { case TABLINE_MENU_CLOSE: if (current_tab == 0) -#ifdef FEAT_GUI_MACVIM - do_cmdline_cmd((char_u *)"conf tabclose"); -#else - do_cmdline_cmd((char_u *)"tabclose"); -#endif + do_cmdline_cmd((char_u *)"confirm tabclose"); else { -#ifdef FEAT_GUI_MACVIM - vim_snprintf((char *)IObuff, IOSIZE, "conf tabclose %d", - current_tab); -#else - vim_snprintf((char *)IObuff, IOSIZE, "tabclose %d", + vim_snprintf((char *)IObuff, IOSIZE, "confirm tabclose %d", current_tab); -#endif do_cmdline_cmd(IObuff); } break; @@ -3590,7 +3581,7 @@ nv_ident(cmdarg_T *cap) aux_ptr = (char_u *)(magic_isset() ? "/?.*~[^$\\" : "/?^$\\"); else if (tag_cmd) { - if (curbuf->b_help) + if (STRCMP(curbuf->b_p_ft, "help") == 0) // ":help" handles unescaped argument aux_ptr = (char_u *)""; else @@ -4070,7 +4061,7 @@ nv_gotofile(cmdarg_T *cap) #endif if (!check_can_set_curbuf_disabled()) - return; + return; ptr = grab_file_name(cap->count1, &lnum); @@ -5687,9 +5678,6 @@ nv_gv_cmd(cmdarg_T *cap) pos_T tpos; int i; - if (checkclearop(cap->oap)) - return; - if (curbuf->b_visual.vi_start.lnum == 0 || curbuf->b_visual.vi_start.lnum > curbuf->b_ml.ml_line_count || curbuf->b_visual.vi_end.lnum == 0) diff --git a/src/ops.c b/src/ops.c index 0e3711eb75..b4b59de226 100644 --- a/src/ops.c +++ b/src/ops.c @@ -248,11 +248,11 @@ get_vts_sum(int *vts_array, int index) int sum = 0; int i; - // Perform the summation for indeces within the actual array. + // Perform the summation for indices within the actual array. for (i = 1; i <= index && i <= vts_array[0]; i++) sum += vts_array[i]; - // Add topstops whose indeces exceed the actual array. + // Add tabstops whose indices exceed the actual array. if (i <= index) sum += vts_array[vts_array[0]] * (index - vts_array[0]); diff --git a/src/option.c b/src/option.c index c1df6e3b01..e0db62848c 100644 --- a/src/option.c +++ b/src/option.c @@ -2945,14 +2945,16 @@ option_expand(int opt_idx, char_u *val) /* * Expanding this with NameBuff, expand_env() must not be passed IObuff. - * Escape spaces when expanding 'tags', they are used to separate file - * names. + * Escape spaces when expanding 'tags' or 'path', they are used to separate + * file names. * For 'spellsuggest' expand after "file:". */ - expand_env_esc(val, NameBuff, MAXPATHL, - (char_u **)options[opt_idx].var == &p_tags, FALSE, + char_u ** var = (char_u **)options[opt_idx].var; + int esc = var == &p_tags || var == &p_path; + + expand_env_esc(val, NameBuff, MAXPATHL, esc, FALSE, #ifdef FEAT_SPELL - (char_u **)options[opt_idx].var == &p_sps ? (char_u *)"file:" : + var == &p_sps ? (char_u *)"file:" : #endif NULL); if (STRCMP(NameBuff, val) == 0) // they are the same @@ -3129,6 +3131,9 @@ redraw_titles(void) { need_maketitle = TRUE; redraw_tabline = TRUE; +#if defined(FEAT_TABPANEL) + redraw_tabpanel = TRUE; +#endif } /* @@ -4160,6 +4165,29 @@ did_set_scrollbind(optset_T *args UNUSED) return NULL; } +/* + * Process the new 'maxsearchcount' option value. + */ + char * +did_set_maxsearchcount(optset_T *args UNUSED) +{ + char *errmsg = NULL; +// if you increase this, also increase SEARCH_STAT_BUF_LEN in search.c +#define MAX_SEARCH_COUNT 9999 + + if (p_msc <= 0) + errmsg = e_argument_must_be_positive; + else if (p_msc > MAX_SEARCH_COUNT) + errmsg = e_invalid_argument; + + if (errmsg != NULL) + p_msc = 99; + + return errmsg; +#undef MAX_SEARCH_COUNT +} + + #if defined(BACKSLASH_IN_FILENAME) || defined(PROTO) /* * Process the updated 'shellslash' option value. @@ -4745,6 +4773,36 @@ did_set_winwidth(optset_T *args UNUSED) return errmsg; } +#ifdef FEAT_WAYLAND_CLIPBOARD +/* + * Process the new 'wlsteal' option value. + */ + char * +did_set_wlsteal(optset_T *args UNUSED) +{ + wayland_cb_reload(); + + return NULL; +} +#endif + +#ifdef FEAT_WAYLAND +/* + * Process the new 'wltimeoutlen' option value. + */ + char * +did_set_wltimeoutlen(optset_T *args) +{ + if (p_wtm < 0) + { + p_wtm = args->os_oldval.number; + return e_argument_must_be_positive; + } + + return NULL; +} +#endif + /* * Process the updated 'wrap' option value. */ @@ -4760,6 +4818,44 @@ did_set_wrap(optset_T *args UNUSED) return NULL; } +#ifdef FEAT_QUICKFIX +/* + * Process the new 'chistory' or 'lhistory' option value. 'chistory' will + * be used if args->os_varp is the same as p_chi, else 'lhistory'. + */ + char * +did_set_xhistory(optset_T *args) +{ + int is_p_chi = (long*)args->os_varp == &p_chi; + int err; + long *arg = (is_p_chi) ? &p_chi :(long*)args->os_varp; + + // cannot have zero or negative number of quickfix lists in a stack + if (*arg < 1) + { + *arg = args->os_oldval.number; + return e_cannot_have_negative_or_zero_number_of_quickfix; + } + + // cannot have more than 100 quickfix lists in a stack + if (*arg > 100) + { + *arg = args->os_oldval.number; + return e_cannot_have_more_than_hundred_quickfix; + } + + if (is_p_chi) + err = qf_resize_stack(*arg); + else + err = ll_resize_stack(curwin, *arg); + + if (err == FAIL) + return e_failed_resizing_quickfix_stack; + + return NULL; +} +#endif + #pragma region MacVim specific options // MacVim-specific option handlers go here. This helps resolve merge conflicts // easier than if sorting them alphabetically with the rest. @@ -6516,9 +6612,17 @@ unset_global_local_option(char_u *name, void *from) clear_string_option(&buf->b_p_cot); buf->b_cot_flags = 0; break; + case PV_ISE: + clear_string_option(&buf->b_p_ise); + break; case PV_DICT: clear_string_option(&buf->b_p_dict); break; +# ifdef FEAT_DIFF + case PV_DIA: + clear_string_option(&buf->b_p_dia); + break; +# endif case PV_TSR: clear_string_option(&buf->b_p_tsr); break; @@ -6539,6 +6643,9 @@ unset_global_local_option(char_u *name, void *from) case PV_EFM: clear_string_option(&buf->b_p_efm); break; + case PV_GEFM: + clear_string_option(&buf->b_p_gefm); + break; case PV_GP: clear_string_option(&buf->b_p_gp); break; @@ -6618,6 +6725,7 @@ get_varp_scope(struct vimoption *p, int scope) #endif #ifdef FEAT_QUICKFIX case PV_EFM: return (char_u *)&(curbuf->b_p_efm); + case PV_GEFM: return (char_u *)&(curbuf->b_p_gefm); case PV_GP: return (char_u *)&(curbuf->b_p_gp); case PV_MP: return (char_u *)&(curbuf->b_p_mp); #endif @@ -6634,7 +6742,11 @@ get_varp_scope(struct vimoption *p, int scope) case PV_INC: return (char_u *)&(curbuf->b_p_inc); #endif case PV_COT: return (char_u *)&(curbuf->b_p_cot); + case PV_ISE: return (char_u *)&(curbuf->b_p_ise); case PV_DICT: return (char_u *)&(curbuf->b_p_dict); +#ifdef FEAT_DIFF + case PV_DIA: return (char_u *)&(curbuf->b_p_dia); +#endif case PV_TSR: return (char_u *)&(curbuf->b_p_tsr); #ifdef FEAT_COMPL_FUNC case PV_TSRFU: return (char_u *)&(curbuf->b_p_tsrfu); @@ -6716,8 +6828,14 @@ get_varp(struct vimoption *p) #endif case PV_COT: return *curbuf->b_p_cot != NUL ? (char_u *)&(curbuf->b_p_cot) : p->var; + case PV_ISE: return *curbuf->b_p_ise != NUL + ? (char_u *)&(curbuf->b_p_ise) : p->var; case PV_DICT: return *curbuf->b_p_dict != NUL ? (char_u *)&(curbuf->b_p_dict) : p->var; +#ifdef FEAT_DIFF + case PV_DIA: return *curbuf->b_p_dia != NUL + ? (char_u *)&(curbuf->b_p_dia) : p->var; +#endif case PV_TSR: return *curbuf->b_p_tsr != NUL ? (char_u *)&(curbuf->b_p_tsr) : p->var; #ifdef FEAT_COMPL_FUNC @@ -6733,6 +6851,8 @@ get_varp(struct vimoption *p) #ifdef FEAT_QUICKFIX case PV_EFM: return *curbuf->b_p_efm != NUL ? (char_u *)&(curbuf->b_p_efm) : p->var; + case PV_GEFM: return *curbuf->b_p_gefm != NUL + ? (char_u *)&(curbuf->b_p_gefm) : p->var; case PV_GP: return *curbuf->b_p_gp != NUL ? (char_u *)&(curbuf->b_p_gp) : p->var; case PV_MP: return *curbuf->b_p_mp != NUL @@ -6807,6 +6927,7 @@ get_varp(struct vimoption *p) case PV_WFW: return (char_u *)&(curwin->w_p_wfw); #if defined(FEAT_QUICKFIX) case PV_PVW: return (char_u *)&(curwin->w_p_pvw); + case PV_LHI: return (char_u *)&(curwin->w_p_lhi); #endif #ifdef FEAT_RIGHTLEFT case PV_RL: return (char_u *)&(curwin->w_p_rl); @@ -7130,6 +7251,9 @@ copy_winopt(winopt_T *from, winopt_T *to) #ifdef FEAT_SIGNS to->wo_scl = copy_option_val(from->wo_scl); #endif +#ifdef FEAT_QUICKFIX + to->wo_lhi = from->wo_lhi; +#endif #ifdef FEAT_EVAL // Copy the script context so that we know where the value was last set. @@ -7524,6 +7648,7 @@ buf_copy_options(buf_T *buf, int flags) buf->b_p_bkc = empty_option; buf->b_bkc_flags = 0; #ifdef FEAT_QUICKFIX + buf->b_p_gefm = empty_option; buf->b_p_gp = empty_option; buf->b_p_mp = empty_option; buf->b_p_efm = empty_option; @@ -7548,7 +7673,11 @@ buf_copy_options(buf_T *buf, int flags) buf->b_p_cot = empty_option; buf->b_cot_flags = 0; buf->b_p_dict = empty_option; +#ifdef FEAT_DIFF + buf->b_p_dia = empty_option; +#endif buf->b_p_tsr = empty_option; + buf->b_p_ise = empty_option; #ifdef FEAT_COMPL_FUNC buf->b_p_tsrfu = empty_option; #endif @@ -8943,6 +9072,18 @@ option_set_callback_func(char_u *optval UNUSED, callback_T *optcb UNUSED) #endif } +#if defined(FEAT_TABPANEL) +/* + * Process the new 'showtabpanel' option value. + */ + char * +did_set_showtabpanel(optset_T *args UNUSED) +{ + shell_new_columns(); + return NULL; +} +#endif + #if defined(FEAT_EVAL) || defined(PROTO) static void didset_options_sctx(int opt_flags, char **buf) diff --git a/src/option.h b/src/option.h index c723b7f010..317f8f21fe 100644 --- a/src/option.h +++ b/src/option.h @@ -231,10 +231,11 @@ typedef enum { #define CPO_CHDIR '.' // don't chdir if buffer is modified #define CPO_SCOLON ';' // using "," and ";" will skip over char if // cursor would not move +#define CPO_NOSYMLINKS '~' // don't resolve symlinks when changing directory // default values for Vim, Vi and POSIX #define CPO_VIM "aABceFsz" #define CPO_VI "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZz$!%*-+<>;" -#define CPO_ALL "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZz$!%*-+<>#{|&/\\.;" +#define CPO_ALL "aAbBcCdDeEfFgHiIjJkKlLmMnoOpPqrRsStuvwWxXyZz$!%*-+<>#{|&/\\.;~" // characters for p_ww option: #define WW_ALL "bshl<>[]~" @@ -374,8 +375,9 @@ typedef enum { // flags for the 'wildoptions' option // each defined char should be unique over all values. #define WOP_FUZZY 'z' -#define WOP_TAGFILE 't' +#define WOP_TAGFILE 'g' #define WOP_PUM 'p' +#define WOP_EXACTTEXT 'x' // arguments for can_bs() // each defined char should be unique over all values @@ -504,6 +506,7 @@ EXTERN char_u *p_cedit; // 'cedit' EXTERN long p_cwh; // 'cmdwinheight' #ifdef FEAT_CLIPBOARD EXTERN char_u *p_cb; // 'clipboard' +EXTERN char_u *p_cpm; // 'clipmethod' #endif EXTERN long p_ch; // 'cmdheight' #ifdef FEAT_FOLDING @@ -535,6 +538,7 @@ EXTERN unsigned cot_flags; // flags from 'completeopt' #define COT_FUZZY 0x100 // TRUE: fuzzy match enabled #define COT_NOSORT 0x200 // TRUE: fuzzy match without qsort score #define COT_PREINSERT 0x400 // TRUE: preinsert +#define COT_NEAREST 0x800 // TRUE: prioritize matches close to cursor #define CFC_KEYWORD 0x001 #define CFC_FILES 0x002 @@ -567,6 +571,7 @@ EXTERN char_u *p_def; // 'define' EXTERN char_u *p_inc; #endif #ifdef FEAT_DIFF +EXTERN char_u *p_dia; // 'diffanchors' EXTERN char_u *p_dip; // 'diffopt' # ifdef FEAT_EVAL EXTERN char_u *p_dex; // 'diffexpr' @@ -645,9 +650,9 @@ EXTERN int fuoptions_bgcolor; #define FUOPT_MAXVERT 0x001 #define FUOPT_MAXHORZ 0x002 #define FUOPT_BGCOLOR_HLGROUP 0x004 // if set, fuoptions_bgcolor - // is a highlight group - // id. Else, it's an explicit - // argb color. + // is a highlight group + // id. Else, it's an explicit + // argb color. #endif EXTERN int p_gd; // 'gdefault' EXTERN char_u *p_jop; // 'jumpoptions' @@ -742,6 +747,7 @@ EXTERN char_u *p_inde; // 'indentexpr' EXTERN char_u *p_indk; // 'indentkeys' #endif EXTERN int p_im; // 'insertmode' +EXTERN char_u *p_ise; // 'isexpand' EXTERN char_u *p_isf; // 'isfname' EXTERN char_u *p_isi; // 'isident' EXTERN char_u *p_isk; // 'iskeyword' @@ -804,6 +810,7 @@ EXTERN long p_mmt; // 'maxmemtot' EXTERN long p_mis; // 'menuitems' #endif EXTERN char_u *p_mopt; // 'messagesopt' +EXTERN long p_msc; // 'maxsearchcount' #ifdef FEAT_SPELL EXTERN char_u *p_msm; // 'mkspellmem' #endif @@ -881,6 +888,7 @@ EXTERN char_u *p_rop; // 'renderoptions' EXTERN long p_report; // 'report' #if defined(FEAT_QUICKFIX) EXTERN long p_pvh; // 'previewheight' +EXTERN long p_chi; // 'chistory' #endif #ifdef MSWIN EXTERN int p_rs; // 'restorescreen' @@ -1003,7 +1011,15 @@ EXTERN unsigned swb_flags; #define SWB_NEWTAB 0x008 #define SWB_VSPLIT 0x010 #define SWB_USELAST 0x020 + EXTERN char_u *p_spk; // 'splitkeep' + +#if defined(FEAT_TABPANEL) +EXTERN char_u *p_tpl; // 'tabpanel' +EXTERN long p_stpl; // 'showtabpanel' +EXTERN char_u *p_tplo; // 'tabpanelopt' +#endif + #ifdef FEAT_SYN_HL EXTERN char_u *p_syn; // 'syntax' #endif @@ -1147,6 +1163,13 @@ EXTERN long p_wh; // 'winheight' EXTERN long p_wmh; // 'winminheight' EXTERN long p_wmw; // 'winminwidth' EXTERN long p_wiw; // 'winwidth' +#ifdef FEAT_WAYLAND +EXTERN char_u *p_wse; // 'wlseat' +# ifdef FEAT_WAYLAND_CLIPBOARD +EXTERN int p_wst; // 'wlsteal' +# endif +EXTERN long p_wtm; // 'wltimeoutlen' +#endif #if defined(MSWIN) && defined(FEAT_TERMINAL) EXTERN char_u *p_winptydll; // 'winptydll' #endif @@ -1172,6 +1195,7 @@ enum , BV_BT #ifdef FEAT_QUICKFIX , BV_EFM + , BV_GEFM , BV_GP , BV_MP #endif @@ -1192,6 +1216,9 @@ enum , BV_COT , BV_CPT , BV_DICT +#ifdef FEAT_DIFF + , BV_DIA +#endif , BV_TSR #ifdef BACKSLASH_IN_FILENAME , BV_CSL @@ -1229,6 +1256,7 @@ enum , BV_INEX #endif , BV_INF + , BV_ISE , BV_ISK #ifdef FEAT_CRYPT , BV_KEY @@ -1352,6 +1380,7 @@ enum #endif #if defined(FEAT_QUICKFIX) , WV_PVW + , WV_LHI #endif #ifdef FEAT_RIGHTLEFT , WV_RL diff --git a/src/optiondefs.h b/src/optiondefs.h index 381e111015..1bb972898a 100644 --- a/src/optiondefs.h +++ b/src/optiondefs.h @@ -33,6 +33,7 @@ #define PV_BT OPT_BUF(BV_BT) #ifdef FEAT_QUICKFIX # define PV_EFM OPT_BOTH(OPT_BUF(BV_EFM)) +# define PV_GEFM OPT_BOTH(OPT_BUF(BV_GEFM)) # define PV_GP OPT_BOTH(OPT_BUF(BV_GP)) # define PV_MP OPT_BOTH(OPT_BUF(BV_MP)) #endif @@ -53,6 +54,9 @@ #define PV_COT OPT_BOTH(OPT_BUF(BV_COT)) #define PV_CPT OPT_BUF(BV_CPT) #define PV_DICT OPT_BOTH(OPT_BUF(BV_DICT)) +#ifdef FEAT_DIFF +# define PV_DIA OPT_BOTH(OPT_BUF(BV_DIA)) +#endif #define PV_TSR OPT_BOTH(OPT_BUF(BV_TSR)) #define PV_FFU OPT_BOTH(OPT_BUF(BV_FFU)) #define PV_CSL OPT_BUF(BV_CSL) @@ -90,6 +94,7 @@ # define PV_INEX OPT_BUF(BV_INEX) #endif #define PV_INF OPT_BUF(BV_INF) +#define PV_ISE OPT_BOTH(OPT_BUF(BV_ISE)) #define PV_ISK OPT_BUF(BV_ISK) #ifdef FEAT_CRYPT # define PV_KEY OPT_BUF(BV_KEY) @@ -195,6 +200,7 @@ #endif #if defined(FEAT_QUICKFIX) # define PV_PVW OPT_WIN(WV_PVW) +# define PV_LHI OPT_WIN(WV_LHI) #endif #ifdef FEAT_RIGHTLEFT # define PV_RL OPT_WIN(WV_RL) @@ -306,7 +312,7 @@ struct vimoption # define ISP_LATIN1 (char_u *)"@,161-255" #endif -# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,E:DiffTextAdd,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea,h:ComplMatchIns" +# define HIGHLIGHT_INIT "8:SpecialKey,~:EndOfBuffer,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,y:CurSearch,m:MoreMsg,M:ModeMsg,n:LineNr,a:LineNrAbove,b:LineNrBelow,N:CursorLineNr,G:CursorLineSign,O:CursorLineFold,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffChange,D:DiffDelete,T:DiffText,E:DiffTextAdd,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,k:PmenuMatch,<:PmenuMatchSel,[:PmenuKind,]:PmenuKindSel,{:PmenuExtra,}:PmenuExtraSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,z:StatusLineTerm,Z:StatusLineTermNC,g:MsgArea,h:ComplMatchIns,%:TabPanel,^:TabPanelSel,&:TabPanelFill" // Default python version for pyx* commands #if defined(FEAT_PYTHON) && defined(FEAT_PYTHON3) @@ -621,6 +627,15 @@ static struct vimoption options[] = #else (char_u *)NULL, PV_NONE, NULL, NULL, {(char_u *)0L, (char_u *)0L} +#endif + SCTX_INIT}, + {"chistory", "chi", P_NUM|P_VI_DEF, +#ifdef FEAT_QUICKFIX + (char_u *)&p_chi, PV_NONE, did_set_xhistory, NULL, + {(char_u *)10L, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, NULL, NULL, + {(char_u *)0L, (char_u *)0L} #endif SCTX_INIT}, {"cindent", "cin", P_BOOL|P_VI_DEF|P_VIM, @@ -644,7 +659,7 @@ static struct vimoption options[] = {"clipboard", "cb", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_CLIPBOARD (char_u *)&p_cb, PV_NONE, did_set_clipboard, expand_set_clipboard, -# ifdef FEAT_XCLIPBOARD +# if defined(FEAT_XCLIPBOARD) || defined(FEAT_WAYLAND_CLIPBOARD) {(char_u *)"autoselect,exclude:cons\\|linux", (char_u *)0L} # else @@ -653,6 +668,21 @@ static struct vimoption options[] = #else (char_u *)NULL, PV_NONE, NULL, NULL, {(char_u *)"", (char_u *)0L} +#endif + SCTX_INIT}, + {"clipmethod", "cpm", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, +#ifdef FEAT_CLIPBOARD + (char_u *)&p_cpm, PV_NONE, did_set_clipmethod, expand_set_clipmethod, +# ifdef UNIX + {(char_u *)"wayland,x11", (char_u *)0L} +# elif defined(VMS) + {(char_u *)"x11", (char_u *)0L} +# else + {(char_u *)"", (char_u *)0L} +# endif +#else + (char_u *)NULL, PV_NONE, NULL, NULL, + {(char_u *)NULL, (char_u *)0L} #endif SCTX_INIT}, {"cmdheight", "ch", P_NUM|P_VI_DEF|P_RALL, @@ -887,6 +917,13 @@ static struct vimoption options[] = (char_u *)NULL, PV_NONE, NULL, NULL, #endif {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, + {"diffanchors", "dia", P_STRING|P_VI_DEF|P_ONECOMMA, +#ifdef FEAT_DIFF + (char_u *)&p_dia, PV_DIA, did_set_diffanchors, NULL, +#else + (char_u *)NULL, PV_NONE, NULL, NULL, +#endif + {(char_u *)"", (char_u *)NULL} SCTX_INIT}, {"diffexpr", "dex", P_STRING|P_VI_DEF|P_SECURE|P_CURSWANT, #if defined(FEAT_DIFF) && defined(FEAT_EVAL) (char_u *)&p_dex, PV_NONE, did_set_optexpr, NULL, @@ -1216,7 +1253,7 @@ static struct vimoption options[] = {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, {"grepformat", "gfm", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, #ifdef FEAT_QUICKFIX - (char_u *)&p_gefm, PV_NONE, NULL, NULL, + (char_u *)&p_gefm, PV_GEFM, NULL, NULL, {(char_u *)DFLT_GREPFORMAT, (char_u *)0L} #else (char_u *)NULL, PV_NONE, NULL, NULL, @@ -1531,6 +1568,10 @@ static struct vimoption options[] = {"insertmode", "im", P_BOOL|P_VI_DEF|P_VIM, (char_u *)&p_im, PV_NONE, did_set_insertmode, NULL, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, + {"isexpand", "ise", P_STRING|P_VI_DEF|P_ONECOMMA|P_NODUP, + (char_u *)&p_ise, PV_ISE, did_set_isexpand, NULL, + {(char_u *)"", (char_u *)0L} + SCTX_INIT}, {"isfname", "isf", P_STRING|P_VI_DEF|P_COMMA|P_NODUP, (char_u *)&p_isf, PV_NONE, did_set_isopt, NULL, { @@ -1656,6 +1697,15 @@ static struct vimoption options[] = {"lazyredraw", "lz", P_BOOL|P_VI_DEF, (char_u *)&p_lz, PV_NONE, NULL, NULL, {(char_u *)FALSE, (char_u *)0L} SCTX_INIT}, + {"lhistory", "lhi", P_NUM|P_VI_DEF, +#ifdef FEAT_QUICKFIX + (char_u *)VAR_WIN, PV_LHI, did_set_xhistory, NULL, + {(char_u *)10L, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, NULL, NULL, + {(char_u *)0L, (char_u *)0L} +#endif + SCTX_INIT}, {"linebreak", "lbr", P_BOOL|P_VI_DEF|P_RWIN, #ifdef FEAT_LINEBREAK (char_u *)VAR_WIN, PV_LBR, NULL, NULL, @@ -1803,6 +1853,9 @@ static struct vimoption options[] = (char_u *)&p_mmt, PV_NONE, NULL, NULL, {(char_u *)DFLT_MAXMEMTOT, (char_u *)0L} SCTX_INIT}, + {"maxsearchcount", "msc", P_NUM|P_VI_DEF, + (char_u *)&p_msc, PV_NONE, did_set_maxsearchcount, NULL, + {(char_u *)99L, (char_u *)0L} SCTX_INIT}, {"menuitems", "mis", P_NUM|P_VI_DEF, #ifdef FEAT_MENU (char_u *)&p_mis, PV_NONE, NULL, NULL, @@ -2432,13 +2485,7 @@ static struct vimoption options[] = {(char_u *)"", (char_u *)0L} SCTX_INIT}, {"showcmd", "sc", P_BOOL|P_VIM, (char_u *)&p_sc, PV_NONE, NULL, NULL, - {(char_u *)FALSE, -#ifdef UNIX - (char_u *)FALSE -#else - (char_u *)TRUE -#endif - } SCTX_INIT}, + {(char_u *)FALSE, (char_u *)TRUE} SCTX_INIT}, {"showcmdloc", "sloc", P_STRING|P_RSTAT, (char_u *)&p_sloc, PV_NONE, did_set_showcmdloc, expand_set_showcmdloc, {(char_u *)"last", (char_u *)"last"} SCTX_INIT}, @@ -2454,6 +2501,11 @@ static struct vimoption options[] = {"showtabline", "stal", P_NUM|P_VI_DEF|P_RALL, (char_u *)&p_stal, PV_NONE, did_set_showtabline, NULL, {(char_u *)1L, (char_u *)0L} SCTX_INIT}, +#if defined(FEAT_TABPANEL) + {"showtabpanel", "stpl", P_NUM|P_RALL, + (char_u *)&p_stpl, PV_NONE, did_set_showtabpanel, NULL, + {(char_u *)0L, (char_u *)0L} SCTX_INIT}, +#endif {"sidescroll", "ss", P_NUM|P_VI_DEF, (char_u *)&p_ss, PV_NONE, NULL, NULL, {(char_u *)0L, (char_u *)0L} SCTX_INIT}, @@ -2613,6 +2665,17 @@ static struct vimoption options[] = {"tabpagemax", "tpm", P_NUM|P_VI_DEF, (char_u *)&p_tpm, PV_NONE, NULL, NULL, {(char_u *)10L, (char_u *)0L} SCTX_INIT}, +#if defined(FEAT_TABPANEL) + {"tabpanel", "tpl", P_STRING|P_VI_DEF|P_RALL, + (char_u *)&p_tpl, PV_NONE, NULL, NULL, + {(char_u *)"", (char_u *)0L} SCTX_INIT}, + {"tabpanelopt","tplo", P_STRING|P_ALLOCED|P_VI_DEF|P_ONECOMMA|P_COLON + |P_NODUP, + (char_u *)&p_tplo, PV_NONE, did_set_tabpanelopt, + expand_set_tabpanelopt, + {(char_u *)"", (char_u *)0L} + SCTX_INIT}, +#endif {"tabstop", "ts", P_NUM|P_VI_DEF|P_RBUF, (char_u *)&p_ts, PV_TS, did_set_shiftwidth_tabstop, NULL, @@ -3036,6 +3099,33 @@ static struct vimoption options[] = {"winwidth", "wiw", P_NUM|P_VI_DEF, (char_u *)&p_wiw, PV_NONE, did_set_winwidth, NULL, {(char_u *)20L, (char_u *)0L} SCTX_INIT}, + {"wlseat", "wse", P_STRING|P_VI_DEF, +#ifdef FEAT_WAYLAND + (char_u *)&p_wse, PV_NONE, did_set_wlseat, NULL, + {(char_u *)"", (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, NULL, NULL, + {(char_u *)NULL, (char_u *)0L} +#endif + SCTX_INIT}, + {"wlsteal", "wst", P_BOOL|P_VI_DEF, +#ifdef FEAT_WAYLAND_CLIPBOARD + (char_u *)&p_wst, PV_NONE, did_set_wlsteal, NULL, + {(char_u *)FALSE, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, NULL, NULL, + {(char_u *)NULL, (char_u *)0L} +#endif + SCTX_INIT}, + {"wltimeoutlen", "wtm", P_NUM|P_VI_DEF, +#ifdef FEAT_WAYLAND + (char_u *)&p_wtm, PV_NONE, did_set_wltimeoutlen, NULL, + {(char_u *)500L, (char_u *)0L} +#else + (char_u *)NULL, PV_NONE, NULL, NULL, + {(char_u *)NULL, (char_u *)0L} +#endif + SCTX_INIT}, {"wrap", NULL, P_BOOL|P_VI_DEF|P_RWIN, (char_u *)VAR_WIN, PV_WRAP, did_set_wrap, NULL, {(char_u *)TRUE, (char_u *)0L} SCTX_INIT}, diff --git a/src/optionstr.c b/src/optionstr.c index ed73b5e6c7..c0eb02e9af 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -28,9 +28,14 @@ static char *(p_bo_values[]) = {"all", "backspace", "cursor", "complete", // Note: Keep this in sync with briopt_check() static char *(p_briopt_values[]) = {"shift:", "min:", "sbr", "list:", "column:", NULL}; #endif +#if defined(FEAT_TABPANEL) +// Note: Keep this in sync with tabpanelopt_changed() +static char *(p_tplo_values[]) = {"align:", "columns:", "vert", NULL}; +static char *(p_tplo_align_values[]) = {"left", "right", NULL}; +#endif #if defined(FEAT_DIFF) // Note: Keep this in sync with diffopt_changed() -static char *(p_dip_values[]) = {"filler", "context:", "iblank", "icase", "iwhite", "iwhiteall", "iwhiteeol", "horizontal", "vertical", "closeoff", "hiddenoff", "foldcolumn:", "followwrap", "internal", "indent-heuristic", "algorithm:", "inline:", "linematch:", NULL}; +static char *(p_dip_values[]) = {"filler", "anchor", "context:", "iblank", "icase", "iwhite", "iwhiteall", "iwhiteeol", "horizontal", "vertical", "closeoff", "hiddenoff", "foldcolumn:", "followwrap", "internal", "indent-heuristic", "algorithm:", "inline:", "linematch:", NULL}; static char *(p_dip_algorithm_values[]) = {"myers", "minimal", "patience", "histogram", NULL}; static char *(p_dip_inline_values[]) = {"none", "simple", "char", "word", NULL}; #endif @@ -39,6 +44,8 @@ static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL}; #ifdef FEAT_CLIPBOARD // Note: Keep this in sync with did_set_clipboard() static char *(p_cb_values[]) = {"unnamed", "unnamedplus", "autoselect", "autoselectplus", "autoselectml", "html", "exclude:", NULL}; +// Note: Keep this in sync with get_clipmethod() +static char *(p_cpm_values[]) = {"wayland", "x11", NULL}; #endif #ifdef FEAT_CRYPT static char *(p_cm_values[]) = {"zip", "blowfish", "blowfish2", @@ -96,7 +103,7 @@ static char *(p_ttym_values[]) = {"xterm", "xterm2", "dec", "netterm", "jsbterm" static char *(p_ve_values[]) = {"block", "insert", "all", "onemore", "none", "NONE", NULL}; // Note: Keep this in sync with check_opt_wim() static char *(p_wim_values[]) = {"full", "longest", "list", "lastused", "noselect", NULL}; -static char *(p_wop_values[]) = {"fuzzy", "tagfile", "pum", NULL}; +static char *(p_wop_values[]) = {"fuzzy", "tagfile", "pum", "exacttext", NULL}; #ifdef FEAT_WAK static char *(p_wak_values[]) = {"yes", "menu", "no", NULL}; #endif @@ -122,7 +129,7 @@ static char *(p_fdm_values[]) = {"manual", "expr", "marker", "indent", "syntax", static char *(p_fcl_values[]) = {"all", NULL}; #endif static char *(p_cfc_values[]) = {"keyword", "files", "whole_line", NULL}; -static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", "nosort", "preinsert", NULL}; +static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "popup", "popuphidden", "noinsert", "noselect", "fuzzy", "nosort", "preinsert", "nearest", NULL}; #ifdef BACKSLASH_IN_FILENAME static char *(p_csl_values[]) = {"slash", "backslash", NULL}; #endif @@ -310,6 +317,7 @@ check_buf_options(buf_T *buf) check_string_option(&buf->b_p_cinw); check_string_option(&buf->b_p_cot); check_string_option(&buf->b_p_cpt); + check_string_option(&buf->b_p_ise); #ifdef FEAT_COMPL_FUNC check_string_option(&buf->b_p_cfu); check_string_option(&buf->b_p_ofu); @@ -323,6 +331,7 @@ check_buf_options(buf_T *buf) check_string_option(&buf->b_p_keymap); #endif #ifdef FEAT_QUICKFIX + check_string_option(&buf->b_p_gefm); check_string_option(&buf->b_p_gp); check_string_option(&buf->b_p_mp); check_string_option(&buf->b_p_efm); @@ -332,6 +341,9 @@ check_buf_options(buf_T *buf) check_string_option(&buf->b_p_tags); check_string_option(&buf->b_p_tc); check_string_option(&buf->b_p_dict); +#ifdef FEAT_DIFF + check_string_option(&buf->b_p_dia); +#endif check_string_option(&buf->b_p_tsr); check_string_option(&buf->b_p_lw); check_string_option(&buf->b_p_bkc); @@ -1383,6 +1395,23 @@ expand_set_clipboard(optexpand_T *args, int *numMatches, char_u ***matches) numMatches, matches); } + + char * +did_set_clipmethod(optset_T *args UNUSED) +{ + return choose_clipmethod(); +} + + int +expand_set_clipmethod(optexpand_T *args, int *numMatches, char_u ***matches) +{ + return expand_set_opt_string( + args, + p_cpm_values, + ARRAY_LENGTH(p_cpm_values) - 1, + numMatches, + matches); +} #endif /* @@ -1558,48 +1587,82 @@ did_set_commentstring(optset_T *args) #endif /* - * The 'complete' option is changed. + * Check if value for 'complete' is valid when 'complete' option is changed. */ char * did_set_complete(optset_T *args) { char_u **varp = (char_u **)args->os_varp; - char_u *s; + char_u *p, *t; + char_u buffer[LSIZE]; + char_u *buf_ptr; + char_u char_before = NUL; + int escape; - // check if it is a valid value for 'complete' -- Acevedo - for (s = *varp; *s;) + for (p = *varp; *p; ) { - while (*s == ',' || *s == ' ') - s++; - if (!*s) - break; - if (vim_strchr((char_u *)".wbuksid]tU", *s) == NULL) - return illegal_char(args->os_errbuf, args->os_errbuflen, *s); - if (*++s != NUL && *s != ',' && *s != ' ') + vim_memset(buffer, 0, LSIZE); + buf_ptr = buffer; + escape = 0; + + // Extract substring while handling escaped commas + while (*p && (*p != ',' || escape) && buf_ptr < (buffer + LSIZE - 1)) { - if (s[-1] == 'k' || s[-1] == 's') + if (*p == '\\' && *(p + 1) == ',') { - // skip optional filename after 'k' and 's' - while (*s && *s != ',' && *s != ' ') - { - if (*s == '\\' && s[1] != NUL) - ++s; - ++s; - } + escape = 1; // Mark escape mode + p++; // Skip '\' } else { - if (args->os_errbuf != NULL) + escape = 0; + *buf_ptr++ = *p; + } + p++; + } + *buf_ptr = NUL; + + if (vim_strchr((char_u *)".wbuksid]tUFo", *buffer) == NULL) + return illegal_char(args->os_errbuf, args->os_errbuflen, *buffer); + + if (vim_strchr((char_u *)"ksF", *buffer) == NULL && *(buffer + 1) != NUL + && *(buffer + 1) != '^') + char_before = *buffer; + else + { + // Test for a number after '^' + if ((t = vim_strchr(buffer, '^')) != NULL) + { + *t++ = NUL; + if (!*t) + char_before = '^'; + else { - vim_snprintf((char *)args->os_errbuf, args->os_errbuflen, - _(e_illegal_character_after_chr), *--s); - return args->os_errbuf; + for (; *t; t++) + { + if (!vim_isdigit(*t)) + { + char_before = '^'; + break; + } + } } - return ""; } } + if (char_before != NUL) + { + if (args->os_errbuf) + { + vim_snprintf((char *)args->os_errbuf, args->os_errbuflen, + _(e_illegal_character_after_chr), char_before); + return args->os_errbuf; + } + return NULL; + } + // Skip comma and spaces + while (*p == ',' || *p == ' ') + p++; } - return NULL; } @@ -1607,7 +1670,7 @@ did_set_complete(optset_T *args) expand_set_complete(optexpand_T *args, int *numMatches, char_u ***matches) { static char *(p_cpt_values[]) = { - ".", "w", "b", "u", "k", "kspell", "s", "i", "d", "]", "t", "U", + ".", "w", "b", "u", "k", "kspell", "s", "i", "d", "]", "t", "U", "F", "o", NULL}; return expand_set_opt_string( args, @@ -1835,7 +1898,7 @@ did_set_cryptkey(optset_T *args) } # ifdef FEAT_SODIUM if (crypt_method_is_sodium(crypt_get_method_nr(curbuf))) - crypt_sodium_lock_key(args->os_newval.string); + crypt_sodium_lock_key(args->os_newval.string); # endif return NULL; @@ -1993,6 +2056,18 @@ expand_set_debug(optexpand_T *args, int *numMatches, char_u ***matches) } #if defined(FEAT_DIFF) || defined(PROTO) +/* + * The 'diffanchors' option is changed. + */ + char * +did_set_diffanchors(optset_T *args) +{ + if (diffanchors_changed(args->os_flags & OPT_LOCAL) == FAIL) + return e_invalid_argument; + + return NULL; +} + /* * The 'diffopt' option is changed. */ @@ -2217,11 +2292,18 @@ static int expand_eiw = FALSE; static char_u * get_eventignore_name(expand_T *xp, int idx) { + int subtract = *xp->xp_pattern == '-'; // 'eventignore(win)' allows special keyword "all" in addition to // all event names. - if (idx == 0) + if (!subtract && idx == 0) return (char_u *)"all"; - return get_event_name_no_group(xp, idx - 1, expand_eiw); + + char_u *name = get_event_name_no_group(xp, idx - 1 + subtract, expand_eiw); + if (name == NULL) + return NULL; + + sprintf((char *)IObuff, "%s%s", subtract ? "-" : "", name); + return IObuff; } int @@ -2840,6 +2922,48 @@ did_set_imactivatekey(optset_T *args UNUSED) } #endif +/* + * The 'isexpand' option is changed. + */ + char * +did_set_isexpand(optset_T *args) +{ + char_u *ise = p_ise; + char_u *p; + int last_was_comma = FALSE; + + if (args->os_flags & OPT_LOCAL) + ise = curbuf->b_p_ise; + + for (p = ise; *p != NUL;) + { + if (*p == '\\' && p[1] == ',') + { + p += 2; + last_was_comma = FALSE; + continue; + } + + if (*p == ',') + { + if (last_was_comma) + return e_invalid_argument; + last_was_comma = TRUE; + p++; + continue; + } + + last_was_comma = FALSE; + MB_PTR_ADV(p); + } + + if (last_was_comma) + return e_invalid_argument; + + return NULL; +} + + /* * The 'iskeyword' option is changed. */ @@ -3140,9 +3264,20 @@ did_set_mkspellmem(optset_T *args UNUSED) did_set_mouse(optset_T *args) { char_u **varp = (char_u **)args->os_varp; + char *retval; - return did_set_option_listflag(*varp, (char_u *)MOUSE_ALL, args->os_errbuf, + retval = did_set_option_listflag(*varp, (char_u *)MOUSE_ALL, args->os_errbuf, args->os_errbuflen); + if (retval == NULL) + { + redraw_tabline = TRUE; + if (tabline_height() > 0) + update_screen(UPD_VALID); +#if (defined(FEAT_PROP_POPUP) && defined(FEAT_QUICKFIX)) || defined(PROTO) + popup_close_info(); // Close info popup to apply new properties +#endif + } + return retval; } int @@ -3480,6 +3615,50 @@ did_set_rulerformat(optset_T *args) } #endif +#if defined(FEAT_TABPANEL) +/* + * Process the new 'tabpanelopt' option value. + */ + char * +did_set_tabpanelopt(optset_T *args UNUSED) +{ + if (tabpanelopt_changed() == FAIL) + return e_invalid_argument; + + return NULL; +} + + int +expand_set_tabpanelopt(optexpand_T *args, int *numMatches, char_u ***matches) +{ + expand_T *xp = args->oe_xp; + + if (xp->xp_pattern > args->oe_set_arg && *(xp->xp_pattern-1) == ':') + { + // Within "align:", we have a subgroup of possible options. + int align_len = (int)STRLEN("align:"); + if (xp->xp_pattern - args->oe_set_arg >= align_len && + STRNCMP(xp->xp_pattern - align_len, "align:", align_len) == 0) + { + return expand_set_opt_string( + args, + p_tplo_align_values, + ARRAY_LENGTH(p_tplo_align_values) - 1, + numMatches, + matches); + } + return FAIL; + } + + return expand_set_opt_string( + args, + p_tplo_values, + ARRAY_LENGTH(p_tplo_values) - 1, + numMatches, + matches); +} +#endif + /* * The 'scrollopt' option is changed. */ @@ -3500,6 +3679,21 @@ expand_set_scrollopt(optexpand_T *args, int *numMatches, char_u ***matches) matches); } +/* + * The 'wlseat' option is changed + */ + char * +did_set_wlseat(optset_T *args UNUSED) +{ +#ifdef FEAT_WAYLAND_CLIPBOARD + // If there isn't any seat named 'wlseat', then let the Wayland clipboard be + // unavailable. Ignore errors returned. + wayland_cb_reload(); +#endif + + return NULL; +} + /* * The 'selection' option is changed. */ @@ -4935,7 +5129,7 @@ check_fuoptions(void) else { char_u hg_term; // character terminating highlight group string - // in 'background' option + // in 'background' option // highlight group name for (j = i; ASCII_ISALPHA(p[j]); ++j) diff --git a/src/os_mswin.c b/src/os_mswin.c index 485ee20afc..7a323f327b 100644 --- a/src/os_mswin.c +++ b/src/os_mswin.c @@ -513,18 +513,23 @@ stat_impl(const char *name, stat_T *stp, const int resolve) // means that the maximum pathname is _MAX_PATH * 3 bytes when 'enc' is // UTF-8. char_u buf[_MAX_PATH * 3 + 1]; + size_t buflen; char_u *p; WCHAR *wp; int n; vim_strncpy((char_u *)buf, (char_u *)name, sizeof(buf) - 1); - p = buf + STRLEN(buf); + buflen = STRLEN(buf); + p = buf + buflen; if (p > buf) MB_PTR_BACK(buf, p); // Remove trailing '\\' except root path. if (p > buf && (*p == '\\' || *p == '/') && p[-1] != ':') + { *p = NUL; + buflen = (size_t)(p - buf); + } if ((buf[0] == '\\' && buf[1] == '\\') || (buf[0] == '/' && buf[1] == '/')) { @@ -534,7 +539,7 @@ stat_impl(const char *name, stat_T *stp, const int resolve) { p = vim_strpbrk(p + 1, (char_u *)"\\/"); if (p == NULL) - STRCAT(buf, "\\"); + STRCPY(buf + buflen, "\\"); } } @@ -759,9 +764,9 @@ mch_check_messages(void) * and returns an allocated string. * Return OK if it worked, FAIL if not. */ -typedef LPTSTR (*MYSTRPROCSTR)(LPTSTR); -typedef LPTSTR (*MYINTPROCSTR)(int); -typedef int (*MYSTRPROCINT)(LPTSTR); +typedef char_u *(*MYSTRPROCSTR)(char_u *); +typedef int (*MYSTRPROCINT)(char_u *); +typedef char_u *(*MYINTPROCSTR)(int); typedef int (*MYINTPROCINT)(int); /* @@ -874,11 +879,6 @@ mch_libcall( int *number_result) { HINSTANCE hinstLib; - MYSTRPROCSTR ProcAdd; - MYINTPROCSTR ProcAddI; - char_u *retval_str = NULL; - int retval_int = 0; - size_t len; BOOL fRunTimeLinkSuccess = FALSE; @@ -888,6 +888,10 @@ mch_libcall( // If the handle is valid, try to get the function address. if (hinstLib != NULL) { + char_u *retval_str = NULL; + int retval_int = 0; + size_t len; + # ifdef HAVE_TRY_EXCEPT __try { @@ -895,25 +899,53 @@ mch_libcall( if (argstring != NULL) { // Call with string argument - ProcAdd = (MYSTRPROCSTR)GetProcAddress(hinstLib, (LPCSTR)funcname); - if ((fRunTimeLinkSuccess = (ProcAdd != NULL)) != 0) + if (string_result != NULL) { - if (string_result == NULL) - retval_int = ((MYSTRPROCINT)ProcAdd)((LPSTR)argstring); - else - retval_str = (char_u *)(ProcAdd)((LPSTR)argstring); + MYSTRPROCSTR proc; + + proc = (MYSTRPROCSTR)GetProcAddress(hinstLib, (LPCSTR)funcname); + if (proc != NULL) + { + fRunTimeLinkSuccess = TRUE; + retval_str = proc(argstring); + } + } + else + { + MYSTRPROCINT proc; + + proc = (MYSTRPROCINT)GetProcAddress(hinstLib, (LPCSTR)funcname); + if (proc != NULL) + { + fRunTimeLinkSuccess = TRUE; + retval_int = proc(argstring); + } } } else { // Call with number argument - ProcAddI = (MYINTPROCSTR) GetProcAddress(hinstLib, (LPCSTR)funcname); - if ((fRunTimeLinkSuccess = (ProcAddI != NULL)) != 0) + if (string_result != NULL) { - if (string_result == NULL) - retval_int = ((MYINTPROCINT)ProcAddI)(argint); - else - retval_str = (char_u *)(ProcAddI)(argint); + MYINTPROCSTR proc; + + proc = (MYINTPROCSTR)GetProcAddress(hinstLib, (LPCSTR)funcname); + if (proc != NULL) + { + fRunTimeLinkSuccess = TRUE; + retval_str = proc(argint); + } + } + else + { + MYINTPROCINT proc; + + proc = (MYINTPROCINT)GetProcAddress(hinstLib, (LPCSTR)funcname); + if (proc != NULL) + { + fRunTimeLinkSuccess = TRUE; + retval_int = proc(argint); + } } } @@ -935,7 +967,7 @@ mch_libcall( { if (GetExceptionCode() == EXCEPTION_STACK_OVERFLOW) _resetstkoflw(); - fRunTimeLinkSuccess = 0; + fRunTimeLinkSuccess = FALSE; } # endif @@ -2077,13 +2109,18 @@ Messaging_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) res = alloc(len); if (res != NULL) - vim_snprintf((char *)res, len, "%s: \"%s\"", err, str); + reply.cbData = (DWORD)vim_snprintf_safelen( + (char *)res, len, "%s: \"%s\"", err, str); + else + reply.cbData = 0; reply.dwData = COPYDATA_ERROR_RESULT; } else + { + reply.cbData = (DWORD)STRLEN(res) + 1; reply.dwData = COPYDATA_RESULT; + } reply.lpData = res; - reply.cbData = (DWORD)STRLEN(res) + 1; if (serverSendEnc(sender) < 0) retval = -1; @@ -2226,12 +2263,16 @@ enumWindowsGetServer(HWND hwnd, LPARAM lparam) } // If we are looking for an alternate server, remember this name. - if (altname_buf_ptr != NULL - && STRNICMP(server, id->name, STRLEN(id->name)) == 0 - && vim_isdigit(server[STRLEN(id->name)])) + if (altname_buf_ptr != NULL) { - STRCPY(altname_buf_ptr, server); - altname_buf_ptr = NULL; // don't use another name + size_t namelen = STRLEN(id->name); + + if (STRNICMP(server, id->name, namelen) == 0 + && vim_isdigit(server[namelen])) + { + STRCPY(altname_buf_ptr, server); + altname_buf_ptr = NULL; // don't use another name + } } // Otherwise, keep looking @@ -2307,16 +2348,20 @@ findServer(char_u *name) void serverSetName(char_u *name) { + size_t namelen; char_u *ok_name; HWND hwnd = 0; int i = 0; char_u *p; // Leave enough space for a 9-digit suffix to ensure uniqueness! - ok_name = alloc(STRLEN(name) + 10); + namelen = STRLEN(name); + ok_name = alloc(namelen + 10); + if (ok_name == NULL) + return; STRCPY(ok_name, name); - p = ok_name + STRLEN(name); + p = ok_name + namelen; for (;;) { @@ -2409,6 +2454,7 @@ serverSendToVim( int timeout, // timeout in seconds or zero int silent) // don't complain about no server { + size_t namelen; HWND target; COPYDATASTRUCT data; char_u *retval = NULL; @@ -2422,7 +2468,8 @@ serverSendToVim( // If the server name does not end in a digit then we look for an // alternate name. e.g. when "name" is GVIM then we may find GVIM2. - if (STRLEN(name) > 1 && !vim_isdigit(name[STRLEN(name) - 1])) + namelen = STRLEN(name); + if (namelen > 1 && !vim_isdigit(name[namelen - 1])) altname_buf_ptr = altname_buf; altname_buf[0] = NUL; target = findServer(name); @@ -2640,63 +2687,65 @@ serverProcessPendingMessages(void) struct charset_pair { - char *name; + string_T name; BYTE charset; }; +#define STRING_INIT(s) \ + {(char_u *)(s), STRLEN_LITERAL(s)} static struct charset_pair charset_pairs[] = { - {"ANSI", ANSI_CHARSET}, - {"CHINESEBIG5", CHINESEBIG5_CHARSET}, - {"DEFAULT", DEFAULT_CHARSET}, - {"HANGEUL", HANGEUL_CHARSET}, - {"OEM", OEM_CHARSET}, - {"SHIFTJIS", SHIFTJIS_CHARSET}, - {"SYMBOL", SYMBOL_CHARSET}, - {"ARABIC", ARABIC_CHARSET}, - {"BALTIC", BALTIC_CHARSET}, - {"EASTEUROPE", EASTEUROPE_CHARSET}, - {"GB2312", GB2312_CHARSET}, - {"GREEK", GREEK_CHARSET}, - {"HEBREW", HEBREW_CHARSET}, - {"JOHAB", JOHAB_CHARSET}, - {"MAC", MAC_CHARSET}, - {"RUSSIAN", RUSSIAN_CHARSET}, - {"THAI", THAI_CHARSET}, - {"TURKISH", TURKISH_CHARSET}, + {STRING_INIT("ANSI"), ANSI_CHARSET}, + {STRING_INIT("CHINESEBIG5"), CHINESEBIG5_CHARSET}, + {STRING_INIT("DEFAULT"), DEFAULT_CHARSET}, + {STRING_INIT("HANGEUL"), HANGEUL_CHARSET}, + {STRING_INIT("OEM"), OEM_CHARSET}, + {STRING_INIT("SHIFTJIS"), SHIFTJIS_CHARSET}, + {STRING_INIT("SYMBOL"), SYMBOL_CHARSET}, + {STRING_INIT("ARABIC"), ARABIC_CHARSET}, + {STRING_INIT("BALTIC"), BALTIC_CHARSET}, + {STRING_INIT("EASTEUROPE"), EASTEUROPE_CHARSET}, + {STRING_INIT("GB2312"), GB2312_CHARSET}, + {STRING_INIT("GREEK"), GREEK_CHARSET}, + {STRING_INIT("HEBREW"), HEBREW_CHARSET}, + {STRING_INIT("JOHAB"), JOHAB_CHARSET}, + {STRING_INIT("MAC"), MAC_CHARSET}, + {STRING_INIT("RUSSIAN"), RUSSIAN_CHARSET}, + {STRING_INIT("THAI"), THAI_CHARSET}, + {STRING_INIT("TURKISH"), TURKISH_CHARSET} # ifdef VIETNAMESE_CHARSET - {"VIETNAMESE", VIETNAMESE_CHARSET}, + , + {STRING_INIT("VIETNAMESE"), VIETNAMESE_CHARSET} # endif - {NULL, 0} }; struct quality_pair { - char *name; + string_T name; DWORD quality; }; static struct quality_pair quality_pairs[] = { # ifdef CLEARTYPE_QUALITY - {"CLEARTYPE", CLEARTYPE_QUALITY}, + {STRING_INIT("CLEARTYPE"), CLEARTYPE_QUALITY}, # endif # ifdef ANTIALIASED_QUALITY - {"ANTIALIASED", ANTIALIASED_QUALITY}, + {STRING_INIT("ANTIALIASED"), ANTIALIASED_QUALITY}, # endif # ifdef NONANTIALIASED_QUALITY - {"NONANTIALIASED", NONANTIALIASED_QUALITY}, + {STRING_INIT("NONANTIALIASED"), NONANTIALIASED_QUALITY}, # endif # ifdef PROOF_QUALITY - {"PROOF", PROOF_QUALITY}, + {STRING_INIT("PROOF"), PROOF_QUALITY}, # endif # ifdef DRAFT_QUALITY - {"DRAFT", DRAFT_QUALITY}, + {STRING_INIT("DRAFT"), DRAFT_QUALITY}, # endif - {"DEFAULT", DEFAULT_QUALITY}, - {NULL, 0} + {STRING_INIT("DEFAULT"), DEFAULT_QUALITY} }; +#undef STRING_INIT /* * Convert a charset ID to a name. @@ -2705,12 +2754,15 @@ quality_pairs[] = { char * charset_id2name(int id) { - struct charset_pair *cp; + int i; - for (cp = charset_pairs; cp->name != NULL; ++cp) - if ((BYTE)id == cp->charset) - break; - return cp->name; + for (i = 0; i < (int)ARRAY_LENGTH(charset_pairs); ++i) + { + if ((BYTE)id == charset_pairs[i].charset) + return (char *)charset_pairs[i].name.string; + } + + return NULL; } /* @@ -2720,12 +2772,15 @@ charset_id2name(int id) char * quality_id2name(DWORD id) { - struct quality_pair *qp; + int i; - for (qp = quality_pairs; qp->name != NULL; ++qp) - if (id == qp->quality) - break; - return qp->name; + for (i = 0; i < (int)ARRAY_LENGTH(quality_pairs); ++i) + { + if (id == quality_pairs[i].quality) + return (char *)quality_pairs[i].name.string; + } + + return NULL; } // The default font height in 100% scaling (96dpi). @@ -2952,6 +3007,7 @@ gui_mch_expand_font(optexpand_T *args, void *param UNUSED, int (*add_match)(char if (xp->xp_pattern > args->oe_set_arg && *(xp->xp_pattern-1) == ':') { char buf[30]; + int i; // Always fill in with the current font size as first option for // convenience. We simply round to the closest integer for simplicity. @@ -2964,19 +3020,18 @@ gui_mch_expand_font(optexpand_T *args, void *param UNUSED, int (*add_match)(char // 'q' as we fill in all the values below. static char *(p_gfn_win_opt_values[]) = { "h" , "w" , "W" , "b" , "i" , "u" , "s"}; - for (size_t i = 0; i < ARRAY_LENGTH(p_gfn_win_opt_values); i++) + for (i = 0; i < (int)ARRAY_LENGTH(p_gfn_win_opt_values); i++) add_match((char_u *)p_gfn_win_opt_values[i]); - struct charset_pair *cp; - for (cp = charset_pairs; cp->name != NULL; ++cp) + for (i = 0; i < (int)ARRAY_LENGTH(charset_pairs); ++i) { - vim_snprintf(buf, ARRAY_LENGTH(buf), "c%s", cp->name); + vim_snprintf(buf, sizeof(buf), "c%s", charset_pairs[i].name.string); add_match((char_u *)buf); } - struct quality_pair *qp; - for (qp = quality_pairs; qp->name != NULL; ++qp) + + for (i = 0; i < (int)ARRAY_LENGTH(quality_pairs); ++i) { - vim_snprintf(buf, ARRAY_LENGTH(buf), "q%s", qp->name); + vim_snprintf(buf, sizeof(buf), "q%s", quality_pairs[i].name.string); add_match((char_u *)buf); } return; @@ -3035,7 +3090,7 @@ set_default_logfont(LOGFONTW *lf) const char *defaultfontname = N_("DefaultFontNameForWindows"); char *fontname = _(defaultfontname); - if (strcmp(fontname, defaultfontname) == 0) + if (STRCMP(fontname, defaultfontname) == 0) fontname = "Consolas"; *lf = s_lfDefault; @@ -3163,48 +3218,51 @@ get_logfont( lf->lfStrikeOut = TRUE; break; case L'c': + for (i = 0; i < (int)ARRAY_LENGTH(charset_pairs); ++i) { - struct charset_pair *cp; - - for (cp = charset_pairs; cp->name != NULL; ++cp) - if (utf16ascncmp(p, cp->name, strlen(cp->name)) == 0) - { - lf->lfCharSet = cp->charset; - p += strlen(cp->name); - break; - } - if (cp->name == NULL && verbose) + if (utf16ascncmp(p, (char *)charset_pairs[i].name.string, + charset_pairs[i].name.length) == 0) { - char_u *s = utf16_to_enc(p, NULL); + lf->lfCharSet = charset_pairs[i].charset; + p += charset_pairs[i].name.length; + break; + } + } + if (i == (int)ARRAY_LENGTH(charset_pairs) && verbose) + { + char_u *s = utf16_to_enc(p, NULL); + if (s != NULL) + { semsg(_(e_illegal_str_name_str_in_font_name_str), "charset", s, name); vim_free(s); - break; } - break; } + break; case L'q': + for (i = 0; i < (int)ARRAY_LENGTH(quality_pairs); ++i) + { + if (utf16ascncmp(p, (char *)quality_pairs[i].name.string, + quality_pairs[i].name.length) == 0) + { + lf->lfQuality = quality_pairs[i].quality; + p += quality_pairs[i].name.length; + break; + } + } + + if (i == (int)ARRAY_LENGTH(quality_pairs) && verbose) { - struct quality_pair *qp; - - for (qp = quality_pairs; qp->name != NULL; ++qp) - if (utf16ascncmp(p, qp->name, strlen(qp->name)) == 0) - { - lf->lfQuality = qp->quality; - p += strlen(qp->name); - break; - } - if (qp->name == NULL && verbose) + char_u *s = utf16_to_enc(p, NULL); + if (s != NULL) { - char_u *s = utf16_to_enc(p, NULL); semsg(_(e_illegal_str_name_str_in_font_name_str), "quality", s, name); vim_free(s); - break; } - break; } + break; default: if (verbose) semsg(_(e_illegal_char_nr_in_font_name_str), p[-1], name); diff --git a/src/os_unix.c b/src/os_unix.c index 790f8281ed..4d327aface 100644 --- a/src/os_unix.c +++ b/src/os_unix.c @@ -26,6 +26,12 @@ #include "os_unixx.h" // unix includes for os_unix.c only +#ifdef HAVE_SHM_OPEN +# include +# include +# include +#endif + #ifdef USE_XSMP # include #endif @@ -135,7 +141,6 @@ static void sig_sysmouse SIGPROTOARG; # include static Widget xterm_Shell = (Widget)0; static void clip_update(void); -static void xterm_update(void); # endif Window x11_window = 0; @@ -1303,33 +1308,43 @@ sigcont_handler SIGDEFARG(sigarg) } #endif -#if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) -# ifdef USE_SYSTEM +#if defined(FEAT_CLIPBOARD) +# if defined(USE_SYSTEM) && (defined(FEAT_X11) \ + || defined(FEAT_WAYLAND_CLIPBOARD)) static void *clip_star_save = NULL; static void *clip_plus_save = NULL; # endif +# if defined(FEAT_CLIPBOARD) && (defined(FEAT_X11) \ + || defined(FEAT_WAYLAND_CLIPBOARD)) /* * Called when Vim is going to sleep or execute a shell command. - * We can't respond to requests for the X selections. Lose them, otherwise - * other applications will hang. But first copy the text to cut buffer 0. + * We can't respond to requests for the X or Wayland selections. + * Lose them, otherwise other applications will hang. But first + * copy the text to cut buffer 0 (for X11). Wayland users must have + * a clipboard manager to replicate such behaviour. */ static void loose_clipboard(void) { if (clip_star.owned || clip_plus.owned) { +#ifdef FEAT_X11 x11_export_final_selection(); +#endif if (clip_star.owned) clip_lose_selection(&clip_star); if (clip_plus.owned) clip_lose_selection(&clip_plus); +#ifdef FEAT_X11 if (x11_display != NULL) XFlush(x11_display); +#endif } } +#endif -# ifdef USE_SYSTEM +# if defined(USE_SYSTEM) && (defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD)) /* * Save clipboard text to restore later. */ @@ -1343,7 +1358,7 @@ save_clipboard(void) } /* - * Restore clipboard text if no one own the X selection. + * Restore clipboard text if no one own the X/Wayland selection. */ static void restore_clipboard(void) @@ -1385,7 +1400,8 @@ mch_suspend(void) settmode(TMODE_COOK); out_flush(); // needed to disable mouse on some systems -# if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) +# if defined(FEAT_CLIPBOARD) && (defined(FEAT_X11) \ + || defined(FEAT_WAYLAND_CLIPBOARD)) loose_clipboard(); # endif # if defined(SIGCONT) @@ -1810,7 +1826,7 @@ x_IOerror_handler(Display *dpy UNUSED) * (e.g. through tmux). */ static void -may_restore_clipboard(void) +may_restore_x11_clipboard(void) { // No point in restoring the connecting if we are exiting or dying. if (!exiting && !v_dying && xterm_dpy_retry_count > 0) @@ -1844,13 +1860,14 @@ ex_xrestore(exarg_T *eap) xterm_display = (char *)vim_strnsave(eap->arg, arglen); xterm_display_allocated = TRUE; } - smsg(_("restoring display %s"), xterm_display == NULL + smsg(_("restoring X11 display %s"), xterm_display == NULL ? (char *)mch_getenv((char_u *)"DISPLAY") : xterm_display); clear_xterm_clip(); x11_window = 0; xterm_dpy_retry_count = 5; // Try reconnecting five times - may_restore_clipboard(); + may_restore_x11_clipboard(); + choose_clipmethod(); } #endif @@ -2358,7 +2375,7 @@ mch_settitle(char_u *title, char_u *icon) set_x11_title(title); // x11 #endif #if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_HAIKU) \ - || defined(FEAT_GUI_MACVIM) \ + || defined(FEAT_GUI_MACVIM) \ || defined(FEAT_GUI_PHOTON) else gui_mch_settitle(title, icon); @@ -4402,9 +4419,9 @@ mch_calc_cell_size(struct cellsize *cs_out) if (retval == -1 || ws.ws_col == 0 || ws.ws_row == 0) { - cs_out->cs_xpixel = -1; - cs_out->cs_ypixel = -1; - return; + cs_out->cs_xpixel = -1; + cs_out->cs_ypixel = -1; + return; } // calculate parent tty's pixel per cell. @@ -4440,7 +4457,7 @@ mch_report_winsize(int fd, int rows, int cols) ws.ws_col = cols; ws.ws_row = rows; - // calcurate and set tty pixel size + // calculate and set tty pixel size struct cellsize cs; #if defined(FEAT_GUI) && defined(FEAT_GUI_MACVIM) if (gui.in_use) @@ -4455,14 +4472,14 @@ mch_report_winsize(int fd, int rows, int cols) if (cs.cs_xpixel == -1) { - // failed get pixel size. - ws.ws_xpixel = 0; - ws.ws_ypixel = 0; + // failed get pixel size. + ws.ws_xpixel = 0; + ws.ws_ypixel = 0; } else { - ws.ws_xpixel = cols * cs.cs_xpixel; - ws.ws_ypixel = rows * cs.cs_ypixel; + ws.ws_xpixel = cols * cs.cs_xpixel; + ws.ws_ypixel = rows * cs.cs_ypixel; } retval = ioctl(tty_fd, TIOCSWINSZ, &ws); @@ -4857,8 +4874,11 @@ mch_call_shell_system( if (options & SHELL_COOKED) settmode(TMODE_COOK); // set to normal mode -# if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) +# if defined(FEAT_CLIPBOARD) && (defined(FEAT_X11) \ + || defined(FEAT_WAYLAND_CLIPBOARD)) +# if defined(FEAT_X11) || defined(FEAT_WAYLAND_CLIPBOARD) save_clipboard(); +#endif loose_clipboard(); # endif @@ -4920,7 +4940,8 @@ mch_call_shell_system( settmode(TMODE_RAW); // set to raw mode } resettitle(); -# if defined(FEAT_CLIPBOARD) && defined(FEAT_X11) +# if defined(FEAT_CLIPBOARD) && (defined(FEAT_X11) \ + || defined(FEAT_WAYLAND_CLIPBOARD)) restore_clipboard(); # endif return x; @@ -5195,7 +5216,7 @@ mch_call_shell_fork( * different on different machines. This may cause a warning * message with strict compilers, don't worry about it. * Call _exit() instead of exit() to avoid closing the connection - * to the X server (esp. with GTK, which uses atexit()). + * to the X/Wayland server (esp. with GTK, which uses atexit()). */ execvp(argv[0], argv); _exit(EXEC_FAILED); // exec failed, return failure code @@ -5287,14 +5308,13 @@ mch_call_shell_fork( else if (wpid == 0) // child { linenr_T lnum = curbuf->b_op_start.lnum; - int written = 0; + size_t written = 0; char_u *lp = ml_get(lnum); size_t lplen = (size_t)ml_get_len(lnum); close(fromshell_fd); for (;;) { - lplen -= written; if (lplen == 0) len = 0; else if (lp[written] == NL) @@ -5305,10 +5325,10 @@ mch_call_shell_fork( char_u *s = vim_strchr(lp + written, NL); len = write(toshell_fd, (char *)lp + written, - s == NULL ? lplen + s == NULL ? lplen - written : (size_t)(s - (lp + written))); } - if (len == (int)lplen) + if (len == (int)(lplen - written)) { // Finished a line, add a NL, unless this line // should not have one. @@ -5332,7 +5352,7 @@ mch_call_shell_fork( written = 0; } else if (len > 0) - written += len; + written += (size_t)len; } _exit(0); } @@ -5618,6 +5638,11 @@ mch_call_shell_fork( // Handle any X events, e.g. serving the clipboard. clip_update(); # endif +#ifdef FEAT_WAYLAND + // Handle Wayland events such as sending data as the source + // client. + wayland_client_update(); +#endif } finished: p_more = p_more_save; @@ -5644,7 +5669,7 @@ mch_call_shell_fork( close(toshell_fd); close(fromshell_fd); } -# if defined(FEAT_XCLIPBOARD) && defined(FEAT_X11) +# if (defined(FEAT_XCLIPBOARD) && defined(FEAT_X11)) || defined(FEAT_WAYLAND) else { long delay_msec = 1; @@ -5655,8 +5680,8 @@ mch_call_shell_fork( out_str_t_TE(); /* - * Similar to the loop above, but only handle X events, no - * I/O. + * Similar to the loop above, but only handle X and Wayland + * events, no I/O. */ for (;;) { @@ -5683,8 +5708,15 @@ mch_call_shell_fork( break; } +#if defined(FEAT_XCLIPBOARD) && defined(FEAT_X11) // Handle any X events, e.g. serving the clipboard. clip_update(); +#endif +#ifdef FEAT_WAYLAND + // Handle Wayland events such as sending data as the source + // client. + wayland_client_update(); +#endif // Wait for 1 to 10 msec. 1 is faster but gives the child // less time, gradually wait longer. @@ -6537,8 +6569,11 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) #endif #ifndef HAVE_SELECT // each channel may use in, out and err - struct pollfd fds[6 + 3 * MAX_OPEN_CHANNELS]; + struct pollfd fds[7 + 3 * MAX_OPEN_CHANNELS]; int nfd; +# ifdef FEAT_WAYLAND_CLIPBOARD + int wayland_idx = -1; +# endif # ifdef FEAT_XCLIPBOARD int xterm_idx = -1; # endif @@ -6562,6 +6597,15 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) fds[0].events = POLLIN; nfd = 1; +# ifdef FEAT_WAYLAND_CLIPBOARD + if (wayland_may_restore_connection()) + { + wayland_idx = nfd; + fds[nfd].fd = wayland_display_fd; + fds[nfd].events = POLLIN; + nfd++; + } +# endif # ifdef FEAT_XCLIPBOARD may_restore_clipboard(); if (xterm_Shell != (Widget)0) @@ -6590,9 +6634,9 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) nfd++; } # endif -#ifdef FEAT_JOB_CHANNEL +# ifdef FEAT_JOB_CHANNEL nfd = channel_poll_setup(nfd, &fds, &towait); -#endif +# endif if (interrupted != NULL) *interrupted = FALSE; @@ -6608,6 +6652,15 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) finished = FALSE; # endif +# ifdef FEAT_WAYLAND_CLIPBOARD + // Technically we should first call wl_display_prepare_read() before + // polling the fd, then read and dispatch after we poll. However that is + // only needed for multi threaded environments to prevent deadlocks so + // we are fine. + if (fds[wayland_idx].revents & POLLIN) + wayland_client_update(); +# endif + # ifdef FEAT_XCLIPBOARD if (xterm_Shell != (Widget)0 && (fds[xterm_idx].revents & POLLIN)) { @@ -6640,11 +6693,11 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) finished = FALSE; // Try again } # endif -#ifdef FEAT_JOB_CHANNEL +# ifdef FEAT_JOB_CHANNEL // also call when ret == 0, we may be polling a keep-open channel if (ret >= 0) channel_poll_check(ret, &fds); -#endif +# endif #else // HAVE_SELECT @@ -6688,8 +6741,19 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) # endif maxfd = fd; +# ifdef FEAT_WAYLAND_CLIPBOARD + + if (wayland_may_restore_connection()) + { + FD_SET(wayland_display_fd, &rfds); + + if (maxfd < wayland_display_fd) + maxfd = wayland_display_fd; + } +# endif + # ifdef FEAT_XCLIPBOARD - may_restore_clipboard(); + may_restore_x11_clipboard(); if (xterm_Shell != (Widget)0) { FD_SET(ConnectionNumber(xterm_dpy), &rfds); @@ -6777,6 +6841,15 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) finished = FALSE; # endif +# ifdef FEAT_WAYLAND_CLIPBOARD + // Technically we should first call wl_display_prepare_read() before + // polling the fd, then read and dispatch after we poll. However that is + // only needed for multi threaded environments to prevent deadlocks so + // we are fine. + if (ret > 0 && FD_ISSET(wayland_display_fd, &rfds)) + wayland_client_update(); +# endif + # ifdef FEAT_XCLIPBOARD if (ret > 0 && xterm_Shell != (Widget)0 && FD_ISSET(ConnectionNumber(xterm_dpy), &rfds)) @@ -6821,11 +6894,11 @@ RealWaitForChar(int fd, long msec, int *check_for_gpm UNUSED, int *interrupted) } } # endif -#ifdef FEAT_JOB_CHANNEL +# ifdef FEAT_JOB_CHANNEL // also call when ret == 0, we may be polling a keep-open channel if (ret >= 0) (void)channel_select_check(ret, &rfds, &wfds); -#endif +# endif #endif // HAVE_SELECT @@ -7001,9 +7074,9 @@ mch_expand_wildcards( } if (shell_style == STYLE_ECHO) { - if (strstr((char *)gettail(p_sh), "bash") != NULL) + if (strstr((char *)gettail(p_sh), "bash") != NULL) shell_style = STYLE_GLOBSTAR; - else if (strstr((char *)gettail(p_sh), "sh") != NULL) + else if (strstr((char *)gettail(p_sh), "sh") != NULL) shell_style = STYLE_VIMGLOB; } @@ -8327,7 +8400,7 @@ clip_update(void) * nothing in the X event queue (& no timers pending), then we return * immediately. */ - static void + void xterm_update(void) { XEvent event; @@ -8878,3 +8951,44 @@ start_timeout(long msec) } # endif // PROF_NSEC #endif // FEAT_RELTIME + +/* + * Create an anonymous/temporary file/object and return its file descriptor. + * Returns -1 on error. + */ + int +mch_create_anon_file(void) +{ + int fd = -1; +#ifdef HAVE_SHM_OPEN + const char template[] = "/vimXXXXXX"; + + for (int i = 0; i < 100; i++) + { + mch_get_random((char_u*)template + 4, 6); + + errno = 0; + fd = shm_open(template, O_CREAT | O_RDWR | O_EXCL, 0600); + + if (fd >= 0 || errno != EEXIST) + break; + } + // Remove object name from namespace + shm_unlink(template); +#endif + // Last resort + if (fd == -1) + { + char_u *tempname; + // get a name for the temp file + if ((tempname = vim_tempname('w', FALSE)) == NULL) + { + emsg(_(e_cant_get_temp_file_name)); + return -1; + } + fd = mch_open((char *)tempname, O_CREAT | O_RDWR | O_EXCL, 0600); + mch_remove(tempname); + vim_free(tempname); + } + return fd; +} diff --git a/src/os_vms.c b/src/os_vms.c index 23854dd3f0..0a67a6b75d 100644 --- a/src/os_vms.c +++ b/src/os_vms.c @@ -686,9 +686,9 @@ vms_fixfilename(void *instring) } #ifdef DEBUG - char *tmpbuf = NULL; - tmpbuf = ALLOC_MULT(char, buflen); - strcpy(tmpbuf, instring); + char *tmpbuf = NULL; + tmpbuf = ALLOC_MULT(char, buflen); + strcpy(tmpbuf, instring); #endif Fspec_Rms = buf; // for decc$to_vms diff --git a/src/os_win32.c b/src/os_win32.c index 0ba4eedb94..0f71a3cd99 100644 --- a/src/os_win32.c +++ b/src/os_win32.c @@ -164,7 +164,8 @@ static int write_input_record_buffer(INPUT_RECORD* irEvents, int nLength); #ifdef FEAT_GUI_MSWIN static int s_dont_use_vimrun = TRUE; static int need_vimrun_warning = FALSE; -static char *vimrun_path = "vimrun "; +static string_T vimrun_path = {(char_u *)"vimrun ", 7}; +static int vimrun_path_allocated = FALSE; #endif static int win32_getattrs(char_u *name); @@ -175,12 +176,12 @@ static int conpty_working = 0; static int conpty_type = 0; static int conpty_stable = 0; static int conpty_fix_type = 0; -static void vtp_flag_init(); +static void vtp_flag_init(void); #if !defined(FEAT_GUI_MSWIN) || defined(VIMDLL) static int vtp_working = 0; -static void vtp_init(); -static void vtp_exit(); +static void vtp_init(void); +static void vtp_exit(void); static void vtp_sgr_bulk(int arg); static void vtp_sgr_bulks(int argc, int *argv); @@ -430,20 +431,19 @@ wait_for_single_object( void mch_get_exe_name(void) { - // Maximum length of $PATH is more than MAXPATHL. 8191 is often mentioned - // as the maximum length that works. Add 1 for a NUL byte and 5 for - // "PATH=". -#define MAX_ENV_PATH_LEN (8191 + 1 + 5) - WCHAR temp[MAX_ENV_PATH_LEN]; - WCHAR buf[MAX_PATH]; int updated = FALSE; static int enc_prev = -1; + WCHAR *path; + size_t pathlen; if (exe_name == NULL || exe_pathw == NULL || enc_prev != enc_codepage) { + WCHAR buf[MAX_PATH]; + WCHAR *p; + // store the name of the executable, may be used for $VIM - GetModuleFileNameW(NULL, buf, MAX_PATH); - if (*buf != NUL) + p = buf + GetModuleFileNameW(NULL, buf, MAX_PATH); + if (p > buf) { if (enc_codepage == -1) enc_codepage = GetACP(); @@ -451,9 +451,18 @@ mch_get_exe_name(void) exe_name = utf16_to_enc(buf, NULL); enc_prev = enc_codepage; - WCHAR *wp = wcsrchr(buf, '\\'); - if (wp != NULL) - *wp = NUL; + // truncate the buffer at the last path separator + // to isolate the path. + do + { + --p; + if (*p == L'\\') + { + *p = L'\0'; + break; + } + } while (p > buf); + vim_free(exe_pathw); exe_pathw = _wcsdup(buf); updated = TRUE; @@ -466,33 +475,49 @@ mch_get_exe_name(void) // Append our starting directory to $PATH, so that when doing // "!xxd" it's found in our starting directory. Needed because // SearchPath() also looks there. - WCHAR *p = _wgetenv(L"PATH"); - if (p == NULL || wcslen(p) + wcslen(exe_pathw) + 2 + 5 < MAX_ENV_PATH_LEN) + path = _wgetenv(L"PATH"); + pathlen = (path == NULL) ? 0 : wcslen(path); + + // Maximum length of $PATH is more than MAXPATHL. 8191 is often mentioned + // as the maximum length that works. Add an extra 7 characters (5 for + // "PATH=", 1 for a potential ";" and 1 for the NUL byte). +#define EXTRA_LEN 7 +#define MAX_ENV_STRING_LEN 8191 + + if (pathlen + wcslen(exe_pathw) < MAX_ENV_STRING_LEN) { - wcscpy(temp, L"PATH="); + WCHAR temp[MAX_ENV_STRING_LEN + EXTRA_LEN] = L"PATH="; + size_t templen = 5; - if (p == NULL || *p == NUL) - wcscat(temp, exe_pathw); + if (pathlen == 0) + wcscpy(temp + templen, exe_pathw); else { - wcscat(temp, p); + wcscpy(temp + templen, path); // Check if exe_path is already included in $PATH. if (wcsstr(temp, exe_pathw) == NULL) { + templen += pathlen; + // Append ';' if $PATH doesn't end with it. - size_t len = wcslen(temp); - if (temp[len - 1] != L';') - wcscat(temp, L";"); + if (temp[templen - 1] != L';') + { + wcscpy(temp + templen, L";"); + ++templen; + } - wcscat(temp, exe_pathw); + wcscpy(temp + templen, exe_pathw); } } + _wputenv(temp); #ifdef libintl_wputenv libintl_wputenv(temp); #endif } +#undef EXTRA_LEN +#undef MAX_ENV_PATH_LEN } /* @@ -733,7 +758,7 @@ get_forwarded_dll(HINSTANCE hInst) if (p - name + 1 > sizeof(buf)) return NULL; strncpy(buf, name, p - name); - buf[p - name] = '\0'; + buf[p - name] = NUL; return GetModuleHandleA(buf); } #endif @@ -971,7 +996,7 @@ PlatformId(void) ovi.dwOSVersionInfoSize = sizeof(ovi); if (!GetVersionEx(&ovi)) - return; + return; #ifdef FEAT_EVAL vim_snprintf(windowsVersion, sizeof(windowsVersion), "%d.%d", @@ -988,7 +1013,7 @@ PlatformId(void) #ifdef HAVE_ACL // Enable privilege for getting or setting SACLs. if (!win32_enable_privilege(SE_SECURITY_NAME)) - return; + return; #endif } #ifdef _MSC_VER @@ -1092,7 +1117,6 @@ win32_kbd_patch_key( static WORD awAnsiCode[2]; static BYTE abKeystate[256]; - if (s_iIsDead == 2) { pker->uChar.UnicodeChar = (WCHAR) awAnsiCode[1]; @@ -1173,7 +1197,7 @@ decode_key_event( return TRUE; } - for (i = ARRAY_LENGTH(VirtKeyMap); --i >= 0; ) + for (i = ARRAY_LENGTH(VirtKeyMap); --i >= 0; ) { if (VirtKeyMap[i].wVirtKey == pker->wVirtualKeyCode) { @@ -1962,14 +1986,19 @@ encode_mouse_event(dict_T *args, INPUT_RECORD *ir) static int write_input_record_buffer(INPUT_RECORD* irEvents, int nLength) { - int nCount = 0; + int nCount = 0; + input_record_buffer_node_T *event_node; + while (nCount < nLength) { - input_record_buffer.length++; - input_record_buffer_node_T *event_node = - malloc(sizeof(input_record_buffer_node_T)); + event_node = alloc(sizeof(input_record_buffer_node_T)); + if (event_node == NULL) + return -1; + event_node->ir = irEvents[nCount++]; event_node->next = NULL; + + input_record_buffer.length++; if (input_record_buffer.tail == NULL) { input_record_buffer.head = event_node; @@ -2065,7 +2094,13 @@ test_mswin_event(char_u *event, dict_T *args) // events. But, this doesn't work well in the CI test environment. So // implementing an input_record_buffer instead. if (input_encoded) - lpEventsWritten = write_input_record_buffer(&ir, 1); + { + if ((lpEventsWritten = write_input_record_buffer(&ir, 1)) < 0) + { + semsg(_(e_out_of_memory), "event"); + return FALSE; + } + } // Set flags to execute the event, ie. like feedkeys mode X. if (execute) @@ -2775,23 +2810,22 @@ executable_file(char *name, char_u **path) * the allocated memory. */ static int -executable_exists(char *name, char_u **path, int use_path, int use_pathext) +executable_exists(char *name, size_t namelen, char_u **path, int use_path, int use_pathext) { // WinNT and later can use _MAX_PATH wide characters for a pathname, which // means that the maximum pathname is _MAX_PATH * 3 bytes when 'enc' is // UTF-8. char_u buf[_MAX_PATH * 3]; - size_t len = STRLEN(name); - size_t tmplen; - char_u *p, *e, *e2; - char_u *pathbuf = NULL; - char_u *pathext = NULL; - char_u *pathextbuf = NULL; + char_u *p; + string_T pathbuf = {NULL, 0}; + int pathbuf_allocated = FALSE; + string_T pathext = {NULL, 0}; + int pathext_allocated = FALSE; char_u *shname = NULL; int noext = FALSE; int retval = FALSE; - if (len >= sizeof(buf)) // safety check + if (namelen >= sizeof(buf)) // safety check return FALSE; // Using the name directly when a Unix-shell like 'shell'. @@ -2803,17 +2837,25 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext) if (use_pathext) { - pathext = mch_getenv("PATHEXT"); - if (pathext == NULL) - pathext = (char_u *)".com;.exe;.bat;.cmd"; + pathext.string = mch_getenv("PATHEXT"); + if (pathext.string == NULL) + { + pathext.string = (char_u *)".com;.exe;.bat;.cmd"; + pathext.length = 19; + } + else + pathext.length = STRLEN(pathext.string); if (noext == FALSE) { + char_u *e; + size_t plen; + /* * Loop over all extensions in $PATHEXT. * Check "name" ends with extension. */ - p = pathext; + p = pathext.string; while (*p) { if (p[0] == ';' @@ -2825,10 +2867,10 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext) } e = vim_strchr(p, ';'); if (e == NULL) - e = p + STRLEN(p); - tmplen = e - p; + e = pathext.string + pathext.length; + plen = (size_t)(e - p); - if (_strnicoll(name + len - tmplen, (char *)p, tmplen) == 0) + if (_strnicoll(name + namelen - plen, (char *)p, plen) == 0) { noext = TRUE; break; @@ -2840,20 +2882,27 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext) } // Prepend single "." to pathext, it means no extension added. - if (pathext == NULL) - pathext = (char_u *)"."; + if (pathext.string == NULL) + { + pathext.string = (char_u *)"."; + pathext.length = 1; + } else if (noext == TRUE) { - if (pathextbuf == NULL) - pathextbuf = alloc(STRLEN(pathext) + 3); - if (pathextbuf == NULL) + char_u *tmp; + + tmp = alloc(pathext.length + 3); + if (tmp == NULL) { retval = FALSE; goto theend; } - STRCPY(pathextbuf, ".;"); - STRCAT(pathextbuf, pathext); - pathext = pathextbuf; + + STRCPY(tmp, ".;"); + STRCPY(tmp + 2, pathext.string); + pathext.string = tmp; + pathext.length += 2; + pathext_allocated = TRUE; } // Use $PATH when "use_path" is TRUE and "name" is basename. @@ -2862,18 +2911,23 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext) p = mch_getenv("PATH"); if (p != NULL) { - pathbuf = alloc(STRLEN(p) + 3); - if (pathbuf == NULL) + size_t plen = STRLEN(p); + + pathbuf.string = alloc(plen + 3); + if (pathbuf.string == NULL) { retval = FALSE; goto theend; } if (mch_getenv("NoDefaultCurrentDirectoryInExePath") == NULL) - STRCPY(pathbuf, ".;"); - else - *pathbuf = NUL; - STRCAT(pathbuf, p); + { + STRCPY(pathbuf.string, ".;"); + pathbuf.length = 2; + } + STRCPY(pathbuf.string + pathbuf.length, p); + pathbuf.length += plen; + pathbuf_allocated = TRUE; } } @@ -2881,9 +2935,17 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext) * Walk through all entries in $PATH to check if "name" exists there and * is an executable file. */ - p = (pathbuf != NULL) ? pathbuf : (char_u *)"."; + if (pathbuf.string == NULL) + { + pathbuf.string = (char_u *)"."; + pathbuf.length = 1; + } + p = pathbuf.string; while (*p) { + char_u *e; + size_t buflen; + if (*p == ';') // Skip empty entry { ++p; @@ -2891,50 +2953,57 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext) } e = vim_strchr(p, ';'); if (e == NULL) - e = p + STRLEN(p); + e = pathbuf.string + pathbuf.length; - if (e - p + len + 2 > sizeof(buf)) + if (e - p + namelen + 2 > sizeof(buf)) { retval = FALSE; goto theend; } // A single "." that means current dir. if (e - p == 1 && *p == '.') + { STRCPY(buf, name); + buflen = namelen; + } else { - vim_strncpy(buf, p, e - p); - add_pathsep(buf); - STRCAT(buf, name); + buflen = vim_snprintf_safelen( + (char *)buf, + sizeof(buf), + "%.*s%s%s", (int)(e - p), p, + !after_pathsep(p, e - 1) ? PATHSEPSTR : "", + name); } - tmplen = STRLEN(buf); /* * Loop over all extensions in $PATHEXT. * Check "name" with extension added. */ - p = pathext; + p = pathext.string; while (*p) { + char_u *e2; + if (*p == ';') { // Skip empty entry ++p; continue; } - e2 = vim_strchr(p, (int)';'); + e2 = vim_strchr(p, ';'); if (e2 == NULL) - e2 = p + STRLEN(p); + e2 = pathext.string + pathext.length; if (!(p[0] == '.' && (p[1] == NUL || p[1] == ';'))) { // Not a single "." that means no extension is added. - if (e2 - p + tmplen + 1 > sizeof(buf)) + if (e2 - p + buflen + 1 > sizeof(buf)) { retval = FALSE; goto theend; } - vim_strncpy(buf + tmplen, p, e2 - p); + vim_strncpy(buf + buflen, p, e2 - p); } if (executable_file((char *)buf, path)) { @@ -2949,8 +3018,10 @@ executable_exists(char *name, char_u **path, int use_path, int use_pathext) } theend: - free(pathextbuf); - free(pathbuf); + if (pathbuf_allocated) + free(pathbuf.string); + if (pathext_allocated) + free(pathext.string); return retval; } @@ -3008,31 +3079,60 @@ mch_init_g(void) Rows = 25; Columns = 80; - // Look for 'vimrun' + // Look for 'vimrun'. { - char_u vimrun_location[_MAX_PATH + 4]; + char_u vimrun_location[_MAX_PATH + 4]; + size_t exe_pathlen = (size_t)(gettail(exe_name) - exe_name); - // First try in same directory as gvim.exe - STRCPY(vimrun_location, exe_name); - STRCPY(gettail(vimrun_location), "vimrun.exe"); - if (mch_getperm(vimrun_location) >= 0) + // Note: 10 is length of 'vimrun.exe'. + if (exe_pathlen + 10 >= sizeof(vimrun_location)) { - if (*skiptowhite(vimrun_location) != NUL) + if (executable_exists("vimrun.exe", STRLEN_LITERAL("vimrun.exe"), + NULL, TRUE, FALSE)) + s_dont_use_vimrun = FALSE; + } + else + { + // First try in same directory as gvim.exe. + if (exe_pathlen > 0) + vim_strncpy(vimrun_location, exe_name, exe_pathlen); + STRCPY(vimrun_location + exe_pathlen, "vimrun.exe"); + + if (mch_getperm(vimrun_location) >= 0) { - // Enclose path with white space in double quotes. - mch_memmove(vimrun_location + 1, vimrun_location, - STRLEN(vimrun_location) + 1); - *vimrun_location = '"'; - STRCPY(gettail(vimrun_location), "vimrun\" "); - } - else - STRCPY(gettail(vimrun_location), "vimrun "); + char_u *p; + size_t plen; - vimrun_path = (char *)vim_strsave(vimrun_location); - s_dont_use_vimrun = FALSE; + if (exe_pathlen > 0 && *skiptowhite(vimrun_location) != NUL) + { + // Enclose path with white space in double quotes. + plen = vim_snprintf_safelen( + (char *)vimrun_location, + sizeof(vimrun_location), + "\"%.*svimrun\" ", + (int)exe_pathlen, exe_name); + } + else + { + // Remove the suffix ('.exe'). + vimrun_location[exe_pathlen + 6] = ' '; + vimrun_location[exe_pathlen + 7] = NUL; + plen = exe_pathlen + 7; + } + + p = vim_strnsave(vimrun_location, plen); + if (p != NULL) + { + vimrun_path.string = p; + vimrun_path.length = plen; + vimrun_path_allocated = TRUE; + s_dont_use_vimrun = FALSE; + } + } + else if (executable_exists("vimrun.exe", STRLEN_LITERAL("vimrun.exe"), + NULL, TRUE, FALSE)) + s_dont_use_vimrun = FALSE; } - else if (executable_exists("vimrun.exe", NULL, TRUE, FALSE)) - s_dont_use_vimrun = FALSE; // Don't give the warning for a missing vimrun.exe right now, but only // when vimrun was supposed to be used. Don't bother people that do @@ -3042,10 +3142,11 @@ mch_init_g(void) } /* - * If "finstr.exe" doesn't exist, use "grep -n" for 'grepprg'. + * If "findstr.exe" doesn't exist, use "grep -n" for 'grepprg'. * Otherwise the default "findstr /n" is used. */ - if (!executable_exists("findstr.exe", NULL, TRUE, FALSE)) + if (!executable_exists("findstr.exe", STRLEN_LITERAL("findstr.exe"), + NULL, TRUE, FALSE)) set_option_value_give_err((char_u *)"grepprg", 0, (char_u *)"grep -n", 0); @@ -3284,7 +3385,6 @@ RestoreConsoleBuffer( SMALL_RECT WriteRegion; int i; - if (cb == NULL || !cb->IsValid) return FALSE; @@ -3635,11 +3735,16 @@ mch_exit(int r) #endif #ifdef VIMDLL + if (vimrun_path_allocated) + vim_free(vimrun_path.string); + if (gui.in_use || gui.starting) mch_exit_g(r); else mch_exit_c(r); #elif defined(FEAT_GUI_MSWIN) + if (vimrun_path_allocated) + vim_free(vimrun_path.string); mch_exit_g(r); #else mch_exit_c(r); @@ -3678,12 +3783,10 @@ fname_case( char_u *name, int len) { - int flen; WCHAR *p; WCHAR buf[_MAX_PATH + 1]; - flen = (int)STRLEN(name); - if (flen == 0) + if (*name == NUL) return; slash_adjust(name); @@ -3698,8 +3801,15 @@ fname_case( if (q != NULL) { - if (len > 0 || flen >= (int)STRLEN(q)) - vim_strncpy(name, q, (len > 0) ? len - 1 : flen); + if (len > 0) + vim_strncpy(name, q, len - 1); + else + { + size_t namelen = STRLEN(name); + + if (namelen >= STRLEN(q)) + vim_strncpy(name, q, namelen); + } vim_free(q); } } @@ -3778,7 +3888,7 @@ mch_process_running(long pid) if (hProcess == NULL) return FALSE; // might not have access - if (GetExitCodeProcess(hProcess, &status) ) + if (GetExitCodeProcess(hProcess, &status)) ret = status == STILL_ACTIVE; CloseHandle(hProcess); return ret; @@ -3810,10 +3920,13 @@ mch_dirname( if (GetLongPathNameW(wbuf, wcbuf, _MAX_PATH) != 0) { p = utf16_to_enc(wcbuf, NULL); - if (STRLEN(p) >= (size_t)len) + if (p != NULL) { - // long path name is too long, fall back to short one - VIM_CLEAR(p); + if (STRLEN(p) >= (size_t)len) + { + // long path name is too long, fall back to short one + VIM_CLEAR(p); + } } } if (p == NULL) @@ -3835,10 +3948,10 @@ mch_dirname( mch_getperm(char_u *name) { stat_T st; - int n; - n = mch_stat((char *)name, &st); - return n == 0 ? (long)(unsigned short)st.st_mode : -1L; + return (mch_stat((char *)name, &st) == 0) + ? (long)(unsigned short)st.st_mode + : -1L; } @@ -4132,7 +4245,7 @@ mch_writable(char_u *name) int mch_can_exe(char_u *name, char_u **path, int use_path UNUSED) { - return executable_exists((char *)name, path, TRUE, TRUE); + return executable_exists((char *)name, STRLEN(name), path, TRUE, TRUE); } /* @@ -5086,8 +5199,8 @@ mch_system_piped(char *cmd, int options) // About "Inherit handles" being TRUE: this command can be litigious, // handle inheritance was deactivated for pending temp file, but, if we // deactivate it, the pipes don't work for some reason. - vim_create_process(p, TRUE, CREATE_DEFAULT_ERROR_MODE, - &si, &pi, NULL, NULL); + vim_create_process(p, TRUE, CREATE_DEFAULT_ERROR_MODE, + &si, &pi, NULL, NULL); if (p != cmd) vim_free(p); @@ -5658,7 +5771,7 @@ mch_call_shell( #ifdef FEAT_GUI_MSWIN ((gui.in_use || gui.starting) ? (!s_dont_use_vimrun && p_stmp ? - STRLEN(vimrun_path) : STRLEN(p_sh) + STRLEN(p_shcf)) + vimrun_path.length : STRLEN(p_sh) + STRLEN(p_shcf)) : 0) + #endif STRLEN(p_sh) + STRLEN(p_shcf) + STRLEN(cmd) + 10; @@ -5694,7 +5807,7 @@ mch_call_shell( // Use vimrun to execute the command. It opens a console // window, which can be closed without killing Vim. vim_snprintf((char *)newcmd, cmdlen, "%s%s%s %s %s", - vimrun_path, + vimrun_path.string, (msg_silent != 0 || (options & SHELL_DOOUT)) ? "-s " : "", p_sh, p_shcf, cmd); @@ -6346,7 +6459,7 @@ termcap_mode_end(void) // Switch back to main screen buffer. if (exiting && use_alternate_screen_buffer) - vtp_printf("\033[?1049l"); + vtp_printf("\033[?1049l"); if (!USE_WT && (p_rs || exiting)) { @@ -7593,19 +7706,33 @@ mch_total_mem(int special UNUSED) mch_wrename(WCHAR *wold, WCHAR *wnew) { WCHAR *p; - int i; + WCHAR *q; WCHAR szTempFile[_MAX_PATH + 1]; WCHAR szNewPath[_MAX_PATH + 1]; HANDLE hf; // No need to play tricks unless the file name contains a "~" as the // seventh character. - p = wold; - for (i = 0; wold[i] != NUL; ++i) - if ((wold[i] == '/' || wold[i] == '\\' || wold[i] == ':') - && wold[i + 1] != 0) - p = wold + i + 1; - if ((int)(wold + i - p) < 8 || p[6] != '~') + for (p = q = wold; *p != L'\0'; ++p) + { + switch (*p) + { + case L'/': + case L'\\': + case L':': + if (*(p + 1) != L'\0') + q = p + 1; // point to the character after the path + // separator. + break; + + default: + break; + } + } + + // If the length of the file name is less than 8 characters or the seventh + // character is not a "~', do a normal move. + if ((int)(p - q) < 8 || q[6] != L'~') return (MoveFileW(wold, wnew) == 0); // Get base path of new file name. Undocumented feature: If pszNewFile is @@ -7846,7 +7973,10 @@ copy_substream(HANDLE sh, void *context, WCHAR *to, WCHAR *substream, long len) HANDLE hTo; WCHAR *to_name; - to_name = malloc((wcslen(to) + wcslen(substream) + 1) * sizeof(WCHAR)); + to_name = alloc((wcslen(to) + wcslen(substream) + 1) * sizeof(WCHAR)); + if (to_name == NULL) + return; + wcscpy(to_name, to); wcscat(to_name, substream); @@ -8088,9 +8218,9 @@ copy_extattr(char_u *from, char_u *to) if (fromf == NULL || tof == NULL) goto theend; STRCPY(fromf, "\\??\\"); - STRCAT(fromf, from); + STRCPY(fromf + STRLEN_LITERAL("\\??\\"), from); STRCPY(tof, "\\??\\"); - STRCAT(tof, to); + STRCPY(tof + STRLEN_LITERAL("\\??\\"), to); // Convert the names to wide characters. fromw = enc_to_utf16(fromf, NULL); @@ -8191,7 +8321,7 @@ get_cmd_argsW(char ***argvp) ArglistW = CommandLineToArgvW(GetCommandLineW(), &nArgsW); if (ArglistW != NULL) { - argv = malloc((nArgsW + 1) * sizeof(char *)); + argv = alloc((nArgsW + 1) * sizeof(char *)); if (argv != NULL) { argc = nArgsW; @@ -8223,7 +8353,7 @@ get_cmd_argsW(char ***argvp) { if (used_file_indexes != NULL) free(used_file_indexes); - used_file_indexes = malloc(argc * sizeof(int)); + used_file_indexes = alloc(argc * sizeof(int)); } if (argvp != NULL) @@ -8966,7 +9096,7 @@ GetWin32Error(void) // remove trailing \r\n char *pcrlf = strstr(msg, "\r\n"); if (pcrlf != NULL) - *pcrlf = '\0'; + *pcrlf = NUL; oldmsg = msg; return msg; } @@ -8991,9 +9121,7 @@ static sig_atomic_t *timeout_flag = &timeout_flags[0]; static void CALLBACK set_flag(void *param, BOOLEAN unused2 UNUSED) { - int *timeout_flag = (int *)param; - - *timeout_flag = TRUE; + *(sig_atomic_t *)param = TRUE; } /* diff --git a/src/po/Make_all.mak b/src/po/Make_all.mak index f7a6166363..c8c821bead 100644 --- a/src/po/Make_all.mak +++ b/src/po/Make_all.mak @@ -4,7 +4,6 @@ LANGUAGES = \ af \ - am \ ca \ cs \ da \ @@ -16,6 +15,7 @@ LANGUAGES = \ fr \ ga \ hu \ + hy \ it \ ja \ ko.UTF-8 \ @@ -59,7 +59,6 @@ LANGUAGES_UTF8_ONLY = \ POFILES = \ af.po \ - am.po \ ca.po \ cs.po \ da.po \ @@ -71,6 +70,7 @@ POFILES = \ fr.po \ ga.po \ hu.po \ + hy.po \ it.po \ ja.po \ ko.UTF-8.po \ @@ -107,7 +107,6 @@ POFILES = \ MOFILES = \ af.mo \ - am.mo \ ca.mo \ cs.mo \ da.mo \ @@ -119,6 +118,7 @@ MOFILES = \ fr.mo \ ga.mo \ hu.mo \ + hy.mo \ it.mo \ ja.mo \ ko.UTF-8.mo \ @@ -169,6 +169,7 @@ CHECKFILES = \ fr.ck \ ga.ck \ hu.ck \ + hy.ck \ it.ck \ ja.ck \ ko.UTF-8.ck \ diff --git a/src/po/Make_cyg.mak b/src/po/Make_cyg.mak index c04837eed3..d4d8eb8ee0 100644 --- a/src/po/Make_cyg.mak +++ b/src/po/Make_cyg.mak @@ -96,4 +96,5 @@ install-all: install clean: $(RM) *.mo - $(RM) *.pot +# $(RM) *.pot + $(RM) *.orig diff --git a/src/po/Make_ming.mak b/src/po/Make_ming.mak index 21d2d2037c..fb62827214 100644 --- a/src/po/Make_ming.mak +++ b/src/po/Make_ming.mak @@ -119,4 +119,5 @@ endif clean: $(RM) *.mo - $(RM) *.pot +# $(RM) *.pot + $(RM) *.orig diff --git a/src/po/Make_mvc.mak b/src/po/Make_mvc.mak index de0339743b..61fdcb74e0 100644 --- a/src/po/Make_mvc.mak +++ b/src/po/Make_mvc.mak @@ -526,11 +526,11 @@ $(PLUGPACKAGE).mo : $(PO_PLUGPACKAGE) clean: checkclean - $(RM) *.mo - $(RM) *.pot - $(RM) *.orig - $(RM) files allfiles - $(RM) sjiscorr.obj sjiscorr.exe -# $(RM) big5corr.obj big5corr.exe + - $(RM) *.mo + - $(RM) *.orig + - $(RM) files allfiles + - $(RM) sjiscorr.obj sjiscorr.exe +# - $(RM) *.pot +# - $(RM) big5corr.obj big5corr.exe # vim: set noet sw=8 ts=8 sts=0 wm=0 tw=0 ft=make: diff --git a/src/po/Makefile b/src/po/Makefile index d9ebdb6ace..0c0835a1de 100644 --- a/src/po/Makefile +++ b/src/po/Makefile @@ -249,10 +249,10 @@ prefixcheck: fi clean: checkclean - rm -f core core.* *.old.po *.mo *.pot sjiscorr - rm -f LINGUAS vim.desktop gvim.desktop tmp_*desktop - rm -f ./allfiles -# rm -f big5corr + - rm -f core core.* *.old.po *.mo sjiscorr + - rm -f LINGUAS vim.desktop gvim.desktop tmp_*desktop + - rm -f ./allfiles +# - rm -f big5corr distclean: clean @@ -278,12 +278,13 @@ $(PACKAGE).pot: $(PO_INPUTLIST) $(PO_VIM_INPUTLIST) @ cat ./vim_to_js >> ./allfiles # Create vim.pot. $(XGETTEXT) --default-domain=$(PACKAGE) --output=$(PACKAGE).pot \ - --add-comments $(XGETTEXT_KEYWORDS) --files-from=./allfiles + --add-comments $(XGETTEXT_KEYWORDS) --files-from=./allfiles \ + --no-location # Fix Vim scripts names, so that "gf" works. $(VIMPROG) -u NONE --not-a-term -S fixfilenames.vim $(PACKAGE).pot \ $(PO_VIM_INPUTLIST) # Delete the temporary files. - rm -f *.js ./vim_to_js + rm -f *.js ./vim_to_js allfiles vim.desktop: vim.desktop.in $(POFILES) echo $(LANGUAGES) | tr " " "\n" |$(SED) -e '/\./d' | sort > LINGUAS diff --git a/src/po/check.vim b/src/po/check.vim index 2ea4a3824e..8ca48aaf41 100644 --- a/src/po/check.vim +++ b/src/po/check.vim @@ -4,6 +4,8 @@ " - All %...s items in "msgid" are identical to the ones in "msgstr". " - An error or warning code in "msgid" matches the one in "msgstr". +" Last Update: 2025 Jul 10 + if 1 " Only execute this if the eval feature is available. " using line continuation @@ -207,19 +209,19 @@ let cte = search('^"Content-Transfer-Encoding:\s\+8-bit', 'n') let ctc = search('^"Content-Type:.*;\s\+\80v', 'n') if overlong > 0 - echomsg "Lines should be wrapped at 80 columns" + echomsg "Warn: Lines should be wrapped at 80 columns" + " TODO: make this an error + " if error == 0 + " let error = overlong + " endif +endif + +" Check that there is no trailing whitespace +let overlong = search('\s\+$', 'n') +if overlong > 0 + echomsg $"Warn: Trailing whitespace at line: {overlong}" " TODO: make this an error " if error == 0 " let error = overlong diff --git a/src/po/de.po b/src/po/de.po index 99a62db281..4d0db25b3e 100644 --- a/src/po/de.po +++ b/src/po/de.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: Vim\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2023-12-29 00:02+0100\n" +"POT-Creation-Date: 2025-07-18 20:09+0200\n" "PO-Revision-Date: 2008-05-24 17:26+0200\n" "Last-Translator: Christian Brabandt \n" "Language-Team: German\n" @@ -161,6 +161,10 @@ msgstr "Anfang" msgid "%d%%" msgstr "%d%%" +#, c-format +msgid "%2s" +msgstr "%2s" + #, c-format msgid " (%d of %d)" msgstr "(%d von %d)" @@ -177,6 +181,9 @@ msgstr " (Datei %d von %d)" msgid " (file (%d) of %d)" msgstr " (Datei (%d) von %d)" +msgid "[Command Line]" +msgstr "[Befehlszeile]" + msgid "[Prompt]" msgstr "[Prompt]" @@ -262,6 +269,13 @@ msgstr ": Versenden des Ausdrucks fehlgeschlagen.\n" msgid "Used CUT_BUFFER0 instead of empty selection" msgstr "CUT_BUFFER0 anstatt der leeren Auswahl benutzt" +msgid "Could not find a way to access the clipboard." +msgstr "Konnte nicht auf die Zwischenablage zugreifen." + +#, c-format +msgid "Switched to clipboard method '%s'." +msgstr "Zum Zwischenablage-Verfahren '%s' gewechselt." + msgid "tagname" msgstr "Tag-Name" @@ -455,10 +469,9 @@ msgstr "Katakana" msgid "Bopomofo" msgstr "Bopomofo" -msgid "Not enough memory to set references, garbage collection aborted!" -msgstr "" -"Nicht gen�gend Speicher um Referenzen zu setzen, Garbagecollection " -"abgebrochen!" +#, c-format +msgid "%ld," +msgstr "%ld," msgid "" "\n" @@ -715,9 +728,6 @@ msgstr "Fehler" msgid "Interrupt" msgstr "Unterbrechung" -msgid "[Command Line]" -msgstr "[Befehlszeile]" - msgid "is a directory" msgstr "ist ein Verzeichnis" @@ -799,8 +809,12 @@ msgid "[unix format]" msgstr "[unix Format]" #, c-format -msgid "%ld line, " -msgid_plural "%ld lines, " +msgid "%s%ldL, %lldB" +msgstr "%s%ldL, %lldB" + +#, c-format +msgid "%s%ld line, " +msgid_plural "%s%ld lines, " msgstr[0] "%ld Zeile, " msgstr[1] "%ld Zeilen, " @@ -893,6 +907,11 @@ msgid_plural "+-%s%3ld lines: " msgstr[0] "+-%s%3ld Zeile: " msgstr[1] "+-%s%3ld Zeilen: " +msgid "Not enough memory to set references, garbage collection aborted!" +msgstr "" +"Nicht gen�gend Speicher um Referenzen zu setzen, Garbagecollection " +"abgebrochen!" + msgid "No match at cursor, finding next" msgstr "Kein Treffer beim Cursor, finde den n�chsten" @@ -1343,8 +1362,8 @@ msgstr[1] "%ld Zeilen einger msgid " Keyword completion (^N^P)" msgstr " Stichwort Vervollst�ndigung (^N^P)" -msgid " ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" -msgstr " ^X Modus (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" +msgid " ^X mode (^]^D^E^F^I^K^L^N^O^P^Rs^U^V^Y)" +msgstr " ^X Modus (^]^D^E^F^I^K^L^N^O^P^Rs^U^V^Y)" msgid " Whole line completion (^L^N^P)" msgstr " Zeilen-Vervollst�ndigung (^L^N^P)" @@ -1382,6 +1401,9 @@ msgstr " Vorschlag der Rechtschreibpr msgid " Keyword Local completion (^N^P)" msgstr " Lokale Stichwort-Vervollst�ndigung(^N^P)" +msgid " Register completion (^N^P)" +msgstr " Register Vervollst�ndigung (^N^P)" + msgid "'dictionary' option is empty" msgstr "Die Option 'dictionary' ist leer" @@ -1455,6 +1477,9 @@ msgstr "mapnew() Argument" msgid "filter() argument" msgstr "filter() Argument" +msgid "foreach() argument" +msgstr "foreach() Argument" + msgid "extendnew() argument" msgstr "extendnew() Argument" @@ -1742,6 +1767,9 @@ msgstr "-display \tStarte Vim " msgid "-X\t\t\tDo not connect to X server" msgstr "-X\t\t\tStelle keine Verbindung zum X-server her" +msgid "-Y\t\t\tDo not connect to Wayland compositor" +msgstr "-Y\t\t\tStelle keine Verbindung zum Wayland Compositor her" + msgid "--remote \tEdit in a Vim server if possible" msgstr "" "--remote \tEditiere in einem Vim-Server falls m�glich" @@ -1835,13 +1863,13 @@ msgstr "-italicfont \tBenutze f msgid "-geometry \tUse for initial geometry (also: -geom)" msgstr "" -"-geometry \tBenutze f�r die Anfangs Abmessungen (auch mit: -" -"geom)" +"-geometry \tBenutze f�r die Anfangs Abmessungen (auch mit: " +"-geom)" msgid "-borderwidth \tUse a border width of (also: -bw)" msgstr "" -"-borderwidth \tBenutze einen Rahmen der Breite (auch mit: -" -"bw)" +"-borderwidth \tBenutze einen Rahmen der Breite (auch mit: " +"-bw)" msgid "-scrollbarwidth Use a scrollbar width of (also: -sw)" msgstr "" @@ -2330,6 +2358,12 @@ msgstr "" " LEERZEICHEN/d/j: Seite/halbe Seite/Zeile vorw�rts, b/u/k: r�ckw�rts, q: " "Ende " +msgid "W23: Clipboard register not available, using register 0" +msgstr "W23: Zwischenablage-Register nicht verf�gbar, nutze Register 0" + +msgid "W24: Clipboard register not available. See :h W24" +msgstr "W24: Zwischenablage-Register nicht verf�gbar. Siehe :h W24" + msgid "Question" msgstr "Frage" @@ -2542,6 +2576,9 @@ msgstr "nach %s auf %s" msgid "Printing '%s'" msgstr "Drucke '%s'" +msgid "DefaultFontNameForWindows" +msgstr "Standard Windows Font" + #, c-format msgid "Opening the X display took %ld msec" msgstr "�ffnen des X-Displays dauerte %ld msec" @@ -2553,9 +2590,8 @@ msgstr "" "\n" "Vim: ein X11 Fehler trat auf\n" -#, c-format -msgid "restoring display %s" -msgstr "Wiederherstellen des Displays %s" +msgid "restoring X11 display %s" +msgstr "Wiederherstellen des X11-Displays %s" msgid "Testing the X display failed" msgstr "Test des X-Displays schlug fehl" @@ -3492,13 +3528,20 @@ msgid "%s returning %s" msgstr "%s lieferte \"%s\" zur�ck" #, c-format -msgid "Function %s does not need compiling" -msgstr "Funktion %s muss nicht kompiliert werden" +msgid "Function %s%s%s does not need compiling" +msgstr "Funktion %s%s%s muss nicht kompiliert werden" #, c-format msgid "%s (%s, compiled %s)" msgstr "%s (%s kompiliert am %s)" +msgid "" +"\n" +"MS-Windows ARM64 GUI/console version" +msgstr "" +"\n" +"MS-Windows ARM64 GUI/Konsolen-Version" + msgid "" "\n" "MS-Windows 64-bit GUI/console version" @@ -3513,6 +3556,13 @@ msgstr "" "\n" "MS-Windows 32 Bit GUI/Konsolen-Version" +msgid "" +"\n" +"MS-Windows ARM64 GUI version" +msgstr "" +"\n" +"MS-Windows ARM64 GUI Version" + msgid "" "\n" "MS-Windows 64-bit GUI version" @@ -3530,6 +3580,13 @@ msgstr "" msgid " with OLE support" msgstr " mit OLE-Unterst�tzung" +msgid "" +"\n" +"MS-Windows ARM64 console version" +msgstr "" +"\n" +"MS-Windows ARM64 Konsolen-Version" + msgid "" "\n" "MS-Windows 64-bit console version" @@ -3652,6 +3709,9 @@ msgstr " zweite Benutzer-vimrc-Datei: \"" msgid " 3rd user vimrc file: \"" msgstr " dritte Benutzer-vimrc-Datei: \"" +msgid " 4th user vimrc file: \"" +msgstr " vierte Benutzer-vimrc-Datei: \"" + msgid " user exrc file: \"" msgstr " Benutzer-exrc-Datei: \"" @@ -3912,6 +3972,15 @@ msgstr " FEHLGESCHLAGEN" msgid "Writing viminfo file \"%s\"" msgstr "Schreiben der viminfo-Datei \"%s\"" +msgid "wayland protocol error -> " +msgstr "Wayland Protokoll Fehler -> " + +msgid "restoring Wayland display %s" +msgstr "Wiederherstellen des Wayland Displays %s" + +msgid "failed restoring, lost connection to Wayland display" +msgstr "Wiederherstellung fehlgeschlagen, Verbindung zur Wayland-Anzeige verloren" + msgid "Already only one window" msgstr "Bereits nur ein Fenster" @@ -4267,6 +4336,10 @@ msgstr "E104: ist in einem Digraphen nicht erlaubt" msgid "E105: Using :loadkeymap not in a sourced file" msgstr "E105: :loadkeymap au�erhalb einer eingelesenen Datei" +#, c-format +msgid "E106: Unsupported diff output format: %s" +msgstr "E106: Nicht unterst�tztes Diff-Ausgabeformat: %s" + #, c-format msgid "E107: Missing parentheses: %s" msgstr "E107: Fehlende Klammern: %s" @@ -4608,8 +4681,8 @@ msgstr "E196: Keine Digraphen in dieser Version" msgid "E197: Cannot set language to \"%s\"" msgstr "E197: Sprache kann nicht auf \"%s\" gesetzt werden" -msgid "E199: Active window or buffer deleted" -msgstr "E199: Aktives Fenster oder Buffer gel�scht" +msgid "E199: Active window or buffer changed or deleted" +msgstr "E199: Aktives Fenster oder Buffer ge�ndert oder gel�scht" msgid "E200: *ReadPre autocommands made the file unreadable" msgstr "E200: *ReadPre Autokommandos haben die Datei unlesbar gemacht" @@ -6067,9 +6140,6 @@ msgstr "E612: Zu viele Zeichen definiert" msgid "E613: Unknown printer font: %s" msgstr "E613: Unbekannte Druckerschriftart: %s" -msgid "E614: Class required" -msgstr "E614: Klasse ben�tigt" - #, c-format msgid "E616: Object required for argument %d" msgstr "E616: Objekt erforderlich f�r Argument %d" @@ -6244,8 +6314,8 @@ msgstr "E667: Fsync fehlgeschlagen" #, c-format msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\"" msgstr "" -"E668: Falscher Zugriffsmodus auf die NetBeans Zugriff-Informationsdatei: \"%s" -"\"" +"E668: Falscher Zugriffsmodus auf die NetBeans Zugriff-Informationsdatei: " +"\"%s\"" msgid "E669: Unprintable character in group name" msgstr "E669: Nicht druckbare Zeichen im Namen der Gruppe" @@ -7004,9 +7074,14 @@ msgstr "" msgid "E876: (NFA regexp) Not enough space to store the whole NFA" msgstr "E876: (NFA Regexp) Nicht genug Speicher zum Speichern der NFA" +#, c-format +msgid "E877: (NFA regexp) Invalid character class: %d" +msgstr "E877: (NFA Regexp) Ung�ltige Zeichenklasse %d" + msgid "E878: (NFA regexp) Could not allocate memory for branch traversal!" msgstr "" -"E878: (NFA Regexp) Konnte nicht Speicher allokieren um �ste zu durchlaufen!" +"E878: (NFA Regexp) Konnte keinen Speicher f�r Verzweigungsdurchlauf " +"reservieren!" msgid "E879: (NFA regexp) Too many \\z(" msgstr "E879: (NFA Regexp) Zu viele \\z(" @@ -7873,8 +7948,8 @@ msgstr "E1115: \"assert_fails()\" viertes Argument muss eine Zahl sein" msgid "E1116: \"assert_fails()\" fifth argument must be a string" msgstr "E1116: \"assert_fails()\" f�nftes Argument muss eine Zahl sein" -msgid "E1117: Cannot use ! with nested :def" -msgstr "E1117: Kann nicht ! innerhalb verschachtelter :def verwenden" +msgid "E1117: Cannot use ! with nested %s" +msgstr "E1117: Kann nicht ! innerhalb verschachtelter %s verwenden" msgid "E1118: Cannot change locked list" msgstr "E1118: Kann gesperrte Liste nicht �ndern" @@ -7944,8 +8019,8 @@ msgstr "E1138: Bool als Zahl verwendet" msgid "E1139: Missing matching bracket after dict key" msgstr "E1139: Fehlende zugeh�rige eckige Klammer nach Dict Schl�ssel" -msgid "E1140: :for argument must be a sequence of lists" -msgstr "E1140: :for Argument muss eine Folge von Listen sein" +msgid "E1140: :for argument must be a sequence of lists or tuples" +msgstr "E1140: :for Argument muss eine Folge von Listen oder Tuples sein" msgid "E1141: Indexable type required" msgstr "E1141: indexierbarer Typ erforderlich" @@ -8265,9 +8340,10 @@ msgid "E1224: String, Number or List required for argument %d" msgstr "E1224: Zeichenkette, Zahl oder Liste erforderlich f�r Argument %d" #, c-format -msgid "E1225: String, List or Dictionary required for argument %d" +msgid "E1225: String, List, Tuple or Dictionary required for argument %d" msgstr "" -"E1225: Zeichenkette, Liste oder Dictionary erforderlich f�r Argument %d" +"E1225: Zeichenkette, Liste, Tuple oder Dictionary erforderlich f�r Argument " +"%d" #, c-format msgid "E1226: List or Blob required for argument %d" @@ -8305,6 +8381,10 @@ msgstr "" msgid "E1234: legacy must be followed by a command" msgstr "E1234: legacy muss von einem Befehl gefolgt werden" +#, c-format +msgid "E1235: Bool or Number required for argument %d" +msgstr "E1235: Bool oder Zahl erforderlich f�r Argument %d" + #, c-format msgid "E1236: Cannot use %s itself, it is imported" msgstr "E1236: Kann %s nicht verwenden, es wurde import" @@ -8362,14 +8442,20 @@ msgstr "" "sein" #, c-format -msgid "E1251: List, Dictionary, Blob or String required for argument %d" +msgid "E1251: List, Tuple, Dictionary, Blob or String required for argument %d" msgstr "" -"E1251: Liste, Dictionary, Blob oder Zeichenkette erforderlich f�r Argument %d" +"E1251: Liste, Tuple, Dictionary, Blob oder Zeichenkette erforderlich f�r " +"Argument %d" #, c-format msgid "E1252: String, List or Blob required for argument %d" msgstr "E1252: Zeichenkette, Liste oder Blob erforderlich f�r Argument %d" +#, c-format +msgid "E1253: String, List, Tuple or Blob required for argument %d" +msgstr "" +"E1253: Zeichenkette, Liste, Tuple oder Blob erforderlich f�r Argument %d" + msgid "E1254: Cannot use script variable in for loop" msgstr "E1254: Kann Skriptvariable nicht in einer for Schleife verwenden" @@ -8546,9 +8632,10 @@ msgid "E1300: Cannot use a partial with dictionary for :defer" msgstr "E1300: Kann kein Partial mit Dictionary f�r :defer verwenden" #, c-format -msgid "E1301: String, Number, List or Blob required for argument %d" +msgid "E1301: String, Number, List, Tuple or Blob required for argument %d" msgstr "" -"E1301: Zeichenkette, Zahl, Liste oder Blob erforderlich f�r Argument %d" +"E1301: Zeichenkette, Zahl, Liste, Tuple oder Blob erforderlich f�r Argument " +"%d" msgid "E1302: Script variable was deleted" msgstr "E1302: Scriptvariable wurde gel�scht" @@ -8614,21 +8701,12 @@ msgstr "E1317: Ung msgid "E1318: Not a valid command in a class: %s" msgstr "E1318: Ung�ltiger Befehl in Klasse: %s" -msgid "E1319: Using a Class as a Number" -msgstr "E1319: Klasse als Zahl verwendet" - msgid "E1320: Using an Object as a Number" msgstr "E1320: Objekt als Zahl verwendet" -msgid "E1321: Using a Class as a Float" -msgstr "E1321: Klasse als Float verwendet" - msgid "E1322: Using an Object as a Float" msgstr "E1322: Objekt als Float verwendet" -msgid "E1323: Using a Class as a String" -msgstr "E1323: Klasse als Zeichenkette verwendet" - msgid "E1324: Using an Object as a String" msgstr "E1324: Objekt als Zeichenkette verwendet" @@ -8658,15 +8736,14 @@ msgid "E1330: Invalid type for object variable: %s" msgstr "E1330: Ung�ltiger Typ f�r Objekt-Variable: %s" msgid "" -"E1331: Public must be followed by \"var\" or \"static\" or \"final\" or " +"E1331: public must be followed by \"var\" or \"static\" or \"final\" or " "\"const\"" msgstr "" -"E1331: Public muss von \"var\" oder \"static\" oder \"final\" oder \"const\"" -"gefolgt werden" +"E1331: Auf public muss \"var\", \"static\", \"final\" oder \"const\" folgen" #, c-format -msgid "E1332: Public variable name cannot start with underscore: %s" -msgstr "E1332: Public Variable darf nicht mit einem Unterstrich beginnen: %s" +msgid "E1332: public variable name cannot start with underscore: %s" +msgstr "E1332: public Variable darf nicht mit einem Unterstrich beginnen: %s" #, c-format msgid "E1333: Cannot access protected variable \"%s\" in class \"%s\"" @@ -8791,11 +8868,11 @@ msgstr "" "unterschiedlich" msgid "" -"E1368: Static must be followed by \"var\" or \"def\" or \"final\" or \"const" -"\"" +"E1368: Static must be followed by \"var\" or \"def\" or \"final\" or " +"\"const\"" msgstr "" -"E1368: Static muss von \"var\" oder \"def\" oder \"final\" oder \"const\"" -"gefolgt werden" +"E1368: Static muss von \"var\" oder \"def\" oder \"final\" oder " +"\"const\"gefolgt werden" #, c-format msgid "E1369: Duplicate variable: %s" @@ -8868,11 +8945,11 @@ msgstr "E1385: Klassenmethode \"%s\" nur durch Klasse \"%s\" zug msgid "E1386: Object method \"%s\" accessible only using class \"%s\" object" msgstr "E1386: Objektmethode \"%s\" nur durch Klassenobjekt \"%s\" zug�nglich" -msgid "E1387: Public variable not supported in an interface" -msgstr "E1387: Public variable in einem Interface nicht unterst�tzt" +msgid "E1387: public variable not supported in an interface" +msgstr "E1387: public Variable in einem Interface nicht unterst�tzt" -msgid "E1388: Public keyword not supported for a method" -msgstr "E1388: Public Schl�sselwort f�r eine Methode nicht unterst�tzt" +msgid "E1388: public keyword not supported for a method" +msgstr "E1388: public Schl�sselwort f�r eine Methode nicht unterst�tzt" msgid "E1389: Missing name after implements" msgstr "E1389: Fehlender Name nach implements" @@ -8903,9 +8980,8 @@ msgstr "E1393: Type kann nur in Vim9 Script verwendet werden" msgid "E1394: Type name must start with an uppercase letter: %s" msgstr "E1394: Typname muss mit einen Gro�buchstaben anfangen: %s" -#, c-format -msgid "E1395: Type alias \"%s\" cannot be modified" -msgstr "E1395: Typ Alias \"%s\" kann nicht ver�ndert werden" +msgid "E1395: Using a null class" +msgstr "E1395: Verwenden einer Null-Klasse" #, c-format msgid "E1396: Type alias \"%s\" already exists" @@ -8920,18 +8996,6 @@ msgstr "E1398: Fehlender Typ Alias Typ" msgid "E1399: Type can only be used in a script" msgstr "E1399: Typ kann nur in einem Script verwendet werden" -#, c-format -msgid "E1400: Using type alias \"%s\" as a Number" -msgstr "E1400: Typ Alias \"%s\" als Zahl verwendet" - -#, c-format -msgid "E1401: Using type alias \"%s\" as a Float" -msgstr "E1401: Typ Alias \"%s\" als Float verwendet" - -#, c-format -msgid "E1402: Using type alias \"%s\" as a String" -msgstr "E1402: Typ Alias \"%s\" als Zeichenkette verwendet" - #, c-format msgid "E1403: Type alias \"%s\" cannot be used as a value" msgstr "E1403: Typ Alias \"%s\" kann nicht als Wert verwendet werden" @@ -8943,9 +9007,6 @@ msgstr "E1404: Abstract kann nicht in einem Interface verwendet werden" msgid "E1405: Class \"%s\" cannot be used as a value" msgstr "E1405: Klasse \"%s\" kann nicht als Wert verwendet werden" -msgid "E1406: Cannot use a Class as a variable or value" -msgstr "E1406: Kann Klasse nicht als Variable oder Wert verwenden" - msgid "E1407: Cannot use a Typealias as a variable or value" msgstr "E1407: Kann Typenalias nicht as Variable oder Wert verwenden" @@ -8954,7 +9015,8 @@ msgstr "E1408: Final variable in einem Interface nicht unterst #, c-format msgid "E1409: Cannot change read-only variable \"%s\" in class \"%s\"" -msgstr "E1409: Kann eine read-only Variable \"%s\" in Klasse \"%s\" nicht ver�ndern" +msgstr "" +"E1409: Kann eine read-only Variable \"%s\" in Klasse \"%s\" nicht ver�ndern" msgid "E1410: Const variable not supported in an interface" msgstr "E1410: Const Variable in einem Interface nicht unterst�tzt" @@ -8963,11 +9025,88 @@ msgstr "E1410: Const Variable in einem Interface nicht unterst msgid "E1411: Missing dot after object \"%s\"" msgstr "E1411: Fehlender Punkt nach Object \"%s\"" +#, c-format +msgid "E1412: Builtin object method \"%s\" not supported" +msgstr "E1412: Builtin Objektmethode \"%s\" nicht unterst�tzt" + +msgid "E1413: Builtin class method not supported" +msgstr "E1413: Builtin Klassenmethode nicht unterst�tzt" + +msgid "E1414: Enum can only be defined in Vim9 script" +msgstr "E1414: Enum kann nur in Vim9-Script definiert werden" + +#, c-format +msgid "E1415: Enum name must start with an uppercase letter: %s" +msgstr "E1415: Enum muss mit einen Gro�buchstaben anfangen: %s" + +msgid "E1416: Enum cannot extend a class or enum" +msgstr "E1416: Enum kann Klasse oder Enum nicht erweitern" + +msgid "E1417: Abstract cannot be used in an Enum" +msgstr "E1417: Abstract kann nicht in einem Enum verwendet werden" + +#, c-format +msgid "E1418: Invalid enum value declaration: %s" +msgstr "E1418: Ung�ltige Enum-Variablen-Deklaration: %s" + +#, c-format +msgid "E1419: Not a valid command in an Enum: %s" +msgstr "E1419: Ung�ltiger Befehl in Enum: %s" + +msgid "E1420: Missing :endenum" +msgstr "E1420: Fehlendes :endenum" + +#, c-format +msgid "E1421: Enum \"%s\" cannot be used as a value" +msgstr "E1421: Enum \"%s\" kann nicht als Wert verwendet werden" + +#, c-format +msgid "E1422: Enum value \"%s\" not found in enum \"%s\"" +msgstr "E1422: Enum-Wert \"%s\" nicht in Enum gefunden \"%s\"" + +#, c-format +msgid "E1423: Enum value \"%s.%s\" cannot be modified" +msgstr "E1423: Enum-Wert \"%s.%s\" kann nicht ver�ndert werden" + +#, c-format +msgid "E1424: Using an Enum \"%s\" as a Number" +msgstr "E1424: Enum \"%s\" als Zahl verwendet" + +#, c-format +msgid "E1425: Using an Enum \"%s\" as a String" +msgstr "E1425: Enum \"%s\" als Zeichenkette verwendet" + +#, c-format +msgid "E1426: Enum \"%s\" ordinal value cannot be modified" +msgstr "E1426: Enum \"%s\" Wert kann nicht ver�ndert werden" + +#, c-format +msgid "E1427: Enum \"%s\" name cannot be modified" +msgstr "E1427: Enum \"%s\" kann nicht ver�ndert werden" + +#, c-format +msgid "E1428: Duplicate enum value: %s" +msgstr "E1428: Doppelter Enum-Wert: %s" + +msgid "E1429: Class can only be used in a script" +msgstr "E1429: Klasse kann nur in einem Script verwendet werden" + +#, c-format +msgid "E1430: Uninitialized object variable '%s' referenced" +msgstr "E1430: Nicht initialisierte Objekt-Variable '%s' referenziert" + +#, c-format +msgid "" +"E1431: Abstract method \"%s\" in class \"%s\" cannot be accessed directly" +msgstr "" +"E1431: Abstrakte Methode \"%s\" in Klasse \"%s\" kann nicht direkt " +"aufgerufen werden" + #, c-format msgid "E1500: Cannot mix positional and non-positional arguments: %s" msgstr "" -"E1500: positionsbezogene und nicht-positionsbezogene Argumente k�nnen " -"nichtgemischt werden: %s" +"E1500: positionsbezogene und nicht-positionsbezogene Argumente k�nnen nicht " +"gemischt werden: %s" #, c-format msgid "E1501: format argument %d unused in $-style format: %s" @@ -9013,6 +9152,153 @@ msgstr "" msgid "E1510: Value too large: %s" msgstr "E1510: Wert zu gro�: %s" +#, c-format +msgid "E1511: Wrong number of characters for field \"%s\"" +msgstr "E1511: Unzul�ssige Zeichenanzahl f�r Feld \"%s\"" + +#, c-format +msgid "E1512: Wrong character width for field \"%s\"" +msgstr "E1512: Ung�ltige Zeichenbreite f�r Feld \"%s\"" + +msgid "E1513: Cannot switch buffer. 'winfixbuf' is enabled" +msgstr "E1513: Kann Buffer nicht wechseln, 'winfixbuf' ist aktiviert" + +msgid "E1514: 'findfunc' did not return a List type" +msgstr "E1514: 'findfunc' hat keinen Listentyp zur�ckgegeben" + +#, c-format +msgid "E1515: Unable to convert from '%s' encoding" +msgstr "E1515: Konvertierung von '%s'-Kodierung nicht m�glich" + +#, c-format +msgid "E1516: Unable to convert to '%s' encoding" +msgstr "E1516: Konvertierung nach '%s'-Kodierung nicht m�glich" + +msgid "E1517: Can only compare Tuple with Tuple" +msgstr "E1517: Kann nur Tuple mit Tuple vergleichen" + +msgid "E1518: Invalid operation for Tuple" +msgstr "E1518: Ung�ltige Operation f�r Tuple" + +#, c-format +msgid "E1519: Tuple index out of range: %ld" +msgstr "E1519: Tuple-Index au�erhalb des Bereichs: %ld" + +msgid "E1520: Using a Tuple as a Number" +msgstr "E1520: Tuple als Zahl verwendet" + +msgid "E1521: Using a Tuple as a Float" +msgstr "E1521: Tuple als Float verwendet" + +msgid "E1522: Using a Tuple as a String" +msgstr "E1522: Tuple als Zeichenkette verwendet" + +msgid "E1523: String, List, Tuple or Blob required" +msgstr "E1523: Zeichenkette, Liste, Tuple oder Blob erforderlich" + +#, c-format +msgid "E1524: Cannot use a tuple with function %s" +msgstr "E1524: Kann Tuple nicht mit Funktion %s verwenden" + +#, c-format +msgid "E1525: Argument of %s must be a List, Tuple, String, Dictionary or Blob" +msgstr "" +"E1525: Argument von %s muss eine Liste, Tuple, Zeichenkette, Dictionary oder " +"Blob sein" + +#, c-format +msgid "E1526: Missing end of Tuple ')': %s" +msgstr "E1526: Fehlendes Ende des Tuples ')': %s" + +#, c-format +msgid "E1527: Missing comma in Tuple: %s" +msgstr "E1527: Fehlendes Komma in Tuple: %s" + +#, c-format +msgid "E1528: List or Tuple or Blob required for argument %d" +msgstr "E1528: Liste, Tuple oder Blob erforderlich als Argument %d" + +#, c-format +msgid "E1529: List or Tuple required for argument %d" +msgstr "E1529: Liste oder Tuple erforderlich als Argument %d" + +#, c-format +msgid "E1530: List or Tuple or Dictionary required for argument %d" +msgstr "E1530: Liste, Tuple oder Dictionary erforderlich als Argument %d" + +#, c-format +msgid "E1531: Argument of %s must be a List, Tuple, Dictionary or Blob" +msgstr "" +"E1531: Argument von %s muss eine Liste, Tuple, Dictionary oder Blob sein" + +msgid "E1532: Cannot modify a tuple" +msgstr "E1532: Kann Tuple nicht �ndern" + +msgid "E1533: Cannot slice a tuple" +msgstr "E1533: Auf ein Tuple kann kein Slice angewendet werden" + +#, c-format +msgid "E1534: Tuple required for argument %d" +msgstr "E1534: Tuple erforderlich als Argument %d" + +msgid "E1535: List or Tuple required" +msgstr "E1535: Liste oder Tuple erforderlich" + +# TODO: Capitalise first word of message? +msgid "E1536: Tuple required" +msgstr "E1536: Tuple ben�tigt" + +msgid "E1537: Less targets than Tuple items" +msgstr "E1537: Weniger Ziele als Eintr�ge im Tuple" + +msgid "E1538: More targets than Tuple items" +msgstr "E1538: Mehr Ziele als Eintr�ge im Tuple" + +#, c-format +msgid "E1539: Variadic tuple must end with a list type: %s" +msgstr "E1539: Ein variadisches Tuple muss mit einem Listentyp enden: %s" + +msgid "E1540: Cannot use a variadic tuple in concatenation" +msgstr "E1540: Kann variadisches Tuple nicht f�r Verkettung verwenden" + +msgid "E1541: Value too large, max Unicode codepoint is U+10FFFF" +msgstr "E1541: Wert zu gro�, maximale Unicode-Codepunkt ist U+10FFFF" + +msgid "E1542: Cannot have a negative or zero number of quickfix/location lists" +msgstr "" +"E1542: Die Anzahl der Quickfix-/Positionslisten darf nicht negativ oder null " +"sein" + +msgid "E1543: Cannot have more than a hundred quickfix/location lists" +msgstr "" +"E1543: Die Anzahl der Quickfix-/Positionslisten darf nicht gr��er als 100 " +"sein" + +msgid "E1544: Failed resizing the quickfix/location list stack" +msgstr "" +"E1544: Verg��ern/Verkleinern der Quickfix-/Positionslisten fehlgeschlagen" + +msgid "E1545: Quickfix list stack unavailable" +msgstr "E1545: Quickfixlisten Stack nicht verf�gbar" + +msgid "E1546: Cannot switch to a closing buffer" +msgstr "E1546: Kann nicht zu einem zu schlie�enden Buffer wechseln" + +msgid "E1547: This version of Vim does support :redrawtabpanel" +msgstr "E1547: Diese Version von Vim unterst�tzt nicht :redrawtabpanel" + +msgid "E1548: Wayland connection is unavailable" +msgstr "E1548: Wayland Verbindung nicht verf�gbar" + +msgid "E1549: Cannot have more than %d diff anchors" +msgstr "E1549: Mehr als %d Diff-Anker sind nicht zul�ssig" + +msgid "E1550: Failed to find all diff anchors" +msgstr "E1550: Nicht alle Diff-Anker konnten gefunden werden" + +msgid "E1551: Cannot open a popup window to a closing buffer" +msgstr "E1551: Kann kein Popup Fenster f�r einen zu schlie�enden Buffer �ffnen" + msgid "--No lines in buffer--" msgstr "--Keine Zeilen im Buffer--" @@ -9195,6 +9481,18 @@ msgstr "kann vim.List Attribute nicht l msgid "cannot modify fixed list" msgstr "kann feste Liste nicht modifizieren" +msgid "tuple constructor does not accept keyword arguments" +msgstr "Tuple Konstruktor akzeptiert keine Keyword Argumente" + +msgid "tuple index out of range" +msgstr "Tuple-Index au�erhalb des g�ltigen Bereichs" + +msgid "cannot delete vim.Tuple attributes" +msgstr "kann vim.Tuple Attribute nicht l�schen" + +msgid "cannot modify fixed tuple" +msgstr "festes Tuple kann nicht ver�ndert werden" + #, c-format msgid "unnamed function %s does not exist" msgstr "Unbenannte Funktion %s existiert nicht" @@ -9493,6 +9791,9 @@ msgstr "Gro msgid "override 'ignorecase' when pattern has upper case characters" msgstr "'ignorecase' Option aufheben, wenn Muster mit Gro�buchstaben beginnt" +msgid "maximum number for the search count feature" +msgstr "Maximalwert der Suchanzahl" + msgid "what method to use for changing case of letters" msgstr "" "Welche Methode verwendet werden soll zum �ndern von Gro�-/Kleinbuchstaben" @@ -9605,8 +9906,12 @@ msgstr "" "passt\n" "f�ge \"uhex\" hinzu um nicht druckbare Zeichen als Hex-Wert anzuzeigen" -msgid "characters to use for the status line, folds and filler lines" -msgstr "zu verwendende Zeichen f�r die Statuszeile, Folds und F�llzeilen" +msgid "" +"characters to use for the status line, folds, diffs, buffer text, filler " +"lines and truncation in the completion menu" +msgstr "" +"zu verwendende Zeichen f�r die Statuszeile, Folds, Diffs Buffertext, " +"F�llzeilen und Truncation-Zeichen im Completion Men�" msgid "number of lines used for the command-line" msgstr "Anzahl zu verwendender Zeilen f�r die Kommandozeile" @@ -9648,6 +9953,12 @@ msgstr "relative Zeilennummerierung anzeigen" msgid "number of columns to use for the line number" msgstr "zu verwendede Spaltenanzahl f�r die Zeilennummerierung" +msgid "maximum number of quickfix lists that can be stored in history" +msgstr "maximale Anzahl an Quickfixlisten, die vorgehalten werden k�nnen" + +msgid "maximum number of location lists that can be stored in history" +msgstr "maximale Anzahl an Positionslisten, die vorgehalten werden k�nnen" + msgid "controls whether concealable text is hidden" msgstr "ob verdeckter Text anzuzeigen ist" @@ -9741,6 +10052,9 @@ msgstr "minimal zu verwendende Zeilenanzahl f msgid "minimal number of lines used for any window" msgstr "minmal zu verwendende Zeilenanzahl f�r alle Fenster" +msgid "keep window focused on a single buffer" +msgstr "Fenster auf einen einzelnen Buffer fokussiert halten" + msgid "keep the height of the window" msgstr "aktuelle Gr��e des Fenster beibehalten" @@ -9819,6 +10133,9 @@ msgstr "mehrere Tab Seiten" msgid "0, 1 or 2; when to use a tab pages line" msgstr "0, 1, oder 2; wann eine Tabseitenzeile verwendet wird" +msgid "behaviour when closing tab pages: left, uselast or empty" +msgstr "Verhalten wenn Tabpage geschlossen wird: left, uselast oder empty" + msgid "maximum number of tab pages to open for -p and \"tab all\"" msgstr "maximale Anzahl an zu �ffnenden Tabseiten (f�r -p und \"tab all\")" @@ -10029,6 +10346,9 @@ msgstr "f msgid "list of flags to make messages shorter" msgstr "Liste an Flags um Meldungen k�rzer auszugeben" +msgid "options for outputting messages" +msgstr "Optionen f�r die Ausgabe von Benachrichtigungen" + msgid "show (partial) command keys in location given by 'showcmdloc'" msgstr "" "zeige (teilweise) Befehlstasten an dem mit 'showcmdloc' angegebenen Ort" @@ -10095,6 +10415,20 @@ msgstr "" "\"unnamed\" nutzt das * Register wie das unbenannte Register\n" "\"autoselect\" ausgew�hlten Text automatisch in der Zwischenablage speichern" +msgid "Ordered list of possible methods for accessing the clipboard" +msgstr "Sortierte Liste m�glicher Methoden zum Zugriff auf die Zwischenablage" + +msgid "Timeout to use when polling for data to read or write in wayland" +msgstr "Timeout beim Zugriff auf Wayland" + +msgid "Wayland seat to use" +msgstr "zu verwendender Wayland-Seat (Sitz)" + +msgid "" +"Enable wayland focus stealing functionality in order to access the clipboard" +msgstr "" +"Aktiviere die Wayland-Fokus-Steal-Funktionalit�t, um auf die Zwischenablage zuzugreifen" + msgid "\"startsel\" and/or \"stopsel\"; what special keys can do" msgstr "\"startsel\" und/oder \"stopsel\"; was bestimmte Tasten machen" @@ -10148,10 +10482,16 @@ msgstr "" "legt fest, wie Vervollst�ndigen im Einf�ge-Modus mit CTRL-N und CTRL-P " "funktioniert" +msgid "use fuzzy collection for specific completion modes" +msgstr "Fuzzy-Sammlung f�r spezifische Vervollst�ndigungsmodi verwenden" + msgid "whether to use a popup menu for Insert mode completion" msgstr "" "ob ein Popup-Men� bei der Verfollst�ndigen im Einf�ge-Modus genutzt wird" +msgid "popup menu item align order" +msgstr "Ausrichtungsreihenfolge im Popup-Men�" + msgid "options for the Insert mode completion info popup" msgstr "Optionen f�r das Popup bei der Einf�ge-Modus Vervollst�ndigung" @@ -10161,6 +10501,9 @@ msgstr "maximale H msgid "minimum width of the popup menu" msgstr "minimale Breite des Popup-Men�s" +msgid "maximum width of the popup menu" +msgstr "maximale Breite des Popup-Men�s" + msgid "user defined function for Insert mode completion" msgstr "benutzerdefinierte Funktion f�r Vervollst�ndigung im Einf�ge-Modus" @@ -10342,6 +10685,9 @@ msgstr "Optionen f msgid "expression used to obtain a diff file" msgstr "Ausdr�cke um einen Diff zu erhalten" +msgid "list of addresses for anchoring a diff" +msgstr "Liste an Adressen zum Verankern des Diffs" + msgid "expression used to patch a file" msgstr "verwendeter Ausdruck um einen Datei zu patchen" @@ -10609,6 +10955,9 @@ msgstr "spezifiziert Zeichen in einem Dateinamen" msgid "specifies the characters in an identifier" msgstr "spezifiziert Zeichen in einer Kennung (identifier)" +msgid "defines trigger strings for complete_match()" +msgstr "definiert Trigger Zeichenketten f�r complete_match()" + msgid "specifies the characters in a keyword" msgstr "spezifiziert Zeichen in einem Keyword" @@ -10728,6 +11077,10 @@ msgstr "" msgid "list of autocommand events which are to be ignored" msgstr "Liste von zu ignorierenden Autokommando Ereignisse" +msgid "list of autocommand events which are to be ignored in a window" +msgstr "" +"Liste von zu ignorierenden Autokommando Ereignisse innerhalb eines Fensters" + msgid "load plugin scripts when starting up" msgstr "Lade Plugins beim Start" @@ -10820,6 +11173,15 @@ msgstr "Name der dynamischen MzScheme Bibliothek" msgid "name of the MzScheme GC dynamic library" msgstr "Name der dynamischen MzScheme GC Bibliothek" +msgid "0, 1 or 2; when to use the tabpanel" +msgstr "0, 1, oder 2; wann das Tabpanel angezeigt wird" + +msgid "custom tab pages in tabpanel" +msgstr "benutzerdefinierte Tabpages im Tabpanel" + +msgid "options for using tabpanel" +msgstr "Optionen f�r das Tabpanel" + msgid "You discovered the command-line window! You can close it with \":q\"." msgstr "" "Sie haben das Befehlszeilenfenster entdeckt! Schlie�en Sie es mit \":q\"." diff --git a/src/po/am.po b/src/po/hy.po similarity index 97% rename from src/po/am.po rename to src/po/hy.po index cefabd3a9c..bf6d225b46 100644 --- a/src/po/am.po +++ b/src/po/hy.po @@ -1,11087 +1,11087 @@ -# Armenian translation for Vim vim:set foldmethod=marker: -# -# Do ":help uganda" in Vim to read copying and usage conditions. -# Do ":help credits" in Vim to see a list of people who contributed. -# -# Gagik Hakobyan 2015 -# option - կարգանշան -# unload - բեռնաթափել -# load - բեռնել -# loop - շրջակցում -# prefix - նախածանց -# nested - ներդրված -# flag - դրոշմանիշ -# compound - պարփակ -# region - -# include - կցաֆայլ -# cluster - hամակարգ -# highlight - գունանշում -# attribute - բնորոշիչ -# garbage - աղբ -# shell - terminal -# combine - միավորում -# search - որոնում -# patch - նմանակում -# extra - հավելյալ -# feature - հատկություն -# ignore - անտեսել -# replace - փոխարինում -# pattern - նմուշ -# delimiter - բաժանիչ -# equal - համարժեք -# settings - կարգաբերում -# duplicate - կրկնակի -# find - -# found - հայտնաբերված -# support - աջակցում -# class - դաս -# fold - փաթաթ -# soundfold - ձայնափաթաթ -# swap - -# menu - -# undo - չեղարկում -# overwrite - -# skipp - -# owner - -# failed - -# list -# match - համընկնում -# autocommand - -# case - depq, -# fatal - օրհասական -# mark - նշակ -# key - banali -# character - ?? -# demage - վնասված -# abort -# event - -# read-only -# option -# preview - Նախադիտում -# spell - ուղղագրում -# directory - թղթապանակ -msgid "" -msgstr "" -"Project-Id-Version: vim_9.1_am\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-09-24 21:58+0300\n" -"PO-Revision-Date: 2024-10-11 11:18+0000\n" -"Last-Translator: Gagik Hakobyan \n" -"Language-Team: Armenian\n" -"Language: hy\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Loco-Source-Locale: en_AM\n" -"X-Generator: Loco https://localise.biz/\n" -"X-Poedit-KeywordsList: փաթաթ;միջակայք\n" -"X-Loco-Parser: loco_parse_po" - -msgid "ERROR: " -msgstr "ՍԽԱԼ: " - -#, c-format -msgid "--Deleted--" -msgstr "--Ջնջված է--" - -#, c-format -msgid "auto-removing autocommand: %s " -msgstr "ինքնա֊ջնջող ինքնահրաման: %s <բուֆեր=%d>" - -msgid "W19: Deleting augroup that is still in use" -msgstr "W19: Օգտագործվող ինքնախմբի ջնջում" - -#, c-format -msgid "No matching autocommands: %s" -msgstr "Չկան համապատասխան ինքնահրամաններ: %s" - -#, c-format -msgid "%s Autocommands for \"%s\"" -msgstr "%s Ինքնահրամաններ \"%s\"-ի համար" - -#, c-format -msgid "Executing %s" -msgstr "Կատարվում է %s" - -#, c-format -msgid "autocommand %s" -msgstr "ինքնահրաման %s" - -msgid "add() argument" -msgstr "add() արգումենտ" - -msgid "insert() argument" -msgstr "insert() արգումենտ" - -msgid "[Location List]" -msgstr "[Տեղորոշման ցանկ]" - -msgid "[Quickfix List]" -msgstr "[Արագ կարգավորման ցանկ]" - -#, c-format -msgid "%d buffer unloaded" -msgid_plural "%d buffers unloaded" -msgstr[0] "%d բուֆեր բեռնաթափվել է" -msgstr[1] "%d բուֆերներ բեռնաթափվել են" - -#, c-format -msgid "%d buffer deleted" -msgid_plural "%d buffers deleted" -msgstr[0] "%d բուֆեր ջնջվել է" -msgstr[1] "%d բուֆերներ ջնջվել են" - -#, c-format -msgid "%d buffer wiped out" -msgid_plural "%d buffers wiped out" -msgstr[0] "%d բուֆեր մաքրվել է" -msgstr[1] "%d բուֆերներ մաքրվել են" - -msgid "W14: Warning: List of file names overflow" -msgstr "W14: Զգուշացում: ֆայլերի ցանկը հատել է սահմանաչափը" - -#, c-format -msgid "line %ld" -msgstr "տող %ld" - -msgid " [Modified]" -msgstr " [Փոփոխված]" - -msgid "[Not edited]" -msgstr "[Չխմբագրված]" - -msgid "[Read errors]" -msgstr "[Կարդալու սխալներ]" - -msgid "[RO]" -msgstr "[ՄԿ]" - -msgid "[readonly]" -msgstr "[Միայն կարդալու համար]" - -#, c-format -msgid "%ld line --%d%%--" -msgid_plural "%ld lines --%d%%--" -msgstr[0] "%ld տող --%d%%--" -msgstr[1] "%ld տողեր --%d%%--" - -#, c-format -msgid "line %ld of %ld --%d%%-- col " -msgstr "տող. %ld - %ld --%d%%-- քան. " - -msgid "[No Name]" -msgstr "[Անանուն]" - -msgid "help" -msgstr "օգնություն" - -msgid "[Help]" -msgstr "[օգնություն]" - -msgid "[Preview]" -msgstr "[Նախադիտում]" - -msgid "All" -msgstr "Ամբողջը" - -msgid "Bot" -msgstr "Ներքևում" - -msgid "Top" -msgstr "Վերևում" - -#, c-format -msgid "%d%%" -msgstr "%d%%" - -#, c-format -msgid " (%d of %d)" -msgstr " (%d %d-ից)" - -#, c-format -msgid " ((%d) of %d)" -msgstr " ((%d) %d-ից)" - -#, c-format -msgid " (file %d of %d)" -msgstr " (Ֆայլ %d %d-ից)" - -#, c-format -msgid " (file (%d) of %d)" -msgstr " (Ֆայլ (%d) %d-ից)" - -msgid "[Command Line]" -msgstr "[Հրամանյին տող]" - -msgid "[Prompt]" -msgstr "[Հուշում]" - -msgid "[Popup]" -msgstr "[Սահապատ]" - -msgid "[Scratch]" -msgstr "[Ժամանակավոր]" - -msgid "WARNING: The file has been changed since reading it!!!" -msgstr "Զգուշացում: ֆայլը փոփոխվել է դեռ չկարդացված !!!" - -msgid "Do you really want to write to it" -msgstr "Իրո՞ք ուզում եք գրել" - -msgid "[New]" -msgstr "[Նոր]" - -msgid "[New File]" -msgstr "[Նոր ֆայլ]" - -msgid " CONVERSION ERROR" -msgstr " ՓՈԽԱԿԵՐՊՄԱՆ ՍԽԱԼ" - -#, c-format -msgid " in line %ld;" -msgstr " %ld տողում;" - -msgid "[NOT converted]" -msgstr "[ՉԻ փոխակերպվել]" - -msgid "[converted]" -msgstr "[փոխակերպվել է]" - -msgid "[Device]" -msgstr "[Սարք]" - -msgid " [a]" -msgstr " [a]" - -msgid " appended" -msgstr " կից" - -msgid " [w]" -msgstr " [w]" - -msgid " written" -msgstr " ամրագրված է" - -msgid "" -"\n" -"WARNING: Original file may be lost or damaged\n" -msgstr "" -"\n" -"Զգուշացում: նախնական ֆայլը հնարավոր է վնասված է\n" - -msgid "don't quit the editor until the file is successfully written!" -msgstr "մի փակեք խմբագիրը քանի դեռ ֆայլը հաջողությամբ կգրվի!" - -msgid "W10: Warning: Changing a readonly file" -msgstr "W10: Զգուշացում: Փոփոխվում է կարդալու թուլտվությամբ ֆայլ" - -msgid "No display" -msgstr "Էկրան չկա" - -msgid "" -": Send failed.\n" -msgstr "" -": Հնարավոր չեղավ ուղարկել.\n" - -msgid "" -": Send failed. Trying to execute locally\n" -msgstr "" -": Հնարավոր չեղավ ուղարկել. Լոկալ կատարման փորձ\n" - -#, c-format -msgid "%d of %d edited" -msgstr "%d֊ը %d֊ից խմբագրվել է" - -msgid "" -"No display: Send expression failed.\n" -msgstr "" -"Էկրան չկա: Հնարավոր չեղավ ուղարկել արտահայտությունը.\n" - -msgid "" -": Send expression failed.\n" -msgstr "" -": Հնարավոր չեղավ ուղարկել արտահայտությունը.\n" - -msgid "Used CUT_BUFFER0 instead of empty selection" -msgstr "Օգտագործվել է CUT_BUFFER0 դատարկ ընտրության փոխարեն" - -msgid "tagname" -msgstr "պիտակի անուն" - -msgid "" -" kind file\n" -msgstr "" -" ֆայլի տիպ\n" - -msgid "'history' option is zero" -msgstr "'history' կարգանշանը դատարկ է" - -msgid "Warning: Using a weak encryption method; see :help 'cm'" -msgstr "Զգուշացում։ Օգտագործվում է թույլ կոդավորման մեթոդ, տես․ :help 'cm'" - -msgid "Note: Encryption of swapfile not supported, disabling swap file" -msgstr "" -"Նշում․ փոխանակման ֆայլի կոդավորումը չի աջակցվում, ապաակտիվացվում է " -"փոխանակման ֆայլը" - -msgid "Enter encryption key: " -msgstr "Կոդավորման համար մուտթագրեք գաղտնաբառը: " - -msgid "Enter same key again: " -msgstr "Կրկնեք գաղտնաբառը: " - -msgid "Keys don't match!" -msgstr "Բանալիները տարբեր են!" - -msgid "[crypted]" -msgstr "[կոդավորված]" - -#, c-format -msgid "xchacha20v2: using custom opslimit \"%llu\" for Key derivation." -msgstr "" -"xchacha20v2: օգտագործելով \"%llu\" մաքսային սահմանաչափը բանալիների ածանցման " -"համար:" - -#, c-format -msgid "xchacha20v2: using default opslimit \"%llu\" for Key derivation." -msgstr "" -"xchacha20v2: օգտագործելով լռելյայն \"%llu\" opslimit բանալի ածանցման համար:" - -#, c-format -msgid "xchacha20v2: using custom memlimit \"%lu\" for Key derivation." -msgstr "" -"xchacha20v2: օգտագործելով հատուկ memlimit \"%lu\" հիմնական ածանցման համար:" - -#, c-format -msgid "xchacha20v2: using default memlimit \"%lu\" for Key derivation." -msgstr "" -"xchacha20v2: օգտագործելով լռելյայն memlimit \"%lu\" հիմնական ածանցման համար:" - -#, c-format -msgid "xchacha20v2: using custom algorithm \"%d\" for Key derivation." -msgstr "" -"xchacha20v2: օգտագործելով \"%d\" հատուկ ալգորիթմը բանալիների ածանցման համար:" - -#, c-format -msgid "xchacha20v2: using default algorithm \"%d\" for Key derivation." -msgstr "" -"xchacha20v2: օգտագործելով \"%d\" լռելյայն ալգորիթմը բանալիների ածանցման " -"համար:" - -msgid "Entering Debug mode. Type \"cont\" to continue." -msgstr "Մուտք կոդի զննման ռեժիմ. Շարունակելու համար կատարել \"cont\" հրամանը." - -#, c-format -msgid "Oldval = \"%s\"" -msgstr "Օլդվալ = \"%s\"" - -#, c-format -msgid "Newval = \"%s\"" -msgstr "Newval = \"%s\"" - -#, c-format -msgid "line %ld: %s" -msgstr "տող %ld: %s" - -#, c-format -msgid "cmd: %s" -msgstr "հրաման: %s" - -#| msgid "E726: Stride is zero" -msgid "frame is zero" -msgstr "շրջանակը զրո է" - -#, c-format -msgid "frame at highest level: %d" -msgstr "շրջանակ ամենաբարձր մակարդակում՝ %d" - -#, c-format -msgid "Breakpoint in \"%s%s\" line %ld" -msgstr "Վերադարձի կետը՝ \"%s%s\" տող %ld" - -msgid "No breakpoints defined" -msgstr "Վերադարձի կետեր չեն սահամանվել" - -#, c-format -msgid "%3d %s %s line %ld" -msgstr "%3d %s %s տող %ld" - -#, c-format -msgid "%3d expr %s" -msgstr "%3d expr %s" - -msgid "extend() argument" -msgstr "extend() արգումենտ" - -#, c-format -msgid "Not enough memory to use internal diff for buffer \"%s\"" -msgstr "" -"Հիշողությունը բավարար չէ \"%s\" բուֆերի համար ներքին տարբերություն " -"օգտագործելու համար" - -msgid "Patch file" -msgstr "Նմանակման ֆայլ" - -msgid "Custom" -msgstr "Հարմարեցված" - -msgid "Latin supplement" -msgstr "Լատինական հավելում" - -msgid "Greek and Coptic" -msgstr "Հունական և Ղպտիական" - -msgid "Cyrillic" -msgstr "Կիրիլիցա" - -msgid "Hebrew" -msgstr "Եբրայական" - -msgid "Arabic" -msgstr "Արաբական" - -msgid "Latin extended" -msgstr "Լատինական ընդարձակ" - -msgid "Greek extended" -msgstr "Հունարեն երկարաձգված" - -msgid "Punctuation" -msgstr "Կետադրական նշան" - -msgid "Super- and subscripts" -msgstr "Սուպեր- և բաժանորդներ" - -msgid "Currency" -msgstr "Արժույթ" - -msgid "Other" -msgstr "Այլ" - -msgid "Roman numbers" -msgstr "Հռոմեական թվեր" - -msgid "Arrows" -msgstr "Ռադիո" - -msgid "Mathematical operators" -msgstr "Մաթեմատիկական օպերատորներ" - -msgid "Technical" -msgstr "Տեխնիկական" - -msgid "Box drawing" -msgstr "Տուփի նկարչություն" - -msgid "Block elements" -msgstr "Արգելափակման տարրեր" - -msgid "Geometric shapes" -msgstr "Երկրաչափական պատկերներ" - -msgid "Symbols" -msgstr "Խորհրդանիշներ" - -msgid "Dingbats" -msgstr "Դինգբատներ" - -msgid "CJK symbols and punctuation" -msgstr "CJK նշաններ և կետադրական նշաններ" - -msgid "Hiragana" -msgstr "Հիրագանա" - -msgid "Katakana" -msgstr "Կատականա" - -msgid "Bopomofo" -msgstr "Բոպոմոֆո" - -msgid "" -"\n" -"\tLast set from " -msgstr "" -"\n" -"\tՎերջին փոփոխումը " - -msgid "&Ok" -msgstr "&Լավ" - -msgid "" -"&OK\n" -"&Cancel" -msgstr "" -"&Լավ\n" -"&Չեղարկել" - -msgid "called inputrestore() more often than inputsave()" -msgstr "inputrestore() կանչվել է ավելի շատ քան inputsave() ֆունկցիան" - -#, c-format -msgid "<%s>%s%s %d, Hex %02x, Oct %03o, Digr %s" -msgstr "<%s>%s%s %d, Hex %02x, Oct %03o, Digr %s" - -#, c-format -msgid "<%s>%s%s %d, Hex %02x, Octal %03o" -msgstr "<%s>%s%s %d, Hexa %02x, Octal %03o" - -#, c-format -msgid "> %d, Hex %04x, Oct %o, Digr %s" -msgstr "> %d, Հեքս %04x, Հոկտ %o, Դիգ %s" - -#, c-format -msgid "> %d, Hex %08x, Oct %o, Digr %s" -msgstr "> %d, Հեքս %08x, Հոկտ %o, Դիգ %s" - -#, c-format -msgid "> %d, Hex %04x, Octal %o" -msgstr "> %d, Hexa %04x, Octal %o" - -#, c-format -msgid "> %d, Hex %08x, Octal %o" -msgstr "> %d, Hexa %08x, Octal %o" - -#, c-format -msgid "%ld line moved" -msgid_plural "%ld lines moved" -msgstr[0] "%ld տող տեղափոխվել է" -msgstr[1] "%ld տողեր տեղափոխվել են" - -#, c-format -msgid "%ld lines filtered" -msgstr "%ld տողեր ֆիլտրվել են" - -msgid "" -"[No write since last change]\n" -msgstr "" -"[Փոփոխությունները պահպանված չեն]\n" - -msgid "Save As" -msgstr "Պահպանել որպես" - -msgid "Write partial file?" -msgstr "Պահպանե՞լ մաս-մաս?" - -#, c-format -msgid "Overwrite existing file \"%s\"?" -msgstr "Վերագրում գոյություն ունեցող ֆայլում\"%s\"?" - -#, c-format -msgid "Swap file \"%s\" exists, overwrite anyway?" -msgstr "Սվեփ ֆայլը գոյություն ունի \"%s\", վերագրել?" - -#, c-format -msgid "" -"'readonly' option is set for \"%s\".\n" -"Do you wish to write anyway?" -msgstr "" -"\"%s\"-ի համար 'readonly' կարգանշումը միացված է.\n" -"Պահպանել?" - -#, c-format -msgid "" -"File permissions of \"%s\" are read-only.\n" -"It may still be possible to write it.\n" -"Do you wish to try?" -msgstr "" -"\"%s\" ֆայլն ունի միայն կարդալու հնարավորություն.\n" -"Հնարավոր է, որ այն կարելի է ամրագրել.\n" -"Ու՞զում եք փորձել?" - -msgid "Edit File" -msgstr "Խմբագրել ֆայլը" - -#, c-format -msgid "replace with %s (y/n/a/q/l/^E/^Y)?" -msgstr "փոխարինել %s արժեքո՞վ (y/n/a/q/l/^E/^Y)" - -msgid "(Interrupted) " -msgstr "(Ընդհատված) " - -#, c-format -msgid "%ld match on %ld line" -msgid_plural "%ld matches on %ld line" -msgstr[0] "%ld համընկնում %ld տողում" -msgstr[1] "%ld համընկնումներ %ld տողում" - -#, c-format -msgid "%ld substitution on %ld line" -msgid_plural "%ld substitutions on %ld line" -msgstr[0] "%ld հատ փոխարինումներ %ld տողում" -msgstr[1] "%ld հատ փոխարինումներ %ld տողում" - -#, c-format -msgid "%ld match on %ld lines" -msgid_plural "%ld matches on %ld lines" -msgstr[0] "%ld համընկնում %ld տողերում" -msgstr[1] "%ld համընկնումներ %ld տողերում" - -#, c-format -msgid "%ld substitution on %ld lines" -msgid_plural "%ld substitutions on %ld lines" -msgstr[0] "%ld հատ փոխարինումներ %ld տեղերում" -msgstr[1] "%ld հատ փոխարինումներ %ld տեղերում" - -#, c-format -msgid "Pattern found in every line: %s" -msgstr "Ամեն տողում համապատասխանեցում է հայտնաբերվել: %s" - -#, c-format -msgid "Pattern not found: %s" -msgstr "Նմուշը չի հայտնաբերվել: %s" - -msgid "No old files" -msgstr "Չկան հին ֆայլեր" - -#, c-format -msgid "Save changes to \"%s\"?" -msgstr "Պահպանե՞լ փոփոխությունները \"%s\"?" - -msgid "Warning: Entered other buffer unexpectedly (check autocommands)" -msgstr "" -"Զգուշացում: Անսպասելու անցում է կատարվել դեպի այլ բուֆեր (ստուգեք " -"ինքնահրամանննրը)" - -#, c-format -msgid "W20: Required python version 2.x not supported, ignoring file: %s" -msgstr "W20: Պահանջվող python 2.x տարբերակը չի աջակցվում՝ %s ֆայլն անտեսվում է" - -#, c-format -msgid "W21: Required python version 3.x not supported, ignoring file: %s" -msgstr "" -"W21: Պահանջվող python 3.x տարբերակը չի աջակցվում, անտեսում ենք %s ֆայլը" - -msgid "Entering Ex mode. Type \"visual\" to go to Normal mode." -msgstr "" -"Մուտք Կատարման ռեժիմ. Նորմալ ռեժիմ անցնելու համար կատարել \"visual\" հրամանը." - -#, c-format -msgid "Executing: %s" -msgstr "Կատարվում է։ %s" - -msgid "End of sourced file" -msgstr "Կցված ֆայլի վերջում" - -msgid "End of function" -msgstr "Ֆունկցիայի վերջը" - -msgid "Backwards range given, OK to swap" -msgstr "Տրված է հակադարձ միջակայք, անցնել սվեփ" - -#, c-format -msgid "%d more file to edit. Quit anyway?" -msgid_plural "%d more files to edit. Quit anyway?" -msgstr[0] "%d֊ից շատ խմբագրվող ֆայլեր. Վերջացնե՞լ?" -msgstr[1] "%d֊ից շատ խմբագրվող ֆայլեր. Վերջացնե՞լ?" - -msgid "unknown" -msgstr "անծանոթ" - -msgid "Greetings, Vim user!" -msgstr "Ողջույն Vim-ի օգտատեր!" - -msgid "Already only one tab page" -msgstr "Մնացել է միայն մեկ բացված թաբի էջ" - -msgid "Edit File in new tab page" -msgstr "Խմբագրել ֆայլը նոր թաբի էջում" - -msgid "Edit File in new window" -msgstr "Խմբագրել ֆայլը նոր պատուհանում" - -#, c-format -msgid "Tab page %d" -msgstr "Թաբ էջ %d" - -msgid "No swap file" -msgstr "Առանց սվեփ ֆայլ" - -msgid "Append File" -msgstr "Կցել ֆայլին" - -#, c-format -msgid "Window position: X %d, Y %d" -msgstr "Նոր պատուհան: X %d, Y %d" - -msgid "Save Redirection" -msgstr "ՈՒղղղորդման պահպանում" - -msgid "Untitled" -msgstr "Անանուն" - -#, c-format -msgid "Exception thrown: %s" -msgstr "Բացառում է նետվել: %s" - -#, c-format -msgid "Exception finished: %s" -msgstr "Բացառումը ավարտվել է: %s" - -#, c-format -msgid "Exception discarded: %s" -msgstr "Բացառումը անտեսվել է: %s" - -#, c-format -msgid "%s, line %ld" -msgstr "%s, տող %ld" - -#, c-format -msgid "Exception caught: %s" -msgstr "Բացառում է առաջացել: %s" - -#, c-format -msgid "%s made pending" -msgstr "%s սպասում է" - -#, c-format -msgid "%s resumed" -msgstr "%s բաց է թողնված" - -#, c-format -msgid "%s discarded" -msgstr "%s անտեսված է" - -msgid "Exception" -msgstr "Բացառման իրավիճակ" - -msgid "Error and interrupt" -msgstr "Սխալ և ընդհատում" - -msgid "Error" -msgstr "Սխալ" - -msgid "Interrupt" -msgstr "Ընդհատում" - -msgid "is a directory" -msgstr "թղթապանակ է" - -msgid "Illegal file name" -msgstr "Չթույլատրված ֆայլի անուն" - -msgid "is not a file" -msgstr "ֆայլ չէ" - -msgid "is a device (disabled with 'opendevice' option)" -msgstr "սարք է ('opendevice' կարգանշանն անջատված է)" - -msgid "[New DIRECTORY]" -msgstr "[Նոր ցանկ]" - -msgid "[File too big]" -msgstr "[ֆայլը շատ մեծ է]" - -msgid "[Permission Denied]" -msgstr "[Թույլատրված չէ]" - -msgid "" -"Vim: Reading from stdin...\n" -msgstr "" -"Vim: Ընթերցում ստանդարտ մուտքից...\n" - -msgid "Reading from stdin..." -msgstr "Ընթերցում ստանդարտ մուտքից..." - -msgid "[fifo]" -msgstr "[ֆիֆո]" - -msgid "[socket]" -msgstr "[վարդակ]" - -msgid "[character special]" -msgstr "[նշանին հատուկ]" - -msgid "[CR missing]" -msgstr "[Բացակայող CR]" - -msgid "[long lines split]" -msgstr "[երկար տողերի բաժանում]" - -#, c-format -msgid "[CONVERSION ERROR in line %ld]" -msgstr "[ՓՈԽԱԿԵՐՊՄԱՆ ՍԽԱԼ %ld տողում]" - -#, c-format -msgid "[ILLEGAL BYTE in line %ld]" -msgstr "[ԱՆԹՈՒՅԼԱՏՐԵԼԻ ԲԱՅԹ %ld տողում]" - -msgid "[READ ERRORS]" -msgstr "[ԿԱՐԴԱԼՈՒ ՍԽԱԼ]" - -msgid "Can't find temp file for conversion" -msgstr "Փոխակերպման Ժամանակավոր ֆայլը չի գտնվել" - -msgid "Conversion with 'charconvert' failed" -msgstr "Փոխակերպումն անհաջող է ավարտվել'charconvert'-ի հետ" - -msgid "can't read output of 'charconvert'" -msgstr "անհնար է ընթերցել 'charconvert'-ի ելքը" - -msgid "[dos]" -msgstr "[դոս]" - -msgid "[dos format]" -msgstr "[format dos]" - -msgid "[mac]" -msgstr "[mac]" - -msgid "[mac format]" -msgstr "[format mac]" - -msgid "[unix]" -msgstr "[յունիքս]" - -msgid "[unix format]" -msgstr "[format unix]" - -#, c-format -msgid "%ld line, " -msgid_plural "%ld lines, " -msgstr[0] "տող: %ld, " -msgstr[1] "տողեր: %ld, " - -#, c-format -msgid "%lld byte" -msgid_plural "%lld bytes" -msgstr[0] "%lld բայթ" -msgstr[1] "%lld բայթեր" - -msgid "[noeol]" -msgstr "[նոոլ]" - -msgid "[Incomplete last line]" -msgstr "[Չվերջացած վերջին տող]" - -#, c-format -msgid "" -"W12: Warning: File \"%s\" has changed and the buffer was changed in Vim as " -"well" -msgstr "W12: Զգուշացում: \"%s\" ֆայլն ու բուֆերը փոփոխվել են միմյանցից անկախ" - -msgid "See \":help W12\" for more info." -msgstr "Տես. \":help W12\" հավելյալ տեղեկատվության համար." - -#, c-format -msgid "W11: Warning: File \"%s\" has changed since editing started" -msgstr "W11: Զգուշացում: \"%s\" ֆայլը փոփոխվել է խմբագրման սկսվելու ժամանակ" - -msgid "See \":help W11\" for more info." -msgstr "Տես. \":help W11\" հավելյալ տեղեկատվությոան համար." - -#, c-format -msgid "W16: Warning: Mode of file \"%s\" has changed since editing started" -msgstr "" -"W16: Զգուշացում: \"%s\" ֆայլին դիմելու մոդը փոփոխվել է խմբագրման սկսվելու " -"ժամանակредактирования" - -msgid "See \":help W16\" for more info." -msgstr "Տես. \":help W16\" հավելյալ տեղեկատվության համար." - -#, c-format -msgid "W13: Warning: File \"%s\" has been created after editing started" -msgstr "W13: Զգուշացում: \"%s\" ֆայլը ստեղծել է խմբագրման սկսվելուց հետո" - -msgid "Warning" -msgstr "Զգուշացում" - -msgid "" -"&OK\n" -"&Load File\n" -"Load File &and Options" -msgstr "" -"&Լավ\n" -"&Բեռնել ֆայլը\n" -"Բեռնել ֆայլը և ընտրանքները" - -msgid "" -msgstr "<դատարկ>" - -msgid "writefile() first argument must be a List or a Blob" -msgstr "writefile()-ի առաջին պարամետրը պետք է լինի Cանկ" - -msgid "Select Directory dialog" -msgstr "Նշել թղթապանակը" - -msgid "Save File dialog" -msgstr "Ֆայլ պահպանելու դիալոգ" - -msgid "Open File dialog" -msgstr "Ֆայլ բացելու դիալոգ" - -msgid "no matches" -msgstr "չկան համընկնումներ" - -#, c-format -msgid "+--%3ld line folded " -msgid_plural "+--%3ld lines folded " -msgstr[0] "+--%3ld տող փաթաթվել է " -msgstr[1] "+--%3ld տողեր փաթաթվել են " - -#, c-format -msgid "+-%s%3ld line: " -msgid_plural "+-%s%3ld lines: " -msgstr[0] "+-%s%3ld տող: " -msgstr[1] "+-%s%3ld տողեր: " - -msgid "Not enough memory to set references, garbage collection aborted!" -msgstr "" -"Հիշողությունը բավարար չէ հղումներ սահմանելու համար, աղբահանությունն " -"ընդհատվել է!" - -msgid "No match at cursor, finding next" -msgstr "Կուրսորի դիրքում չկա համընկնում, հաջորդի որոնում" - -msgid "_Save" -msgstr "_Պահպանել" - -msgid "_Open" -msgstr "_Բացել" - -msgid "_Cancel" -msgstr "_Չեղարկել" - -msgid "_OK" -msgstr "_Այո" - -msgid "" -"&Yes\n" -"&No\n" -"&Cancel" -msgstr "" -"&Այո\n" -"&Ոչ\n" -"&Թողնել" - -msgid "OK" -msgstr "Այո" - -msgid "Yes" -msgstr "Այո" - -msgid "No" -msgstr "Ոչ" - -msgid "Cancel" -msgstr "Չեղարկել" - -msgid "Input _Methods" -msgstr "Զետեղման եղանակ" - -msgid "VIM - Search and Replace..." -msgstr "VIM - Որոնում և փոխարինում..." - -msgid "VIM - Search..." -msgstr "VIM - Որոնում..." - -msgid "Find what:" -msgstr "Ինչ փնտրել:" - -msgid "Replace with:" -msgstr "Փոխարինել:" - -msgid "Match whole word only" -msgstr "Համապատասխանեցնել միայն ամբողջ բառը" - -msgid "Match case" -msgstr "Համընկնման դեպք" - -msgid "Direction" -msgstr "Ուղղություն" - -msgid "Up" -msgstr "Վերև" - -msgid "Down" -msgstr "Ներքև" - -msgid "Find Next" -msgstr "Փնտրել հաջորդը" - -msgid "Replace" -msgstr "Փոխարինում" - -msgid "Replace All" -msgstr "Փոխարինել բոլորը" - -msgid "_Close" -msgstr "_Փակել" - -msgid "" -"Vim: Received \"die\" request from session manager\n" -msgstr "" -"Vim: Սեսսիայի զեկավարությունից ստացվել է մահվան պահանջ\n" - -msgid "Close tab" -msgstr "Փակել թաբը" - -msgid "New tab" -msgstr "Նոր թաբ" - -msgid "Open Tab..." -msgstr "Բացել թաբ..." - -msgid "" -"Vim: Main window unexpectedly destroyed\n" -msgstr "" -"Vim: Գլխավոր պատուհանն անսպասելի ավերվել է\n" - -msgid "&Filter" -msgstr "&Ֆիլտր" - -msgid "&Cancel" -msgstr "&Թողնել" - -msgid "Directories" -msgstr "Թղթապանակ" - -msgid "Filter" -msgstr "Ֆիլտր" - -msgid "&Help" -msgstr "&Օգնություն" - -msgid "Files" -msgstr "Ֆայլեր" - -msgid "&OK" -msgstr "&Այո" - -msgid "Selection" -msgstr "Նշել" - -msgid "Vim dialog" -msgstr "Vim դիալոգ" - -msgid "Find &Next" -msgstr "Փնտրել հաջորդը" - -msgid "&Replace" -msgstr "Փոխարինել" - -msgid "Replace &All" -msgstr "Փոխարինել &բոլորը" - -msgid "&Undo" -msgstr "Չեղարկել" - -msgid "Open tab..." -msgstr "Բացել թաբը..." - -msgid "Find string" -msgstr "Փնտրել տողը" - -msgid "Find & Replace" -msgstr "Փնտրել և Փոխարինել" - -msgid "Not Used" -msgstr "Օգտագործված չէ" - -msgid "" -"Directory\t*.nothing\n" -msgstr "" -"Թղթապանակ\t*.ոչինչ\n" - -#, c-format -msgid "Font0: %s" -msgstr "Ֆոնտ0: %s" - -#, c-format -msgid "Font%d: %s" -msgstr "Ֆոնտ%d: %s" - -#, c-format -msgid "Font%d width is not twice that of font0" -msgstr "Font%d-ի երկարությունը font0 ֆոնտի երկարության կրկնակին չէ" - -#, c-format -msgid "Font0 width: %d" -msgstr "Font0-ի երկարությունը: %d" - -#, c-format -msgid "Font%d width: %d" -msgstr "Font%d-ի երկարությունը: %d" - -msgid "Invalid font specification" -msgstr "Անվավեր տառատեսակ" - -msgid "&Dismiss" -msgstr "Թաքցնել" - -msgid "no specific match" -msgstr "հատուկ համընկնում չկա" - -msgid "Vim - Font Selector" -msgstr "Vim - տառատեսակի ընտրող" - -msgid "Name:" -msgstr "Անվանում:" - -msgid "Show size in Points" -msgstr "Ցուդադրել կետային չափը" - -msgid "Encoding:" -msgstr "Կոդավորում:" - -msgid "Font:" -msgstr "Տառատեսակ:" - -msgid "Style:" -msgstr "Ստիլ:" - -msgid "Size:" -msgstr "Չափ:" - -#, c-format -msgid "Page %d" -msgstr "Էջ %d" - -msgid "No text to be printed" -msgstr "Արտածվելիք տեքստ չկա" - -#, c-format -msgid "Printing page %d (%d%%)" -msgstr "Էջի տպագրում։ %d (%d%%)" - -#, c-format -msgid " Copy %d of %d" -msgstr " Պատճենել %d-ը %d֊ից" - -#, c-format -msgid "Printed: %s" -msgstr "Պատճենված: %s" - -msgid "Printing aborted" -msgstr "Պատճենումը ընդհատված է" - -msgid "Sending to printer..." -msgstr "Ուղարկվում է պատճենահանողին..." - -msgid "Print job sent." -msgstr "Պատճենման հրամանն ուղարկվել է." - -#, c-format -msgid "Sorry, help file \"%s\" not found" -msgstr "Ներողություն, '%s' օգնության էջը չի հայտնաբերվել" - -msgid "W18: Invalid character in group name" -msgstr "W18: Անվավեր նշան՝ խմբի անվանման մեջ" - -msgid "Add a new database" -msgstr "Ավելացնել նոր տվյալների բազա" - -msgid "Query for a pattern" -msgstr "Հարցում նմուշի համար" - -msgid "Show this message" -msgstr "Ցուցադրել այս հաղորդագրությունը" - -msgid "Kill a connection" -msgstr "Վթարել կապը" - -msgid "Reinit all connections" -msgstr "Վերանախապատրաստել կապերը" - -msgid "Show connections" -msgstr "Ցուցադրել կապերը" - -msgid "" -"This cscope command does not support splitting the window.\n" -msgstr "" -"Այս cscope հրամանը պատուհանի բաժանմանը չի աջակցում.\n" - -#, c-format -msgid "Added cscope database %s" -msgstr "Ավելացվել է %s cscope տվյալների բազան" - -msgid "cs_create_connection setpgid failed" -msgstr "cs_create_connection: setpgid֊ն հնարավոր չի եղել կատարել" - -msgid "cs_create_connection exec failed" -msgstr "cs_create_connection: exec֊ն հնարավոր չի եղել կատարել" - -msgid "cs_create_connection: fdopen for to_fp failed" -msgstr "cs_create_connection: fdopen֊ն հնարավոր չի կատարել to_fp֊ի համար" - -msgid "cs_create_connection: fdopen for fr_fp failed" -msgstr "cs_create_connection: հնարավոր չի կատարել fr_fp֊ի համար" - -msgid "" -"cscope commands:\n" -msgstr "" -"cscope հրամանները:\n" - -#, c-format -msgid "%-5s: %s%*s (Usage: %s)" -msgstr "%-5s: %s%*s (Օգտագործում: %s)" - -msgid "" -"\n" -" a: Find assignments to this symbol\n" -" c: Find functions calling this function\n" -" d: Find functions called by this function\n" -" e: Find this egrep pattern\n" -" f: Find this file\n" -" g: Find this definition\n" -" i: Find files #including this file\n" -" s: Find this C symbol\n" -" t: Find this text string\n" -msgstr "" -"\n" -" a: Փնտրել այս նշանի վերագրումները\n" -" c: Փնտրել այս ֆունկցիան կանչող ֆունկցիանները\n" -" d: Փնտրել այս ֆունկցիայից կանչվող ֆունկցիաները\n" -" e: Փնտրել այս egrep նմուշը\n" -" f: Փնտրել այս ֆայլը\n" -" g: Փնտրել այս սահմանումը\n" -" s: Փնտրելայս C-նշանը\n" -" t: Փնտրել այս տեքստը\n" - -#, c-format -msgid "cscope connection %s closed" -msgstr "cscope %s կապը չի փակվել է" - -#, c-format -msgid "Cscope tag: %s" -msgstr "Cscope պիտակ: %s" - -msgid "" -"\n" -" # line" -msgstr "" -"\n" -" # տող" - -msgid "" -"filename / context / line\n" -msgstr "" -"ֆայլի անուն / կոնտեքստ / տող\n" - -msgid "All cscope databases reset" -msgstr "Ողջ cscope տվյալների բազաների վերաբեռնում" - -msgid "" -"no cscope connections\n" -msgstr "" -"չկան cscope կապեր\n" - -msgid "" -" # pid database name prepend path\n" -msgstr "" -" # pid տվյալների բազայի անվանումը prepend path\n" - -msgid "Lua library cannot be loaded." -msgstr "Հնարավոր չէ բեռնել Lua գրադարանը." - -msgid "cannot save undo information" -msgstr "հնարավոր չէ պահպանել չեղարկման տեղեկատվությոանը" - -msgid "invalid expression" -msgstr "անվավեր արտահայտություն" - -msgid "expressions disabled at compile time" -msgstr "արտահայտոթյուններն անջատված են կառուցման ժամանակ" - -msgid "hidden option" -msgstr "թաքցված կարգանշան" - -msgid "unknown option" -msgstr "անծանոթ կարգանշան" - -msgid "window index is out of range" -msgstr "պատուհանի համարն միջակայքից դուրս է եկել" - -msgid "couldn't open buffer" -msgstr "հնարավոր չէ բացել բուֆերը" - -msgid "cannot delete line" -msgstr "հնարավոր չէ ջնջել տողը" - -msgid "cannot replace line" -msgstr "հնարավոր չէ փոխարինել տողը" - -msgid "cannot insert line" -msgstr "հնարավոր չէ զետեղել տողը" - -msgid "string cannot contain newlines" -msgstr "տողը չի կարող պարունակել տողանցումներ" - -msgid "error converting Scheme values to Vim" -msgstr "scheme արժեքների փոխակերպման սխալ" - -msgid "Vim error: ~a" -msgstr "Vim սխալ: ~a" - -msgid "Vim error" -msgstr "Vim սխալ" - -msgid "buffer is invalid" -msgstr "բուֆերն անվավեր է" - -msgid "window is invalid" -msgstr "պատուհանն անվավեր է" - -msgid "linenr out of range" -msgstr "տողի համարը միջակայքից դուրս է եկել" - -msgid "not allowed in the Vim sandbox" -msgstr "չի թույլատրվում Vim sandbox" - -#, c-format -msgid "E370: Could not load library %s" -msgstr "E370: Հնարավոր չէր բեռնել %s գրադարանը" - -msgid "Sorry, this command is disabled: the Perl library could not be loaded." -msgstr "" -"Ներողություն, այս հրամանն անջատված է: հնարավոր չէ բեռնել Perl գրադարանը." - -msgid "invalid buffer number" -msgstr "անվավեր բուֆերի համար" - -msgid "not implemented yet" -msgstr "իրականացված չէ դեռևս" - -msgid "cannot set line(s)" -msgstr "հնարավոր չէ նշանակել տողը(երը)" - -msgid "invalid mark name" -msgstr "անվավեր նշակման անուն" - -msgid "mark not set" -msgstr "նշակումը սահմանած չէ" - -#, c-format -msgid "row %d column %d" -msgstr "տող %d սյուն %d" - -msgid "cannot insert/append line" -msgstr "հնարավոր չէ զետեղել/կցել տողը" - -msgid "line number out of range" -msgstr "տողի համարը միջակայքից անցել է" - -msgid "unknown flag: " -msgstr "անծանոթ դրոշմանիշ: " - -msgid "unknown vimOption" -msgstr "անծանոթ vimOption" - -msgid "keyboard interrupt" -msgstr "ստեղնաշարային ընդհատում" - -msgid "cannot create buffer/window command: object is being deleted" -msgstr "հնարավորչէ կատարել բուֆերի/պատուհանի հարամանը: օբյեկտը ջնջվում է" - -msgid "" -"cannot register callback command: buffer/window is already being deleted" -msgstr "հնարավորչէ ռեգիստրացնել մշակման հրամանը․ բուֆերը/պատուհանը ջնջվում է" - -msgid "cannot register callback command: buffer/window reference not found" -msgstr "" -"հնարավորչէ ռեգիստրացնել մշակման հրամանը․ բուֆերի/պատուհանի հղումը չի " -"հայտնաբերվել" - -msgid "cannot get line" -msgstr "հանրավոր չէ ստանալ տողը" - -msgid "Unable to register a command server name" -msgstr "Հնարավոր չէ ռեգիստրացնել server name հրամանը" - -#, c-format -msgid "%ld lines to indent... " -msgstr "%ld տողեր խորացման համար․.. " - -#, c-format -msgid "%ld line indented " -msgid_plural "%ld lines indented " -msgstr[0] "%ld տող խորացվել է " -msgstr[1] "%ld տողեր խորացվել են " - -msgid " Keyword completion (^N^P)" -msgstr "Հիմնաբառերի ավտոմատ լրացում (^N^P)" - -msgid " ^X mode (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" -msgstr " ^X ավտոմատ լրացման ռեժիմ (^]^D^E^F^I^K^L^N^O^Ps^U^V^Y)" - -msgid " Whole line completion (^L^N^P)" -msgstr " Տողի ամբողջական լրացում (^L^N^P)" - -msgid " File name completion (^F^N^P)" -msgstr " Ֆայլի անունի ավոտմատ լրացում (^F^N^P)" - -msgid " Tag completion (^]^N^P)" -msgstr " Պիտակի ավտոմատ լրացում (^]^N^P)" - -msgid " Path pattern completion (^N^P)" -msgstr " Ճանապարհի ավոտմատ լրացում (^N^P)" - -msgid " Definition completion (^D^N^P)" -msgstr " Սահմանման ավտոմատ լրացում (^D^N^P)" - -msgid " Dictionary completion (^K^N^P)" -msgstr " Բառարանի ավտոմատ լրացում (^K^N^P)" - -msgid " Thesaurus completion (^T^N^P)" -msgstr " Հոմանիշների ավտոմատ լրացում (^T^N^P)" - -msgid " Command-line completion (^V^N^P)" -msgstr " Հրամանի տողի ավտոմատ լրացում (^V^N^P)" - -msgid " User defined completion (^U^N^P)" -msgstr " Օգտագործողի սահմանած ավտոմատ լրացում (^U^N^P)" - -msgid " Omni completion (^O^N^P)" -msgstr " Omni-լրացում (^O^N^P)" - -msgid " Spelling suggestion (^S^N^P)" -msgstr " Ուղղագրական ճշգրտում (^S^N^P)" - -msgid " Keyword Local completion (^N^P)" -msgstr "Հիմնաբառերի ավտոմատ լրացում (^N^P)" - -msgid "'dictionary' option is empty" -msgstr "'dictionary' կարգանշանը դատարկ է" - -msgid "'thesaurus' option is empty" -msgstr "'thesaurus' կարգանշանը դատարկ է" - -#, c-format -msgid "Scanning dictionary: %s" -msgstr "Բառարանի ընթերցում: %s" - -msgid " (insert) Scroll (^E/^Y)" -msgstr " (զետեղել) Փաթաթ (^E/^Y)" - -msgid " (replace) Scroll (^E/^Y)" -msgstr " (փոխարինել) Փաթաթ (^E/^Y)" - -#, c-format -msgid "Scanning: %s" -msgstr "Ընթերցում: %s" - -msgid "Scanning tags." -msgstr "Կատարվում է պիտակների ընթերցում." - -msgid "match in file" -msgstr "համընկնում ֆայլում" - -msgid " Adding" -msgstr " Ավելացում" - -msgid "-- Searching..." -msgstr "-- Որոնում..." - -msgid "Hit end of paragraph" -msgstr "Պարագրաֆի վերջը" - -msgid "Pattern not found" -msgstr "Նմուշը չի հայտնաբերվել" - -msgid "Back at original" -msgstr "Վերադարձ նախնական վիճակին" - -msgid "Word from other line" -msgstr "Այլ տողի բառ" - -msgid "The only match" -msgstr "Միակ համընկնումը" - -#, c-format -msgid "match %d of %d" -msgstr "%d համընկնում %d հնարավորից" - -#, c-format -msgid "match %d" -msgstr "համընկնում %d" - -msgid "flatten() argument" -msgstr "flatten() արգումենտ" - -msgid "sort() argument" -msgstr "sort() արգումենտ" - -msgid "uniq() argument" -msgstr "uniq() արգումենտ" - -msgid "map() argument" -msgstr "map() արգումենտ" - -msgid "mapnew() argument" -msgstr "mapnew() արգումենտ" - -msgid "filter() argument" -msgstr "filter() արգումենտ" - -msgid "foreach() argument" -msgstr "foreach() արգումենտ" - -msgid "extendnew() argument" -msgstr "extendnew() արգումենտ" - -msgid "remove() argument" -msgstr "remove() արգումենտ" - -msgid "reverse() argument" -msgstr "reverse() արգումենտ" - -#, c-format -msgid "Current %slanguage: \"%s\"" -msgstr "Օգտագործվող %sլեզուն: \"%s\"" - -msgid "Unknown option argument" -msgstr "Անծանոթ կարգանշման արգումենտ" - -msgid "Too many edit arguments" -msgstr "Աննախադեպ շատ խմբագրման արգումենտներ" - -msgid "Argument missing after" -msgstr "Արգումենտը տրված չէ" - -msgid "Garbage after option argument" -msgstr "Աղբ, կարգանշման արգումենտից հետո" - -msgid "Too many \"+command\", \"-c command\" or \"--cmd command\" arguments" -msgstr "Աննախադեպ շատ \"+command\", \"-c command\" կամ \"--cmd command\"" - -msgid "Invalid argument for" -msgstr "Անվավեր արգումենտ" - -#, c-format -msgid "" -"%d files to edit\n" -msgstr "" -"խմագրվելիք ֆայլերի քանակը: %d\n" - -msgid "" -"netbeans is not supported with this GUI\n" -msgstr "" -"netbeans-ը չի աջակցվում այս գրաֆիկական ինտերֆեյսի հետ\n" - -msgid "" -"'-nb' cannot be used: not enabled at compile time\n" -msgstr "" -"'-nb'֊ն չի կարող օգտագործվել: չի միացվել կառուցման ժամանակ\n" - -msgid "This Vim was not compiled with the diff feature." -msgstr "Այս Vim-ը չի կառուցվել diff հատկությամբ." - -msgid "Attempt to open script file again: \"" -msgstr "Սկրիտպային ֆայլի կրկնակի բացման փորձ։ \"" - -msgid "Cannot open for reading: \"" -msgstr "Հնարավոր չէ բացել ընթերցման համար: \"" - -msgid "Cannot open for script output: \"" -msgstr "Հնարավոր չէ բացել սկրիպտի ելքի համար : \"" - -msgid "" -"Vim: Error: Failure to start gvim from NetBeans\n" -msgstr "" -"Vim: Սխալ: հնարավոր չէ բացել gvim֊ը NetBeans֊ից\n" - -msgid "" -"Vim: Error: This version of Vim does not run in a Cygwin terminal\n" -msgstr "" -"Vim. Սխալ. Vim-ի այս տարբերակը չի աշխատում Cygwin տերմինալում\n" - -msgid "" -"Vim: Warning: Output is not to a terminal\n" -msgstr "" -"Vim: Զգուշացում: Ելքը տերմինալ չէ\n" - -msgid "" -"Vim: Warning: Input is not from a terminal\n" -msgstr "" -"Vim: Զգուշացում: Մուտքը տերմինալից չէ\n" - -msgid "pre-vimrc command line" -msgstr "pre-vimrc հրամանային տող" - -msgid "" -"\n" -"More info with: \"vim -h\"\n" -msgstr "" -"\n" -"Հավելյալ տեղեկատվություն: \"vim -h\"\n" - -msgid "[file ..] edit specified file(s)" -msgstr "[ֆայլ ..] խմբագրել նշված ֆայլերը" - -msgid "- read text from stdin" -msgstr "- տեքստի ընթերցում stdin֊ից" - -msgid "-t tag edit file where tag is defined" -msgstr "-t պիտակ խմբագրել ֆայլը որտեղ սահմանված է պիտակը" - -msgid "-q [errorfile] edit file with first error" -msgstr "" -"-q [ֆայլ֊սխալ]\n" -"\t\t\t\t ֆայլի խմբագրում առաջին սխալով" - -msgid "" -"\n" -"\n" -"Usage:" -msgstr "" -"\n" -"\n" -"Օգտագործում:" - -msgid " vim [arguments] " -msgstr " vim [արգումնետներ] " - -msgid "" -"\n" -" or:" -msgstr "" -"\n" -" կամ:" - -msgid "" -"\n" -"Where case is ignored prepend / to make flag upper case" -msgstr "" -"\n" -"Where դեպքն անտեսվել է, ավելացրեք ՛/՛՝ դրոշմանիշը մեծատառ դարձնելու համար" - -msgid "" -"\n" -"\n" -"Arguments:\n" -msgstr "" -"\n" -"\n" -"Արգումենտներ:\n" - -msgid "--\t\t\tOnly file names after this" -msgstr "--\t\t\tԱյնուհետև նշվում են ֆայլի անունները" - -msgid "--literal\t\tDon't expand wildcards" -msgstr "--literal\t\tՉբացել wildcard-ները" - -msgid "-register\t\tRegister this gvim for OLE" -msgstr "-register\t\tՌեգիստրացնել այս gvim֊ը OLE֊ի համար" - -msgid "-unregister\t\tUnregister gvim for OLE" -msgstr "-unregister\t\tանռեգիստրացնել այս gvim֊ը OLE֊ի համար" - -msgid "-g\t\t\tRun using GUI (like \"gvim\")" -msgstr "-g\t\t\tԿատարել գրաֆիկական ինտերֆեյսով (ինչպես \"gvim\")" - -msgid "-f or --nofork\tForeground: Don't fork when starting GUI" -msgstr "-f կամ --nofork\tԱկտիվ: Չկատարել fork֊ը GUI֊ն սկսելու ժամանակ" - -msgid "-v\t\t\tVi mode (like \"vi\")" -msgstr "-v\t\t\tVi ռեժիմ (ինչպես \"vi\")" - -msgid "-e\t\t\tEx mode (like \"ex\")" -msgstr "-e\t\t\tEx ռեժիմ (ինչպես \"ex\")" - -msgid "-E\t\t\tImproved Ex mode" -msgstr "-E\t\t\tԿատաելագործված Ex ռեժիմ" - -msgid "-s\t\t\tSilent (batch) mode (only for \"ex\")" -msgstr "-s\t\t\tԼուռ (ծրարված) ռեժիմ (միայն \"ex\"-ի համար)" - -msgid "-d\t\t\tDiff mode (like \"vimdiff\")" -msgstr "-d\t\t\tDiff ռեժիմ (ինչպես \"vimdiff\")" - -msgid "-y\t\t\tEasy mode (like \"evim\", modeless)" -msgstr "-y\t\t\tEasy ռեժիմ (ինչպես \"evim\", modeless)" - -msgid "-R\t\t\tReadonly mode (like \"view\")" -msgstr "-R\t\t\tReadonly ռեժիմ (ինչպես \"view\")" - -msgid "-Z\t\t\tRestricted mode (like \"rvim\")" -msgstr "-Z\t\t\tՍահմանափակված ռեժիմ (ինչպես \"rvim\")" - -msgid "-m\t\t\tModifications (writing files) not allowed" -msgstr "-m\t\t\tՓոփոխումները թույլատրված չեն (ֆայլում պահպանելը)" - -msgid "-M\t\t\tModifications in text not allowed" -msgstr "-M\t\t\tՏողում փոփոխումները թույլատրված չեն" - -msgid "-b\t\t\tBinary mode" -msgstr "-b\t\t\tԵրկուական չեժիմ" - -msgid "-l\t\t\tLisp mode" -msgstr "-l\t\t\tLisp Ռեժիմ" - -msgid "-C\t\t\tCompatible with Vi: 'compatible'" -msgstr "-C\t\t\tVi համապատասխանեցված: 'compatible'" - -msgid "-N\t\t\tNot fully Vi compatible: 'nocompatible'" -msgstr "-N\t\t\tVi մասնակի համապատասխանեցված: 'nocompatible'" - -msgid "-V[N][fname]\t\tBe verbose [level N] [log messages to fname]" -msgstr "" -"-V[N][ֆայլ]\t\tԱրտածել լրացուցիչ հաղորդագրություններ\n" -"\t\t\t\t[կարգ N] [արտածել ֆայլում]" - -msgid "-D\t\t\tDebugging mode" -msgstr "-D\t\t\tԶննման ռեժիմ" - -msgid "-n\t\t\tNo swap file, use memory only" -msgstr "-n\t\t\tԱռանց սվեփ ֆայլի, օգտագործել միայն հիշողությունը" - -msgid "-r\t\t\tList swap files and exit" -msgstr "-r\t\t\tՑուցադրել սվեփ ֆայլերն ու ավարտել" - -msgid "-r (with file name)\tRecover crashed session" -msgstr "-r (ֆայլի անուն)\tՎերկանգնել վթարված սեսիան" - -msgid "-L\t\t\tSame as -r" -msgstr "-L\t\t\tՆույնն է ինչպես -r֊ը" - -msgid "-f\t\t\tDon't use newcli to open window" -msgstr "-f\t\t\tՉօգտագօրծել newcli֊ը պատուհան բացելու համար" - -msgid "-dev \t\tUse for I/O" -msgstr "-dev <սարք>\t\tՕգտագործեք <սարք>֊ը ներմուծման/արտածման համար" - -msgid "-A\t\t\tStart in Arabic mode" -msgstr "-A\t\t\tԱրաբական ռեժիմով սկսում" - -msgid "-H\t\t\tStart in Hebrew mode" -msgstr "-H\t\t\tHebrew ռեժիմով սկսում" - -msgid "-T \tSet terminal type to " -msgstr "-T <տերմինալ>\tՏերմինալի տիպը դնել <տերմինալ>" - -msgid "--not-a-term\t\tSkip warning for input/output not being a terminal" -msgstr "" -"--ոչ մի ժամկետ Բաց թողնել նախազգուշացումը մուտքի/ելքի տերմինալ չլինելու համար" - -msgid "--gui-dialog-file {fname} For testing: write dialog text" -msgstr "--gui-dialog-file {fname} Փորձարկման համար գրեք երկխոսության տեքստ" - -msgid "--ttyfail\t\tExit if input or output is not a terminal" -msgstr "--ttyfail Ելք, եթե մուտքը կամ ելքը տերմինալ չէ" - -msgid "-u \t\tUse instead of any .vimrc" -msgstr "-u \t\tՕգտագործեկ ֊ն ցանկացած ․vimrc֊ու փոխարեն" - -msgid "-U \t\tUse instead of any .gvimrc" -msgstr "-U \t\tՕգտագործեկ ֊ն ցանկացած ․gvimrc֊ու փոխարեն" - -msgid "--noplugin\t\tDon't load plugin scripts" -msgstr "--noplugin\t\tՉբեռնել կցման մոդուլները" - -msgid "-p[N]\t\tOpen N tab pages (default: one for each file)" -msgstr "" -"-p[N]\t\tԲացել N թաբեր (լռելիությամբ: ամեն մեկում\n" -"\t\t\t\tմեկ ֆայլ)" - -msgid "-o[N]\t\tOpen N windows (default: one for each file)" -msgstr "" -"-o[N]\t\tԲացել N պատուհաններ (լռելիությամբ: ամեն մեկում\n" -"\t\t\t\tմեկ ֆայլ)" - -msgid "-O[N]\t\tLike -o but split vertically" -msgstr "-O[N]\t\tԻնչպես -o, բայց բայց բաժանել ուղղահայաց" - -msgid "+\t\t\tStart at end of file" -msgstr "+\t\t\tՖայլի վերջից սկսում" - -msgid "+\t\tStart at line " -msgstr "+\t\t-ի տողից սկսում" - -msgid "--cmd \tExecute before loading any vimrc file" -msgstr "" -"--cmd <հրաման>\tԿատարել <հրաման>֊ը նախքան ցանկացախ vimrc ֆայլի բեռնումը" - -msgid "-c \t\tExecute after loading the first file" -msgstr "-c <հրաման>\t\tԿատարել <հրաման>֊ը առաջին ֆայլի բեռնումից հետո" - -msgid "-S \t\tSource file after loading the first file" -msgstr "-S \t\tԿարդալ ֆայլն առաջին ֆայլի բեռնումից հետո" - -msgid "-s \tRead Normal mode commands from file " -msgstr "-s \tԿարդալ Normal ռեժիմի հրամանները ֆայլից" - -msgid "-w \tAppend all typed commands to file " -msgstr "-w \tԿցել բոլոր հրամանները ֆայլին" - -msgid "-W \tWrite all typed commands to file " -msgstr "-W \tԳրել բոլոր հրամանները ֆայլում" - -msgid "-x\t\t\tEdit encrypted files" -msgstr "-x\t\t\tԽմբագրել կոդավորված ֆայլերը" - -msgid "-display \tConnect Vim to this particular X-server" -msgstr "-display <էկրան>\tԿպցել Vim-ն այս X-server-ին" - -msgid "-X\t\t\tDo not connect to X server" -msgstr "-X\t\t\tՉկպցնել X-server֊ին" - -msgid "--remote \tEdit in a Vim server if possible" -msgstr "--remote <ֆայլեր>\tԽմբագրել <ֆայլեր>֊ը Vim server֊ում, եթե հնարավոր է" - -msgid "--remote-silent Same, don't complain if there is no server" -msgstr "--remote-silent <ֆայլեր> Նույնն ինչպես, չբողոքել եթե սերվեր չկա" - -msgid "" -"--remote-wait As --remote but wait for files to have been edited" -msgstr "--remote-wait Նույնն ինչպես --remote, բայց ավրտման սպասումով" - -msgid "" -"--remote-wait-silent Same, don't complain if there is no server" -msgstr "--remote-wait-silent Նույնն ինչպես, չբողոքել եթե սերվեր չկա" - -msgid "" -"--remote-tab[-wait][-silent] As --remote but use tab page per file" -msgstr "" -"--remote-tab[-wait][-silent] Նույնն ինչպես --remote, բայց օգտագործել " -"թաբ ամեն մի ֆայլի համար" - -msgid "--remote-send \tSend to a Vim server and exit" -msgstr "--remote-send <տառեր>\tՈւղարկել <տառեր>֊ը Vim server֊ին և ավարտել" - -msgid "--remote-expr \tEvaluate in a Vim server and print result" -msgstr "" -"--remote-expr <արտահայտոթյուն>\tՀաշվել <արտահայտոթյուն>֊ը Vim server֊ում և " -"արտածել արդյունքը" - -msgid "--serverlist\t\tList available Vim server names and exit" -msgstr "" -"--serverlist\t\tՑուցադրել հասանելի Vim server֊ների անուններն ու ավարտել" - -msgid "--servername \tSend to/become the Vim server " -msgstr "--servername <անուն>\tՈւղարկել/լինել <անուն>֊ով Vim server" - -msgid "--startuptime \tWrite startup timing messages to " -msgstr "" -"--startuptime <ֆայլ>\tԳրել սկսման ժամանակային հաղորդագրությունները <ֆայլ>֊ում" - -msgid "--log \t\tStart logging to early" -msgstr "--log Սկսեք մուտք գործել վաղ" - -msgid "-i \t\tUse instead of .viminfo" -msgstr "-i \t\tՕգտագործել , ․viminfo փոխարեն" - -msgid "--clean\t\t'nocompatible', Vim defaults, no plugins, no viminfo" -msgstr "" -"--clean\t\t'nocompatible', Vim լռելյայն, առանց պլագինների, առանց viminfo-ի" - -msgid "-h or --help\tPrint Help (this message) and exit" -msgstr "-h կամ --help\tԱրտածել Օգնություն (այս հաղորդագրությունը) և ավարտել" - -msgid "--version\t\tPrint version information and exit" -msgstr "--version\t\tԱրտածել տարբերակի մասին հաղորդագրություն և ավարտել" - -msgid "" -"\n" -"Arguments recognised by gvim (Motif version):\n" -msgstr "" -"\n" -"gvim-ի կողմից ճանաչված արգումենտներ (Motif տարբերակ):\n" - -msgid "-display \tRun Vim on " -msgstr "-display <էկրան>\tԲացել Vim-ը <էկրան>-ի վրա" - -msgid "-iconic\t\tStart Vim iconified" -msgstr "-iconic\t\tՍկսել Vim-ը նկարով" - -msgid "-background \tUse for the background (also: -bg)" -msgstr "-background <գույն>\tՕգտագործել <գույն>֊ը ներքին ֆոնում (նաև: -bg)" - -msgid "-foreground \tUse for normal text (also: -fg)" -msgstr "" -"-foreground <գույն>\tՕգտագործել <գույն>֊ը նորմալ տեքստերի համար (նաև: -fg)" - -msgid "-font \t\tUse for normal text (also: -fn)" -msgstr "" -"-font <տառատեսակ>\t\tՕգտագործել <տառատեսակ>֊ը նորմալ տեքստերի համար (նաև: -" -"fn)" - -msgid "-boldfont \tUse for bold text" -msgstr "-boldfont <տառատեսակ>\tՕգտագործել <տառատեսակ>֊ը չաղ տեքստերի համար" - -msgid "-italicfont \tUse for italic text" -msgstr "-italicfont <տառատեսակ>\tՕգտագործել <տառատեսակ>֊ը թեք տեքստերի համար" - -msgid "-geometry \tUse for initial geometry (also: -geom)" -msgstr "-geometry \tՕգտագործել նախնական չափերի համար (նաև: -geom)" - -msgid "-borderwidth \tUse a border width of (also: -bw)" -msgstr "-borderwidth <երկարություն>\tՕգտագործել <երկարություն> եզր (նաև: -bw)" - -msgid "-scrollbarwidth Use a scrollbar width of (also: -sw)" -msgstr "" -"-scrollbarwidth <երկարություն> Օգտագործել երկարությամբ փաթաթ (նաև: -sw)" - -msgid "-reverse\t\tUse reverse video (also: -rv)" -msgstr "-reverse\t\tՕգտագործել հակադարձված վիդեո ռեժիմ (նաև: -rv)" - -msgid "+reverse\t\tDon't use reverse video (also: +rv)" -msgstr "+reverse\t\tՉօգտագործել հակադարձված վիդեո ռեժիմ (նաև: +rv)" - -msgid "-xrm \tSet the specified resource" -msgstr "-xrm <ռեսուրս>\tԿարգավորել տրված <ռեսուրս>֊ը" - -msgid "" -"\n" -"Arguments recognised by gvim (GTK+ version):\n" -msgstr "" -"\n" -"Ճանաչելի արգումենտներ՝ gvim-ի համար (GTK+ տարբերակ):\n" - -msgid "-display \tRun Vim on (also: --display)" -msgstr "-display <էկրան>\tԲացել Vim-ը <էկրան>֊ում (Նաև։ --display)" - -msgid "--role \tSet a unique role to identify the main window" -msgstr "--role <դեր>\tԳլխավոր պատուհանի ճանաչման համար վերագրել միարժեք <դեր>" - -msgid "--socketid \tOpen Vim inside another GTK widget" -msgstr "--socketid \tԲացել Vim֊ը ուրիշ GTK֊ի ներսում" - -msgid "--echo-wid\t\tMake gvim echo the Window ID on stdout" -msgstr "" -"--echo-wid\t\tԹույլատրել gvim֊ին արտածել պատուհանի համարը ստանդարտ ելքում" - -msgid "-P \tOpen Vim inside parent application" -msgstr "-P <ծնողի անուն>\tԲացել Vim֊ը ծնող ծրագրի ներսում" - -msgid "--windowid \tOpen Vim inside another win32 widget" -msgstr "--windowid \tԲացել Vim֊ը այլ win32 ծրագրի ներսում" - -msgid "" -"Seen modifyOtherKeys: true\n" -msgstr "" -"Տեսել է modifyOtherKeys՝ ճշմարիտ\n" - -msgid "Unknown" -msgstr "Անծանոթ" - -msgid "Off" -msgstr "Անջատել" - -msgid "On" -msgstr "Միացնել" - -msgid "Disabled" -msgstr "Ապաակտիվացված" - -msgid "Cleared" -msgstr "Մաքրված" - -#, c-format -msgid "" -"modifyOtherKeys detected: %s\n" -msgstr "" -"modifyOtherKeys-ը հայտնաբերվեց՝ %s\n" - -#, c-format -msgid "" -"Kitty keyboard protocol: %s\n" -msgstr "" -"Kitty ստեղնաշարի արձանագրություն՝ %s\n" - -msgid "No abbreviation found" -msgstr "Հապավումը չի հայտնաբերվել" - -msgid "No mapping found" -msgstr "Համապատասխանեցումը չի հայտնաբերվել" - -msgid "No marks set" -msgstr "Նշակներ չկան" - -msgid "" -"\n" -"mark line col file/text" -msgstr "" -"\n" -"նշում տող սյուն ֆայլ/տեքստ" - -msgid "" -"\n" -" jump line col file/text" -msgstr "" -"\n" -"ցատկ տող սյուն ֆայլ/տեքստ" - -msgid "" -"\n" -"change line col text" -msgstr "" -"\n" -"փոփոխել տող սյուն տեքստ" - -msgid "Enter number of swap file to use (0 to quit): " -msgstr "Տալ սվեփ ֆայլերի քանակությունը (0 - ավարտելու դեպքում): " - -msgid "Unable to read block 0 from " -msgstr "Հնարավոր չէ կարդալ 0 բլոկը " - -msgid "" -"\n" -"Maybe no changes were made or Vim did not update the swap file." -msgstr "" -"\n" -"Փոփոխություններ չկան, կամ Vim-ը չի թարմացրել սվեփ ֆայլը." - -msgid "" -" cannot be used with this version of Vim.\n" -msgstr "" -" հնարավոր չէ օգտագործել այս տարբերակի Vim-ի հետ.\n" - -msgid "" -"Use Vim version 3.0.\n" -msgstr "" -"Օգտագերծել 3.0 Vim տարբերակը.\n" - -msgid "" -" cannot be used on this computer.\n" -msgstr "" -" հնարավոր չէ օգտագործել այս համակարգչում.\n" - -msgid "The file was created on " -msgstr "Ֆայլը ստեղծվել է " - -msgid "" -",\n" -"or the file has been damaged." -msgstr "" -",\n" -"կամ ֆայլը վնասված է." - -msgid "" -" has been damaged (page size is smaller than minimum value).\n" -msgstr "" -" վնասված է (էջի չափը ավելի փոքր է քան մինիմում արժեքը).\n" - -#, c-format -msgid "Using swap file \"%s\"" -msgstr "Օգտագործվում է սվեփ ֆայլ - \"%s\"" - -#, c-format -msgid "Original file \"%s\"" -msgstr "Իրական ֆայլ \"%s\"" - -#, c-format -msgid "Swap file is encrypted: \"%s\"" -msgstr "Սվեփ ֆայլը կոդավորված է: \"%s\"" - -msgid "" -"\n" -"If you entered a new crypt key but did not write the text file," -msgstr "" -"\n" -"եթե ներկայացրեք եք նոր բանալի, բայց չեք գրել ֆայլում," - -msgid "" -"\n" -"enter the new crypt key." -msgstr "" -"\n" -"ավելացրեք նոր կոդավորման բանալին." - -msgid "" -"\n" -"If you wrote the text file after changing the crypt key press enter" -msgstr "" -"\n" -"Եթե գրում եք ֆայլում կոդավորման բանալու փոփոխումից հետ, ապա սեղմեք նոր տող" - -msgid "" -"\n" -"to use the same key for text file and swap file" -msgstr "" -"\n" -"նույն բանալին տեքստային և սվեփ ֆայլի համար" - -msgid "???MANY LINES MISSING" -msgstr "???ՇԱՏ ՏՈՂԵՐ ԲԱՑԱԿԱՅՈՒՄ ԵՆ" - -msgid "???LINE COUNT WRONG" -msgstr "???ՏՈՂԵՐԻ ՀԱՇՎԻՉԻ ՍԽԱԼ ԱՐԺԵՔ" - -msgid "???EMPTY BLOCK" -msgstr "???ԴԱՏԱՐԿ ԲԼՈԿ" - -msgid "???LINES MISSING" -msgstr "???ՏՈՂԵՐ ԵՆ ԲԱՑԱԿԱՅՈՒՄ" - -msgid "???BLOCK MISSING" -msgstr "???ԲԱՑԱԿԱՅՈՂ ԲԼՈԿ" - -msgid "??? from here until ???END lines may be messed up" -msgstr "???այստեղից մինչև վերջ??? տողեր են պակասում" - -msgid "??? from here until ???END lines may have been inserted/deleted" -msgstr "???այստեղից մինչև վերջ??? տողեր են ավելացվել/ջնջվել" - -msgid "??? lines may be missing" -msgstr "??? տողերը կարող են բացակայել" - -msgid "???END" -msgstr "???ՎԵՐՋ" - -msgid "See \":help E312\" for more information." -msgstr "Տես. \":help E312\" հավելյալ տեղեկատվության համար." - -msgid "Recovery completed. You should check if everything is OK." -msgstr "Վերականգնումն ավարտված է. Ստուգեք արդյո՞ք ամեն ինչ կարգին է." - -msgid "" -"\n" -"(You might want to write out this file under another name\n" -msgstr "" -"\n" -"(Կարող եք ֆայլն ամրագրել այլ անունով\n" - -msgid "and run diff with the original file to check for changes)" -msgstr "կատարել diff֊ը սկզբնական ֆայլի հետ՝ փոփխությունները ստուգելու համար)" - -msgid "Recovery completed. Buffer contents equals file contents." -msgstr "" -"Վերականգնումն ավարտված է. Ֆայլի պարունակությունն ու բուֆերը համարժեք են." - -msgid "" -"\n" -"You may want to delete the .swp file now." -msgstr "" -"\n" -"Միգուցե ցանկանաք ջնջել .swp. ֆայլը." - -msgid "" -"\n" -"Note: process STILL RUNNING: " -msgstr "" -"\n" -"Նշում. գործընթացը ԴԵՌ ԿԱՏԱՐՎՈՒՄ Է. " - -msgid "" -"Using crypt key from swap file for the text file.\n" -msgstr "" -"Տեքստ ֆայլի համար օգտագործվում է կոդավորման բանալի սվեփ ֆայլից.\n" - -msgid "Swap files found:" -msgstr "Հայտնավերված սվեփ ֆայլեր:" - -msgid "" -" In current directory:\n" -msgstr "" -" Այս թղթապանակում:\n" - -msgid "" -" Using specified name:\n" -msgstr "" -" Տրված անվանմամբ:\n" - -msgid " In directory " -msgstr " Թղթապանակ " - -msgid "" -" -- none --\n" -msgstr "" -" -- ոչ --\n" - -msgid " owned by: " -msgstr " պատկանելիություն: " - -msgid " dated: " -msgstr " ամսաթիվ: " - -msgid " dated: " -msgstr " ամսաթիվ: " - -msgid " [from Vim version 3.0]" -msgstr " [3.0 Vim տարբերակից]" - -msgid " [does not look like a Vim swap file]" -msgstr " [Vim-ի սվեփ ֆայլ չէ]" - -msgid " file name: " -msgstr " ֆայլի անուն: " - -msgid "" -"\n" -" modified: " -msgstr "" -"\n" -" փոփոխված: " - -msgid "YES" -msgstr "ԱՅՈ" - -msgid "no" -msgstr "ոչ" - -msgid "" -"\n" -" user name: " -msgstr "" -"\n" -" օգտատեր: " - -msgid " host name: " -msgstr " հոսթ: " - -msgid "" -"\n" -" host name: " -msgstr "" -"\n" -" հոսթ: " - -msgid "" -"\n" -" process ID: " -msgstr "" -"\n" -" պրոցես: " - -msgid " (STILL RUNNING)" -msgstr " (ԴԵՌ ԿԱՏԱՐՎՈՒՄ Է)" - -msgid "" -"\n" -" [not usable with this version of Vim]" -msgstr "" -"\n" -" [օգտագործելի չէ այս տարբերակի Vim-ի հետ]" - -msgid "" -"\n" -" [not usable on this computer]" -msgstr "" -"\n" -" [օգտագործելի չէ այս համակարգչում]" - -msgid " [cannot be read]" -msgstr " [չի կարող ըթերցվել]" - -msgid " [cannot be opened]" -msgstr " [չի կարող բացվել]" - -msgid "File preserved" -msgstr "Սվեփ ֆայլը թարմացվել է" - -msgid "stack_idx should be 0" -msgstr "stack_idx արժեքը պետք է 0 լինի" - -msgid "deleted block 1?" -msgstr "բլոկ 1-ը ջնջվել է?" - -msgid "pe_line_count is zero" -msgstr "pe_line_count֊ի արժեքը 0 է" - -msgid "Stack size increases" -msgstr "Ստեկի չափը մեծանում է" - -msgid "" -"\n" -"Found a swap file by the name \"" -msgstr "" -"\n" -"Հայտնաբերվել է սվեփ ֆայլ \"" - -msgid "While opening file \"" -msgstr "Ֆայլը բացելու դեպքում \"" - -msgid " CANNOT BE FOUND" -msgstr " ՀԱՅՏՆԱԲԵՐՎԱԾ ՉԷ" - -msgid "" -" NEWER than swap file!\n" -msgstr "" -" Ավելի ՆՈՐ, քան սվեփ ֆայլը!\n" - -msgid "" -"\n" -"(1) Another program may be editing the same file. If this is the case,\n" -" be careful not to end up with two different instances of the same\n" -" file when making changes. Quit, or continue with caution.\n" -msgstr "" -"\n" -"(1) Հնարավոր է, որ մեկ այլ ծրագիր խմբագրում է այս ֆայլը․ Եթե այդպես է,\n" -" ապա հոգ տարեք որ խմբագրելուց հետո չունենաք նույն ֆայլի երկու տարբեր\n" -" խմբագրված օրինակներ.\n" - -msgid "" -"(2) An edit session for this file crashed.\n" -msgstr "" -"(2) Այս ֆայլի խմբագրման սեանսը ավարտվել է անհաջողությամբ.\n" - -msgid " If this is the case, use \":recover\" or \"vim -r " -msgstr "" -" Եթե այդպես է, ապա կատարել հետևյալ հրամանները - \":recover\" կամ \"vim -r " - -msgid "" -"\"\n" -" to recover the changes (see \":help recovery\").\n" -msgstr "" -"\"\n" -" փոփոխությունները վերականգնելու համար (կատարել \":help recovery\").\n" - -msgid " If you did this already, delete the swap file \"" -msgstr " Եթե սա արդեն կատարել եք, ապա ջնջեք սվեփ ֆայլը \"" - -msgid "" -"\"\n" -" to avoid this message.\n" -msgstr "" -"\"\n" -" այս հաղորդագրությունը հետագայում չստանալու համար.\n" - -msgid "Found a swap file that is not useful, deleting it" -msgstr "Գտնվել է փոխանակման ֆայլ, որն օգտակար չէ, ջնջում ենք այն" - -msgid "Swap file \"" -msgstr "Սվեփ ֆայլ \"" - -msgid "\" already exists!" -msgstr "\" արդեն գոյություն ունի!" - -msgid "VIM - ATTENTION" -msgstr "VIM - ՈՒՇԱԴՐՈՒԹՅՈՒՆ" - -msgid "Swap file already exists!" -msgstr "Սվեփ ֆայլն արդեն գոյություն ունի!" - -msgid "" -"&Open Read-Only\n" -"&Edit anyway\n" -"&Recover\n" -"&Quit\n" -"&Abort" -msgstr "" -"&Բացել միայն կարդալու համար\n" -"&Խմբագրել\n" -"&Վերականգնել\n" -"&Դուրս գալ\n" -"&Ընդհատել" - -msgid "" -"&Open Read-Only\n" -"&Edit anyway\n" -"&Recover\n" -"&Delete it\n" -"&Quit\n" -"&Abort" -msgstr "" -"&OԲացել միայն կարդալու համար\n" -"&E Խմբագրել\n" -"&R Վերականգնել\n" -"&D Ջնջել\n" -"&Q Դուրս գալ\n" -"&A Ընդհատել" - -msgid "" -"\n" -"--- Menus ---" -msgstr "" -"\n" -"--- Ցանկ ---" - -msgid "Tear off this menu" -msgstr "Անջատել այս մենյուն" - -#, c-format -msgid "Error detected while compiling %s:" -msgstr "Հայտնաբերվել է սխալ մշակման ժամանակ: %s:" - -#, c-format -msgid "Error detected while processing %s:" -msgstr "Հայտնաբերվել է սխալ %s մշակման ժամանակ:" - -#, c-format -msgid "line %4ld:" -msgstr "տող %4ld:" - -msgid "Messages maintainer: The Vim Project" -msgstr "Հայերեն թարգմանության հեղինակ։ Գագիկ Հակոբյան" - -msgid "Interrupt: " -msgstr "Ընդհատում: " - -msgid "Press ENTER or type command to continue" -msgstr "Շարունակելու համար սեղմել ENTER կամ տալ որևէ այլ հրաման" - -#, c-format -msgid "%s line %ld" -msgstr "%s տող %ld" - -msgid "-- More --" -msgstr "-- Տեսնել ավելին --" - -msgid " SPACE/d/j: screen/page/line down, b/u/k: up, q: quit " -msgstr " SPACE/d/j: էկրան/էջ/տողը ներքևից, b/u/k: վերև, q: ելք " - -msgid "Question" -msgstr "Հարց" - -msgid "" -"&Yes\n" -"&No" -msgstr "" -"&Այո\n" -"&Ոչ" - -msgid "" -"&Yes\n" -"&No\n" -"Save &All\n" -"&Discard All\n" -"&Cancel" -msgstr "" -"&Այո\n" -"&Ոչ\n" -"&Պահպանել բոլորը\n" -"&Կորցնել բոլորը\n" -"&Ընդհատել" - -msgid "Type number and or click with the mouse (q or empty cancels): " -msgstr "" -"Մուտքագրել թիվ և կամ կտտացնել մկնիկով (q կամ դատարկ՝ չեղարկման համար)" -": " - -msgid "Type number and (q or empty cancels): " -msgstr "Մուտքագրել թիվ և (դատարկ՝ չեղարկման համար): " - -#, c-format -msgid "%ld more line" -msgid_plural "%ld more lines" -msgstr[0] "ավելացված տողերի քանակը: %ld" -msgstr[1] "ավելացված տողերի քանակը: %ld" - -#, c-format -msgid "%ld line less" -msgid_plural "%ld fewer lines" -msgstr[0] "մեկ տող ջնջվել է" -msgstr[1] "%ld տողեր ջնջվել են" - -msgid " (Interrupted)" -msgstr " (Ընդհատված)" - -msgid "Beep!" -msgstr "Ազդանշան!" - -#, c-format -msgid "Calling shell to execute: \"%s\"" -msgstr "Հրամանի կատարման համար կանչվում է տերմինալը: \"%s\"" - -msgid "Warning: terminal cannot highlight" -msgstr "Զգուշացում: տերմինալը չի կարող գունանշել" - -msgid "Type :qa! and press to abandon all changes and exit Vim" -msgstr "Vim-ն ընդհատելու համար մուտքագրել :qa! հրամանը" - -msgid "Type :qa and press to exit Vim" -msgstr "Vim-ն ընդհատելու համար մուտքագրել :qa հրամանը" - -#, c-format -msgid "%ld line %sed %d time" -msgid_plural "%ld line %sed %d times" -msgstr[0] "%ld տող %sed %d անգամ" -msgstr[1] "%ld տողեր %sed %d անգամ" - -#, c-format -msgid "%ld lines %sed %d time" -msgid_plural "%ld lines %sed %d times" -msgstr[0] "%ld տող %sed %d անգամ" -msgstr[1] "%ld տողեր %sed %d անգամ" - -msgid "cannot yank; delete anyway" -msgstr "պատճենել հնարավոր չէ, ամեն դեպքում ջնջել" - -#, c-format -msgid "%ld line changed" -msgid_plural "%ld lines changed" -msgstr[0] "փոփոխվել է %ld հատ տող" -msgstr[1] "փոփոխվել են %ld հատ տողեր" - -#, c-format -msgid "%d line changed" -msgid_plural "%d lines changed" -msgstr[0] "փոփոխվել է %d հատ տող" -msgstr[1] "փոփոխվել են %d հատ տողեր" - -#, c-format -msgid "%ld Cols; " -msgstr "Սյուն: %ld; " - -#, c-format -msgid "Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Bytes" -msgstr "Նշված է %s%ld %ld տողերից; %lld %lld բառերից; %lld %lld բայթերից" - -#, c-format -msgid "" -"Selected %s%ld of %ld Lines; %lld of %lld Words; %lld of %lld Chars; %lld of " -"%lld Bytes" -msgstr "" -"Նշված %s%ld-ից %ld տողեր; %lld %lld բառեր; %lld %lld տառեր; %lld %lld բայթեր" - -#, c-format -msgid "Col %s of %s; Line %ld of %ld; Word %lld of %lld; Byte %lld of %lld" -msgstr "Սյուն %s %s֊ից; Տող %ld %ld-ից; Բառեր %lld %lld֊ից; Բայթ %lld %lld-ից" - -#, c-format -msgid "" -"Col %s of %s; Line %ld of %ld; Word %lld of %lld; Char %lld of %lld; Byte " -"%lld of %lld" -msgstr "" -"Սյուն %s %s-ից; Տող %ld %ld-ից; Բառեր %lld %lld-ից; Տառեր %lld %lld-ից; Բայթ " -"%lld %lld-ից" - -#, c-format -msgid "(+%lld for BOM)" -msgstr "(+%lld BOM-ի համար)" - -msgid "W17: Arabic requires UTF-8, do ':set encoding=utf-8'" -msgstr "" -"W17: Արաբերենը պահանջում է UTF-8, կատարել ':set encoding=UTF-8' հրամանը" - -msgid "" -"\n" -"--- Terminal codes ---" -msgstr "" -"\n" -"--- Տերմինալային կոդեր ---" - -msgid "" -"\n" -"--- Global option values ---" -msgstr "" -"\n" -"--- Գլոբալ կարգանշման արժեքները ---" - -msgid "" -"\n" -"--- Local option values ---" -msgstr "" -"\n" -"--- Լոկալ կարգանշման արժեքները ---" - -msgid "" -"\n" -"--- Options ---" -msgstr "" -"\n" -"--- Կարգանշաններ ---" - -msgid "cannot open " -msgstr "չի կարող բացվել " - -msgid "" -"VIM: Can't open window!\n" -msgstr "" -"VIM: Հնարավոր չէ բացել պատուհանը!\n" - -msgid "" -"Need Amigados version 2.04 or later\n" -msgstr "" -"Պետք է Amigados տարբերակ 2.04 կամ ավելի նոր տարբերակ\n" - -#, c-format -msgid "" -"Need %s version %ld\n" -msgstr "" -"Անհրաժեշտ է %s տարբերակ %ld\n" - -msgid "" -"Cannot open NIL:\n" -msgstr "" -"Անհնար է բացել NIL:\n" - -msgid "Cannot create " -msgstr "Անհնար է ստեղծել " - -#, c-format -msgid "" -"Vim exiting with %d\n" -msgstr "" -"Vim-ը ավարտվում է %d-ով\n" - -msgid "" -"cannot change console mode ?!\n" -msgstr "" -"չեք կարող փոխել վահանակի ռեժիմը ?!\n" - -msgid "" -"mch_get_shellsize: not a console??\n" -msgstr "" -"mch_get_shellsize: не в консоли??\n" - -msgid "Cannot execute " -msgstr "Անհնար է կատարել " - -msgid "shell " -msgstr "տերմինալ " - -msgid "" -" returned\n" -msgstr "" -" ավարտել է\n" - -msgid "ANCHOR_BUF_SIZE too small." -msgstr "ANCHOR_BUF_SIZE չափազանց փոքր է:" - -msgid "I/O ERROR" -msgstr "I/O ՍԽԱԼ" - -msgid "Message" -msgstr "Հաղորդում" - -#, c-format -msgid "to %s on %s" -msgstr "to %s on %s" - -#, c-format -msgid "Printing '%s'" -msgstr "'%s'-ի տպում" - -msgid "DefaultFontNameForWindows" -msgstr "DefaultFontNameForWindows" - -#, c-format -msgid "Opening the X display took %ld msec" -msgstr "X էկրանը բացելը տևեց %ld վրկ" - -msgid "" -"\n" -"Vim: Got X error\n" -msgstr "" -"\n" -"Vim: X-ի սխալ\n" - -#| msgid "Testing the X display failed" -msgid "restoring display %s" -msgstr "էկրանի վերականգնում %s" - -msgid "Testing the X display failed" -msgstr "X էկրանի փորձարկումը ձախողվեց" - -msgid "Opening the X display timed out" -msgstr "X էկրանը բացելու ժամանակը սպառվել է" - -msgid "" -"\n" -"Could not get security context for " -msgstr "" -"\n" -"Հնարավոր չէ ստանալ գաղտնի կոտնտեքստ " - -msgid "" -"\n" -"Could not set security context for " -msgstr "" -"\n" -"Հնարավոր չէ կարգավորել գաղտնի կոտնտեքստ " - -#| msgid "" -#| "\n" -#| "Could not set security context for " -msgid "Could not set security context %s for %s" -msgstr "Հնարավոր չէ %s-ի համար կարգավորել գաղտնի կոնտեքստ %s-ը" - -#| msgid "" -#| "\n" -#| "Could not get security context for " -msgid "Could not get security context %s for %s. Removing it!" -msgstr "" -"Չհաջողվեց ստանալ անվտանգության համատեքստ %s %s-ի համար: Հեռացնում ենք այն!" - -msgid "" -"\n" -"Cannot execute shell sh\n" -msgstr "" -"\n" -"Հնարավոր չէ կատարել sh տերմինալը\n" - -msgid "" -"\n" -"shell returned " -msgstr "" -"\n" -"տերմինալը վերադարձրել է " - -msgid "" -"\n" -"Cannot create pipes\n" -msgstr "" -"\n" -"Հնարավոր չէ ստեղծէլ սրնգափող\n" - -msgid "" -"\n" -"Cannot fork\n" -msgstr "" -"\n" -"Հնարավոր չէ կատարել fork()\n" - -msgid "" -"\n" -"Cannot execute shell " -msgstr "" -"\n" -"Հնարավոր չէ կատարել տերմինալը " - -msgid "" -"\n" -"Command terminated\n" -msgstr "" -"\n" -"Հրամանն ընդհատված է\n" - -msgid "XSMP lost ICE connection" -msgstr "XSMP ICE կապակցման կորուստ" - -#, c-format -msgid "Could not load gpm library: %s" -msgstr "Հնարավոր չէր բեռնել %s գրադարանը" - -#, c-format -msgid "dlerror = \"%s\"" -msgstr "dlerror = \"%s\"" - -msgid "Opening the X display failed" -msgstr "X էկրանի բացումը ձախողվեց" - -msgid "XSMP handling save-yourself request" -msgstr "XSMP կատարում է ինքնապահպանում" - -msgid "XSMP opening connection" -msgstr "XSMP֊ն կապակցում է բացում" - -msgid "XSMP ICE connection watch failed" -msgstr "XSMP ICE կապակցման դիտարկումն անհաջող է ավարտվել" - -#, c-format -msgid "XSMP SmcOpenConnection failed: %s" -msgstr "XSMP SmcOpenConnection անհաջող է ավարտվել: %s" - -msgid "At line" -msgstr "Տողում" - -#, c-format -msgid "" -"Vim: Caught %s event\n" -msgstr "" -"Vim: Բռնվել է %s բացառումը\n" - -msgid "close" -msgstr "փակել" - -msgid "logoff" -msgstr "անջատում" - -msgid "shutdown" -msgstr "ելք" - -msgid "" -"VIMRUN.EXE not found in your $PATH.\n" -"External commands will not pause after completion.\n" -"See :help win32-vimrun for more information." -msgstr "" -"VIMRUN.EXE֊ն չի հայտնաբերվել $PATH ճանապարհներում.\n" -"Արտաքին հրամանները կանգ չեն առնի ավարտից հետո.\n" -"Հավելյալ տեղեկատվության համար տես :help win32-vimrun." - -msgid "Vim Warning" -msgstr "Vim Զգուշացում" - -#, c-format -msgid "shell returned %d" -msgstr "shell վերադարձել է %d" - -#, c-format -msgid "(%d of %d)%s%s: " -msgstr "(%d %d֊ից)%s%s: " - -msgid " (line deleted)" -msgstr " (տողը ջնջվել է)" - -#, c-format -msgid "%serror list %d of %d; %d errors " -msgstr "%sսխալների ցանկ %d %d-ից; %d սխալներ " - -msgid "No entries" -msgstr "Գրառումներ չկան" - -msgid "Error file" -msgstr "Ֆայլի սխալ" - -#, c-format -msgid "Cannot open file \"%s\"" -msgstr "Հնարավոր չէ բացել \"%s\" ֆայլը" - -msgid "cannot have both a list and a \"what\" argument" -msgstr "չի կարող ունենալ և՛ ցուցակ, և՛ \"what\" փաստարկ" - -msgid "Switching to backtracking RE engine for pattern: " -msgstr "Նախշի համար անցում կատարվող RE շարժիչին. " - -msgid "" -"External submatches:\n" -msgstr "" -"Արտաքին ենթահամընկնում:\n" - -msgid "Could not open temporary log file for writing, displaying on stderr... " -msgstr "" -"Չհաջողվեց բացել ժամանակավոր գրանցամատյանի ֆայլը գրելու համար, որը " -"ցուցադրվում է stderr... " - -#, c-format -msgid " into \"%c" -msgstr " մեջ \"%c\"" - -#, c-format -msgid "block of %ld line yanked%s" -msgid_plural "block of %ld lines yanked%s" -msgstr[0] "պատճենվել է %ld տողանոց բլոկ%s" -msgstr[1] "պատճենվել է %ld տողանոց բլոկ%s" - -#, c-format -msgid "%ld line yanked%s" -msgid_plural "%ld lines yanked%s" -msgstr[0] "%ld տող պատճենվել է%s" -msgstr[1] "%ld տողեր պատճենվել են%s" - -msgid "" -"\n" -"Type Name Content" -msgstr "" -"\n" -"Տիպ Անուն Պարունակություն" - -msgid " VREPLACE" -msgstr " ԶՆՆԱԿԱՆ ՓՈԽԱՐԻՆՈՒՄ" - -msgid " REPLACE" -msgstr " ՓՈԽԱՐԻՆՈՒՄ" - -msgid " REVERSE" -msgstr " ՀԱԿԱԴԱՐՁ" - -msgid " INSERT" -msgstr " ԶԵՏԵՂՈՒՄ" - -msgid " (insert)" -msgstr " (զետեղում)" - -msgid " (replace)" -msgstr " (փոխարինում)" - -msgid " (vreplace)" -msgstr " (զննական փոխարինում)" - -msgid " Hebrew" -msgstr " Եբրայական" - -msgid " Arabic" -msgstr " Արաբական" - -msgid " (paste)" -msgstr " (փակցնել)" - -msgid " VISUAL" -msgstr " ԶՆՆԱԿԱՆ ՌԵԺԻՄ" - -msgid " VISUAL LINE" -msgstr " ԶՆՆԱԿԱՆ ՏՈՂ" - -msgid " VISUAL BLOCK" -msgstr " ԶՆՆԱԿԱՆ ԲԼՈԿ" - -msgid " SELECT" -msgstr " ՆՇՄԱՆ ՌԵԺԻՄ" - -msgid " SELECT LINE" -msgstr " ՆՇՄԱՆ ՏԵՂ" - -msgid " SELECT BLOCK" -msgstr " ՆՇՄԱՆ ԲԼՈԿ" - -msgid "recording" -msgstr "գրառում" - -#, c-format -msgid "Searching for \"%s\" under \"%s\" in \"%s\"" -msgstr "Որոնում \"%s\" \"%s\"֊ում \"%s\"-ի մեջ" - -#, c-format -msgid "Searching for \"%s\" in \"%s\"" -msgstr "Որոնում \"%s\" \"%s\"֊ում" - -#, c-format -msgid "Searching for \"%s\"" -msgstr "Որոնում \"%s\"" - -#, c-format -msgid "not found in '%s': \"%s\"" -msgstr "չի հայտնաբերվել: '%s': \"%s\"" - -msgid "Source Vim script" -msgstr "Կցել Vim սկրիպտ" - -#, c-format -msgid "Cannot source a directory: \"%s\"" -msgstr "Անհնար է կցել թղթապանակ: \"%s\"" - -#, c-format -msgid "could not source \"%s\"" -msgstr "անհնար է կցել \"%s\"" - -#, c-format -msgid "line %ld: could not source \"%s\"" -msgstr "տող %ld: Անհնար է կցել \"%s\"" - -#, c-format -msgid "sourcing \"%s\"" -msgstr "\"%s\"-ի կցում" - -#, c-format -msgid "line %ld: sourcing \"%s\"" -msgstr "տող %ld: \"%s\"-ի կցում" - -#, c-format -msgid "finished sourcing %s" -msgstr "%s֊ի կցումն ավարտվել է" - -#, c-format -msgid "continuing in %s" -msgstr "շարունակվում է %s" - -msgid "modeline" -msgstr "տողային ռեժիմ" - -msgid "--cmd argument" -msgstr "--cmd արգումենտ" - -msgid "-c argument" -msgstr "-c արգումենտ" - -msgid "environment variable" -msgstr "շրջապատման արգումենտ" - -msgid "error handler" -msgstr "սխալի մշակիչ" - -msgid "changed window size" -msgstr "պատուհանի չափը փոխվել է" - -msgid "W15: Warning: Wrong line separator, ^M may be missing" -msgstr "" -"W15: Զգուշացում: Սխալ տրված տողի բաժանիչ. Հնարավոր է ^M֊ը բաց է թողնված" - -msgid " (includes previously listed match)" -msgstr " (ընդգրկում է նախկինում ցուցադրված համընկնումը)" - -msgid "--- Included files " -msgstr "--- Կցաֆայլեր " - -msgid "not found " -msgstr "չի հայտնաբերվել " - -msgid "" -"in path ---\n" -msgstr "" -"ճանապարհում ---\n" - -msgid " (Already listed)" -msgstr " (Արդեն ցուցադրված է)" - -msgid " NOT FOUND" -msgstr " ՀԱՅՏՆԱԲԵՐՎԱԾ ՉԷ" - -#, c-format -msgid "Scanning included file: %s" -msgstr "Կցվաֆայլերի ցուցադրում: %s" - -#, c-format -msgid "Searching included file %s" -msgstr "%s կցաֆայլի որոնում" - -msgid "All included files were found" -msgstr "Բոլոր կցաֆայլերն հայտնաբերվել են" - -msgid "No included files" -msgstr "Կցաֆայլեր չկան" - -msgid "Save View" -msgstr "Դիտման պահպանում" - -msgid "Save Session" -msgstr "Սեսսիայի պահպանում" - -msgid "Save Setup" -msgstr "Կարգավորման պահպանում" - -msgid "[Deleted]" -msgstr "[Ջնջված է]" - -msgid "" -"\n" -"--- Signs ---" -msgstr "" -"\n" -"--- Նշաններ ---" - -#, c-format -msgid "Signs for %s:" -msgstr "%s-ի նշաններ:" - -#, c-format -msgid " group=%s" -msgstr " group=%s" - -#, c-format -msgid " line=%ld id=%d%s name=%s priority=%d" -msgstr " տող=%ld համար=%d%s անուն=%s կարգ=%d" - -msgid " (NOT FOUND)" -msgstr " (ՉԻ ՀԱՅՏՆԱԲԵՐՎԵԼ)" - -msgid " (not supported)" -msgstr " (չի աջակցվում)" - -#, c-format -msgid "Warning: Cannot find word list \"%s_%s.spl\" or \"%s_ascii.spl\"" -msgstr "" -"Զգուշացում. հնարավոր չէ գտնել \"%s_%s.spl\" կամ \"%s_ascii.spl\" բառերի ցանկը" - -#, c-format -msgid "Warning: Cannot find word list \"%s.%s.spl\" or \"%s.ascii.spl\"" -msgstr "" -"Զգուշացում. հնարավոր չէ գտնել \"%s.%s.spl\" կամ \"%s.ascii.spl\" բառերի " -"ցանկը:" - -#, c-format -msgid "Warning: region %s not supported" -msgstr "Զգուշացում. ռեգիոնը %s չի աջակցվում" - -#, c-format -msgid "Trailing text in %s line %d: %s" -msgstr "Հետևյալ տեքստ %s տողում %d՝ %s" - -#, c-format -msgid "Affix name too long in %s line %d: %s" -msgstr "Անունը չափազանց երկար դրեք %s տողում %d՝ %s" - -msgid "Compressing word tree..." -msgstr "Բառի ծառի սեղմում..." - -#, c-format -msgid "Reading spell file \"%s\"" -msgstr "\"%s\" ուղղագրման ֆայլի ընթերցում" - -#| msgid "Reading undo file: %s" -msgid "Reading affix file %s..." -msgstr "Կարդում է կցված ֆայլը %s..." - -#, c-format -msgid "Conversion failure for word in %s line %d: %s" -msgstr "%s տող %d բառի փոխակերպման ձախողում. %s" - -#, c-format -msgid "Conversion in %s not supported: from %s to %s" -msgstr "Փոխակերպումը %s-ում չի աջակցվում՝ %s-ից %s" - -#, c-format -msgid "Invalid value for FLAG in %s line %d: %s" -msgstr "ԴՐՈՇՄԱՆԻՇԻ անվավեր արժեք %s֊ում, տող %d: %s" - -#, c-format -msgid "FLAG after using flags in %s line %d: %s" -msgstr "ԴՐՈՇՄԱՆԻՇ դրոշմանիշի օգտագործումից հետո, %s, տող %d: %s" - -#, c-format -msgid "" -"Defining COMPOUNDFORBIDFLAG after PFX item may give wrong results in %s line " -"%d" -msgstr "" -"PFX կետից հետո COMPOUNDFORBIDFLAG սահմանելը կարող է սխալ արդյունքներ տալ %s " -"տող %d-ում" - -#, c-format -msgid "" -"Defining COMPOUNDPERMITFLAG after PFX item may give wrong results in %s line " -"%d" -msgstr "" -"PFX կետից հետո COMPOUNDPERMITFLAG սահմանելը կարող է սխալ արդյունքներ տալ %s " -"տող %d-ում" - -#, c-format -msgid "Wrong COMPOUNDRULES value in %s line %d: %s" -msgstr "Սխալ COMPOUNDRULES արժեքը %s տողում %d՝ %s" - -#, c-format -msgid "Wrong COMPOUNDWORDMAX value in %s line %d: %s" -msgstr "Սխալ COMPOUNDWORDMAX արժեք %s տող %d-ում՝ %s" - -#, c-format -msgid "Wrong COMPOUNDMIN value in %s line %d: %s" -msgstr "Սխալ COMPOUNDMIN արժեք %s տող %d-ում՝ %s" - -#, c-format -msgid "Wrong COMPOUNDSYLMAX value in %s line %d: %s" -msgstr "Սխալ COMPOUNDSYLMAX արժեք %s տող %d. %s" - -#, c-format -msgid "Wrong CHECKCOMPOUNDPATTERN value in %s line %d: %s" -msgstr "Սխալ CHECKCOMPOUNDPATTERN արժեքը %s տողում %d՝ %s" - -#, c-format -msgid "Different combining flag in continued affix block in %s line %d: %s" -msgstr "" -"Տարբեր միավորման դրոշմանիշեր շարունակական affix բլոկում, %s, տող %d: %s" - -#, c-format -msgid "Duplicate affix in %s line %d: %s" -msgstr "Կրկնակի affix %s֊ում, տող %d: %s" - -#, c-format -msgid "" -"Affix also used for BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST in %s " -"line %d: %s" -msgstr "" -"Affix֊ը օգտագործվել է նաև " -"BAD/RARE/KEEPCASE/NEEDAFFIX/NEEDCOMPOUND/NOSUGGEST֊ի համար՝ %s֊ում, տող %d: " -"%s" - -#, c-format -msgid "Expected Y or N in %s line %d: %s" -msgstr "Ակնկալվում է Y կամ N %s տողում %d՝ %s" - -#, c-format -msgid "Broken condition in %s line %d: %s" -msgstr "Կոտրված վիճակ %s տող %d. %s" - -#, c-format -msgid "Expected REP(SAL) count in %s line %d" -msgstr "Սպասվող REP(SAL) քանակը %s տողում %d" - -#, c-format -msgid "Expected MAP count in %s line %d" -msgstr "Սպասվող ՔԱՐՏԵԶԻ հաշվարկ %s տողում %d" - -#, c-format -msgid "Duplicate character in MAP in %s line %d" -msgstr "Կրկնակի տառ MAP֊ում, %s, տող %d" - -#, c-format -msgid "Unrecognized or duplicate item in %s line %d: %s" -msgstr "Անծանոթ կամ կրկնակի էլեմենտ %s֊ում, տող %d: %s" - -#, c-format -msgid "Missing FOL/LOW/UPP line in %s" -msgstr "%s-ում բացակայում է FOL/LOW/UPP տողը" - -msgid "COMPOUNDSYLMAX used without SYLLABLE" -msgstr "COMPOUNDSYLMAX֊ն օգտագործվում է առանց SYLLABLE" - -msgid "Too many postponed prefixes" -msgstr "Աննախադեպ շատ հետաձգված նախածանցներ" - -msgid "Too many compound flags" -msgstr "Աննախադեպ շատ պարփակման դրոշմանիշեր" - -msgid "Too many postponed prefixes and/or compound flags" -msgstr "Աննախադեպ շատ հետաձգված նախածանցներ կամ պարփակման դրոշմանիշեր" - -#, c-format -msgid "Missing SOFO%s line in %s" -msgstr "Բացակայում է SOFO%s տողը %s-ում" - -#, c-format -msgid "Both SAL and SOFO lines in %s" -msgstr "SAL և SOFO գծերը %s-ում" - -#, c-format -msgid "Flag is not a number in %s line %d: %s" -msgstr "Դրոշմանիշը թիվ չէ, %s, տող %d: %s" - -#, c-format -msgid "Illegal flag in %s line %d: %s" -msgstr "Չթույլատրված դրոշմանիշ, %s տող %d: %s" - -#, c-format -msgid "%s value differs from what is used in another .aff file" -msgstr "%s արժեքը տարբերէ այլ .aff ֆայլում օգտագործված արժեքից" - -#| msgid "Reading undo file: %s" -msgid "Reading dictionary file %s..." -msgstr "Բառարանի ֆայլի ընթերցում %s..." - -#| msgid "line %ld: %s" -msgid "line %6d, word %6ld - %s" -msgstr "տող %6d, բառ %6ld - %s" - -#, c-format -msgid "Duplicate word in %s line %d: %s" -msgstr "Կրկնակի բառ %s֊ում, տող %d: %s" - -#, c-format -msgid "First duplicate word in %s line %d: %s" -msgstr "Առաջին կրկնված բառը %s֊ում, տող %d: %s" - -#, c-format -msgid "%d duplicate word(s) in %s" -msgstr "%d կրկնվող բառեր՝ %s֊ում" - -#, c-format -msgid "Ignored %d word(s) with non-ASCII characters in %s" -msgstr "Անտեսված %d բառեր՝ ոչ ASCII նշաններով, %s" - -#| msgid "Reading undo file: %s" -msgid "Reading word file %s..." -msgstr "Word ֆայլի ընթերցում %s..." - -#| msgid "Conversion failure for word in %s line %d: %s" -msgid "Conversion failure for word in %s line %ld: %s" -msgstr "%s տող %ld բառի փոխակերպման ձախողում. %s" - -#| msgid "Duplicate /regions= line ignored in %s line %ld: %s" -msgid "Duplicate /encoding= line ignored in %s line %ld: %s" -msgstr "Կրկնվող /encoding= տողը անտեսվել է %s տողում %ld՝ %s" - -#, c-format -msgid "/encoding= line after word ignored in %s line %ld: %s" -msgstr "/encoding= տողն անտեսված է %s֊ում, տող %ld: %s" - -#, c-format -msgid "Duplicate /regions= line ignored in %s line %ld: %s" -msgstr "Կրկնակի /regions= տողն անտեսված է %s֊ում, տող %ld: %s" - -#, c-format -msgid "Too many regions in %s line %ld: %s" -msgstr "Աննախադեպ շատ ռեգիոններ %s֊ում, տող %ld: %s" - -#, c-format -msgid "/ line ignored in %s line %ld: %s" -msgstr "/ տեղն անտեսվել է %s֊ում, տող %ld: %s" - -#, c-format -msgid "Invalid region nr in %s line %ld: %s" -msgstr "Անվավեր տարածաշրջանի թիվ %s տողում %ld՝ %s" - -#, c-format -msgid "Unrecognized flags in %s line %ld: %s" -msgstr "Անծանոթ դրոշմանիշ, %s, տող %ld: %s" - -#, c-format -msgid "Ignored %d words with non-ASCII characters" -msgstr "Անտեսված %d բառեր՝ ոչ ASCII նշաններով" - -#, c-format -msgid "Compressed %s: %ld of %ld nodes; %ld (%ld%%) remaining" -msgstr "Սեղմված են %s. %ld %ld հանգույցներ; մնացել է %ld (%ld%%)" - -msgid "Reading back spell file..." -msgstr "Ուղղագրման ֆայլի վերականգնում..." - -msgid "Performing soundfolding..." -msgstr "Կատարվում է ձայնափաթաթ..." - -#, c-format -msgid "Number of words after soundfolding: %ld" -msgstr "Բառերի քանակը՝ ձայնափաթաթից հետո: %ld" - -#, c-format -msgid "Total number of words: %d" -msgstr "Բառերի ընդհանուր քանակը՝ %d" - -#| msgid "Writing spell file %s..." -msgid "Writing suggestion file %s..." -msgstr "Առաջարկի ֆայլը գրուվում է %s..." - -#, c-format -msgid "Estimated runtime memory use: %d bytes" -msgstr "Գործարկման հիշողության գնահատված օգտագործումը՝ %d բայթ" - -msgid "Warning: both compounding and NOBREAK specified" -msgstr "Զգուշացում: պարփակումն ու NOBREAK֊ը միաժամանակ են տրված" - -#, c-format -msgid "Writing spell file %s..." -msgstr "ՈՒղղագրման ֆայլի պահպանում %s..." - -msgid "Done!" -msgstr "Ավարտված է!" - -#, c-format -msgid "Word '%.*s' removed from %s" -msgstr "'%.*s' բառը հեռացվել է %s-ից" - -#| msgid "E294: Seek error in swap file read" -msgid "Seek error in spellfile" -msgstr "Սխալ փնտրեք spellfile-ում" - -#, c-format -msgid "Word '%.*s' added to %s" -msgstr "'%.*s' բառն ավելացվել է %s-ին" - -msgid "Sorry, no suggestions" -msgstr "Կներեք, առաջարկներ չկան" - -#, c-format -msgid "Sorry, only %ld suggestions" -msgstr "Ներողություն, միայն %ld առաջարկ" - -#, c-format -msgid "Change \"%.*s\" to:" -msgstr "Փոխել \"%.*s\"-ը հետևյալին:" - -#, c-format -msgid " < \"%.*s\"" -msgstr " < \"%.*s\"" - -msgid "No Syntax items defined for this buffer" -msgstr "Այս բուֆերի համար ուղղագրական տարրեր սահմանված չեն" - -msgid "'redrawtime' exceeded, syntax highlighting disabled" -msgstr "'redrawtime'-ը գերազանցվել է, ուղղագրական գունանշումն անջատված է" - -msgid "syntax iskeyword not set" -msgstr "ուղղագրական iskeyword-ը սահմանված չէ" - -#| msgid "" -#| "\n" -#| "syncing on items" -msgid "syncing on C-style comments" -msgstr "C-style մեկնաբանությունների համաժամանակեցում" - -msgid "no syncing" -msgstr "առանց սինխրոնիզացման" - -#| msgid "syncing starts " -msgid "syncing starts at the first line" -msgstr "համաժամացումը սկսվում է առաջին տողից" - -msgid "syncing starts " -msgstr "համաժամանակեցումն սկսվում է " - -msgid " lines before top line" -msgstr " տողեր՝ վերևի տողից առաջ" - -msgid "" -"\n" -"--- Syntax sync items ---" -msgstr "" -"\n" -"--- Ուղղագրական համապատասխանեցման էլեմենտներ ---" - -msgid "" -"\n" -"syncing on items" -msgstr "" -"\n" -"էլեմենտների համաժամանակեցում" - -msgid "" -"\n" -"--- Syntax items ---" -msgstr "" -"\n" -"--- Ուղղագրական էլեմենտներ ---" - -#| msgid "Word from other line" -msgid "from the first line" -msgstr "առաջին տողից" - -msgid "minimal " -msgstr "նվազագույն " - -msgid "maximal " -msgstr "առավելագույնը " - -msgid "; match " -msgstr "; համընկնում " - -msgid " line breaks" -msgstr " տողի ընդհատում" - -msgid "" -" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN" -msgstr "" -" ԱՄԲՈՂՋ ՔԱՆԱԿ ՀԱՄԸՆԿՆՈՒՄ ՄՆԱՑՅԱԼ ՄԻՋԻՆ ԱՆՈՒՆ " -"ՕՐԻՆԱԿ" - -#, c-format -msgid "File \"%s\" does not exist" -msgstr "\"%s\" Ֆայլը գոյություն չունի" - -#, c-format -msgid "tag %d of %d%s" -msgstr "պիտակ %d %d%s-ի" - -msgid " or more" -msgstr " կամ ավելին" - -msgid " Using tag with different case!" -msgstr " Օգտագործելով տարբեր գործերով պիտակ!" - -msgid " # pri kind tag" -msgstr " #pri kind պիտակ" - -msgid "" -"file\n" -msgstr "" -"ֆայլ\n" - -msgid "" -"\n" -" # TO tag FROM line in file/text" -msgstr "" -"\n" -" # TO պիտակել FROM տողում ֆայլում/տեքստում" - -msgid "Ignoring long line in tags file" -msgstr "Անտեսելով երկար տողը պիտակների ֆայլում" - -#, c-format -msgid "Before byte %ld" -msgstr "Նախքան բայթը %ld" - -#, c-format -msgid "Searching tags file %s" -msgstr "Որոնում %s պիտակների ֆայլում" - -#, c-format -msgid "Duplicate field name: %s" -msgstr "Կրկնակի դաշտի անուն: %s" - -msgid "' not known. Available builtin terminals are:" -msgstr "' անծանոթ է. Գոյություն ունեցող ներդրված տերմինալներն հետևյալն են:" - -msgid "defaulting to '" -msgstr "կանխադրվում է '" - -msgid "" -"\n" -"--- Terminal keys ---" -msgstr "" -"\n" -"--- Տերմինալի ստեղներ ---" - -#, c-format -msgid "Kill job in \"%s\"?" -msgstr "Վթարել աշխատանքը \"%s\"?" - -msgid "Terminal" -msgstr "Տերմինալ" - -#| msgid "finished" -msgid "Terminal-finished" -msgstr "Տերմինալը ավարտված է" - -msgid "active" -msgstr "ակտիվ" - -msgid "running" -msgstr "կատարվում է" - -msgid "finished" -msgstr "ավարտվել է" - -msgid "(Invalid)" -msgstr "(Անվավեր )" - -#, no-c-format -msgid "%a %b %d %H:%M:%S %Y" -msgstr "%a %b %d %H:%M:%S %Y" - -#, c-format -msgid "%ld second ago" -msgid_plural "%ld seconds ago" -msgstr[0] "%ld վայրկյան առաջ" -msgstr[1] "%ld վայրկյաններ առաջ" - -msgid "" -"new shell started\n" -msgstr "" -"սկսվեց նոր կեղևը\n" - -msgid "" -"Vim: Error reading input, exiting...\n" -msgstr "" -"Vim: Մուքի ընթերցման սխալ, ավարտում...\n" - -msgid "No undo possible; continue anyway" -msgstr "Չեղարկումն անհնար է; այնուամենայնիվ շարունակել" - -msgid "Cannot write undo file in any directory in 'undodir'" -msgstr "Հնարավոր չէ ամրագրել չեղրկման ֆայլը՝ 'undodir'-ի որևԷ ենթաթղթապանակում" - -#, c-format -msgid "Will not overwrite with undo file, cannot read: %s" -msgstr "Չեղարկման ֆայլը չի պահպանվելու, անհնար է ընթերցել: %s" - -#, c-format -msgid "Will not overwrite, this is not an undo file: %s" -msgstr "Չի պահպանվելու, սա չեղարկման ֆայլ չէ: %s" - -msgid "Skipping undo file write, nothing to undo" -msgstr "Չեղարկման ֆայլի ամրագրումն անտեսվում է, չեղարկումներ չկան" - -#, c-format -msgid "Writing undo file: %s" -msgstr "Չեղարկման ֆայլի պահպանում: %s" - -#, c-format -msgid "Not reading undo file, owner differs: %s" -msgstr "Չեղարկման ֆայլը չի ընթերցվելու, այն պատկանում է մեկ այլ օգտատիրոջը: %s" - -#, c-format -msgid "Reading undo file: %s" -msgstr "Չեղարկման ֆայլի ընթերցում: %s" - -msgid "File contents changed, cannot use undo info" -msgstr "" -"Ֆայլի պարունակությունը փոփոխվել է, հնարավոր չէ օգտագործել չեղարկման " -"տեղեկատվությունը" - -#, c-format -msgid "Finished reading undo file %s" -msgstr "Չեղարկման ֆայլի ընթերցումն ավարտվել է: %s" - -msgid "Already at oldest change" -msgstr "Արդեն հին փոփոխությունն է" - -msgid "Already at newest change" -msgstr "Արդեն նոր փոփոխությունն է" - -msgid "more line" -msgstr "տողեր ավելացել են" - -msgid "more lines" -msgstr "տողեր ավելացել են" - -msgid "line less" -msgstr "տողեր ջնջվել են" - -msgid "fewer lines" -msgstr "տողեր ջնջվել են" - -msgid "change" -msgstr "փոփոխել" - -msgid "changes" -msgstr "փոփոխություններ" - -#, c-format -msgid "%ld %s; %s #%ld %s" -msgstr "%ld %s; %s #%ld %s" - -msgid "before" -msgstr "առաջ" - -msgid "after" -msgstr "հետո" - -msgid "Nothing to undo" -msgstr "Չեղարկում չկա" - -msgid "number changes when saved" -msgstr "թվերը փոփոխվում են երբ պահպանված է" - -msgid "" -"\n" -" Name Args Address Complete Definition" -msgstr "" -"\n" -" Անուն Արգումենտներ Հասցե Վերջացնել Սահմանում" - -msgid "No user-defined commands found" -msgstr "Օգտատիրոջ սահմանած հրամաններ չեն հայտնաբերվել" - -#| msgid "E123: Undefined function: %s" -msgid "W22: Text found after :endfunction: %s" -msgstr "W22: Տեքստը գտնվել է :endfunction-ից հետո՝ %s" - -#, c-format -msgid "calling %s" -msgstr "կանչվում է %s" - -#, c-format -msgid "%s aborted" -msgstr "%s ընդհատված է" - -#, c-format -msgid "%s returning #%ld" -msgstr "%s վերադարձնում է #%ld" - -#, c-format -msgid "%s returning %s" -msgstr "%s վերադարձնում է %s" - -#| msgid "function %s does not exist" -msgid "Function %s%s%s does not need compiling" -msgstr "%s%s%s ֆունկցիան չի պահանջում կամպիլիացիա" - -#, c-format -msgid "%s (%s, compiled %s)" -msgstr "%s (%s, կազմվել է %s)" - -msgid "" -"\n" -"MS-Windows 64-bit GUI/console version" -msgstr "" -"\n" -"MS-Windows 64 բիթանոց կոնսոլ տարբերակ" - -msgid "" -"\n" -"MS-Windows 32-bit GUI/console version" -msgstr "" -"\n" -"MS-Windows 32 բիթանոց կոնսոլ տարբերակ" - -msgid "" -"\n" -"MS-Windows 64-bit GUI version" -msgstr "" -"\n" -"MS-Windows 64 բիթանոց գրաֆիկական ինտերֆեյս" - -msgid "" -"\n" -"MS-Windows 32-bit GUI version" -msgstr "" -"\n" -"MS-Windows 32 բիթանոց գրաֆիկական ինտերֆեյս" - -msgid " with OLE support" -msgstr " OLE աջակցումով" - -msgid "" -"\n" -"MS-Windows 64-bit console version" -msgstr "" -"\n" -"MS-Windows 64 բիթանոց կոսոլ տարբերակ" - -msgid "" -"\n" -"MS-Windows 32-bit console version" -msgstr "" -"\n" -"MS-Windows 32 բիթանոց կոնսոլ տարբերակ" - -msgid "" -"\n" -"macOS version" -msgstr "" -"\n" -"տարբերակ՝ macOS-ի համար" - -#| msgid "" -#| "\n" -#| "macOS version" -msgid "" -"\n" -"macOS version w/o darwin feat." -msgstr "" -"\n" -"macOS տարբերակ առանց darwin feat-ի:" - -msgid "" -"\n" -"OpenVMS version" -msgstr "" -"\n" -"Տարբերակ՝ OpenVMS-ի համար" - -msgid "" -"\n" -"Included patches: " -msgstr "" -"\n" -"կցված նմանակման ֆայլեր: " - -msgid "" -"\n" -"Extra patches: " -msgstr "" -"\n" -"Հավելյալ նմանակման ֆայլեր: " - -msgid "Modified by " -msgstr "Փոփոխված է " - -msgid "" -"\n" -"Compiled " -msgstr "" -"\n" -"Կառուցված է " - -msgid "by " -msgstr "հետ " - -msgid "" -"\n" -"Huge version " -msgstr "" -"\n" -"Մեծ տարբերակ " - -msgid "" -"\n" -"Normal version " -msgstr "" -"\n" -"Նորմալ տարբերակ " - -msgid "" -"\n" -"Tiny version " -msgstr "" -"\n" -"Փոքր տարբերակ\" " - -msgid "without GUI." -msgstr "առանց գրաֆիկական ինտերֆեյսի." - -#| msgid "with GTK2 GUI." -msgid "with GTK3 GUI." -msgstr "GTK3 GUI-ով:" - -msgid "with GTK2-GNOME GUI." -msgstr "GTK2-GNOME GUI-ով:" - -msgid "with GTK2 GUI." -msgstr "GTK2 GUI-ով:" - -msgid "with X11-Motif GUI." -msgstr "X11-Motif GUI-ով:" - -#| msgid "with GUI." -msgid "with Haiku GUI." -msgstr "Haiku GUI-ի հետ:" - -msgid "with Photon GUI." -msgstr "Photon GUI-ով:" - -msgid "with GUI." -msgstr "GUI-ով:" - -msgid "" -" Features included (+) or not (-):\n" -msgstr "" -" Առանձնահատկությունների միացում (+) և անջաատում (-):\n" - -msgid " system vimrc file: \"" -msgstr " համակարգային vimrc: \"" - -msgid " user vimrc file: \"" -msgstr " օգտատիրոջ ֆայլ vimrc: \"" - -msgid " 2nd user vimrc file: \"" -msgstr " օգտատիրոջ երկրորդ ֆայլ vimrc: \"" - -msgid " 3rd user vimrc file: \"" -msgstr " օգտատիրոջ երրորդ ֆայլ vimrc: \"" - -msgid " 4th user vimrc file: \"" -msgstr " օգտատիրոջ 4-րդ vimrc ֆայլ : \"" - -msgid " user exrc file: \"" -msgstr " օգտատիրոջ ֆայլ exrc: \"" - -msgid " 2nd user exrc file: \"" -msgstr " օգտատիրոջ երկրորդ ֆայլ exrc: \"" - -msgid " system gvimrc file: \"" -msgstr " համակարգային gvimrc: \"" - -msgid " user gvimrc file: \"" -msgstr " օգտատիրոջ ֆայլ gvimrc: \"" - -msgid "2nd user gvimrc file: \"" -msgstr "օգտատիրոջ երկրորդ ֆայլ gvimrc: \"" - -msgid "3rd user gvimrc file: \"" -msgstr "օգտատիրոջ երրորդ ֆայլ gvimrc: \"" - -#| msgid " user exrc file: \"" -msgid " defaults file: \"" -msgstr " լռելյայն ֆայլ." - -msgid " system menu file: \"" -msgstr " համակարգային մենյու ֆայլ: \"" - -msgid " fall-back for $VIM: \"" -msgstr " վերադարձ $VIM֊ին: \"" - -msgid " f-b for $VIMRUNTIME: \"" -msgstr " $VIMRUNTIME՝ ըստ լռելիության: \"" - -msgid "Compilation: " -msgstr "Կառուցման պարամետրեր: " - -msgid "Compiler: " -msgstr "Կառուցող: " - -msgid "Linking: " -msgstr "Կցագրում: " - -msgid " DEBUG BUILD" -msgstr " ԶՆՆՄԱՆ ԿԱՌՈՒՑՈՒՄ" - -msgid "VIM - Vi IMproved" -msgstr "VIM - Vi IMproved (բարելավված Vi)" - -msgid "version " -msgstr "տարբերակ " - -msgid "by Bram Moolenaar et al." -msgstr "այլք և Bram Moolenaar." - -msgid "Vim is open source and freely distributable" -msgstr "Vim֊ը բաց կոդով և ազատ տարածվող ծրագիր է" - -msgid "Help poor children in Uganda!" -msgstr "Օգնեցեք ՈՒգանդացի աղքատ երեխաներին!" - -msgid "type :help iccf for information " -msgstr "հավելյալ տեղեկատվության համար տալ :help iccf հրամանը " - -msgid "type :q to exit " -msgstr "ծրագրից դուրս գալու համար տալ :q հրամանը " - -msgid "type :help or for on-line help" -msgstr "օգնության համար տալ :help կամ հրամանը" - -msgid "type :help version9 for version info" -msgstr "այս տարբերակի մասին իմանալու համար տալ :help version9 հրամանը" - -msgid "Running in Vi compatible mode" -msgstr "Աշխատանք Vi հարմարեցված մոդում" - -#| msgid "type :help iccf for information " -msgid "type :set nocp for Vim defaults" -msgstr "տեսակ :set nocp Vim կանխադրվածների համար" - -msgid "type :help cp-default for info on this" -msgstr "հավելյալ տեղեկատվությոան համար տալ :help cp-default հրամանը" - -msgid "menu Help->Orphans for information " -msgstr "ինֆորմացիա ստանալու համար գնալ - Օգնություն->Որբեր " - -msgid "Running modeless, typed text is inserted" -msgstr "Անռեժիմ վիճակ, հավաքած տեքստի զետեղում" - -msgid "menu Edit->Global Settings->Toggle Insert Mode " -msgstr "մենյու Խմբագրել->Գլոբալ կարգավորումներ->Փոխարկել Տեղադրման ռեժիմը " - -msgid " for two modes " -msgstr " երկակի ռեժիմների համար " - -#| msgid "menu Edit->Global Settings->Toggle Insert Mode " -msgid "menu Edit->Global Settings->Toggle Vi Compatible" -msgstr "մենյու Խմբագրել->Գլոբալ կարգավորումներ->Փոխարկել Vi Compatible" - -msgid " for Vim defaults " -msgstr " Vim-ի լռելիությամբ արժեքների համար " - -msgid "Sponsor Vim development!" -msgstr "Օգնեցեք բարելավել Vim֊ը!" - -msgid "Become a registered Vim user!" -msgstr "Դարձեք Vim-ի ռեգիստրացված օգտատեր!" - -msgid "type :help sponsor for information " -msgstr "" -"հավելյալ տեղեկատվություն ստանալու համար տալ :help sponsor հրամանը " - -msgid "type :help register for information " -msgstr "" -"հավելյալ տեղեկատվություն ստանալու համար տալ :help register հրամանը " - -msgid "menu Help->Sponsor/Register for information " -msgstr "մենյու Օգնություն->Հովանավոր/Գրանցվել տեղեկությունների համար " - -msgid "global" -msgstr "գլոբալ" - -msgid "buffer" -msgstr "բուֆեր" - -msgid "window" -msgstr "պատուհան" - -msgid "tab" -msgstr "թաբ" - -msgid "[end of lines]" -msgstr "[տողի վերջ]" - -msgid "" -"\n" -"# Buffer list:\n" -msgstr "" -"\n" -"# Բուֆերային ցուցակ.\n" - -#, c-format -msgid "" -"\n" -"# %s History (newest to oldest):\n" -msgstr "" -"\n" -"# %s Պատմություն (նորագույնից ամենահին).\n" - -msgid "Command Line" -msgstr "Հրամանյին տող" - -msgid "Search String" -msgstr "Որոնման տող" - -msgid "Expression" -msgstr "Արտահայտություն" - -msgid "Input Line" -msgstr "Զետեղման տող" - -#| msgid "Input Line" -msgid "Debug Line" -msgstr "Վրիպազերծման գիծ" - -msgid "" -"\n" -"# Bar lines, copied verbatim:\n" -msgstr "" -"\n" -"# Բար տողեր, բառացի պատճենված.\n" - -#, c-format -msgid "%sviminfo: %s in line: " -msgstr "%sviminfo: %s տողում: " - -msgid "" -"\n" -"# global variables:\n" -msgstr "" -"\n" -"# գլոբալ փոփոխականներ.\n" - -msgid "" -"\n" -"# Last Substitute String:\n" -"$" -msgstr "" -"\n" -"# Վերջին փոխարինող տողը.\n" -"$" - -#, c-format -msgid "" -"\n" -"# Last %sSearch Pattern:\n" -"~" -msgstr "" -"\n" -"# Վերջին %sՈրոնման նմուշը.\n" -"~" - -msgid "Substitute " -msgstr "Փոխարինող " - -msgid "" -"\n" -"# Registers:\n" -msgstr "" -"\n" -"# Ռեգիստերներ:\n" - -msgid "" -"\n" -"# History of marks within files (newest to oldest):\n" -msgstr "" -"\n" -"# Ֆայլերի մեջ նշանների պատմություն (նորագույնից ամենահին).\n" - -msgid "" -"\n" -"# File marks:\n" -msgstr "" -"\n" -"# Ֆայլի նշաններ.\n" - -msgid "" -"\n" -"# Jumplist (newest first):\n" -msgstr "" -"\n" -"# Jumplist (սկզբում ամենանորը).\n" - -#, c-format -msgid "" -"# This viminfo file was generated by Vim %s.\n" -msgstr "" -"# Այս viminfo ֆայլը ստեղծվել է Vim %s-ի կողմից:\n" - -msgid "" -"# You may edit it if you're careful!\n" -"\n" -msgstr "" -"# Դուք կարող եք խմբագրել այն, եթե զգույշ լինեք:\n" -"\n" - -msgid "" -"# Value of 'encoding' when this file was written\n" -msgstr "" -"# 'encoding'-ի արժեքը, երբ այս ֆայլը գրվել է\n" - -#, c-format -msgid "Reading viminfo file \"%s\"%s%s%s%s" -msgstr "Կարդացվում է viminfo ֆայլը \"%s\"%s%s%s%s" - -msgid " info" -msgstr " տեղեկություն" - -msgid " marks" -msgstr " նշում" - -msgid " oldfiles" -msgstr " հին ֆայլեր" - -msgid " FAILED" -msgstr " ԱՆՀԱՋՈՂ" - -#, c-format -msgid "Writing viminfo file \"%s\"" -msgstr "Viminfo ֆայլի փոփոխում \"%s\"" - -msgid "Already only one window" -msgstr "Արդեն միայն մեկ պատուհան է" - -#| msgid "Edit File in new tab page" -msgid "Edit with Vim using &tabpages" -msgstr "Խմբագրել Vim-ի հետ՝ օգտագործելով &ներդիր էջերը" - -msgid "Edit with single &Vim" -msgstr "Խմբագրել մեկ &Vim-ով" - -msgid "Diff with Vim" -msgstr "Համեմատել &Vim-ի օգնությամբ" - -msgid "Edit with &Vim" -msgstr "Խմբագրել &Vim-ի օգնությամբ" - -msgid "Edit with existing Vim" -msgstr "Խմբագրել գոյություն ունեցող Vim-ի օգնությամբ" - -msgid "Edit with existing Vim - " -msgstr "Խմբագրել գոյություն ունեցող Vim-ի օգնությամբ - " - -msgid "Edits the selected file(s) with Vim" -msgstr "Խմբագրում է ընտրված ֆայլ(եր)ը Vim-ով" - -msgid "Error creating process: Check if gvim is in your path!" -msgstr "Պրոցեսի ստեղծման սխալ. Ստուգեք, արդյոք gvim-ը գտնվում է ճանապարհին!" - -msgid "gvimext.dll error" -msgstr "gvimext.dll֊ի սխալ" - -msgid "Interrupted" -msgstr "Ընդհատված" - -msgid "E10: \\ should be followed by /, ? or &" -msgstr "E10: \\֊ից հետո պետք է լինի /, ? կամ &" - -msgid "E11: Invalid in command-line window; :q closes the window" -msgstr "" -"E11: Հրամանային տողի պատուհանում թույլատրված չէ; :q փակում է պատուհանը" - -msgid "E12: Command not allowed from exrc/vimrc in current dir or tag search" -msgstr "" -"E12: Հրամանն արգելված է կատարել exrc/vimrc֊ից, այս թղթապանակում կամ պիտակ " -"որոնման ժամանակ" - -msgid "E13: File exists (add ! to override)" -msgstr "E13: Ֆայլը գոյություն ունի (ամրագրելու համար ավելացրեք !)" - -#, c-format -msgid "E15: Invalid expression: \"%s\"" -msgstr "E15: Անվավեր արտահայտություն: %s" - -msgid "E16: Invalid range" -msgstr "E16: Անվավեր միջակայք" - -#, c-format -msgid "E17: \"%s\" is a directory" -msgstr "E17: \"%s\"-ը ֆայլերի պահոց է" - -msgid "E18: Unexpected characters in :let" -msgstr "E18: Չսպասված տառ :let հրամանում" - -msgid "E18: Unexpected characters in assignment" -msgstr "E18: Չսպասված տառ վերագրման ժամանակ" - -msgid "E19: Mark has invalid line number" -msgstr "E19: Նշումն ունի անվավեր տողի համար" - -msgid "E20: Mark not set" -msgstr "E20: Նշումը սահմանված չէ" - -msgid "E21: Cannot make changes, 'modifiable' is off" -msgstr "E21: Հնարավոր չէ փոփոխել, 'modifiable' հատկությունն անջատված է" - -msgid "E22: Scripts nested too deep" -msgstr "E22: Սկրիպտը շատ խորն է ներդրված" - -msgid "E23: No alternate file" -msgstr "E23: Այլընտրանքահին ֆայլ չկա" - -msgid "E24: No such abbreviation" -msgstr "E24: Նման հապավում չկա" - -msgid "E25: GUI cannot be used: Not enabled at compile time" -msgstr "E25: Գրաֆիկակակն ինտերֆեյսն անջատված է կառուցման ժամանակ" - -msgid "" -"E26: Hebrew cannot be used: Not enabled at compile time\n" -msgstr "" -"E26: Եբրայերենը հնարավոր չէ օգտագործել, այն անջատված է կառուցման ժամանակ\n" - -msgid "" -"E27: Farsi support has been removed\n" -msgstr "" -"E27: պարսկերենի աջակցությունը հանվել է\n" - -#, c-format -msgid "E28: No such highlight group name: %s" -msgstr "E28: Նման գունանշման խումբ չկա։ %s" - -msgid "E29: No inserted text yet" -msgstr "E29: Դեռևս չկա զետեղված տեքստ" - -msgid "E30: No previous command line" -msgstr "E30: Նախորդ հրամանային տողը չկա" - -msgid "E31: No such mapping" -msgstr "E31: Չկա նման համատեղում" - -msgid "E32: No file name" -msgstr "E32: Ֆայլն անվանված չէ" - -msgid "E33: No previous substitute regular expression" -msgstr "E33: Չկա նախօրոք տրված փոխարինման ռեգուլյար արտահայտություն" - -msgid "E34: No previous command" -msgstr "E34: Չկա նախորդող հրաման" - -msgid "E35: No previous regular expression" -msgstr "E35: Չկա նախօրոք տրված ռեգուլյար արտահայտություն" - -msgid "E36: Not enough room" -msgstr "E36: Անբավարար տարածություն" - -msgid "E37: No write since last change" -msgstr "E37: Պահված չէ վերջին փոփոխությունից հետո" - -msgid "E37: No write since last change (add ! to override)" -msgstr "E37: Փոփոխությունները պահպանված չեն (ամրագրելու համար ավելացրեք !)" - -msgid "E39: Number expected" -msgstr "E39: Սպասվում է թիվ" - -#, c-format -msgid "E40: Can't open errorfile %s" -msgstr "E40: Հնարավոր չէ բացել սխալների ֆայլը %s" - -msgid "E41: Out of memory!" -msgstr "E41: Հիշողությունը չի բավականացնում!" - -msgid "E42: No Errors" -msgstr "E42: Սխալներ չկան" - -msgid "E45: 'readonly' option is set (add ! to override)" -msgstr "E45: 'readonly' կարգանշանը միացված է (անցման համար ավելացնել !)" - -msgid "E46: Cannot change read-only variable" -msgstr "E46: Հնարավոր չէ փոփոխել միայն կարդալու համար տրված փոփոխականը" - -#, c-format -msgid "E46: Cannot change read-only variable \"%s\"" -msgstr "E46: Հնարավոր չէ փոփխել միայն կարդալու համար տրված փոփխականը \"%s\"" - -msgid "E47: Error while reading errorfile" -msgstr "E47: Սխալների ֆայլի ընթերցման սխալ" - -msgid "E48: Not allowed in sandbox" -msgstr "E48: Չի թույլատրվում sandbox֊ում" - -msgid "E49: Invalid scroll size" -msgstr "E49: Անվավեր սկքրոլ՞՞" - -msgid "E50: Too many \\z(" -msgstr "E50: Աննախադեպ շատ \\z(" - -#, c-format -msgid "E51: Too many %s(" -msgstr "E51:Աննախադեպ շատ %s(" - -msgid "E52: Unmatched \\z(" -msgstr "E52: Չհամընկնող \\z(" - -#, c-format -msgid "E53: Unmatched %s%%(" -msgstr "E53: Չհամընկնող %s%%(" - -#, c-format -msgid "E54: Unmatched %s(" -msgstr "E54: Չհամընկնող %s(" - -#, c-format -msgid "E55: Unmatched %s)" -msgstr "E55: Չհամընկնող %s)" - -#, c-format -msgid "E59: Invalid character after %s@" -msgstr "E59: Անվավեր նշան՝ %s@-ից հետո" - -#, c-format -msgid "E60: Too many complex %s{...}s" -msgstr "E60: Աննախադեպ շատ ներդրված կառուցվածքներ %s{...}" - -#, c-format -msgid "E61: Nested %s*" -msgstr "E61: Ներդրված %s*" - -#, c-format -msgid "E62: Nested %s%c" -msgstr "E62: Ներդրված %s%c" - -msgid "E63: Invalid use of \\_" -msgstr "E63: Չթույլատրված \\_ -ի օգտագործում" - -#, c-format -msgid "E64: %s%c follows nothing" -msgstr "E64: %s%c-ը հետևում է ոչնչի" - -msgid "E65: Illegal back reference" -msgstr "E65: Չույլատրված հակադարձ հղում" - -msgid "E66: \\z( not allowed here" -msgstr "E66: \\z(-ը չի կարող օգտագործվել այստեղ" - -msgid "E67: \\z1 - \\z9 not allowed here" -msgstr "E67: \\z1 - \\z9 աստեղ չեն թույլատրվում" - -msgid "E68: Invalid character after \\z" -msgstr "E68: Անվավեր նշան \\z֊ից հետո" - -#, c-format -msgid "E69: Missing ] after %s%%[" -msgstr "E69: Բացակայող ] %s%%[֊ից հետո" - -#, c-format -msgid "E70: Empty %s%%[]" -msgstr "E70: Դատարկ %s%%[]" - -#, c-format -msgid "E71: Invalid character after %s%%" -msgstr "E71: Անվավեր նշան %s%%֊ից հետո" - -msgid "E72: Close error on swap file" -msgstr "E72: Սվեփ ֆայլի փակման սխալ" - -msgid "E73: Tag stack empty" -msgstr "E73: Պիտակների ստեկը դատարկ է" - -msgid "E74: Command too complex" -msgstr "E74: Հրամանը մի քիչ բարդ է" - -msgid "E75: Name too long" -msgstr "E75: Անունը մի քիչ երկար է" - -msgid "E76: Too many [" -msgstr "E76: Աննախադեպ շատ [ նշաններ" - -msgid "E77: Too many file names" -msgstr "E77: Աննախադեպ շատ ֆայլերի անուններ" - -msgid "E78: Unknown mark" -msgstr "E78: Անծանոթ նշում" - -msgid "E79: Cannot expand wildcards" -msgstr "E79: Հնարավոր չէ արտածել" - -msgid "E80: Error while writing" -msgstr "E80: Սխալ գրելու ընթացում" - -msgid "E81: Using not in a script context" -msgstr "E81: -ն օգտագործվել է սկրիպտային կոնտեքստից դուրս" - -msgid "E82: Cannot allocate any buffer, exiting..." -msgstr "E82: Հնարավոր չէ առանձնացնել գոնե մեկ բուֆերի հիշողություն, ավարտ..." - -msgid "E83: Cannot allocate buffer, using other one..." -msgstr "" -"E83: Հնարավոր չէ առանձնացնել բուֆերի հիշողություն, ուրիշ մեկն է օգտագործվում." -".." - -msgid "E84: No modified buffer found" -msgstr "E84: Փոփոխված բուֆերներ չեն հայտնաբերվել" - -msgid "E85: There is no listed buffer" -msgstr "E85: Ցանկում ընդգրկված բուֆերներ չկան" - -#, c-format -msgid "E86: Buffer %ld does not exist" -msgstr "E86: %ld բուֆերը գոյություն չունի" - -msgid "E87: Cannot go beyond last buffer" -msgstr "E87: Սա վերջին բուֆերն է" - -msgid "E88: Cannot go before first buffer" -msgstr "E88: Սա առաջին բուֆերն է" - -#, c-format -msgid "E89: No write since last change for buffer %d (add ! to override)" -msgstr "" -"E89: %d բուֆերի փոփոխությունները չեն ամրագրվել, (ամրագրելու համար ավելացրեք !" -")" - -msgid "E90: Cannot unload last buffer" -msgstr "E90: Հնարավոր չէ բեռնաթափել վերջին բուֆերը" - -msgid "E91: 'shell' option is empty" -msgstr "E91: 'shell' կարգանշանը դատարկ է" - -#, c-format -msgid "E92: Buffer %d not found" -msgstr "E92: %d բուֆերը չի հայտնաբերվել" - -#, c-format -msgid "E93: More than one match for %s" -msgstr "E93: Մի քանի համընկնումներ %s-ի համար" - -#, c-format -msgid "E94: No matching buffer for %s" -msgstr "E94: Չկա համապատասխան բուֆեր %s-ի համար" - -msgid "E95: Buffer with this name already exists" -msgstr "E95: Նմանատիպ անունով բուֆեր արդեն գոյություն ունի" - -#, c-format -msgid "E96: Cannot diff more than %d buffers" -msgstr "E96: Հնարավոր չէ համեմատել %d-ից շատ բուֆերներ" - -msgid "E97: Cannot create diffs" -msgstr "E97: Հնարավոր չէ ստեղծել համեմատություններ" - -msgid "E98: Cannot read diff output" -msgstr "E98: Հնարավոր չէ կարդալ համեմատման ելքը" - -msgid "E99: Current buffer is not in diff mode" -msgstr "E99: Տվյալ բուֆերը չի գտվում համեմատման կարգավիճակում" - -msgid "E100: No other buffer in diff mode" -msgstr "E100: Համեմատման բուֆերներ այլևս չկան" - -msgid "E101: More than two buffers in diff mode, don't know which one to use" -msgstr "E101: Տրված են մի քանի համեմատման բուֆերներ, չգիտեմ որն օգտագործել" - -#, c-format -msgid "E102: Can't find buffer \"%s\"" -msgstr "E102: Հնարավոր չէ գտնել \"%s\" բուֆերը" - -#, c-format -msgid "E103: Buffer \"%s\" is not in diff mode" -msgstr "E103: \"%s\" բուֆերը չի գտնվում համեմատման ռեժիմում" - -msgid "E104: Escape not allowed in digraph" -msgstr "E104: Escape֊ը չի կարելի օգտագործել digraph֊ում" - -msgid "E105: Using :loadkeymap not in a sourced file" -msgstr "E105: loadkeymap հրամանի օգտագործում չկցված ֆայլից" - -#| msgid "E375: Unsupported %%%c in format string" -msgid "E106: Unsupported diff output format: %s" -msgstr "E106: Չաջակցվող տարբերության ելքային ձևաչափ՝ %s" - -#, c-format -msgid "E107: Missing parentheses: %s" -msgstr "E107: Բացակայող փակագծեր: %s" - -#, c-format -msgid "E108: No such variable: \"%s\"" -msgstr "E108: Չկա նման փոփոխական: \"%s\"" - -msgid "E109: Missing ':' after '?'" -msgstr "E109: Բացակայող ':' '?'֊ից հետո" - -msgid "E110: Missing ')'" -msgstr "E110: Բացակայող ')'" - -msgid "E111: Missing ']'" -msgstr "E111: Բացակայող ']'" - -#, c-format -msgid "E112: Option name missing: %s" -msgstr "E112: Կարգանշանի անունը տրված չէ: %s" - -#, c-format -msgid "E113: Unknown option: %s" -msgstr "E113: Անծանոթ կարգանշան: %s" - -#, c-format -msgid "E114: Missing double quote: %s" -msgstr "E114: Բացակայող չակերտ: %s" - -#, c-format -msgid "E115: Missing single quote: %s" -msgstr "E115: Բացակայող չակերտ: %s" - -#, c-format -msgid "E116: Invalid arguments for function %s" -msgstr "E116: %s ֆունկցիային տրված են անվավեր արգումենտներ" - -#, c-format -msgid "E117: Unknown function: %s" -msgstr "E117: Անծանոթ ֆունկցիա: %s" - -#, c-format -msgid "E118: Too many arguments for function: %s" -msgstr "E118: %s Տրված են աննախադեպ շատ Ֆունկցիային արգումենտներ" - -#, c-format -msgid "E119: Not enough arguments for function: %s" -msgstr "E119: Ոչ բավարար քանակությամբ արգումենտներ են տրված %s ֆունկցիային" - -#, c-format -msgid "E120: Using not in a script context: %s" -msgstr "E120: օգտագործվել է ոչ սկրիպտում: %s" - -#, c-format -msgid "E121: Undefined variable: %s" -msgstr "E121: Չսահմանված փոփոխական: %s" - -#, c-format -msgid "E121: Undefined variable: %c:%s" -msgstr "E121: Չսահմանված փոփոխական: %c:%s" - -#, c-format -msgid "E122: Function %s already exists, add ! to replace it" -msgstr "" -"E122: %s ֆունկցիան արդեն գոյություն ունի. Ավելացնել ! այն փոխարինելու համար" - -#, c-format -msgid "E123: Undefined function: %s" -msgstr "E123: Անծանոթ ֆունկցիա: %s" - -#, c-format -msgid "E124: Missing '(': %s" -msgstr "E124: Բացակայող '(': %s" - -#, c-format -msgid "E125: Illegal argument: %s" -msgstr "E125: Չթույլատրված արգումենտ: %s" - -msgid "E126: Missing :endfunction" -msgstr "E126: Բացակայող :endfunction" - -#, c-format -msgid "E127: Cannot redefine function %s: It is in use" -msgstr "E127: Հնարավոր չէ վերասահմանել %s ֆունկցիան, այն կատարման փուլում է" - -#, c-format -msgid "E128: Function name must start with a capital or \"s:\": %s" -msgstr "" -"E128: Ֆունկցիայի անունը պետք է սկսվի մեծատառով կամ պարունակի \"s:\": %s" - -msgid "E129: Function name required" -msgstr "E129: Ֆունկցիայի անունը պարտադիր է" - -#, c-format -msgid "E131: Cannot delete function %s: It is in use" -msgstr "E131: Հնարավոր չէ ջնջել %s ֆունկցիան, այն կատարման փուլում է" - -msgid "E132: Function call depth is higher than 'maxfuncdepth'" -msgstr "E132: ֆունկցիայի կանչի խորությունը մեծ է 'maxfuncdepth'֊ից" - -msgid "E133: :return not inside a function" -msgstr "E133: :return ոչ ֆունկցիայի ներսից" - -#| msgid "E164: Cannot go before first file" -msgid "E134: Cannot move a range of lines into itself" -msgstr "E134: Հնարավոր չէ տեղափոխել մի շարք տողեր իր մեջ" - -msgid "E135: *Filter* Autocommands must not change current buffer" -msgstr "E135: *Filter* Ինքնահրամանները չպետք է փոխեն տվյալ բուֆերը" - -msgid "E136: viminfo: Too many errors, skipping rest of file" -msgstr "" -"E136: viminfo: Աննախադեպ շատ սխալներ, ֆայլի մնացյալ մասը բաց է թողնվում" - -#, c-format -msgid "E137: Viminfo file is not writable: %s" -msgstr "E137: Viminfo ֆայլը փոփոխելի չէ: %s" - -#, c-format -msgid "E138: Can't write viminfo file %s!" -msgstr "E138: Անհնար է ամրագրել viminfo ֆայլը %s!" - -msgid "E139: File is loaded in another buffer" -msgstr "E139: Ֆայլը բեռնված է այլ բուֆերում" - -msgid "E140: Use ! to write partial buffer" -msgstr "E140: Օգտագործել ! բուֆերում մաս֊մաս գրելու համար" - -#, c-format -msgid "E141: No file name for buffer %ld" -msgstr "E141: %ld բուֆերի համար չկա ֆայլի անուն" - -msgid "E142: File not written: Writing is disabled by 'write' option" -msgstr "" -"E142: Ֆայլն ամրագրված չէ: ամրագրոըմն անջատված է 'write' կարգանշման միջոցով" - -#, c-format -msgid "E143: Autocommands unexpectedly deleted new buffer %s" -msgstr "E143:Ինքնահրամանը անսպասելի ջնջել է նոր բուֆերը։ %s" - -msgid "E144: Non-numeric argument to :z" -msgstr "E144: Ոչ թվային արգումենտ :z-ին" - -msgid "E145: Shell commands and some functionality not allowed in rvim" -msgstr "E145: rvim-ում չեն թույլատրվում վահանակի հրամաններ" - -msgid "E146: Regular expressions can't be delimited by letters" -msgstr "E146: Ռեգուլյար արտահայտությունները չեն կարող բաժանված լինել տառերով" - -msgid "E147: Cannot do :global recursive with a range" -msgstr "E147: global հրամանը չի կարող լինել ռեկուրսիվ" - -msgid "E148: Regular expression missing from :global" -msgstr "E148: Ռեգույլար արտահայտությունը բացակայում է :global-ից" - -#, c-format -msgid "E149: Sorry, no help for %s" -msgstr "E149: Ներողություն, '%s' մասին ոչինչ չկա" - -#, c-format -msgid "E150: Not a directory: %s" -msgstr "E150: %s֊ը թղթապանակ չէ" - -#, c-format -msgid "E151: No match: %s" -msgstr "E151: Համընկնում չկա: %s" - -#, c-format -msgid "E152: Cannot open %s for writing" -msgstr "E152: Հնարավոր չէ բացել %s֊ը գրելու համար" - -#, c-format -msgid "E153: Unable to open %s for reading" -msgstr "E153: Հնարավոր չէ բացել %s֊ը կարդալու համար" - -#, c-format -msgid "E154: Duplicate tag \"%s\" in file %s/%s" -msgstr "E154: Կրկնված պիտակ \"%s\" %s/%s֊ֆայլում" - -#, c-format -msgid "E155: Unknown sign: %s" -msgstr "E155: Անծանոթ նշան: %s" - -msgid "E156: Missing sign name" -msgstr "E156: Բացակայող նշանի անուն" - -#, c-format -msgid "E157: Invalid sign ID: %d" -msgstr "E157: Անվավեր նշանի համար: %d" - -#, c-format -msgid "E158: Invalid buffer name: %s" -msgstr "E158: Անվավեր բուֆերի անուն: %s" - -msgid "E159: Missing sign number" -msgstr "E159: Բացակայող թվի նշան" - -#, c-format -msgid "E160: Unknown sign command: %s" -msgstr "E160: Անծանոթ նշանի հրաման %s" - -#, c-format -msgid "E161: Breakpoint not found: %s" -msgstr "E161: Վերադարձի կետը չի հայտնաբերվել: %s" - -#, c-format -msgid "E162: No write since last change for buffer \"%s\"" -msgstr "E162: \"%s\" Բուֆերում կան չամրագրված փոփոխություններ" - -msgid "E163: There is only one file to edit" -msgstr "E163: Խմբագրելու համար կա միայն մեկ ֆայլ" - -msgid "E164: Cannot go before first file" -msgstr "E164: Անցումը հնարավոր չէ, սա առաջին ֆայլն է" - -msgid "E165: Cannot go beyond last file" -msgstr "E165: Անցումը հնարավոր չէ, սա վերջին ֆայլն է" - -msgid "E166: Can't open linked file for writing" -msgstr "E166: Գրելու համար հնարավոր չէ բացել կապված ֆայլը" - -msgid "E167: :scriptencoding used outside of a sourced file" -msgstr "E167: :scriptencoding հրամանը օգտագործվում է կցվող ֆայլից դուրս" - -msgid "E168: :finish used outside of a sourced file" -msgstr "E168: :finish հրամանը օգտագործվում է կցվող ֆայլից դուրս" - -msgid "E169: Command too recursive" -msgstr "E169: Հրամանը շատ ռեկուրսիվ է" - -#| msgid "E171: Missing :endif" -msgid "E170: Missing :endwhile" -msgstr "E170: Բացակայում է :endwhile" - -msgid "E170: Missing :endfor" -msgstr "E170: Հրամանը բացակայում է :endfor" - -msgid "E171: Missing :endif" -msgstr "E171: Հրամանը բացակայում է :endif" - -msgid "E172: Missing marker" -msgstr "E172: Բացակայում կարգանշում" - -#, c-format -msgid "E173: %d more file to edit" -msgid_plural "E173: %d more files to edit" -msgstr[0] "E173: %d-ից շատ խմբագրելի ֆայլ" -msgstr[1] "E173: %d֊ից շատ խմբագրելի ֆայլեր" - -#, c-format -msgid "E174: Command already exists: add ! to replace it: %s" -msgstr "E174: Հրամանն արդեն գոյություն ունի. Փոխարինման համար ավելացնել ! : %s" - -msgid "E175: No attribute specified" -msgstr "E175: բնորոշիչ տրված չէ" - -msgid "E176: Invalid number of arguments" -msgstr "E176: Արգումենտների սխալ քանակություն" - -msgid "E177: Count cannot be specified twice" -msgstr "E177: Քանակը չի կարելի տալ կրկնակի անգամ" - -msgid "E178: Invalid default value for count" -msgstr "E178: Քանակի անվավեր լռելիությամբ արժեք" - -#, c-format -msgid "E179: Argument required for %s" -msgstr "E179: %s հրամանի համար անհրաժեշտ է արգումենտ" - -#, c-format -msgid "E180: Invalid complete value: %s" -msgstr "E180: Անվավեր ավտոլրացման արժեք : %s" - -#, c-format -msgid "E180: Invalid address type value: %s" -msgstr "E180: Անվավեր հասցեյավորման արժեք : %s" - -#, c-format -msgid "E181: Invalid attribute: %s" -msgstr "E181: Անվավեր բնորոշիչ: %s" - -msgid "E182: Invalid command name" -msgstr "E182: Անվավեր հրամանի անուն" - -msgid "E183: User defined commands must start with an uppercase letter" -msgstr "E183: Օգտատիրոջ սահմանած ֆունկցիաները պետք է սկսվեն մեծատառով" - -#, c-format -msgid "E184: No such user-defined command: %s" -msgstr "E184: Չկա նման օգտատիրոջ սահմանած հրաման: %s" - -#, c-format -msgid "E185: Cannot find color scheme '%s'" -msgstr "E185: '%s' գունային սխեման չի գտնվել" - -msgid "E186: No previous directory" -msgstr "E186: Չկա նախկին թղթապանակ" - -msgid "E187: Directory unknown" -msgstr "E187: Անծանոթ բառարան" - -msgid "E188: Obtaining window position not implemented for this platform" -msgstr "E188: Պատուհանի չափեր վերցնելն իրականացված չէ այս պլատֆորմի համար" - -#, c-format -msgid "E189: \"%s\" exists (add ! to override)" -msgstr "E189: \"%s\" արդեն գոյություն ունի (անցման համար ավելացնել !)" - -#, c-format -msgid "E190: Cannot open \"%s\" for writing" -msgstr "E190: Հնարավոր չէ գրելու համար բացել \"%s\"֊ը" - -msgid "E191: Argument must be a letter or forward/backward quote" -msgstr "E191: արգումենտը պետք է լինի տառ կամ բացվող/փակվող չակերտ" - -msgid "E192: Recursive use of :normal too deep" -msgstr "E192: :normal հրամանի ռեկուրսիվ կանչը շատ խորն է" - -#, c-format -msgid "E193: %s not inside a function" -msgstr "E193: %s ոչ ֆունկցիայի ներսից" - -#| msgid "E498: No :source file name to substitute for \"\"" -msgid "E194: No alternate file name to substitute for '#'" -msgstr "E194: '#'-ը փոխարինող ֆայլի այլընտրանքային անուն չկա" - -msgid "E195: Cannot open viminfo file for reading" -msgstr "E195: Կարալու համար հնարավոր չ բացել viminfo ֆայլը" - -msgid "E196: No digraphs in this version" -msgstr "E196: Այս տարբերակում digraph֊ներ չկան" - -#, c-format -msgid "E197: Cannot set language to \"%s\"" -msgstr "E197: Հնարավոր չէ փոխել լեզուն \"%s\"" - -msgid "E199: Active window or buffer changed or deleted" -msgstr "E199: Ակտիվ պատուհանը կամ բուֆերը ջնջնվել կամ փոփոխվել է" - -msgid "E200: *ReadPre autocommands made the file unreadable" -msgstr "E200: *ReadPre ինքնահրամանները ֆայլը դարձրել են անընթեռնելի" - -msgid "E201: *ReadPre autocommands must not change current buffer" -msgstr "E201: ReadPre ինքնահրամանները չեն կարող փոխել տվյալ բուֆերը" - -msgid "E202: Conversion made file unreadable!" -msgstr "E202: Փոխակերպումը ֆայլը դարձրել է անընթեռնելի!" - -msgid "E203: Autocommands deleted or unloaded buffer to be written" -msgstr "E203: Բուֆերը կամ ջնջվել է կամ բեռնաթափվել է ինքնահրամանների միջոցով" - -msgid "E204: Autocommand changed number of lines in unexpected way" -msgstr "E204: Ինքնահրամանը անսպասելի փոխել է տողերը" - -msgid "E205: Patchmode: can't save original file" -msgstr "E205: Patchmode: հնարավոր չէ պահպանել նախնական ֆայլը" - -msgid "E206: Patchmode: can't touch empty original file" -msgstr "E206: Patchmode: հնարավոր չէ թարմացնել նախնական ֆայլը" - -msgid "E207: Can't delete backup file" -msgstr "E207: Հնարավոր չէ ջնջել պահպանման ֆայլը" - -#, c-format -msgid "E208: Error writing to \"%s\"" -msgstr "E208: Սխալ \"%s\" գրոլու ընթացքում" - -#, c-format -msgid "E209: Error closing \"%s\"" -msgstr "E209: Սխալ \"%s\" փակելու ընթացքում" - -#, c-format -msgid "E210: Error reading \"%s\"" -msgstr "E210: Սխալ \"%s\" կարդալու ընթացքում" - -#, c-format -msgid "E211: File \"%s\" no longer available" -msgstr "E211: \"%s\" ֆայլն արդեն հասնելի չէ" - -msgid "E212: Can't open file for writing" -msgstr "E212: Գրելու համար հնարավոր չէ բացել ֆայլը" - -msgid "E213: Cannot convert (add ! to write without conversion)" -msgstr "E213: Հնարավոր չէ փոխարկել (ամրագրելու համար ավելացրեք !)" - -msgid "E214: Can't find temp file for writing" -msgstr "E214: Ժամանակավոր ֆայլը չի գտնվել՝ գրելու համար" - -#, c-format -msgid "E215: Illegal character after *: %s" -msgstr "E215: Չթույլատրված նշան * նշանից հետո: %s" - -#, c-format -msgid "E216: No such event: %s" -msgstr "E216: Իրադարձությունը գոյություն չունի: %s" - -#, c-format -msgid "E216: No such group or event: %s" -msgstr "E216: Իրադարձությունը կամ խումբը գոյություն չունի: %s" - -msgid "E217: Can't execute autocommands for ALL events" -msgstr "" -"E217: Հնարավոր չէ կատարել ինքնահրամանները բոլոր իրադարձությունների համար" - -msgid "E218: Autocommand nesting too deep" -msgstr "E218: Ինքնահրամանը շատ է ներդրված" - -msgid "E219: Missing {." -msgstr "E219: Բացակայող {." - -msgid "E220: Missing }." -msgstr "E220: Բացակայող }." - -msgid "E221: Marker cannot start with lower case letter" -msgstr "E221: Կարգանշումը պետք է սկսվի մեծատառով" - -msgid "E223: Recursive mapping" -msgstr "E223: Ռեկուրսիվ համապատասխանեցում" - -#, c-format -msgid "E224: Global abbreviation already exists for %s" -msgstr "E224: Գլոբալ հապավումն արդեն գոյություն ունի %s-ի համար" - -#, c-format -msgid "E225: Global mapping already exists for %s" -msgstr "E225: Գլոբալ համապատասխանեցումն արդեն գոյություն ունի %s-ի համար" - -#, c-format -msgid "E226: Abbreviation already exists for %s" -msgstr "E226: Հապավումն արդեն գոյություն ունի %s-ի համար" - -#, c-format -msgid "E227: Mapping already exists for %s" -msgstr "E227: Համապատասխանեցումն արդեն գոյություն ունի %s-ի համար" - -msgid "E229: Cannot start the GUI" -msgstr "E229: Հնարավոր չէ սկսել գրաֆիկական ինտերֆեյսը" - -#, c-format -msgid "E230: Cannot read from \"%s\"" -msgstr "E230: Հնարավոր չէ կարդալ \"%s\"֊ից" - -msgid "E231: 'guifontwide' invalid" -msgstr "E231: 'guifontwide'-ի արժեքն անվավեր է" - -msgid "E233: Cannot open display" -msgstr "E233: Հնարավոր չէ բացել էկրանը" - -#, c-format -msgid "E234: Unknown fontset: %s" -msgstr "E234: Անծանոթ ֆոնտերի բաղմություն: %s" - -#, c-format -msgid "E235: Unknown font: %s" -msgstr "E235: Անհաըտ ֆոնտ: %s" - -#, c-format -msgid "E236: Font \"%s\" is not fixed-width" -msgstr "E236: \"%s\" տառատեսակը ֆիքսված երկարությամբ չէ" - -msgid "E237: Printer selection failed" -msgstr "E237: Տպիչի անհաջող ընտրում" - -#, c-format -msgid "E238: Print error: %s" -msgstr "E238: Տպագրման սխալ: %s" - -#, c-format -msgid "E239: Invalid sign text: %s" -msgstr "E239: Անվավեր տեքստային նշան: %s" - -msgid "E240: No connection to the X server" -msgstr "E240: X սերվերի հետ կապ չկա" - -#, c-format -msgid "E241: Unable to send to %s" -msgstr "E241: Անհնար է ուղարկել հաղորդագրությունը %s֊ին" - -#| msgid "E345: Can't find file \"%s\" in path" -msgid "E242: Can't split a window while closing another" -msgstr "E242: Չի կարելի պատուհանը բաժանել մյուսը փակելիս" - -#, c-format -msgid "E243: Argument not supported: \"-%s\"; Use the OLE version." -msgstr "E243: Արգումենտն իրականցաված չէ: \"-%s\"; Օգտագործել OLE տարբերակը." - -#, c-format -msgid "E244: Illegal %s name \"%s\" in font name \"%s\"" -msgstr "E244: %s չթույլատրված անուն \"%s\"՝ \"%s\" տառատեսակի անվանման մեջ" - -#, c-format -msgid "E245: Illegal char '%c' in font name \"%s\"" -msgstr "E245: Չթույլատրված '%c' նշան՝ \"%s\" տառատեսակի անվանման մեջ" - -msgid "E246: FileChangedShell autocommand deleted buffer" -msgstr "" -"E246: Բուֆերը ջնջվել է FileChangedShell ինքնահրամանի կատարման արդյունքում" - -#, c-format -msgid "E247: No registered server named \"%s\"" -msgstr "E247: \"%s\" սերվերը ռեգիստրացված չէ" - -msgid "E248: Failed to send command to the destination program" -msgstr "E248: Հարամանը չի հաջողվել ուղարկել նշանակման վայր" - -#| msgid "E881: Line count changed unexpectedly" -msgid "E249: Window layout changed unexpectedly" -msgstr "E249: Պատուհանի դասավորությունը անսպասելիորեն փոխվել է" - -#, c-format -msgid "E250: Fonts for the following charsets are missing in fontset %s:" -msgstr "" -"E250: Հետևյալ նշանների բազմությունը բացակայում է %s տառատեսակների բազմության " -"մեջ:" - -msgid "E251: VIM instance registry property is badly formed. Deleted!" -msgstr "E251: VIM registry ֆունկցիան սխալ է տրված. Ջնջված է!" - -#, c-format -msgid "E252: Fontset name: %s - Font '%s' is not fixed-width" -msgstr "E252: Տառատեսակ: %s - '%s' տառատեսակը ֆիքսված երկարությամբ չէ" - -#, c-format -msgid "E253: Fontset name: %s" -msgstr "E253: Տառատեսակների բազմության անունը: %s" - -#, c-format -msgid "E254: Cannot allocate color %s" -msgstr "E254: Հնարավոր չէ առաջացնել %s գույնը" - -msgid "E255: Couldn't read in sign data" -msgstr "E255: Հնարավոր չէ կարդալ նշանի տվյալներից" - -msgid "E257: cstag: Tag not found" -msgstr "E257: cstag: Նշումը չի հայտնաբերվել" - -msgid "E258: Unable to send to client" -msgstr "E258: Անհնար է ուղարկել ընդունողին" - -#, c-format -msgid "E259: No matches found for cscope query %s of %s" -msgstr "E259: cscope %s համընկնումներ չեն հայտնաբերվել %s-ի համար" - -msgid "E260: Missing name after ->" -msgstr "E260: Բացակայող անուն ->-ից հետո" - -#, c-format -msgid "E261: Cscope connection %s not found" -msgstr "E261: Cscope %s կապը չի հայտնաբերվել" - -#, c-format -msgid "E262: Error reading cscope connection %d" -msgstr "E262: %d cscope տվյալների բազայի կապի սխալ ընթերցում" - -msgid "" -"E263: Sorry, this command is disabled, the Python library could not be " -"loaded." -msgstr "" -"E263: Ներողություն, այս հրամանն անջատված է, Python գրադարանը հնարավոր չէ " -"բեռնել." - -msgid "E264: Python: Error initialising I/O objects" -msgstr "E264: Python: Օբյեկտի սկզբնարժեքավորման սխալ I/O" - -msgid "E265: $_ must be an instance of String" -msgstr "E265: $_ պետք է լին տող" - -msgid "" -"E266: Sorry, this command is disabled, the Ruby library could not be loaded." -msgstr "" -"E266: Ներողություն, այս հրամանն անջատված է, Ruby գրադարանը հնարավոր չէ " -"բեռնել." - -msgid "E267: Unexpected return" -msgstr "E267: Անսպասելի return" - -msgid "E268: Unexpected next" -msgstr "E268: Անսպասելի next" - -msgid "E269: Unexpected break" -msgstr "E269: Անսպասելի break" - -msgid "E270: Unexpected redo" -msgstr "E270: Անսպասելի redo" - -msgid "E271: Retry outside of rescue clause" -msgstr "E271: Retry rescue օպերատորից դուրս" - -msgid "E272: Unhandled exception" -msgstr "E272: Չմշակված բացառում" - -#, c-format -msgid "E273: Unknown longjmp status %d" -msgstr "E273: Անծանոթ longjmp ստատուս %d" - -msgid "E274: No white space allowed before parenthesis" -msgstr "E274: Փակագծերից առաջ տարածություն չի թույլատրվում" - -#| msgid "E87: Cannot go beyond last buffer" -msgid "E275: Cannot add text property to unloaded buffer" -msgstr "E275: Չի կարող տեքստային հատկություն ավելացնել բեռնաթափված բուֆերին" - -#| msgid "E1061: Cannot find function %s" -msgid "E276: Cannot use function as a method: %s" -msgstr "E276: Հնարավոր չէ օգտագործել ֆունկցիան որպես մեթոդ՝ %s" - -msgid "E277: Unable to read a server reply" -msgstr "E277: Սերվերը չի պատասխանում" - -msgid "E279: Sorry, ++shell is not supported on this system" -msgstr "E279: Ներեցեք, ++ shell-ը չի աջակցվում այս համակարգում" - -#, c-format -msgid "E282: Cannot read from \"%s\"" -msgstr "E282: Հնարավոր չէ կարդալ \"%s\"֊ից" - -#, c-format -msgid "E283: No marks matching \"%s\"" -msgstr "E283: Չկան համընկնող նշումներ \"%s\"" - -msgid "E284: Cannot set IC values" -msgstr "E284: Հնարավոր չէ վերագրել IC արժեքներ" - -msgid "E285: Failed to create input context" -msgstr "E285: Հնարավոր չէ ստեղծել մուտքային կոնտեքստ" - -msgid "E286: Failed to open input method" -msgstr "E286: Հնարավոր չէ բացել մուտքային մեթոսը" - -msgid "E287: Warning: Could not set destroy callback to IM" -msgstr "E287: Զգուշացում: հնարավոր չէ վերագրել IM֊ի ջնջման կանչըввода" - -msgid "E288: Input method doesn't support any style" -msgstr "E288: Մուտքային մեթոդը չի աջակցում ոչ մի ստիլ" - -msgid "E289: Input method doesn't support my preedit type" -msgstr "E289: Մուտքային մեթոդը չի աջակցում ոչ մի նախախմբագրման տիպ" - -#| msgid "E897: List or Blob required" -msgid "E290: List or number required" -msgstr "E290: Ցանկ կամ թիվ է պահանջվում" - -msgid "E294: Seek error in swap file read" -msgstr "E294: Ցուցչի տեղափոխման սխալ սվեփ ֆայլի ընթերցման ժամանակ" - -msgid "E295: Read error in swap file" -msgstr "E295: Սվեփ ֆայլի ընթերցման սխալ" - -msgid "E296: Seek error in swap file write" -msgstr "E296: Ցուցչի տեղափոխման սխալ սվեփ ֆայլի ամրագրման ժամանակ" - -msgid "E297: Write error in swap file" -msgstr "E297: Սվեփ ֆայլի ամրագրման սխալ" - -msgid "E299: Perl evaluation forbidden in sandbox without the Safe module" -msgstr "E299: Perl հաշվարկումն արգելված է առանց զգուշության մոդուլի" - -msgid "E300: Swap file already exists (symlink attack?)" -msgstr "E300: Սվեփ ֆայլն արդեն գոյություն ունի (հարձակու՞մ)" - -msgid "E301: Oops, lost the swap file!!!" -msgstr "E301: Վա՜յ, կորցրեցի սվեփ ֆայլը!!!" - -msgid "E302: Could not rename swap file" -msgstr "E302: Հնարավոր չէ վերանվանել սվեփ ֆայլը" - -#, c-format -msgid "E303: Unable to open swap file for \"%s\", recovery impossible" -msgstr "E303: Հնարավոր չէ բացել սվեփ ֆայլը \"%s\", վերականգնումն անհնար է" - -#, c-format -msgid "E305: No swap file found for %s" -msgstr "E305: Սվեփ ֆայլ չի հայտնաբերվել %s֊ի համար" - -#, c-format -msgid "E306: Cannot open %s" -msgstr "E306: Հնարավոր չէ բացել %s֊ը" - -#, c-format -msgid "E307: %s does not look like a Vim swap file" -msgstr "E307: %s սվեփ ֆայլ չէ" - -msgid "E308: Warning: Original file may have been changed" -msgstr "E308: Զգուշացում: Մուտքային ֆայլն հնարավոր է փոփոխվել է" - -#, c-format -msgid "E309: Unable to read block 1 from %s" -msgstr "E309: Հնարավոր չե կարդալ 1֊ին բլոկը %s֊ից" - -#, c-format -msgid "E310: Block 1 ID wrong (%s not a .swp file?)" -msgstr "E310: Սխալ բլոկի համար, 1, (%s֊ը .swp սվեփ ֆայլ չի՞)" - -msgid "E311: Recovery Interrupted" -msgstr "E311: Վերականգնումն ընդհատված է" - -msgid "" -"E312: Errors detected while recovering; look for lines starting with ???" -msgstr "" -"E312: Սխալներ են հայտնաբերվել վերականգնման ընթացքում, նայել այն տողերը, " -"որոնք սկսվում են ???" - -msgid "E313: Cannot preserve, there is no swap file" -msgstr "E313: Հնարավոր չէ թարմացնել սվեփ ֆայլը, այն չի գտնվել" - -msgid "E314: Preserve failed" -msgstr "E314: Սվեփ ֆայլի թարմացման անհաջող փորձ" - -msgid "E319: Sorry, the command is not available in this version" -msgstr "E319: Ներողություն, այս հրամանը թույլատրված չէ ներկա տարբերակում" - -#, c-format -msgid "E321: Could not reload \"%s\"" -msgstr "E321: Հնարավոր չէ վերաբեռնել \"%s\"" - -msgid "E324: Can't open PostScript output file" -msgstr "E324: Հնարավոր չէ բացել PostScript ելքային ֆայլը" - -msgid "E325: ATTENTION" -msgstr "E325: ՈՒՇԱԴՐՈՒԹՅՈՒՆ" - -msgid "E326: Too many swap files found" -msgstr "E326: Հայտնաբերվել են աննախադեպ շատ քանակությամբ սվեփ ֆայլեր" - -msgid "E327: Part of menu-item path is not sub-menu" -msgstr "E327: Մենյուի֊ի մասի ճանապարհը ենթամենյու չէ" - -msgid "E328: Menu only exists in another mode" -msgstr "E328: Այս ռեժիմում մենյու չկա" - -#, c-format -msgid "E329: No menu \"%s\"" -msgstr "E329: %s մենյուն չկա" - -msgid "E330: Menu path must not lead to a sub-menu" -msgstr "E330: Մենյուի ճանապարհը չի կարող լինել ենթամենյու" - -msgid "E331: Must not add menu items directly to menu bar" -msgstr "E331: Մենյույի էլեմենտները չեն կարող ավելցավել մենյու բարում" - -msgid "E332: Separator cannot be part of a menu path" -msgstr "E332: Բաժանիչը չի կարող լինել մենյույի ճանապարհի մաս" - -msgid "E333: Menu path must lead to a menu item" -msgstr "E333: Մենյույի ճանապարհը պետք է ներկայացնի մենյուի էլէմենտ" - -#, c-format -msgid "E334: Menu not found: %s" -msgstr "E334: Մենյուն չի հայտնաբերվել: %s" - -#, c-format -msgid "E335: Menu not defined for %s mode" -msgstr "E335: Մենյուն %s ռեժիմում սահմանված չէ" - -msgid "E336: Menu path must lead to a sub-menu" -msgstr "E336: Մենյուի ճանապարհը պետք հղվի ենթամենյույի" - -msgid "E337: Menu not found - check menu names" -msgstr "E337: Մենյուն չի հայտնաբերվել - ստուգել մենյույի անունները" - -msgid "E338: Sorry, no file browser in console mode" -msgstr "E338: Ներողություն, ֆայլի դիտարկիչ չկա տողային ռեժիմում" - -msgid "E339: Pattern too long" -msgstr "E339: Անսպասելի երկար նմուշ" - -msgid "E340: Internal error; if you can reproduce please report a bug" -msgstr "" -"E340: Ներքին սխալ; եթե կարող եք վերարտադրել, խնդրում ենք հայտնել սխալի մասին" - -#, c-format -msgid "E342: Out of memory! (allocating %lu bytes)" -msgstr "E342: Հիշողությունը չի բավականացնում! (առանձնացվել է %lu բայթ)" - -#, c-format -msgid "" -"E343: Invalid path: '**[number]' must be at the end of the path or be " -"followed by '%s'." -msgstr "" -"E343: Անվավեր ճանապարհ: '**[թիվ]'֊ը պետք է լինի ճանապարհի վերջում կամ " -"հաջորդի '%s'-ին." - -#, c-format -msgid "E344: Can't find directory \"%s\" in cdpath" -msgstr "E344: \"%s\" թղթապանակը չի գտնվել cdpath֊ում" - -#, c-format -msgid "E345: Can't find file \"%s\" in path" -msgstr "E345: Ֆայլը չի գտնվել \"%s\"-ում" - -#, c-format -msgid "E346: No more directory \"%s\" found in cdpath" -msgstr "E346: Այլ \"%s\" թղթապանակներ չեն հայտնաբերվել cdpath֊ում" - -#, c-format -msgid "E347: No more file \"%s\" found in path" -msgstr "E347: Այլ \"%s\" ֆայլեր չեն հայտնաբերվել" - -msgid "E348: No string under cursor" -msgstr "E348: Կուրսորի դիրքում տող չկա" - -msgid "E349: No identifier under cursor" -msgstr "E349: Կուրսորի դիրքում չկա փոփոխականի անուն" - -msgid "E350: Cannot create fold with current 'foldmethod'" -msgstr "E350: Հնարավոր չէ ստեղծել փաթաթ 'foldmethod'֊ով" - -msgid "E351: Cannot delete fold with current 'foldmethod'" -msgstr "E351: Հնարավոր չէ ջնջել փաթաթ 'foldmethod'֊ով" - -msgid "E352: Cannot erase folds with current 'foldmethod'" -msgstr "E352: Հնարավոր չէ մաքրել փաթաթը 'foldmethod'-ի տվյալ արժեքի դեպքում" - -#, c-format -msgid "E353: Nothing in register %s" -msgstr "E353: %s ռեգիստրը դատարկ է" - -#, c-format -msgid "E354: Invalid register name: '%s'" -msgstr "E354: Ռեգիստրի անվավեր անուն: '%s'" - -#, c-format -msgid "E355: Unknown option: %s" -msgstr "E355: Անծանոթ կարգանշան: %s" - -#, c-format -msgid "E357: 'langmap': Matching character missing for %s" -msgstr "E357: 'langmap': %s-ի համար չկա համընկնման նշան" - -#, c-format -msgid "E358: 'langmap': Extra characters after semicolon: %s" -msgstr "E358: 'langmap': Ստորակետից հետո տրված են հավելյալ նշաններ: %s" - -msgid "E359: Screen mode setting not supported" -msgstr "E359: Տրված էկրանի ռեժիմն աջակցված չէ" - -msgid "E360: Cannot execute shell with -f option" -msgstr "E360: Հնարավոր չէ կատարել shell-ը -f կարգանշմամբ" - -#| msgid "E891: Using a Funcref as a Float" -msgid "E362: Using a boolean value as a Float" -msgstr "E362: բուլյան արժեքի օգտագործումը որպես Float" - -msgid "E363: Pattern uses more memory than 'maxmempattern'" -msgstr "" -"E363: Օրինակն օգտագործում է ավելի շատ հիշողություն քան տրված է " -"'maxmempattern'-ով" - -#, c-format -msgid "E364: Library call failed for \"%s()\"" -msgstr "E364: Անհաջող կանչ \"%s()\"" - -msgid "E365: Failed to print PostScript file" -msgstr "E365: Հնարավոր չէ պատճենել PostScript ֆայլը" - -#| msgid "E788: Not allowed to edit another buffer now" -msgid "E366: Not allowed to enter a popup window" -msgstr "E366: Չի թույլատրվում մուտք գործել սահապատ" - -#, c-format -msgid "E367: No such group: \"%s\"" -msgstr "E367: Խումբը գոյություն չունի։ \"%s\"" - -#, c-format -msgid "E368: Got SIG%s in libcall()" -msgstr "E368: Got SIG%s in libcall()" - -#, c-format -msgid "E369: Invalid item in %s%%[]" -msgstr "E369: Անվավեր էլեմենտ %s%%[]-ում" - -#, c-format -msgid "E370: Could not load library %s: %s" -msgstr "E370: Հնարավոր չէր բեռնել %s: %s գրադարանը" - -msgid "E371: Command not found" -msgstr "E371: Հրամանը չի հայտնաբերվել" - -#, c-format -msgid "E372: Too many %%%c in format string" -msgstr "E372: Տողային ֆորմատին տրված են աննախադեպ շատ %%%c֊եր" - -#, c-format -msgid "E373: Unexpected %%%c in format string" -msgstr "E373: Անսպասելի էլեմենտ %%%c" - -msgid "E374: Missing ] in format string" -msgstr "E374: Բացակայող ]" - -#, c-format -msgid "E375: Unsupported %%%c in format string" -msgstr "E375: %%%c֊ն չի աջակցվում" - -#, c-format -msgid "E376: Invalid %%%c in format string prefix" -msgstr "E376: Անվավեր %%%c տողային ֆորմատի նախածանցում" - -#, c-format -msgid "E377: Invalid %%%c in format string" -msgstr "E377: Անվավեր %%%c" - -msgid "E378: 'errorformat' contains no pattern" -msgstr "E378: 'errorformat'-ը չի պարունակում նմուշներ" - -msgid "E379: Missing or empty directory name" -msgstr "E379: Գոյություն չունեցող կամ դատարկ թղթապանակ" - -msgid "E380: At bottom of quickfix stack" -msgstr "E380: quickfix ստեկի ներքևում" - -msgid "E381: At top of quickfix stack" -msgstr "E381: quickfix ստեկի վերևում" - -msgid "E382: Cannot write, 'buftype' option is set" -msgstr "E382: Պահպանումն անհնար է, 'buftype' կարգանշանը միացված է" - -#, c-format -msgid "E383: Invalid search string: %s" -msgstr "E383: Անվավեր որոնման բառ: %s" - -#, c-format -msgid "E384: Search hit TOP without match for: %s" -msgstr "E384: Որոնումն ավարտված է ֆայլի սկզբում; %s-ը չի գտնվել" - -#, c-format -msgid "E385: Search hit BOTTOM without match for: %s" -msgstr "E385: Որոնումն ավարտված է ֆայլի վերջում; %s-ը չի գտնվել" - -msgid "E386: Expected '?' or '/' after ';'" -msgstr "E386: ';'-ից հետո սպասվում '?' կամ '/'" - -msgid "E387: Match is on current line" -msgstr "E387: Համընկնումը հերթական տողում է" - -msgid "E388: Couldn't find definition" -msgstr "E388: Հնարավոր չէ գտնել սահմանումը" - -msgid "E389: Couldn't find pattern" -msgstr "E389: Նմուշը չի գտնվել" - -#, c-format -msgid "E390: Illegal argument: %s" -msgstr "E390: Չթույլատրված արգումենտ: %s" - -#, c-format -msgid "E391: No such syntax cluster: %s" -msgstr "E391: %s ուղղագրական համակարգը չի գտնվել" - -#, c-format -msgid "E392: No such syntax cluster: %s" -msgstr "E392: %s ուղղագրական համակարգը չի գտնվել" - -msgid "E393: group[t]here not accepted here" -msgstr "E393: group[t]֊ն չի թույլատրվում այստեղ" - -#, c-format -msgid "E394: Didn't find region item for %s" -msgstr "E394: %s֊ի ռեգիոն էլեմենտը չի գտնվել" - -msgid "E395: Contains argument not accepted here" -msgstr "E395: Contains արգումենտը չի թույլատրվում այստեղ" - -msgid "E397: Filename required" -msgstr "E397: Պահանջվում է ֆայլի անուն" - -#, c-format -msgid "E398: Missing '=': %s" -msgstr "E398: Բացակայող '=': %s" - -#, c-format -msgid "E399: Not enough arguments: syntax region %s" -msgstr "E399: Անբավարար քանակությամբ արգումենտներ։ syntax region %s" - -msgid "E400: No cluster specified" -msgstr "E400: Համակարգը տրված չէ" - -#, c-format -msgid "E401: Pattern delimiter not found: %s" -msgstr "E401: Նմուշի բացատանիշն հայտնաբերված չէ: %s" - -#, c-format -msgid "E402: Garbage after pattern: %s" -msgstr "E402: Աղբ՝ նմուշից հետո: %s" - -msgid "E403: syntax sync: Line continuations pattern specified twice" -msgstr "" -"E403: Ուղղագրման համաժամանակեցում, տողի համալրման նմուշը կրկնակի է տրված" - -#, c-format -msgid "E404: Illegal arguments: %s" -msgstr "E404: Չթույլատրված պարամետրեր: %s" - -#, c-format -msgid "E405: Missing equal sign: %s" -msgstr "E405: Բացակայող վերագրման նշան: %s" - -#, c-format -msgid "E406: Empty argument: %s" -msgstr "E406: Դատարկ պարամետեր: %s" - -#, c-format -msgid "E407: %s not allowed here" -msgstr "E407: %s֊ը չի թույլատրվում այստեղ" - -#, c-format -msgid "E408: %s must be first in contains list" -msgstr "E408: %s֊ը պետք է լինի contains ցուցակի սկզբում" - -#, c-format -msgid "E409: Unknown group name: %s" -msgstr "E409: Անծանոթ խումբ: %s" - -#, c-format -msgid "E410: Invalid :syntax subcommand: %s" -msgstr "E410: Անվավեր ենթահրաման :syntax: %s" - -#, c-format -msgid "E411: Highlight group not found: %s" -msgstr "E411: %s գունանշման խումբը չի հայտնաբերվել" - -#, c-format -msgid "E412: Not enough arguments: \":highlight link %s\"" -msgstr "E412: Անբավարար քանակությամբ պարամետրեր: \":highlight link %s\"" - -#, c-format -msgid "E413: Too many arguments: \":highlight link %s\"" -msgstr "E413: Շատ քանակությամ պարամետրեր: \":highlight link %s\"" - -msgid "E414: Group has settings, highlight link ignored" -msgstr "E414: Խումբն ունի կարգաբերումներ, գունանշման հղումն անտեսված է" - -#, c-format -msgid "E415: Unexpected equal sign: %s" -msgstr "E415: Չսպասված հավասարման նշան: %s" - -#, c-format -msgid "E416: Missing equal sign: %s" -msgstr "E416: Բացակայող հավասարման նշան: %s" - -#, c-format -msgid "E417: Missing argument: %s" -msgstr "E417: Բացակայող արգումենտ: %s" - -#, c-format -msgid "E418: Illegal value: %s" -msgstr "E418: Չթույլատրված արժեք: %s" - -msgid "E418: I'm a teapot" -msgstr "E418: Ես թեյնիկ եմ" - -msgid "E419: FG color unknown" -msgstr "E419: Տողի անծանոթ գույն" - -msgid "E420: BG color unknown" -msgstr "E420: ֆոնի անծանոթ գույն" - -#, c-format -msgid "E421: Color name or number not recognized: %s" -msgstr "E421: Անծանոթ գույնի անուն կամ համար։ %s" - -#| msgid "E1011: Name too long: %s" -msgid "E422: Terminal code too long: %s" -msgstr "E422: Տերմինալի կոդը չափազանց երկար է՝ %s" - -#, c-format -msgid "E423: Illegal argument: %s" -msgstr "E423: Չթույլատրված պարամետեր: %s" - -msgid "E424: Too many different highlighting attributes in use" -msgstr "E424: Աննախադեպ շատ գունանշման բնորոշիչներ են օգտագործվում" - -msgid "E425: Cannot go before first matching tag" -msgstr "E425: Հնարավոր չէ անցնել առաջին համընկնման պիտակին" - -#, c-format -msgid "E426: Tag not found: %s" -msgstr "E426: Պիտակը չի հայտնաբերվել: %s" - -msgid "E427: There is only one matching tag" -msgstr "E427: Կա միայն մեկ համընկնման պիտակ" - -msgid "E428: Cannot go beyond last matching tag" -msgstr "E428: Հնարավոր չէ անցնել վերջին գտնված համընկնման պիտակին" - -#, c-format -msgid "E429: File \"%s\" does not exist" -msgstr "E429: \"%s\" ֆայլը չի գտնվել" - -#, c-format -msgid "" -"E430: Tag file path truncated for %s\n" -msgstr "" -"E430: Նշումների ֆայլի ճանապարհը կարճվել է։ %s\n" - -#, c-format -msgid "E431: Format error in tags file \"%s\"" -msgstr "E431: Ֆորմատի սխալ \"%s\" նշումների ֆայլում" - -#, c-format -msgid "E432: Tags file not sorted: %s" -msgstr "E432: Նշումների ֆայլը դասակարգված չէ: %s" - -msgid "E433: No tags file" -msgstr "E433: Պիտակների ֆայլը չի գտնվել" - -msgid "E434: Can't find tag pattern" -msgstr "E434: Պիտակի նմուշը հնարավոր չէ գտնել" - -msgid "E435: Couldn't find tag, just guessing!" -msgstr "E435: Պիտակը չի գտնվել, փորձում եմ գուշակել!" - -#, c-format -msgid "E436: No \"%s\" entry in termcap" -msgstr "E436: \"%s\"֊ը termcap֊ում չկա" - -msgid "E437: Terminal capability \"cm\" required" -msgstr "E437: Պահանջվում է \"cm\" տերմինալի առկայություն" - -msgid "E441: There is no preview window" -msgstr "E441: Նախադիտման պատուհանը բացակայում է" - -msgid "E442: Can't split topleft and botright at the same time" -msgstr "E442: Հնարավոր չէ միաժամանակ կատարել վերևից ձախ և ներքևից աջ բաժանում" - -msgid "E443: Cannot rotate when another window is split" -msgstr "E443: Հնարավոր չէ տեղափոխել քանի դեռ մեկ այլ պատուհան բաժանված է" - -msgid "E444: Cannot close last window" -msgstr "E444: Հնարավոր չէ փակել պատուհանը" - -msgid "E445: Other window contains changes" -msgstr "E445: Մեկ այլ պատուհանում կան փոփոխություններ" - -msgid "E446: No file name under cursor" -msgstr "E446: Կուրսորի դիրքում չկա ֆայլի անուն" - -#, c-format -msgid "E447: Can't find file \"%s\" in path" -msgstr "E447: \"%s\" ֆայլը չի գտնվել" - -#, c-format -msgid "E448: Could not load library function %s" -msgstr "E448: Հնարավոր չէ բեռնել %s գրադարանային ֆունկցիան" - -msgid "E449: Invalid expression received" -msgstr "E449: Ստացվել է անվավեր արտահայտություն" - -msgid "E450: Buffer number, text or a list required" -msgstr "E450: Բուֆերի համար, տեքստ կամ ցանկ է անհրաժեշտ" - -#, c-format -msgid "E451: Expected }: %s" -msgstr "E451: Սպասվում է }: %s" - -msgid "E452: Double ; in list of variables" -msgstr "E452: Կրկնակի ՝;՝ փոփոխականների ցանկում" - -msgid "E453: UL color unknown" -msgstr "E453: Տողի անծանոթ գույն" - -msgid "E454: Function list was modified" -msgstr "E454: Ֆունկցիաների ցանկը փոփոխվել է" - -msgid "E455: Error writing to PostScript output file" -msgstr "E455: Գրելու սխալ PostScript֊ի ելքում" - -#, c-format -msgid "E456: Can't open file \"%s\"" -msgstr "E456: Հնարավոր չէ բացել \"%s\" ֆայլը" - -#, c-format -msgid "E456: Can't find PostScript resource file \"%s.ps\"" -msgstr "E456: PostScript֊ի \"%s.ps\" ռեսուրսային ֆայլը չի գտնվել" - -#, c-format -msgid "E457: Can't read PostScript resource file \"%s\"" -msgstr "E457: Հնարավոր չէ կարդալ \"%s\" PostScript֊ի ռեսուրս ֆայլը" - -msgid "E458: Cannot allocate colormap entry, some colors may be incorrect" -msgstr "" -"E458: Հնարավոր չէ ստեղծել colormap տիպի էլեմենտ, որոշ գույներ հնարավոր է " -"սխալ լինեն" - -msgid "E459: Cannot go back to previous directory" -msgstr "E459: Հնարավոր չէ վերադառնալ նախկին թղթապանակ" - -msgid "E460: Entries missing in mapset() dict argument" -msgstr "E460: Mapset()-ում բացակայում են գրառումները dict արգումենտում" - -#, c-format -msgid "E461: Illegal variable name: %s" -msgstr "E461: Չթույլատրված արժեք: %s" - -#, c-format -msgid "E462: Could not prepare for reloading \"%s\"" -msgstr "E462: Հնարավոր չէ պատրաստել \"%s\" վերաբեռնելու համար" - -msgid "E463: Region is guarded, cannot modify" -msgstr "E463: Ռեգիոնը պահպանվում է, հնարավոր չէ փոփոխել" - -msgid "E464: Ambiguous use of user-defined command" -msgstr "E464: Օգտատիրոջ սահմանած հրամաի սխալ օգտագործում" - -#, c-format -msgid "E464: Ambiguous use of user-defined command: %s" -msgstr "E464: Օգտատիրոջ սահմանած հրամանի սխալ օգտագործում։ %s" - -msgid "E465: :winsize requires two number arguments" -msgstr "E465: :winsize հրամանը պահանջում է արգումենտ" - -msgid "E466: :winpos requires two number arguments" -msgstr "E466: :winpos հրամանը պահանջում է երկու թվային արգումենտներ" - -msgid "E467: Custom completion requires a function argument" -msgstr "E467: սահմանած ավտոլրացումը պահանջում է ֆունկցիայի արգումենտ" - -msgid "E468: Completion argument only allowed for custom completion" -msgstr "" -"E468: Ավտոլրացման արգումեն թույլատրվում է միայն սհամանված ավտոլրացումների " -"համար" - -#, c-format -msgid "E469: Invalid cscopequickfix flag %c for %c" -msgstr "E469: Անվավեր cscopequickfix %c դրոշմանիշ %c-ի համար" - -msgid "E470: Command aborted" -msgstr "E470: Հրամանը ընդհատված է" - -msgid "E471: Argument required" -msgstr "E471: Անհրաժեշտ է արգումենտ" - -msgid "E472: Command failed" -msgstr "E472: Հրամանը ձախողվել է" - -msgid "E474: Invalid argument" -msgstr "E474: Անվավեր պարամետր" - -#, c-format -msgid "E475: Invalid argument: %s" -msgstr "E475: Անվավեր պարամետր: %s" - -#, c-format -msgid "E475: Invalid value for argument %s" -msgstr "E475: Անվավեր պարամետրի արժեք: %s" - -#, c-format -msgid "E475: Invalid value for argument %s: %s" -msgstr "E475: Անվավեր պարամետրի արժեք: %s: %s" - -msgid "E476: Invalid command" -msgstr "E476: Անվավեր հրաման" - -#, c-format -msgid "E476: Invalid command: %s" -msgstr "E476: Անվավեր հրաման։ %s" - -#, c-format -msgid "E476: Invalid command: %s, expected %s" -msgstr "E476: Անվավեր հրաման։ %s: սպասվում է %s" - -msgid "E477: No ! allowed" -msgstr "E477: !-ը թույլատրված չէ" - -msgid "E478: Don't panic!" -msgstr "E478: Մի անհանգստացեք, ամեն ինչ լավ է :)!" - -msgid "E479: No match" -msgstr "E479: Համընկնում չկա" - -#, c-format -msgid "E480: No match: %s" -msgstr "E480: Համընկնում չկա: %s" - -msgid "E481: No range allowed" -msgstr "E481: Չթույլատրված միջակայք" - -#, c-format -msgid "E482: Can't create file %s" -msgstr "E482: Հնարավոր չէ ստեղծել %s ֆայլը" - -msgid "E483: Can't get temp file name" -msgstr "E483: Հնարավոր չէ ստանալ ժամանակավոր ֆայլի անունը" - -#, c-format -msgid "E484: Can't open file %s" -msgstr "E484: Հնարավոր չէ բացել %s ֆայլը" - -#, c-format -msgid "E485: Can't read file %s" -msgstr "E485: Հնարավոր չէ կարդալ %s ֆայլը" - -msgid "E486: Pattern not found" -msgstr "E486: Նմուշը չի հայտնաբերվել" - -#, c-format -msgid "E486: Pattern not found: %s" -msgstr "E486: Նմուշը չի հայտնաբերվել: %s" - -msgid "E487: Argument must be positive" -msgstr "E487: Արգումենտը պետք է լինի դրականա ամբողջաթիվ" - -#, c-format -msgid "E487: Argument must be positive: %s" -msgstr "E487: Արգումենտը պետք է լինի դրական ամբողջաթիվ։ %s" - -msgid "E488: Trailing characters" -msgstr "E488: Ավելորդ նշաններ" - -#, c-format -msgid "E488: Trailing characters: %s" -msgstr "E488: Ավելորդ նշաններ։ %s" - -#| msgid "E498: No :source file name to substitute for \"\"" -msgid "E489: No call stack to substitute for \"\"" -msgstr "E489: Կանչերի կույտ չկա \"\"-ի համար" - -msgid "E490: No fold found" -msgstr "E490: Փաթաթը չի հայտնաբերվել" - -#| msgid "E1002: Syntax error at %s" -msgid "E491: JSON decode error at '%s'" -msgstr "E491: JSON վերծանման սխալ '%s'-ում" - -msgid "E492: Not an editor command" -msgstr "E492: Անծանոթ հրաման" - -msgid "E493: Backwards range given" -msgstr "E493: Տրված է հակադարձ միջակայք" - -msgid "E494: Use w or w>>" -msgstr "E494: Օգտագործել w կամ w>>" - -msgid "E495: No autocommand file name to substitute for \"\"" -msgstr "E495: փոխարինման համար չկա ֆայլի անունով ինքնահրաման \"\"" - -msgid "E496: No autocommand buffer number to substitute for \"\"" -msgstr "E496: փոխարինման համար չկա բուֆերի անունով ինքնահրաման \"\"" - -msgid "E497: No autocommand match name to substitute for \"\"" -msgstr "E497: փոխարինման համար չկա համընկնման անունով ինքնահրաման \"\"" - -msgid "E498: No :source file name to substitute for \"\"" -msgstr "" -"E498: փոխարինման համար չկա :source ֆայլի անունով ինքնահրաման \"\"" - -#, no-c-format -msgid "E499: Empty file name for '%' or '#', only works with \":p:h\"" -msgstr "E499: '%' կամ '#' ֆայլի դատարկ անուն, աշխատում է միայն \":p:h\"-ով:" - -msgid "E500: Evaluates to an empty string" -msgstr "E500: Արտահայտոթյան արժեքը դատարկ տող է" - -msgid "E501: At end-of-file" -msgstr "E501: Ֆայլի վերջում" - -msgid "is not a file or writable device" -msgstr "ֆայլ չէ կամ գրելի սարք" - -#, c-format -msgid "E503: \"%s\" is not a file or writable device" -msgstr "E503: \"%s\" ֆայլ չէ կամ գրելի սարք" - -#| msgid "E775: Eval feature not available" -msgid "E503: Coffee is currently not available" -msgstr "E503: Սուրճը ներկայումս հասանելի չէ" - -msgid "is read-only (cannot override: \"W\" in 'cpoptions')" -msgstr "միայն ընթերցելի է (\"W\" in 'cpoptions')" - -msgid "is read-only (add ! to override)" -msgstr "միայն ընթերցելի է (ամրագրելու համար ավելացրեք !)" - -#, c-format -msgid "E505: \"%s\" is read-only (add ! to override)" -msgstr "E505: \"%s\" միայն կարդալու համար է (ավելացնել !)" - -msgid "E506: Can't write to backup file (add ! to override)" -msgstr "" -"E506: Հնարավոր չէ ամրագրել պահպանման ֆայլում (ամրագրելու համար ավելացրեք !)" - -msgid "E507: Close error for backup file (add ! to write anyway)" -msgstr "E507: Պահպանման ֆայլի փակման սխալ (ամրագրելու համար ավելացրեք !)" - -msgid "E508: Can't read file for backup (add ! to write anyway)" -msgstr "" -"E508: Հնարավոր չէ պահպանման համար կարդալ ֆայլը (ամրագրելու համար ավելացրեք !)" - -msgid "E509: Cannot create backup file (add ! to override)" -msgstr "" -"E509: Հնարավոր չէ ստեղծել պահպանման ֆայլը (ամրագրելու համար ավելացրեք !)" - -msgid "E510: Can't make backup file (add ! to write anyway)" -msgstr "" -"E510: Հնարավոր չէ ստեղծել պահպանման ֆայլ (ամրագրելու համար ավելացրեք !)" - -msgid "E511: NetBeans already connected" -msgstr "E511: NetBeans-ն արդեն կապակցված է" - -msgid "E512: Close failed" -msgstr "E512: Փակումն անհաջող է ավարտվել" - -msgid "E513: Write error, conversion failed (make 'fenc' empty to override)" -msgstr "E513: Գրելու սխալ, փոխակերպումն անհաջող է ավարտվել (մաքրել 'fenc'-ը)" - -#, c-format -msgid "" -"E513: Write error, conversion failed in line %ld (make 'fenc' empty to " -"override)" -msgstr "" -"E513: Գրելու սխալ, փոխակերպումն անհաջող է ավարտվել %ld տողում (մաքրել 'fenc'-" -"ը)" - -msgid "E514: Write error (file system full?)" -msgstr "E514: Ամրագրման սխալ (ֆայլերի համակարգում գրելու տեղ չի՞ մնացել)" - -msgid "E515: No buffers were unloaded" -msgstr "E515: Ոչ մի բուֆեր չի բեռնաթափվել" - -msgid "E516: No buffers were deleted" -msgstr "E516: Ոչ մի բուֆեր չի ջնջվել" - -msgid "E517: No buffers were wiped out" -msgstr "E517: Ոչ մի բուֆեր չի մաքրվել" - -msgid "E518: Unknown option" -msgstr "E518: Անծանոթ կարգանշան" - -msgid "E519: Option not supported" -msgstr "E519: Կարգանշումը չի աջակցվում" - -msgid "E520: Not allowed in a modeline" -msgstr "E520: Չի թույլատրվում տողային ռեժիմում" - -msgid "E521: Number required after =" -msgstr "E521: =֊ից հետո անհրաժեշտ է թիվ" - -#, c-format -msgid "E521: Number required: &%s = '%s'" -msgstr "E521: Պահանջվում է թիվ: &%s = '%s'" - -msgid "E522: Not found in termcap" -msgstr "E522: termcap֊ում չի հայտնաբերվել" - -msgid "E523: Not allowed here" -msgstr "E523: Այստեղ չի թույլատրվում" - -msgid "E524: Missing colon" -msgstr "E524: Բացակայող վերջակետ" - -msgid "E525: Zero length string" -msgstr "E525: Դատարկ տող" - -#, c-format -msgid "E526: Missing number after <%s>" -msgstr "E526: Բացակայող թիվ՝ <%s>֊ից հետո" - -msgid "E527: Missing comma" -msgstr "E527: Բացակայող ստորակետ" - -msgid "E528: Must specify a ' value" -msgstr "E528: Անհրաժեշտ է '-ի համար տալ արժեք" - -msgid "E529: Cannot set 'term' to empty string" -msgstr "E529: Հնարավոր չէ 'term'-ին վերագրել դատարկ արժեք" - -msgid "E530: Cannot change 'term' in the GUI" -msgstr "E530: Գրաֆիկական ռեժիմում հնարավոր չէ փոխել տերմինալը" - -msgid "E531: Use \":gui\" to start the GUI" -msgstr "E531: Գրաֆիկական ինտերֆեյսին անցնելու համար կատարել \":gui\" հրամանը" - -#| msgid "E1249: Highlight group name too long" -msgid "E532: Highlighting color name too long in defineAnnoType" -msgstr "E532: Գունանշման անվան չափազանց երկար ընդգծում defineAnnoType-ում" - -msgid "E533: Can't select wide font" -msgstr "E533: Հնարավոր չէ նշել տառատեսակը" - -msgid "E534: Invalid wide font" -msgstr "E534: Անվավեր երկարությամբ տառատեսակ" - -#, c-format -msgid "E535: Illegal character after <%c>" -msgstr "E535: Սխալ նշան <%c>֊ից հետո" - -msgid "E536: Comma required" -msgstr "E536: Անհրաժեշտ է ստորակետ" - -#, c-format -msgid "E537: 'commentstring' must be empty or contain %s" -msgstr "E537: 'commentstring'֊ը պետք լինի դատարկ կամ պարունակի %s" - -#, c-format -msgid "E538: Pattern found in every line: %s" -msgstr "E538: Ամեն տողում նմուշ է հայտնաբերվել: %s" - -#, c-format -msgid "E539: Illegal character <%s>" -msgstr "E539: Չթույլատրված նշան <%s>" - -msgid "E540: Unclosed expression sequence" -msgstr "E540: Չփակված արտահայտությունների հաջորդականություն" - -msgid "E542: Unbalanced groups" -msgstr "E542: Չբալանսավորված խմբեր" - -msgid "E543: Not a valid codepage" -msgstr "E543: Չթույլատրված կոդավորման անուն" - -msgid "E544: Keymap file not found" -msgstr "E544: Բանալիային համապատասխանեցման ֆայլը չի հայտնաբերվել" - -msgid "E545: Missing colon" -msgstr "E545: Բացակայող վերջակետ" - -msgid "E546: Illegal mode" -msgstr "E546: Անծանոթ ռեժիմ" - -msgid "E547: Illegal mouseshape" -msgstr "E547: Կուրսորի անծանոթ տեսք" - -msgid "E548: Digit expected" -msgstr "E548: Սպասվում է թիվ" - -msgid "E549: Illegal percentage" -msgstr "E549: Տոկոսի անսպասելի արժեք" - -msgid "E550: Missing colon" -msgstr "E550: Բացակայող չակերտ" - -msgid "E551: Illegal component" -msgstr "E551: Սխալ բաղադրիչ" - -msgid "E552: Digit expected" -msgstr "E552: Սպասվում է թիվ" - -msgid "E553: No more items" -msgstr "E553: Այլևս էլեմենտներ չկան" - -#, c-format -msgid "E554: Syntax error in %s{...}" -msgstr "E554: Ուղղագրական սխալ %s{...}֊ում" - -msgid "E555: At bottom of tag stack" -msgstr "E555: Պիտակների ստեկի ներքևում" - -msgid "E556: At top of tag stack" -msgstr "E556: Պիտակների ստեկի վերևում" - -msgid "E557: Cannot open termcap file" -msgstr "E557: Անհնար է բացել termcap ֆայլը" - -msgid "E558: Terminal entry not found in terminfo" -msgstr "E558: Տերմինալի էլեմենտը չի հայտնաբերվել terminfo֊ում" - -msgid "E559: Terminal entry not found in termcap" -msgstr "E559: Տերմինալի էլեմենտը չի հայտնաբերվել termcap֊ում" - -#, c-format -msgid "E560: Usage: cs[cope] %s" -msgstr "E560: Օգտագործում: cs[cope] %s" - -msgid "E561: Unknown cscope search type" -msgstr "E561: Անծանոթ cscope֊ի որոնման տիպ" - -msgid "E562: Usage: cstag " -msgstr "E562: Օգտագործում: cstag <անուն>" - -#, c-format -msgid "E563: stat(%s) error: %d" -msgstr "E563: stat(%s) սխալ: %d" - -#, c-format -msgid "E564: %s is not a directory or a valid cscope database" -msgstr "E564: %s֊ը թղթապանակ կամ cscope֊ի տվյալների բազա չէ" - -#| msgid "E811: Not allowed to change buffer information now" -msgid "E565: Not allowed to change text or change window" -msgstr "E565: Չի թույլատրվում փոխել տեքստը կամ փոխել պատուհանը" - -msgid "E566: Could not create cscope pipes" -msgstr "E566: Հնարավոր չէ ստեղծել cscope֊ի սրնգակապերը" - -msgid "E567: No cscope connections" -msgstr "E567: cscope կապեր չկան" - -msgid "E568: Duplicate cscope database not added" -msgstr "E568: Գոյություն ունեցող cscope տվյալների բազան չի ավելացվել" - -msgid "" -"E571: Sorry, this command is disabled: the Tcl library could not be loaded." -msgstr "" -"E571: Ներողություն, այս հրամանն անջատված է․ Tcl գրադարանը չի կարող բեռնվել." - -#, c-format -msgid "E572: Exit code %d" -msgstr "E572: Ավարտման ստատուս %d" - -#, c-format -msgid "E573: Invalid server id used: %s" -msgstr "E573: Անվավեր սերվերի համար է օգտագործվել: %s" - -#, c-format -msgid "E574: Unknown register type %d" -msgstr "E574: Անծանոթ ռեգիստրի տիպ %d" - -msgid "Illegal starting char" -msgstr "Սխալ սկսելու տառ" - -msgid "Missing '>'" -msgstr "Բացակայող '>'" - -msgid "Illegal register name" -msgstr "Անծանոթ ռեգիստրի անուն" - -msgid "E579: :if nesting too deep" -msgstr "E579: :if֊ը շատ է ներդրված" - -msgid "E579: Block nesting too deep" -msgstr "E579: Բլոկը շատ է ներդրված" - -msgid "E580: :endif without :if" -msgstr "E580: :endif առանց :if" - -msgid "E581: :else without :if" -msgstr "E581: :else առանց :if" - -msgid "E582: :elseif without :if" -msgstr "E582: :elseif առանց :if" - -msgid "E583: Multiple :else" -msgstr "E583: Բազմակի :else" - -msgid "E584: :elseif after :else" -msgstr "E584: :elseif :else֊ից հետո" - -msgid "E585: :while/:for nesting too deep" -msgstr "E585: :while/:for֊ը շատ է ներդրված" - -msgid "E586: :continue without :while or :for" -msgstr "E586: :continue առանց :while կամ :for" - -msgid "E587: :break without :while or :for" -msgstr "E587: :break առանց :while կամ :for" - -msgid "E588: :endwhile without :while" -msgstr "E588: :endwhile հրամանը տրված է առանց :while հրամանի" - -msgid "E588: :endfor without :for" -msgstr "E588: :endfor առանց :for հրամանի" - -msgid "E589: 'backupext' and 'patchmode' are equal" -msgstr "E589: 'backupext'֊ը և 'patchmode'֊ը համարժեք են" - -msgid "E590: A preview window already exists" -msgstr "E590: Նախադիտման պատուհանն արդեն բացված է" - -msgid "E591: 'winheight' cannot be smaller than 'winminheight'" -msgstr "" -"E591: 'winheight'-ի արժեքը չի կարող լինել ավելի փոքր քան 'winminheight'-ի " -"արժեքը" - -msgid "E592: 'winwidth' cannot be smaller than 'winminwidth'" -msgstr "" -"E592: 'winwidth'-ի արժեքը չի կարող լինել ավելի փոքր քան 'winminwidth'-ի " -"արժեքը" - -#, c-format -msgid "E593: Need at least %d lines" -msgstr "E593: Անհրաժեշտ են գոնե %d տողեր" - -#, c-format -msgid "E594: Need at least %d columns" -msgstr "E594: Անհրաժեշտ են գոնե %d սյուններ" - -msgid "E595: 'showbreak' contains unprintable or wide character" -msgstr "E595: 'showbreak'-ը պարունակում է չտպագրվող կամ երկար տառեր" - -msgid "E596: Invalid font(s)" -msgstr "E596: Անվավեր տառատեսակներ" - -msgid "E597: Can't select fontset" -msgstr "E597: Հնարավոր չէ նշել տառատեսակների խումբը" - -msgid "E598: Invalid fontset" -msgstr "E598: Անվավեր տառատեսակների խումբ" - -msgid "E599: Value of 'imactivatekey' is invalid" -msgstr "E599: 'imactivatekey'-ի արժեքն անվավեր է" - -msgid "E600: Missing :endtry" -msgstr "E600: Հրամանը բացակայում է :endtry" - -msgid "E601: :try nesting too deep" -msgstr "E601: :try֊ը շատ է ներդրված" - -msgid "E602: :endtry without :try" -msgstr "E602: :endtry առանց :try" - -msgid "E603: :catch without :try" -msgstr "E603: :catch առանց :try" - -msgid "E604: :catch after :finally" -msgstr "E604: :catch առանց :finally" - -#, c-format -msgid "E605: Exception not caught: %s" -msgstr "E605: Բացառման հրամանը չի բռնվել: %s" - -msgid "E606: :finally without :try" -msgstr "E606: :finally առանց :try" - -msgid "E607: Multiple :finally" -msgstr "E607: Բազմակի :finally" - -msgid "E608: Cannot :throw exceptions with 'Vim' prefix" -msgstr "E608: Անհնար է նետել :throw 'Vim' նախածանցով" - -#, c-format -msgid "E609: Cscope error: %s" -msgstr "E609: Cscope սխալ: %s" - -#| msgid "E1005: Too many argument types" -msgid "E610: No argument to delete" -msgstr "E610: Ջնջելու արգումենտ չկա" - -#| msgid "E1320: Using an Object as a Number" -msgid "E611: Using a Special as a Number" -msgstr "E611: Հատուկ համարի օգտագործումը" - -msgid "E612: Too many signs defined" -msgstr "E612: Սահմանվել են աննախադեպ շատ նշաններ" - -#, c-format -msgid "E613: Unknown printer font: %s" -msgstr "E613: Անծանոթ տպագրման տառատեսակ %s" - -#| msgid "E1210: Number required for argument %d" -msgid "E616: Object required for argument %d" -msgstr "E616: %d արգումենտի համար անհրաժեշտ է օբյեկտ" - -msgid "E617: Cannot be changed in the GTK GUI" -msgstr "E617: Չի կարող փոփոխվել GTK+ 2 գրաֆիկական ինտերֆեյսում" - -#, c-format -msgid "E618: File \"%s\" is not a PostScript resource file" -msgstr "E618: \"%s\" ֆայլը PostScript-ի ռեսուրս ֆայլ չի" - -#, c-format -msgid "E619: File \"%s\" is not a supported PostScript resource file" -msgstr "E619: \"%s\" ֆայլը PostScript֊ի աջակցող ռեսուրս ֆայլ չի" - -#, c-format -msgid "E620: Unable to convert to print encoding \"%s\"" -msgstr "E620: Հնարավոր չէ \"%s\"֊ը փթխակերպերլ պատճենման կոդավորման" - -#, c-format -msgid "E621: \"%s\" resource file has wrong version" -msgstr "E621: \"%s\" ռեսուրս ֆայլն ունի սխալ տարբերակ" - -msgid "E622: Could not fork for cscope" -msgstr "E622: Հնարավոր չէ եղանել cscope֊ի համար" - -msgid "E623: Could not spawn cscope process" -msgstr "E623: Հնարավոր չի ազատել cscope պրոցեսը" - -#, c-format -msgid "E624: Can't open file \"%s\"" -msgstr "E624: Հնարավոր չէ բացել ֆայլը \"%s\"" - -#, c-format -msgid "E625: Cannot open cscope database: %s" -msgstr "E625: Անհնար է բացել cscope տվյալների բազան: %s" - -msgid "E626: Cannot get cscope database information" -msgstr "E626: Անհնար է ստանալ cscope տվյալների բազայի մասին տեղեկատվություն" - -#, c-format -msgid "E627: Missing colon: %s" -msgstr "E627: Բացակայող վերջակետ։ %s" - -#, c-format -msgid "E628: Missing ! or / in: %s" -msgstr "E628: Բաց թողնված ! կամ /: %s" - -#| msgid "E631: %s(): Write failed" -msgid "E630: %s(): Write while not connected" -msgstr "E630: %s(): Գրեք, քանի դեռ միացված չեք" - -#, c-format -msgid "E631: %s(): Write failed" -msgstr "E631: %s(): թարմացման անհաջող փորձ" - -#| msgid "E652: Invalid buffer identifier in getAnno" -msgid "E632: Invalid buffer identifier in getLength" -msgstr "E632: Անվավեր բուֆերի նույնացուցիչ getLength-ում" - -#| msgid "E639: Invalid buffer identifier in setTitle" -msgid "E633: Invalid buffer identifier in getText" -msgstr "E633: Անվավեր բուֆերի նույնացուցիչ getText-ում" - -msgid "E634: Invalid buffer identifier in remove" -msgstr "E634: Անվավեր հեռացվող բուֆերի անուն" - -msgid "E635: Invalid buffer identifier in insert" -msgstr "E635: Անվավեր ավելացվող բուֆերի անուն" - -msgid "E636: Invalid buffer identifier in create" -msgstr "E636: Անվավեր ստեղծվող բուֆերի անուն" - -#| msgid "E639: Invalid buffer identifier in setTitle" -msgid "E637: Invalid buffer identifier in startDocumentListen" -msgstr "E637: Բուֆերի անվավեր նույնացուցիչ startDocumentListen-ում" - -#| msgid "E639: Invalid buffer identifier in setTitle" -msgid "E638: Invalid buffer identifier in stopDocumentListen" -msgstr "E638: Անվավեր բուֆերի նույնացուցիչ stopDocumentListen-ում" - -msgid "E639: Invalid buffer identifier in setTitle" -msgstr "E639: Անվավեր բուֆերի անուն setTitle-ում" - -#| msgid "E647: Invalid buffer identifier in setDot" -msgid "E640: Invalid buffer identifier in initDone" -msgstr "E640: initDone-ում բուֆերի անվավեր նույնացուցիչ" - -#| msgid "E645: Invalid buffer identifier in setVisible" -msgid "E641: Invalid buffer identifier in setBufferNumber" -msgstr "E641: բուֆերի անվավեր նույնացուցիչ setBufferNumber-ում" - -#, c-format -msgid "E642: File %s not found in setBufferNumber" -msgstr "E642: %s ֆայլը չի գտնվել setBufferNumber-ում" - -#| msgid "E639: Invalid buffer identifier in setTitle" -msgid "E643: Invalid buffer identifier in setFullName" -msgstr "E643: բուֆերի անվավեր նույնացուցիչ setFullName-ում" - -#| msgid "E645: Invalid buffer identifier in setVisible" -msgid "E644: Invalid buffer identifier in editFile" -msgstr "E644: editFile-ում բուֆերի անվավեր նույնացուցիչ" - -msgid "E645: Invalid buffer identifier in setVisible" -msgstr "E645: Անվավեր բուֆերի անուն setVisible-ում" - -#| msgid "E645: Invalid buffer identifier in setVisible" -msgid "E646: Invalid buffer identifier in setModified" -msgstr "E646: Բուֆերի անվավեր նույնացուցիչ setModified-ում" - -msgid "E647: Invalid buffer identifier in setDot" -msgstr "E647: Անվավեր բուֆերի անուն setDot-ում" - -msgid "E648: Invalid buffer identifier in close" -msgstr "E648: Անվավեր բուֆերի անուն close-ում" - -#| msgid "E651: Invalid buffer identifier in addAnno" -msgid "E650: Invalid buffer identifier in defineAnnoType" -msgstr "E650: Անվավեր բուֆերի նույնացուցիչ defineAnnoType-ում" - -msgid "E651: Invalid buffer identifier in addAnno" -msgstr "E651: Անվավեր բուֆերի անուն addAnno-ում" - -msgid "E652: Invalid buffer identifier in getAnno" -msgstr "E652: Անվավեր բուֆերի անուն getAnno-ում" - -#, c-format -msgid "E654: Missing delimiter after search pattern: %s" -msgstr "E654: Բացակայող բացատանիշ %s-ից հետո" - -msgid "E655: Too many symbolic links (cycle?)" -msgstr "E655: Աննախադեպ շատ խորհրդանշական հղումներ (ցի՞կլ)" - -msgid "NetBeans disallows writes of unmodified buffers" -msgstr "NetBeans֊ը չի թույլատրում գրել չփոփոխված բուֆերում" - -msgid "Partial writes disallowed for NetBeans buffers" -msgstr "Մասնակի արտագրումը չի թույլատրում NetBeans բուֆերների համար" - -#, c-format -msgid "E658: NetBeans connection lost for buffer %d" -msgstr "E658: NetBeans կապակցումն անհետացել է %d բուֆերի համար" - -msgid "E659: Cannot invoke Python recursively" -msgstr "E659: Հնարավոր չէ ռեկուրսիվ կանչել Python֊ը" - -#, c-format -msgid "E661: Sorry, no '%s' help for %s" -msgstr "E661: Ներողություն, '%s' օգնության էջը չկա %s֊համար" - -msgid "E662: At start of changelist" -msgstr "E662: Փոփոխուոթյունների ցանկի սկիզբը" - -msgid "E663: At end of changelist" -msgstr "E663: Փոփոխուոթյունների ցանկի վերջը" - -msgid "E664: Changelist is empty" -msgstr "E664: Փոփոխությունների ցանկը դատարկ է" - -msgid "E665: Cannot start GUI, no valid font found" -msgstr "" -"E665: Հնարավոր չէ սկսել գրաֆիկական ինտերֆեյսը, համապատասխան տառատեսակ չի " -"հայտնաբերվել" - -#, c-format -msgid "E666: Compiler not supported: %s" -msgstr "E666: Կազմարարը չի աջակցվում: %s" - -msgid "E667: Fsync failed" -msgstr "E667: Fsync-ն անհաջող է ավարտվել" - -#, c-format -msgid "E668: Wrong access mode for NetBeans connection info file: \"%s\"" -msgstr "E668: NetBeans կապակցման տեղեկատվական ֆայլի սխալ ռեժիմ: \"%s\"" - -msgid "E669: Unprintable character in group name" -msgstr "E669: Չտպագրելի նշան՝ խմբի անվան մեջ" - -#, c-format -msgid "E670: Mix of help file encodings within a language: %s" -msgstr "" -"E670: Օգնական ֆայլը օգտագործում է տարբեր կոդավորումներ մի լեզվի համար: %s" - -#, c-format -msgid "E671: Cannot find window title \"%s\"" -msgstr "E671: Պատուհանի անունը չի գտնվել \"%s\"" - -msgid "E672: Unable to open window inside MDI application" -msgstr "E672: Հնարավոր չէ բացել պատուհանը MDI ծրագրում" - -msgid "E673: Incompatible multi-byte encoding and character set" -msgstr "E673: Անհամապատասխան բազմաբայթ կոդավորում և տառատեսակների բազմություն" - -msgid "E674: printmbcharset cannot be empty with multi-byte encoding." -msgstr "E674: printmbcharset֊ը չի կարող դատարկ լինել բազմաբայթ կոդավորման հետ." - -msgid "E675: No default font specified for multi-byte printing." -msgstr "" -"E675: բազմաբայթ կոդավորման հետ տրված չէ լռելիությամբ սահմանված տառատեսակը." - -#| msgid "No matching autocommands: %s" -msgid "E676: No matching autocommands for buftype=%s buffer" -msgstr "E676: Buftype=%s բուֆերի համար համապատասխան ավտոմատ հրամաններ չկան" - -msgid "E677: Error writing temp file" -msgstr "E677: Սխալ է տեղի ունեցել ժամանակավոր ֆայլում գրելու ընթացքում" - -#, c-format -msgid "E678: Invalid character after %s%%[dxouU]" -msgstr "E678: Անվավեր նշան՝ %s%%[dxouU]-ից հետո" - -msgid "E679: Recursive loop loading syncolor.vim" -msgstr "E679: Ռեկուրսիվ շրջակցային բեռնում syncolor.vim" - -#, c-format -msgid "E680: : invalid buffer number" -msgstr "E680: : անվավեր բուֆերի համար" - -msgid "E681: Buffer is not loaded" -msgstr "E681: Բուֆերը չի բեռնվել" - -msgid "E682: Invalid search pattern or delimiter" -msgstr "E682: Անվավեր որոնման նմուշ կամ բացատանիշ" - -msgid "E683: File name missing or invalid pattern" -msgstr "E683: Ֆայլի անունը տրված չէ կամ տրված է անվավեր նմուշ" - -#, c-format -msgid "E684: List index out of range: %ld" -msgstr "E684: Ցանկի ինդեքսն անցել է թույլատրելի միջակայքը: %ld" - -#, c-format -msgid "E685: Internal error: %s" -msgstr "E685: Ներքին համակարգային սխալ: %s" - -#, c-format -msgid "E686: Argument of %s must be a List" -msgstr "E686: %s պարամետրը պետք է լինի ցանկ" - -msgid "E687: Less targets than List items" -msgstr "E687: Ավելի քիչ նշաններ քան ցանկի էլեմենտները" - -msgid "E688: More targets than List items" -msgstr "E688: Ավելի շատ նշաններ քան ցանկի էլեմենտները" - -#| msgid "E790: undojoin is not allowed after undo" -msgid "E689: Index not allowed after a %s: %s" -msgstr "E689: ցուցիչը չի թույլատրվում %s-ից հետո՝ %s" - -msgid "E690: Missing \"in\" after :for" -msgstr "E690: Բացկայող \"in\":for֊ից հետո" - -msgid "E691: Can only compare List with List" -msgstr "E691: Ցանկը պետք է համեմատել միայն ցանկի հետ" - -msgid "E692: Invalid operation for List" -msgstr "E692: Ցանկի հետ չթույլատրված գործողություն" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E693: Class or class typealias required for argument %d" -msgstr "E693: %d արգումենտի համար պահանջվում են դասի կամ դասի տիպեր" - -msgid "E694: Invalid operation for Funcrefs" -msgstr "E694: Ֆունկցիայի հղման հետ չթույլատրված գործողություն" - -msgid "E695: Cannot index a Funcref" -msgstr "E695: Անհնար է Ինդեքսավորել ֆունկցիայի հղումը" - -#, c-format -msgid "E696: Missing comma in List: %s" -msgstr "E696: Ցանկում բաց թողնված ստորակետ: %s" - -#, c-format -msgid "E697: Missing end of List ']': %s" -msgstr "E697: Բացակայող ']'ցանկի վերջում: %s" - -msgid "E698: Variable nested too deep for making a copy" -msgstr "E698: Փոփոխականը շատ խորն է ներդրված պատճենելու համար" - -msgid "E699: Too many arguments" -msgstr "E699: Աննախադեպ շատ արգումենտներ" - -#, c-format -msgid "E700: Unknown function: %s" -msgstr "E700: Անծանոթ ֆունկցիա: %s" - -msgid "E701: Invalid type for len()" -msgstr "E701: Անվավեր տիպ len() ֆունկցիայի համար" - -msgid "E702: Sort compare function failed" -msgstr "E702: Անհաջող համեմատում դասավորման կանչի համար" - -msgid "E703: Using a Funcref as a Number" -msgstr "E703: ֆունկցիայի հղում է օգտագործվել ամբողջի փոխարեն" - -#, c-format -msgid "E704: Funcref variable name must start with a capital: %s" -msgstr "E704: Funcref փոփոխականը պետք է սկսվի մեծատառով: %s" - -#, c-format -msgid "E705: Variable name conflicts with existing function: %s" -msgstr "E705: Փոփոխականի անունով ֆունկցիա արդեն գոյություն ունի: %s" - -#, c-format -msgid "E706: Argument of %s must be a List, String or Dictionary" -msgstr "E706: %s-ի արգումենտը պետք է լինի ցանկ, տող կամ բառարան" - -#, c-format -msgid "E707: Function name conflicts with variable: %s" -msgstr "E707: Ֆունկցիայի անունը համընկնում է փոփոխականի անվան հետ: %s" - -msgid "E708: [:] must come last" -msgstr "E708: [:] պետք է լինի վերջում" - -msgid "E709: [:] requires a List or Blob value" -msgstr "E709: [:] պահանջում է ցանկ կամ բլոբ արժեք" - -msgid "E710: List value has more items than targets" -msgstr "E710: Ցանկի արժեքներն ունեն ավելի շատ էլեմենտներ քան նշաններ" - -msgid "E711: List value does not have enough items" -msgstr "E711: Ցանկի արժեքը չունի բավականաչափ էլեմենտներ" - -#, c-format -msgid "E712: Argument of %s must be a List or Dictionary" -msgstr "E712: %s֊ի արգումենտ պետք է լինի ցանկ կամ բառարան" - -msgid "E713: Cannot use empty key for Dictionary" -msgstr "E713: Անհնար է օգտագործել դատարակ բառարանի բանալի" - -msgid "E714: List required" -msgstr "E714: Ցանկ է անհրաժեշտ" - -msgid "E715: Dictionary required" -msgstr "E715: Բառարան է անհրաժեշտ" - -#, c-format -msgid "E716: Key not present in Dictionary: \"%s\"" -msgstr "E716: Բառարանում \"%s\" բանալին չի գտնվել" - -msgid "E717: Dictionary entry already exists" -msgstr "E717: Բառարանի էլեմենտն արդեն գոյություն ունի" - -msgid "E718: Funcref required" -msgstr "E718: Անհրաժեշտ է Funcref" - -#| msgid "E713: Cannot use empty key for Dictionary" -msgid "E719: Cannot slice a Dictionary" -msgstr "E719: Հնարավոր չէ կտրատել բառարանը" - -#, c-format -msgid "E720: Missing colon in Dictionary: %s" -msgstr "E720: Բառարանում բաց թողնված չակերտ: %s" - -#, c-format -msgid "E721: Duplicate key in Dictionary: \"%s\"" -msgstr "E721: Բառարանի բանալու կրկնություն: \"%s\"" - -#, c-format -msgid "E722: Missing comma in Dictionary: %s" -msgstr "E722: Բառարանում բաց թողնված ստորակետ %s" - -#, c-format -msgid "E723: Missing end of Dictionary '}': %s" -msgstr "E723: Բացակայող '}'ցանկի վերջում: %s" - -msgid "E724: Variable nested too deep for displaying" -msgstr "E724: Փոփոխականը շատ խորն է ներդրված ցուցադրման համար" - -#, c-format -msgid "E725: Calling dict function without Dictionary: %s" -msgstr "E725:dict ֆունկցիան կանչվել է առանց բառարանի: %s" - -msgid "E726: Stride is zero" -msgstr "E726: Քայլը զրո է" - -msgid "E727: Start past end" -msgstr "E727: Սկիզբ՝ վերջից հետո" - -msgid "E728: Using a Dictionary as a Number" -msgstr "E728: Բառարան է օգտագործվել ամբողջի փոխարեն" - -msgid "E729: Using a Funcref as a String" -msgstr "E729: Ֆունկցիայի հղում է օգտագործվել տողի փոխարեն" - -msgid "E730: Using a List as a String" -msgstr "E730: Ցանկ է օգտագործվել տողի փոխարեն" - -msgid "E731: Using a Dictionary as a String" -msgstr "E731: Բառարան է օգտագործվել տողի փոխարեն" - -msgid "E732: Using :endfor with :while" -msgstr "E732: :endfor :while֊ի հետ" - -msgid "E733: Using :endwhile with :for" -msgstr "E733: :endwhile :for֊ի հետ" - -#, c-format -msgid "E734: Wrong variable type for %s=" -msgstr "E734: Փոփոխականի սխալ տիպ %s=" - -msgid "E735: Can only compare Dictionary with Dictionary" -msgstr "E735: Բառարանը պետք է համեմատել միայն բառարանը հետ" - -msgid "E736: Invalid operation for Dictionary" -msgstr "E736: Բառարանի հետ չթույլատրված գործողություն" - -#, c-format -msgid "E737: Key already exists: %s" -msgstr "E737: Բանալին արդեն գոյություն ունի: %s" - -#, c-format -msgid "E738: Can't list variables for %s" -msgstr "E738: Հնարավոր չէ ցուցադրել %s֊ի փոփոխականնները" - -#, c-format -msgid "E739: Cannot create directory: %s" -msgstr "E739: Հնարավոր չէ ստեղծել թղթապանակ: %s" - -#, c-format -msgid "E740: Too many arguments for function %s" -msgstr "E740: %s֊ին տրված են աննախադեպ շատ Ֆունկցիայի արգումենտներ" - -msgid "E741: Value is locked" -msgstr "E741: Արժեքը բլոկավորված է" - -#, c-format -msgid "E741: Value is locked: %s" -msgstr "E741: %s արժեքը բլոկավորված է" - -msgid "E742: Cannot change value" -msgstr "E742: Անհնար է փոխել արժեքը" - -#, c-format -msgid "E742: Cannot change value of %s" -msgstr "E742: Անհնար է փոխել %s֊ի արժեքը" - -msgid "E743: Variable nested too deep for (un)lock" -msgstr "E743: Փոփոխականը շատ խորն է ներդրված բլոկավորման/ապաբլոկավորման համար" - -msgid "E744: NetBeans does not allow changes in read-only files" -msgstr "" -"E744: NetBeans֊ը չի թույլատրում փոփոխություններ միայն կարդալու ֆայլերում" - -msgid "E745: Using a List as a Number" -msgstr "E745: Ցանկ է օգտագործվել ամբողջի փոխարեն" - -#, c-format -msgid "E746: Function name does not match script file name: %s" -msgstr "E746: Ֆունկցիայի անունը չի համընկնում սկրիպտային ֆայլի անվան հետ: %s" - -msgid "E747: Cannot change directory, buffer is modified (add ! to override)" -msgstr "" -"E747: Հնարավոր չէ փոխել թղթապանակը, կա փոփոխված buffer (անցման համար " -"ավելցանել !)" - -msgid "E748: No previously used register" -msgstr "E748: Չկան նախկինում օգտագորխված ռեգիստրներ" - -msgid "E749: Empty buffer" -msgstr "E749: Դատարկ բուֆեր" - -msgid "E750: First use \":profile start {fname}\"" -msgstr "E750: Առաջին օգտագործում \":profile start {fname}\"" - -msgid "E751: Output file name must not have region name" -msgstr "E751: Ելքային ֆայլի անունը չպետք է պարունակի ռեգիոնի անուն" - -msgid "E752: No previous spell replacement" -msgstr "E752: Չկա նախկին ուղղագրման փոխարինում" - -#, c-format -msgid "E753: Not found: %s" -msgstr "E753: Չի հայտնաբերվել: %s" - -#, c-format -msgid "E754: Only up to %d regions supported" -msgstr "E754: Աջակցվում են մինչև %d ռեգիոններ" - -#, c-format -msgid "E755: Invalid region in %s" -msgstr "E755: Անվավեր ռեգիոն %s֊ում" - -msgid "E756: Spell checking is not possible" -msgstr "E756: Ուղղագրիչն անջատված է" - -msgid "E757: This does not look like a spell file" -msgstr "E757: Սա ուղղագրման ֆայլ չէ" - -msgid "E758: Truncated spell file" -msgstr "E758: Անավարտ ուղղագրման ֆայլ" - -msgid "E759: Format error in spell file" -msgstr "E759: Ֆորմատի սխալ՝ ուղղագրման ֆայլում" - -#, c-format -msgid "E760: No word count in %s" -msgstr "E760: %s-ում բառաքանակը տրված չէ" - -msgid "E761: Format error in affix file FOL, LOW or UPP" -msgstr "E761: Ֆորմատի սխալ FOL, LOW կամ UPP ֆայլերում" - -msgid "E762: Character in FOL, LOW or UPP is out of range" -msgstr "E762: FOL, LOW կամ UPP ֆայլերում տրված տառը դուրս է եկել դիապազոնցի" - -msgid "E763: Word characters differ between spell files" -msgstr "" -"E763: Տառերի քանակությունը չի համընկնում ուղղագրման ֆայլում սահմանված բառի " -"տառերի քանակությանը" - -#, c-format -msgid "E764: Option '%s' is not set" -msgstr "E764: '%s' կարգանշանը սահմանված չէ" - -#, c-format -msgid "E765: 'spellfile' does not have %d entries" -msgstr "E765: 'spellfile' չի պարունակում %d էլեմենտներ" - -msgid "E766: Insufficient arguments for printf()" -msgstr "E766: Անբավարար արգումենտնորի քանակ printf()-ի համար" - -msgid "E767: Too many arguments for printf()" -msgstr "E767: printf()-ին տրված են աննախադեպ շատ քանակությամբ արգումենտներ" - -#, c-format -msgid "E768: Swap file exists: %s (:silent! overrides)" -msgstr "" -"E768: սվեփ ֆայլը գոյություն ունի: %s (:silent! հարցերից խուսափելու համար)" - -#, c-format -msgid "E769: Missing ] after %s[" -msgstr "E769: Բացակայող ] после %s[" - -msgid "E770: Unsupported section in spell file" -msgstr "E770: Անծանոթ ենթագլուխ՝ ուղղագրման ֆայլում" - -msgid "E771: Old spell file, needs to be updated" -msgstr "E771: Ուղղագրման ֆայլը հին է, անհրաժեշտ է թարմացնել" - -msgid "E772: Spell file is for newer version of Vim" -msgstr "E772: Ուղղագրման ֆայլը նախատեսված է ավելի թարմ Vim-ի համար" - -#, c-format -msgid "E773: Symlink loop for \"%s\"" -msgstr "E773: Symlink-ի ինքնահղում \"%s\"" - -msgid "E774: 'operatorfunc' is empty" -msgstr "E774: 'operatorfunc'-ի արժեքը դատարկ է" - -msgid "E775: Eval feature not available" -msgstr "E775: Eval առանձնահատկությունը հասանելի չէ" - -msgid "E776: No location list" -msgstr "E776: Տեղակայման ցանկը բացակայում է" - -msgid "E777: String or List expected" -msgstr "E777: Սպասվում է ցանկ կամ տեղ" - -#, c-format -msgid "E778: This does not look like a .sug file: %s" -msgstr "E778: Նման չէ .sug ֆայլի: %s" - -#, c-format -msgid "E779: Old .sug file, needs to be updated: %s" -msgstr "E779: Հին .sug ֆայլ, անհրաժեշտ է թարմացում: %s" - -#, c-format -msgid "E780: .sug file is for newer version of Vim: %s" -msgstr "E780: .sug ֆայլը նախատեսված է ավելի թարմ Vim-ի համար: %s" - -#, c-format -msgid "E781: .sug file doesn't match .spl file: %s" -msgstr "E781: .sug ֆայլը չի համապատասխանում .spl: ֆայլի հետ %s" - -#, c-format -msgid "E782: Error while reading .sug file: %s" -msgstr "E782: .sug ֆայլի ընթերցման սխալ: %s" - -msgid "E783: Duplicate char in MAP entry" -msgstr "E783: Կրկնակի տառ MAP-ի էլեմենտում" - -msgid "E784: Cannot close last tab page" -msgstr "E784: Հնարավոր չէ փակել վերջին բացված թաբը" - -msgid "E785: complete() can only be used in Insert mode" -msgstr "E785: complete() կարող է օգտագործվել միայն զետեղման ռեժիմում" - -msgid "E786: Range not allowed" -msgstr "E786: Միջակայք թույլատրված չէ" - -msgid "E787: Buffer changed unexpectedly" -msgstr "E787: Բուֆֆերն անսպասելի փոփոխվել է" - -msgid "E788: Not allowed to edit another buffer now" -msgstr "E788: Այլ բուֆերի խմբագրում չի թույլատրվում հիմա" - -#, c-format -msgid "E789: Missing ']': %s" -msgstr "E789: Բացակայող ']': %s" - -msgid "E790: undojoin is not allowed after undo" -msgstr "E790: չեղարկման միավորումն անհնար է չեղարկումից հետո" - -msgid "E791: Empty keymap entry" -msgstr "E791: Դատարկ բանալիային համապատասխանեցում" - -msgid "E792: Empty menu name" -msgstr "E792: Մենյուի դատարկ էլեմենտ" - -msgid "E793: No other buffer in diff mode is modifiable" -msgstr "E793: Փոփոխելի բուֆերներ այլևս չկան" - -msgid "E794: Cannot set variable in the sandbox" -msgstr "E794: Հնարավոր չէ ստեղծել փոփոխական sandbox-ում" - -#, c-format -msgid "E794: Cannot set variable in the sandbox: \"%s\"" -msgstr "E794: Հնարավոր չէ ստեղծել փոփոխական sandbox֊ում: \"%s\"" - -msgid "E795: Cannot delete variable" -msgstr "E795: Հնարավոր չէ ջնջել փոփոխականը" - -#| msgid "E795: Cannot delete variable" -msgid "E795: Cannot delete variable %s" -msgstr "E795: Հնարավոր չէ ջնջել %s փոփոխականը" - -msgid "writing to device disabled with 'opendevice' option" -msgstr "սարքում գրելն արգելված է 'opendevice' կարգանշման միջոցով" - -msgid "E797: SpellFileMissing autocommand deleted buffer" -msgstr "" -"E797: Բուֆերը ջնջվել է SpellFileMissing ինքնահրամանի կատարման արդյունքում" - -#, c-format -msgid "E798: ID is reserved for \":match\": %d" -msgstr "E798: ID-ն վերապահված է \":match\"-ի համար՝ %d" - -#, c-format -msgid "E799: Invalid ID: %d (must be greater than or equal to 1)" -msgstr "E799: Անվավեր համար։ %d (համարը պետք է լինի 1-ից մեծ կամ հավասար)" - -msgid "" -"E800: Arabic cannot be used: Not enabled at compile time\n" -msgstr "" -"E800: Արաբերենը հնարավոր չէ օգտագործել, միացված չէ կառուղման ժամանակ\n" - -#| msgid "E1073: Name already defined: %s" -msgid "E801: ID already taken: %d" -msgstr "E801: ID-ն արդեն վերցված է՝ %d" - -#, c-format -msgid "E802: Invalid ID: %d (must be greater than or equal to 1)" -msgstr "E802: Անվավեր համար։ %d (համարը պետք է լինի 1-ից մեծ կամ հավասար)" - -#, c-format -msgid "E803: ID not found: %d" -msgstr "E803:: Համարը չի հայտնաբերվել: %d" - -#, no-c-format -msgid "E804: Cannot use '%' with Float" -msgstr "E804: Անհնար է օգտագործել '%'֊ը սահող կետով թվերի հետ" - -msgid "E805: Using a Float as a Number" -msgstr "E805: Սահող կետով թիվ է օգտագործվել ամբողջի փոխարեն" - -msgid "E806: Using a Float as a String" -msgstr "E806: Սահող կետով թվի օգտագործում` տողի փոխարեն" - -msgid "E807: Expected Float argument for printf()" -msgstr "E807: Սպասվում է սահող կետով արգումենտ printf()-ի համար" - -msgid "E808: Number or Float required" -msgstr "E808: Սահող կետով թիվ է անհրաժեշտ" - -msgid "E809: #< is not available without the +eval feature" -msgstr "E809: #< հասանելի չէ առանց +eval հատկության" - -msgid "E810: Cannot read or write temp files" -msgstr "E810: Հնարավոր չէ գրել կամ կարդալ ժամանակավոր ֆայլերում" - -msgid "E811: Not allowed to change buffer information now" -msgstr "E811: Հնարավոր չէ փոփոխել բուֆորի ինֆորմացիան" - -msgid "E812: Autocommands changed buffer or buffer name" -msgstr "E812: Ինքնահրամանները փոփոխել են բուֆերը կամ բուֆերի անունը" - -msgid "E813: Cannot close autocmd or popup window" -msgstr "E813: Հնարավոր չէ փակել ինքնահրամանը կամ սահապատը" - -msgid "E814: Cannot close window, only autocmd window would remain" -msgstr "" -"E814: Հնարավոր չէ փակել պատուհանը, միայն ինքնահրամանների պատուհանը կարող է " -"մնալ" - -msgid "" -"E815: Sorry, this command is disabled, the MzScheme libraries could not be " -"loaded." -msgstr "" -"E815: Ներողություն, այս հրամանն ապաակտիվացված է, հնարավոր չէ բեռնել MzScheme " -"գրադարանը." - -msgid "E816: Cannot read patch output" -msgstr "E816: Հնարավոր չէ կարդալ նմանակման ելքը" - -msgid "E817: Blowfish big/little endian use wrong" -msgstr "E817: Blowfish֊ին տրված մեծ/փոքր վերջավորության կարգը սխալ է" - -msgid "E818: sha256 test failed" -msgstr "E818: sha256 թեսթն անհաջող է ավարտվել" - -msgid "E819: Blowfish test failed" -msgstr "E819: Blowfish թեսթն անհաջող է ավարտվել" - -msgid "E820: sizeof(uint32_t) != 4" -msgstr "E820: sizeof(uint32_t) != 4" - -msgid "E821: File is encrypted with unknown method" -msgstr "E821: Ֆայլը կոդավորված է անծանոթ մեթոդներով" - -#, c-format -msgid "E822: Cannot open undo file for reading: %s" -msgstr "E822: Հնարավոր չէ բացել չեղարկման ֆայլն ընթերցման համար: %s" - -#, c-format -msgid "E823: Not an undo file: %s" -msgstr "E823: Չեղարկման ֆայլ չէ: %s" - -#, c-format -msgid "E824: Incompatible undo file: %s" -msgstr "E824: Անհամապատասխան չեղարկման ֆայլ: %s" - -#, c-format -msgid "E825: Corrupted undo file (%s): %s" -msgstr "E825: Վնասված չեղարկման ֆայլ (%s): %s" - -#, c-format -msgid "E826: Undo file decryption failed: %s" -msgstr "E826: Չեղարկման ֆայլի դեկոդավորումն ավարտվել է անհաջողությամբ: %s" - -#, c-format -msgid "E827: Undo file is encrypted: %s" -msgstr "E827: Չեղարկման ֆայլը կոդավորված է: %s" - -#, c-format -msgid "E828: Cannot open undo file for writing: %s" -msgstr "E828: Պահպանման համար հնարավոր չէ բացել չեղարկման ֆայլը: %s" - -#, c-format -msgid "E829: Write error in undo file: %s" -msgstr "E829: Չեղարկման ֆայլի ամրագրման սխալ: %s" - -#, c-format -msgid "E830: Undo number %ld not found" -msgstr "E830: Չեղարկման %ld համարը չի հայտնաբերվել" - -#, c-format -msgid "E832: Non-encrypted file has encrypted undo file: %s" -msgstr "E832: Չկոդավորված ֆայլն ունի կոդավորված չեղարկման ֆայլ: %s" - -#, c-format -msgid "" -"E833: %s is encrypted and this version of Vim does not support encryption" -msgstr "E833: %s֊ը կոդավորված է և Vim-ի այս տարբերակը կոդավորում չի աջակցում" - -msgid "E834: Conflicts with value of 'listchars'" -msgstr "E834: Կոնֆլիկտ՝ 'listchars'-ի արժեքում" - -msgid "E835: Conflicts with value of 'fillchars'" -msgstr "E835: Կոնֆլիկտ՝ 'fillchars'-ի արժեքում" - -msgid "E836: This Vim cannot execute :python after using :py3" -msgstr "" -"E836: Այս Vim֊ը չի կարող կատարել :python հրամանը :py3 հրամանի օգտագործումից " -"հետո" - -msgid "E837: This Vim cannot execute :py3 after using :python" -msgstr "" -"E837: Այս Vim֊ը չի կարող կատարել :py3 հրամանը :python հրամանի օգտագործումից " -"հետո" - -msgid "E838: NetBeans is not supported with this GUI" -msgstr "E838: NetBeans֊ը չի աջակցվում այս գրաֆիկական ինտերֆեյսով" - -msgid "E840: Completion function deleted text" -msgstr "E840: Ավտոմատ լրացման գործառույթը ջնջել է տեքստը" - -msgid "E841: Reserved name, cannot be used for user defined command" -msgstr "" -"E841: Ռեզերվացված անուն, չի կարելի օգտագործել օգտատիրոջ սահմանած հրամաններում" - -msgid "E842: No line number to use for \"\"" -msgstr "E842: տողի համարը տրված չէ \"\"-ի համար" - -msgid "E843: Error while updating swap file crypt" -msgstr "E843: Սխալ, սվեփ ֆայլի կոդավորման թարմացման ժամանակ" - -msgid "E844: Invalid cchar value" -msgstr "E844: cchar-ի անվավեր արժեք" - -msgid "E845: Insufficient memory, word list will be incomplete" -msgstr "E845: Անբավարար հիշողություն, բառալիստը կարող է անավարտ մնալ" - -msgid "E846: Key code not set" -msgstr "E846: Ստեղնի կոդը կարգավորված չէ" - -msgid "E847: Too many syntax includes" -msgstr "E847: Աննախադեպ շատ ուղղագրական կցումներ" - -msgid "E848: Too many syntax clusters" -msgstr "E848: Աննախադեպ շատ hամակարգեր" - -msgid "E849: Too many highlight and syntax groups" -msgstr "E849: Աննախադեպ շատ գունանշման բնորոշիչներ և ուղղագրական խմբեր" - -msgid "E850: Invalid register name" -msgstr "E850: Անվավեր ռեգիստր" - -msgid "E851: Failed to create a new process for the GUI" -msgstr "E851: Հնարավոր չէ ստեղծել նոր պրոցես գրաֆիկական ինտերֆեյսի համար" - -msgid "E852: The child process failed to start the GUI" -msgstr "E852: Ճուտ պրոցեսին չի հաջողվել սկսել գրաֆիկական ինտերֆեյսը" - -#, c-format -msgid "E853: Duplicate argument name: %s" -msgstr "E853: Կրկնված արգումենտի անուն: %s" - -msgid "E854: Path too long for completion" -msgstr "E854: Ճանապարհն անսպասելի երկար է ինքնահամալրման համար" - -msgid "E855: Autocommands caused command to abort" -msgstr "E855: Ինքնահրամմանները ստիպել են հրամանին անհաջող ավարտվել" - -msgid "" -"E856: \"assert_fails()\" second argument must be a string or a list with one " -"or two strings" -msgstr "" -"E856: \"assert_fails()\" երկրորդ արգումենտը պետք է լինի տող կամ ցուցակ մեկ " -"կամ երկու տողով" - -#, c-format -msgid "E857: Dictionary key \"%s\" required" -msgstr "E857: Բառարանի \"%s\" բանալին անհրաժեշտ է" - -msgid "E858: Eval did not return a valid python object" -msgstr "E858: Eval֊ը չի վերադարձրել վավեր Python օբյեկտ" - -msgid "E859: Failed to convert returned python object to a Vim value" -msgstr "E859: Հնարավոր չէ փոխակերպել վերադարձված python օբյեկտը՝ Vim արժեքի" - -msgid "E860: Need 'id' and 'type' or 'types' with 'both'" -msgstr "E860: Պետք է 'id' և 'type' կամ 'types' և 'both'" - -#| msgid "E810: Cannot read or write temp files" -msgid "E861: Cannot open a second popup with a terminal" -msgstr "E861: Հնարավոր չէ բացել երկրորդ թռուցիկ պատուհանը տերմինալով" - -msgid "E862: Cannot use g: here" -msgstr "E862: Հնարավոր չէ այստեղ օգտագործել g:֊ն" - -#| msgid "E813: Cannot close autocmd or popup window" -msgid "E863: Not allowed for a terminal in a popup window" -msgstr "E863: Չի թույլատրվում բացվող պատուհանում տերմինալի համար" - -#, no-c-format -msgid "" -"E864: \\%#= can only be followed by 0, 1, or 2: The automatic engine will be " -"used" -msgstr "" -"E864: \\%#=-ին կարող է հետևել միայն 0, 1 կամ 2: Ավտոմատ շարժիչը կօգտագործվի" - -msgid "E865: (NFA) Regexp end encountered prematurely" -msgstr "E865: (NFA) Ռեգուլյար արտահայտթության անսպասելի ավարտ" - -#, c-format -msgid "E866: (NFA regexp) Misplaced %c" -msgstr "E866: (NFA regexp) անսպասելի %c" - -#, c-format -msgid "E867: (NFA regexp) Unknown operator '\\z%c'" -msgstr "E867: (NFA regexp) անծանոթ հրաման '\\z%c'" - -#, c-format -msgid "E867: (NFA regexp) Unknown operator '\\%%%c'" -msgstr "E867: (NFA regexp) անծանոթ հրաման '\\%%%c'" - -msgid "E868: Error building NFA with equivalence class!" -msgstr "E868: Սխալ՝ NFA կառուցման ընթացքում !" - -#, c-format -msgid "E869: (NFA regexp) Unknown operator '\\@%c'" -msgstr "E869: (NFA regexp) անծանոթ օպերատոր '\\@%c'" - -msgid "E870: (NFA regexp) Error reading repetition limits" -msgstr "E870: (NFA regexp) Կրկնման սահմանափակման ընթերցման սխալ" - -msgid "E871: (NFA regexp) Can't have a multi follow a multi" -msgstr "E871: (NFA regexp) Բազմությունը չի կարող հետևել բազմությանը" - -msgid "E872: (NFA regexp) Too many '('" -msgstr "E872: (NFA regexp) աննախադեպ շատ '('" - -msgid "E873: (NFA regexp) proper termination error" -msgstr "E873: (NFA regexp) ավարտման սխալ" - -msgid "E874: (NFA regexp) Could not pop the stack!" -msgstr "E874: (NFA regexp) Հնարավոր չէ ընթերցել ստեկից!" - -msgid "" -"E875: (NFA regexp) (While converting from postfix to NFA), too many states " -"left on stack" -msgstr "" -"E875: (NFA regexp) ստեկում մնացելեն աննախադեպ շատ վիճակներ (պոստֆիքսից " -"NFAփոխակերպման ընթացքում)" - -msgid "E876: (NFA regexp) Not enough space to store the whole NFA" -msgstr "E876: (NFA regexp) Հիշողությունն անբավարար է՝ NFA֊ը պահպանելու համար" - -#, c-format -msgid "E877: (NFA regexp) Invalid character class: %d" -msgstr "E877: (NFA regexp) Անվավեր դաս : %d" - -msgid "E878: (NFA regexp) Could not allocate memory for branch traversal!" -msgstr "" -"E878: (NFA regexp) Ճյուղային այցելության համար հնարավոր չէ առանձնացնել " -"հիշողություն!" - -msgid "E879: (NFA regexp) Too many \\z(" -msgstr "E879: (NFA regexp) աննախադեպ շատ \\z(" - -msgid "E880: Can't handle SystemExit of python exception in vim" -msgstr "E880: Չի կարող կարգավորել SystemExit python բացառությունը vim-ում" - -msgid "E881: Line count changed unexpectedly" -msgstr "E881: Տողերի քանակն անսպասելիորեն փոփոխվել է" - -msgid "E882: Uniq compare function failed" -msgstr "E882: Անհաջող համեմատում դասավորման կանչի համար" - -msgid "" -"E883: Search pattern and expression register may not contain two or more " -"lines" -msgstr "" -"E883: Որոնման օրինակը և արտահայտությունների ռեգիստրը չեն կարող պարունակել " -"երկու կամ ավելի տող" - -#, c-format -msgid "E884: Function name cannot contain a colon: %s" -msgstr "E884: Ֆունկցիայի անունը չի կարող պարունակել ստորակետ: %s" - -#, c-format -msgid "E885: Not possible to change sign %s" -msgstr "E885: Հնարավոր չէ փոխել նշանը %s" - -#, c-format -msgid "E886: Can't rename viminfo file to %s!" -msgstr "E886: Անհնար է վերանվանել viminfo ֆայլը %s-ի!" - -msgid "" -"E887: Sorry, this command is disabled, the Python's site module could not be " -"loaded." -msgstr "" -"E887: Ներողություն, այս հրամանն անջատված է, Python գրադարանը հնարավոր չէ " -"բեռնել." - -#| msgid "E867: (NFA regexp) Unknown operator '\\z%c'" -msgid "E888: (NFA regexp) cannot repeat %s" -msgstr "E888: (NFA regexp) չի կարող կրկնել %s" - -msgid "E889: Number required" -msgstr "E889: Ամբողջ թիվ է անհրաժեշտ" - -#, c-format -msgid "E890: Trailing char after ']': %s]%s" -msgstr "E890: Ավելորդ նշաններ ']'-ից հետո: %s]%s" - -msgid "E891: Using a Funcref as a Float" -msgstr "E891: Ֆունկցիայի հղումն օգտագործվել է սահող կետով թվի փոխարեն" - -#| msgid "E891: Using a Funcref as a Float" -msgid "E892: Using a String as a Float" -msgstr "E892: Օգտագործելով լարը որպես բոց" - -#| msgid "E891: Using a Funcref as a Float" -msgid "E893: Using a List as a Float" -msgstr "E893: Ցուցակի օգտագործումը որպես բոց" - -#| msgid "E728: Using a Dictionary as a Number" -msgid "E894: Using a Dictionary as a Float" -msgstr "E894: Բառարանի օգտագործումը որպես բոց" - -msgid "" -"E895: Sorry, this command is disabled, the MzScheme's racket/base module " -"could not be loaded." -msgstr "" -"E895: Ներողություն, այ հրամանն անջատում է, հնարավոր չէ բեռնել MzScheme " -"գրադարանը." - -#, c-format -msgid "E896: Argument of %s must be a List, Dictionary or Blob" -msgstr "E896: %s֊ի արգումենտը պետք է լինի ցանկ կամ բառարան" - -msgid "E897: List or Blob required" -msgstr "E897: Ցանկ է անհրաժեշտ" - -msgid "E898: socket() in channel_connect()" -msgstr "E898: socket() channel_connect()-ում" - -#, c-format -msgid "E899: Argument of %s must be a List or Blob" -msgstr "E899: %s պարամետրը պետք է լինի ցանկ" - -msgid "E900: maxdepth must be non-negative number" -msgstr "E900: առավելագույն խորությունը պետք է լինի ոչ բացասական թիվ" - -#, c-format -msgid "E901: getaddrinfo() in channel_open(): %s" -msgstr "E901: getaddrinfo() channel_open(): %s" - -msgid "E901: gethostbyname() in channel_open()" -msgstr "E901: gethostbyname() channel_open()-ում" - -#| msgid "E254: Cannot allocate color %s" -msgid "E902: Cannot connect to port" -msgstr "E902: Հնարավոր չէ միանալ նավահանգիստին" - -msgid "E903: Received command with non-string argument" -msgstr "E903: ստացված հրամանը ոչ լարային արգումենտով" - -#| msgid "E904: Third argument for call must be a list" -msgid "E904: Last argument for expr/call must be a number" -msgstr "E904: expr/call-ի վերջին փաստարկը պետք է լինի թիվ" - -msgid "E904: Third argument for call must be a list" -msgstr "E904: 3-րդ արգումենտը պետք է լինի ցանկ" - -#| msgid "E160: Unknown sign command: %s" -msgid "E905: Received unknown command: %s" -msgstr "E905: ստացվել է անհայտ հրաման՝ %s" - -#| msgid "E663: At end of changelist" -msgid "E906: Not an open channel" -msgstr "E906: Բաց ալիք չէ" - -#| msgid "E891: Using a Funcref as a Float" -msgid "E907: Using a special value as a Float" -msgstr "E907: Հատուկ արժեքի օգտագործումը որպես Float" - -#| msgid "E806: Using a Float as a String" -msgid "E908: Using an invalid value as a String: %s" -msgstr "E908: Անվավեր արժեքի օգտագործումը որպես տող՝ %s" - -msgid "E909: Cannot index a special variable" -msgstr "E909: Անհնար է ինդեքսավորել հատուկ փոփոխականը" - -#| msgid "E805: Using a Float as a Number" -msgid "E910: Using a Job as a Number" -msgstr "E910: Աշխատանքի օգտագործումը որպես համար" - -#| msgid "E891: Using a Funcref as a Float" -msgid "E911: Using a Job as a Float" -msgstr "E911: Աշխատանքի օգտագործումը որպես բոց" - -msgid "E912: Cannot use ch_evalexpr()/ch_sendexpr() with a raw or nl channel" -msgstr "" -"E912: Հնարավոր չէ օգտագործել ch_evalexpr()/ch_sendexpr() հումքի կամ nl ալիքով" - -#| msgid "E703: Using a Funcref as a Number" -msgid "E913: Using a Channel as a Number" -msgstr "E913: ալիքի օգտագործումը որպես համար" - -#| msgid "E891: Using a Funcref as a Float" -msgid "E914: Using a Channel as a Float" -msgstr "E914: ալիքի օգտագործումը որպես բոց" - -msgid "E915: in_io buffer requires in_buf or in_name to be set" -msgstr "E915: in_io բուֆերը պահանջում է տեղադրել in_buf կամ in_name" - -#| msgid "E543: Not a valid codepage" -msgid "E916: Not a valid job" -msgstr "E916: Վավեր աշխատանք չէ" - -#| msgid "E197: Cannot set language to \"%s\"" -msgid "E917: Cannot use a callback with %s()" -msgstr "E917: Հնարավոր չէ օգտագործել հետզանգ %s()-ով" - -#, c-format -msgid "E918: Buffer must be loaded: %s" -msgstr "E918: Բուֆերը չի բեռնվել: %s" - -#| msgid "not found in '%s': \"%s\"" -msgid "E919: Directory not found in '%s': \"%s\"" -msgstr "E919: '%s'-ում գրացուցակը չի գտնվել. \"%s\"" - -msgid "E920: _io file requires _name to be set" -msgstr "E920: _io ֆայլը պահանջում է սահմանել _name" - -#| msgid "E474: Invalid argument" -msgid "E921: Invalid callback argument" -msgstr "E921: Անվավեր հետադարձ արգումենտ" - -msgid "E923: Second argument of function() must be a list or a dict" -msgstr "E923: Ֆունկցիայի երկրորդ արգումենտը պետք է լինի ցանկ կամ բառարան" - -msgid "E924: Current window was closed" -msgstr "E924: Ընթացիկ պատուհանը փակ է" - -msgid "E925: Current quickfix list was changed" -msgstr "E925: ընթացիկ Quickfix ցուցակը փոխվել է" - -msgid "E926: Current location list was changed" -msgstr "E926: Ներկայիս տեղադրության ցանկը փոխվել է" - -#| msgid "E476: Invalid command: %s" -msgid "E927: Invalid action: '%s'" -msgstr "E927: Անվավեր գործողություն՝ '%s'" - -msgid "E928: String required" -msgstr "E928: Պահանջվում է տող" - -#, c-format -msgid "E929: Too many viminfo temp files, like %s!" -msgstr "E929: Չափազանց շատ viminfo ժամանակային ֆայլեր, օրինակ՝ %s!" - -msgid "E930: Cannot use :redir inside execute()" -msgstr "E930: Հնարավոր չէ օգտագործել :redir ներսում execute()" - -msgid "E931: Buffer cannot be registered" -msgstr "E931: Բուֆերը չի կարող գրանցվել" - -#, c-format -msgid "E932: Closure function should not be at top level: %s" -msgstr "E932: Փակման գործառույթը չպետք է լինի վերին մակարդակում՝ %s" - -#| msgid "E129: Function name required" -msgid "E933: Function was deleted: %s" -msgstr "E933: ֆունկցիան ջնջվել է՝ %s" - -msgid "E934: Cannot jump to a buffer that does not have a name" -msgstr "E934: Չի կարող անցնել բուֆեր, որն անուն չունի" - -#| msgid "E964: Invalid column number: %ld" -msgid "E935: Invalid submatch number: %d" -msgstr "E935: Անվավեր ենթահամընկնման համար: %d" - -#| msgid "E351: Cannot delete fold with current 'foldmethod'" -msgid "E936: Cannot delete the current group" -msgstr "E936: Հնարավոր չէ ջնջել ընթացիկ խումբը" - -#, c-format -msgid "E937: Attempt to delete a buffer that is in use: %s" -msgstr "E937: Փորձեք ջնջել օգտագործվող բուֆերը՝ %s" - -#, c-format -msgid "E938: Duplicate key in JSON: \"%s\"" -msgstr "E938: Բանալու կրկնություն: \"%s\"" - -msgid "E939: Positive count required" -msgstr "E939: Պահանջվում է դրական քանակ" - -#| msgid "E46: Cannot change read-only variable \"%s\"" -msgid "E940: Cannot lock or unlock variable %s" -msgstr "E940: Հնարավոր չէ կողպել կամ ապակողպել %s փոփոխականը" - -msgid "E941: Already started a server" -msgstr "E941: Արդեն գործարկել է սերվերը" - -#| msgid "E775: Eval feature not available" -msgid "E942: +clientserver feature not available" -msgstr "E942: +clientserver առանձնահատկությունը հասանելի չէ" - -#| msgid "E488: Trailing characters" -msgid "E944: Reverse range in character class" -msgstr "E944: Հակադարձ միջակայքը նիշերի դասում" - -msgid "E945: Range too large in character class" -msgstr "E945: Նիշերի դասի միջակայքը չափազանց մեծ է" - -msgid "E946: Cannot make a terminal with running job modifiable" -msgstr "E946: Հնարավոր չէ կատարել տերմինալ՝ փոփոխվող գործող աշխատանքով" - -#| msgid "E948: Job still running" -msgid "E947: Job still running in buffer \"%s\"" -msgstr "E947: Խնդիրը դեռևս կատարվում է \"%s\" բուֆերում" - -msgid "E948: Job still running" -msgstr "E948: դեռևս կատարվում է" - -#| msgid "E948: Job still running" -msgid "E948: Job still running (add ! to end the job)" -msgstr "" -"E948: Աշխատանքը դեռ աշխատում է (ավելացրե՛ք ! աշխատանքը ավարտելու համար)" - -#| msgid "E80: Error while writing" -msgid "E949: File changed while writing" -msgstr "E949: ֆայլը փոխվել է գրելիս" - -#| msgid "E1354: Cannot extend %s" -msgid "E950: Cannot convert between %s and %s" -msgstr "E950: Հնարավոր չէ փոխարկել %s-ի և %s-ի միջև" - -#, no-c-format -msgid "E951: \\% value too large" -msgstr "E951: \\% արժեքը մի քիչ երկար է" - -#| msgid "E855: Autocommands caused command to abort" -msgid "E952: Autocommand caused recursive behavior" -msgstr "E952: Ավտոհրաման առաջացրել է ռեկուրսիվ վարքագիծ" - -#, c-format -msgid "E953: File exists: %s" -msgstr "E953: Ֆայլն արդեն գոյություն ունի: %s" - -msgid "E954: 24-bit colors are not supported on this environment" -msgstr "E954: 24-բիթանոց գույները չեն ապահովվում այս միջավայրում" - -#| msgid "E94: No matching buffer for %s" -msgid "E955: Not a terminal buffer" -msgstr "E955: Տերմինալային բուֆեր չէ" - -#| msgid "E659: Cannot invoke Python recursively" -msgid "E956: Cannot use pattern recursively" -msgstr "E956: Նմուշը հնարավոր չէ օգտագործել ռեկուրսիվ" - -#| msgid "E966: Invalid line number: %ld" -msgid "E957: Invalid window number" -msgstr "E957: պատուհանի համարն անվավեր է" - -msgid "E958: Job already finished" -msgstr "E958: Աշխատանքն արդեն ավարտված է" - -#| msgid "E534: Invalid wide font" -msgid "E959: Invalid diff format." -msgstr "E959: Տարբերության անվավեր ձևաչափ:" - -msgid "E960: Problem creating the internal diff" -msgstr "E960: Ներքին տարբերություն ստեղծելու խնդիր" - -msgid "E961: No line number to use for \"\"" -msgstr "E961: Տողի համարը տրված չէ \"\"" - -#| msgid "E476: Invalid command: %s" -msgid "E962: Invalid action: '%s'" -msgstr "E962: Անվավեր գործողություն՝ '%s'" - -#, c-format -msgid "E963: Setting v:%s to value with wrong type" -msgstr "E963: v:%s-ի արժեքը սխալ տիպի սահմանում" - -#, c-format -msgid "E964: Invalid column number: %ld" -msgstr "E964: Անվավեր սյան համար: %ld" - -#| msgid "E379: Missing or empty directory name" -msgid "E965: Missing property type name" -msgstr "E965: Բացակայում է սեփականության տիպի անվանումը" - -#, c-format -msgid "E966: Invalid line number: %ld" -msgstr "E966: Անվավեր տողի համար: %ld" - -#| msgid "E593: Need at least %d lines" -msgid "E968: Need at least one of 'id' or 'type'" -msgstr "E968: Պետք է 'id' կամ 'type'-ից առնվազն մեկը" - -#, c-format -msgid "E969: Property type %s already defined" -msgstr "E969: հատկության տեսակը %s արդեն սահմանված է" - -#, c-format -msgid "E970: Unknown highlight group name: '%s'" -msgstr "E970: Անծանոթ գունանշման խումբ: '%s'" - -#| msgid "E429: File \"%s\" does not exist" -msgid "E971: Property type %s does not exist" -msgstr "E971: %s հատկության տեսակը գոյություն չունի" - -#| msgid "E711: List value does not have enough items" -msgid "E972: Blob value does not have the right number of bytes" -msgstr "E972: Blob արժեքը չունի բայթերի ճիշտ քանակ" - -msgid "E973: Blob literal should have an even number of hex characters" -msgstr "E973: Blob literal-ը պետք է ունենա զույգ թվով վեցանկյուն նիշ" - -#| msgid "E745: Using a List as a Number" -msgid "E974: Using a Blob as a Number" -msgstr "E974: բլբի օգտագործումը որպես թիվ" - -#| msgid "E891: Using a Funcref as a Float" -msgid "E975: Using a Blob as a Float" -msgstr "E975: Բլոբի օգտագործումը որպես բոց" - -#| msgid "E806: Using a Float as a String" -msgid "E976: Using a Blob as a String" -msgstr "E976: Բլոբի օգտագործումը որպես տող" - -#| msgid "E691: Can only compare List with List" -msgid "E977: Can only compare Blob with Blob" -msgstr "E977: Կարող է համեմատել միայն Blob-ը Blob-ի հետ" - -#| msgid "E692: Invalid operation for List" -msgid "E978: Invalid operation for Blob" -msgstr "E978: Անվավեր գործողություն Blob-ի համար" - -#| msgid "E684: List index out of range: %ld" -msgid "E979: Blob index out of range: %ld" -msgstr "E979: Blob ինդեքսը դուրս է տիրույթից՝ %ld" - -#| msgid "E519: Option not supported" -msgid "E980: Lowlevel input not supported" -msgstr "E980: Ցածր մակարդակի մուտքագրումը չի ապահովվում" - -msgid "E981: Command not allowed in rvim" -msgstr "E981: rvim֊ում չեն թույլատրվում վահանակի հրամաններ" - -msgid "E982: ConPTY is not available" -msgstr "E982: ConPTY հասանելի չէ" - -#, c-format -msgid "E983: Duplicate argument: %s" -msgstr "E983: Կրկնված արգումենտ: %s" - -msgid "E984: :scriptversion used outside of a sourced file" -msgstr "E984: :scriptversion հրամանը օգտագործվում է կցվող ֆայլից դուրս" - -#| msgid "E838: NetBeans is not supported with this GUI" -msgid "E985: .= is not supported with script version >= 2" -msgstr "E985: .= չի աջակցվում սկրիպտի տարբերակով >= 2" - -#| msgid "E428: Cannot go beyond last matching tag" -msgid "E986: Cannot modify the tag stack within tagfunc" -msgstr "E986: Հնարավոր չէ փոփոխել պիտակների կույտը tagfunc-ում" - -#| msgid "E178: Invalid default value for count" -msgid "E987: Invalid return value from tagfunc" -msgstr "E987: tagfunc-ից վերադարձված անվավեր արժեք" - -#| msgid "E25: GUI cannot be used: Not enabled at compile time" -msgid "E988: GUI cannot be used. Cannot execute gvim.exe." -msgstr "E988: GUI-ն չի կարող օգտագործվել: Հնարավոր չէ գործարկել gvim.exe-ը:" - -msgid "E989: Non-default argument follows default argument" -msgstr "E989: Ոչ լռելյայն արգումենտը հաջորդում է լռելյայն արգումենտին" - -#, c-format -msgid "E990: Missing end marker '%s'" -msgstr "E990: Բացակայող նշման վերջ %s" - -#| msgid "E862: Cannot use g: here" -msgid "E991: Cannot use =<< here" -msgstr "E991: Այստեղ հնարավոր չէ օգտագործել =<<" - -#| msgid "E520: Not allowed in a modeline" -msgid "E992: Not allowed in a modeline when 'modelineexpr' is off" -msgstr "E992: Չի թույլատրվում մոդելում, երբ 'modelineexpr' ն անջատված է" - -#| msgid "E813: Cannot close autocmd or popup window" -msgid "E993: Window %d is not a popup window" -msgstr "E993: %d պատուհանը բացվող պատուհան չէ" - -#| msgid "E48: Not allowed in sandbox" -msgid "E994: Not allowed in a popup window" -msgstr "E994: Չի թույլատրվում բացվող պատուհանում" - -#| msgid "E795: Cannot delete variable" -msgid "E995: Cannot modify existing variable" -msgstr "E995: Հնարավոր չէ փոփոխել գոյություն ունեցող փոփոխականը" - -#| msgid "E795: Cannot delete variable" -msgid "E996: Cannot lock a range" -msgstr "E996: Հնարավոր չէ կողպել միջակայքը" - -#| msgid "E1052: Cannot declare an option: %s" -msgid "E996: Cannot lock an option" -msgstr "E996: Հնարավոր չէ արգելափակել տարբերակը" - -#| msgid "E90: Cannot unload last buffer" -msgid "E996: Cannot lock a list or dict" -msgstr "E996: Հնարավոր չէ կողպել ցուցակը կամ թելադրանքը" - -#| msgid "E46: Cannot change read-only variable" -msgid "E996: Cannot lock an environment variable" -msgstr "E996: Հնարավոր չէ արգելափակել շրջակա միջավայրի փոփոխականը" - -#| msgid "E90: Cannot unload last buffer" -msgid "E996: Cannot lock a register" -msgstr "E996: Հնարավոր չէ արգելափակել գրանցամատյանը" - -#| msgid "E426: Tag not found: %s" -msgid "E997: Tabpage not found: %d" -msgstr "E997: ներդիրը չի գտնվել՝ %d" - -#, c-format -msgid "E998: Reduce of an empty %s with no initial value" -msgstr "E998: Կրճատել դատարկ %s առանց նախնական արժեքի" - -#| msgid "E519: Option not supported" -msgid "E999: scriptversion not supported: %d" -msgstr "E999: սցենարի տարբերակը չի աջակցվում՝ %d" - -#| msgid "E1122: Variable is locked: %s" -msgid "E1001: Variable not found: %s" -msgstr "E1001: փոփոխականը չի գտնվել՝ %s" - -#, c-format -msgid "E1002: Syntax error at %s" -msgstr "E1002: Ուղղագրական սխալ %s" - -#| msgid "E1027: Missing return statement" -msgid "E1003: Missing return value" -msgstr "E1003: վերադարձի արժեքը բացակայում է" - -#, c-format -msgid "E1004: White space required before and after '%s' at \"%s\"" -msgstr "E1004: '%s'-ում \"%s\"-ից առաջ և հետո պահանջվում է սպիտակ տարածություն" - -msgid "E1005: Too many argument types" -msgstr "E1005: Աննախադեպ շատ արգումենտի տիպեր" - -#| msgid "E1035: % requires number arguments" -msgid "E1006: %s is used as an argument" -msgstr "E1006: %s-ն օգտագործվում է որպես արգումենտ" - -#| msgid "Garbage after option argument" -msgid "E1007: Mandatory argument after optional argument" -msgstr "E1007: Պարտադիր փաստարկը կամընտիր փաստարկից հետո" - -#, c-format -msgid "E1008: Missing after %s" -msgstr "E1008: Բացակայող %s-ից հետո" - -#, c-format -msgid "E1009: Missing > after type: %s" -msgstr "E1009: Բացակայող > %s-ից հետո" - -#, c-format -msgid "E1010: Type not recognized: %s" -msgstr "E1010: Անծանոթ տիպ։ %s" - -#, c-format -msgid "E1011: Name too long: %s" -msgstr "E1011: Անունը մի քիչ երկար է: %s" - -#| msgid "E1163: Variable %d: type mismatch, expected %s but got %s" -msgid "E1012: Type mismatch; expected %s but got %s" -msgstr "E1012: Տիպի անհամապատասխանություն; սպասվում էր %s, բայց ստացավ %s" - -#| msgid "E1163: Variable %d: type mismatch, expected %s but got %s" -msgid "E1012: Type mismatch; expected %s but got %s in %s" -msgstr "" -"E1012: Տիպի անհամապատասխանություն; սպասվում էր %s, բայց ստացավ %s %s-ում" - -#| msgid "E1163: Variable %d: type mismatch, expected %s but got %s" -msgid "E1013: Argument %d: type mismatch, expected %s but got %s" -msgstr "" -"E1013: արգումենտ %d. տեսակի անհամապատասխանություն, սպասվում էր %s, բայց " -"ստացավ %s" - -#| msgid "E1163: Variable %d: type mismatch, expected %s but got %s" -msgid "E1013: Argument %d: type mismatch, expected %s but got %s in %s" -msgstr "" -"E1013: Փաստարկ %d. տիպի անհամապատասխանություն, սպասվում էր %s, բայց ստացավ " -"%s %s-ում" - -#, c-format -msgid "E1014: Invalid key: %s" -msgstr "E1014: Անվավեր բանալի: %s" - -#| msgid "E39: Number expected" -msgid "E1015: Name expected: %s" -msgstr "E1015: Անունը սպասվում է՝ %s" - -#| msgid "E1052: Cannot declare an option: %s" -msgid "E1016: Cannot declare a %s variable: %s" -msgstr "E1016: Հնարավոր չէ հայտարարել %s փոփոխական՝ %s" - -#| msgid "E1052: Cannot declare an option: %s" -msgid "E1016: Cannot declare an environment variable: %s" -msgstr "E1016: Հնարավոր չէ հայտարարել շրջակա միջավայրի փոփոխական՝ %s" - -#| msgid "E1073: Name already defined: %s" -msgid "E1017: Variable already declared: %s" -msgstr "E1017: փոփոխականն արդեն հայտարարված է՝ %s" - -#| msgid "E1061: Cannot find function %s" -msgid "E1018: Cannot assign to a constant: %s" -msgstr "E1018: Հնարավոր չէ վերագրել հաստատունին՝ %s" - -#| msgid "E691: Can only compare List with List" -msgid "E1019: Can only concatenate to string" -msgstr "E1019: Կարող է միանալ միայն լարին" - -#| msgid "E1052: Cannot declare an option: %s" -msgid "E1020: Cannot use an operator on a new variable: %s" -msgstr "E1020: հնարավոր չէ օպերատոր օգտագործել նոր փոփոխականի վրա՝ %s" - -#| msgid "E709: [:] requires a List or Blob value" -msgid "E1021: Const requires a value" -msgstr "E1021: Const-ը արժեք է պահանջում" - -#| msgid "E808: Number or Float required" -msgid "E1022: Type or initialization required" -msgstr "E1022: տեսակը կամ սկզբնավորումը պահանջվում է" - -#| msgid "E891: Using a Funcref as a Float" -msgid "E1023: Using a Number as a Bool: %lld" -msgstr "E1023: Օգտագործելով թիվը որպես Bool՝ %lld" - -#| msgid "E1324: Using an Object as a String" -msgid "E1024: Using a Number as a String" -msgstr "E1024: Օգտագործելով թիվը որպես տող" - -#| msgid "E168: :finish used outside of a sourced file" -msgid "E1025: Using } outside of a block scope" -msgstr "E1025: }-ի օգտագործումը բլոկի շրջանակից դուրս" - -msgid "E1026: Missing }" -msgstr "E1026: Բացակայող }." - -msgid "E1027: Missing return statement" -msgstr "E1027: Բացակայող return" - -#| msgid "E702: Sort compare function failed" -msgid "E1028: Compiling :def function failed" -msgstr "E1028: :def ֆունկցիան կազմելը ձախողվեց" - -#| msgid "E451: Expected }: %s" -msgid "E1029: Expected %s but got %s" -msgstr "E1029: Սպասվում էր %s, բայց ստացվեց %s" - -#| msgid "E1320: Using an Object as a Number" -msgid "E1030: Using a String as a Number: \"%s\"" -msgstr "E1030: Օգտագործելով տողը որպես թիվ՝ \"%s\"" - -#| msgid "E284: Cannot set IC values" -msgid "E1031: Cannot use void value" -msgstr "E1031: Չի կարող օգտագործել անվավեր արժեք" - -msgid "E1032: Missing :catch or :finally" -msgstr "E1032: Բացակայող :catch կամ :finally" - -msgid "E1033: Catch unreachable after catch-all" -msgstr "E1033: Բռնելն անհասանելի է ամեն ինչից հետո" - -#| msgid "E1354: Cannot extend %s" -msgid "E1034: Cannot use reserved name %s" -msgstr "E1034: Հնարավոր չէ օգտագործել վերապահված անունը %s" - -#, no-c-format -msgid "E1035: % requires number arguments" -msgstr "E1035: % պահանջում է թվային արգումենտ" - -#| msgid "E1035: % requires number arguments" -msgid "E1036: %c requires number or float arguments" -msgstr "E1036: %c-ը պահանջում է թվային կամ լողացող արգումենտներ" - -#| msgid "E804: Cannot use '%' with Float" -msgid "E1037: Cannot use \"%s\" with %s" -msgstr "E1037: Հնարավոր չէ օգտագործել \"%s\"-ը %s-ի հետ" - -#| msgid "E1399: Type can only be used in a script" -msgid "E1038: \"vim9script\" can only be used in a script" -msgstr "E1038: \"vim9script\" -ը կարող է օգտագործվել միայն սկրիպտում" - -msgid "E1039: \"vim9script\" must be the first command in a script" -msgstr "E1039: \"vim9script\" -ը պետք է լինի սկրիպտի առաջին հրամանը" - -msgid "E1040: Cannot use :scriptversion after :vim9script" -msgstr "E1040: Հնարավոր չէ օգտագործել :scriptversion-ը :vim9script-ից հետո" - -#| msgid "E1048: Item not found in script: %s" -msgid "E1041: Redefining script item: \"%s\"" -msgstr "E1041: Սկրիպտի տարրի վերասահմանում. \"%s\"" - -#| msgid "E1399: Type can only be used in a script" -msgid "E1042: Export can only be used in vim9script" -msgstr "E1042: Արտահանումը կարող է օգտագործվել միայն vim9script-ում" - -msgid "E1043: Invalid command after :export" -msgstr "E1043: Անվավեր հրամանի անուն :export-ից հետո" - -#| msgid "E474: Invalid argument" -msgid "E1044: Export with invalid argument" -msgstr "E1044: Արտահանել անվավեր արգումենտով" - -#, c-format -msgid "E1047: Syntax error in import: %s" -msgstr "E1047: Ուղղագրական սխալ %s" - -#, c-format -msgid "E1048: Item not found in script: %s" -msgstr "E1048: Նմուշը չի հայտնաբերվել: %s" - -#| msgid "E1048: Item not found in script: %s" -msgid "E1049: Item not exported in script: %s" -msgstr "E1049: Տարրը չի արտահանվել սկրիպտով՝ %s" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1050: Colon required before a range: %s" -msgstr "E1050: երկու կետ պահանջվում է ընդգրկույթից առաջ՝ %s" - -#| msgid "E1077: Missing argument type for %s" -msgid "E1051: Wrong argument type for +" -msgstr "E1051: +-ի համար սխալ արգումենտի տեսակ" - -#, c-format -msgid "E1052: Cannot declare an option: %s" -msgstr "E1052: Հնարավոր չէ հայտարարել կարգանշանը: %s" - -#, c-format -msgid "E1053: Could not import \"%s\"" -msgstr "E1053: Հնարավոր չէ բեռնել \"%s\"" - -#| msgid "E1073: Name already defined: %s" -msgid "E1054: Variable already declared in the script: %s" -msgstr "E1054: փոփոխականն արդեն հայտարարված է սկրիպտում՝ %s" - -#| msgid "E260: Missing name after ->" -msgid "E1055: Missing name after ..." -msgstr "E1055: Անունը բացակայում է ..." - -#| msgid "E451: Expected }: %s" -msgid "E1056: Expected a type: %s" -msgstr "E1056: Ակնկալվում էր տեսակ՝ %s" - -msgid "E1057: Missing :enddef" -msgstr "E1057: Հրամանը բացակայում է :enddef" - -msgid "E1058: Function nesting too deep" -msgstr "E1058: Ֆունկցիայի կանչը շատ է ներդրված" - -#, c-format -msgid "E1059: No white space allowed before colon: %s" -msgstr "E1059: երկու կետից առաջ սպիտակ տարածություն չի թույլատրվում՝ %s" - -#| msgid "E451: Expected }: %s" -msgid "E1060: Expected dot after name: %s" -msgstr "E1060: Ակնկալվող կետ անունից հետո՝ %s" - -#, c-format -msgid "E1061: Cannot find function %s" -msgstr "E1061: Անծանոթ ֆունկցիա: %s" - -msgid "E1062: Cannot index a Number" -msgstr "E1062: Անհնար է ինդեքսավորել թիվը" - -msgid "E1063: Type mismatch for v: variable" -msgstr "E1063: Փոփոխականի տիպի անհամապատասխանություն" - -msgid "E1064: Yank register changed while using it" -msgstr "E1064: Յանկ ռեգիստրը փոխվել է այն օգտագործելիս" - -#| msgid "E1146: Command not recognized: %s" -msgid "E1065: Command cannot be shortened: %s" -msgstr "E1065: հրամանը հնարավոր չէ կրճատել՝ %s" - -#| msgid "E1052: Cannot declare an option: %s" -msgid "E1066: Cannot declare a register: %s" -msgstr "E1066: հնարավոր չէ գրանցել՝ %s" - -#| msgid "E151: No match: %s" -msgid "E1067: Separator mismatch: %s" -msgstr "E1067: բաժանարարի անհամապատասխանություն՝ %s" - -#, c-format -msgid "E1068: No white space allowed before '%s': %s" -msgstr "E1068: '%s'-ից առաջ բացատ չի թույլատրվում: %s" - -#, c-format -msgid "E1069: White space required after '%s': %s" -msgstr "E1069: '%s'-ից հետո պահանջվում է տարածություն: %s" - -#| msgid "E1153: Invalid operation for %s" -msgid "E1071: Invalid string for :import: %s" -msgstr "E1071: Անվավեր տող :import՝ %s-ի համար" - -#| msgid "E691: Can only compare List with List" -msgid "E1072: Cannot compare %s with %s" -msgstr "E1072: Հնարավոր չէ համեմատել %s-ը %s-ի հետ" - -#, c-format -msgid "E1073: Name already defined: %s" -msgstr "E1073: Անունն արդեն սահմանված է: %s" - -#| msgid "E790: undojoin is not allowed after undo" -msgid "E1074: No white space allowed after dot" -msgstr "E1074: Կետից հետո տարածություն չի թույլատրվում" - -#| msgid "E1241: Separator not supported: %s" -msgid "E1075: Namespace not supported: %s" -msgstr "E1075: Անվանատարածքը չի աջակցվում՝ %s" - -#, c-format -msgid "E1077: Missing argument type for %s" -msgstr "E1077: Բացակայող արգումենտի տիպ: %s" - -msgid "E1078: Invalid command \"nested\", did you mean \"++nested\"?" -msgstr "E1078: \"nested\" հրամանը սխալ է, նկատի ունեիք \"++nested\"?" - -#| msgid "E794: Cannot set variable in the sandbox" -msgid "E1079: Cannot declare a variable on the command line" -msgstr "E1079: Հնարավոր չէ փոփոխական հայտարարել հրամանի տողում" - -msgid "E1080: Invalid assignment" -msgstr "E1080: Անվավեր վերագրում" - -#| msgid "E1148: Cannot index a %s" -msgid "E1081: Cannot unlet %s" -msgstr "E1081: Հնարավոր չէ ապասահմանել %s" - -#| msgid "E492: Not an editor command" -msgid "E1082: Command modifier without command" -msgstr "E1082: Հրամանի փոփոխիչ առանց հրամանի" - -msgid "E1083: Missing backtick" -msgstr "E1083: Բացակայող ')'" - -#| msgid "E1061: Cannot find function %s" -msgid "E1084: Cannot delete Vim9 script function %s" -msgstr "E1084: Հնարավոր չէ ջնջել Vim9 սկրիպտի ֆունկցիան %s" - -#| msgid "E108: No such variable: \"%s\"" -msgid "E1085: Not a callable type: %s" -msgstr "E1085: Չկանչելի տեսակ՝ %s" - -#| msgid "E909: Cannot index a special variable" -msgid "E1087: Cannot use an index when declaring a variable" -msgstr "E1087: փոփոխական հայտարարելիս չի կարող ինդեքս օգտագործել" - -msgid "E1088: Script cannot import itself" -msgstr "E1088: Սկրիպտը չի կարող ինքն իրեն ներմուծել" - -#, c-format -msgid "E1089: Unknown variable: %s" -msgstr "E1089: Չսահմանված փոփոխական: %s" - -#| msgid "E197: Cannot set language to \"%s\"" -msgid "E1090: Cannot assign to argument %s" -msgstr "E1090: Հնարավոր չէ վերագրել արգումենտին %s" - -#| msgid "E1146: Command not recognized: %s" -msgid "E1091: Function is not compiled: %s" -msgstr "E1091: Ֆունկցիան կազմված չէ՝ %s" - -#| msgid "E1062: Cannot index a Number" -msgid "E1092: Cannot nest :redir" -msgstr "E1092: Չի կարող բույն դնել :redir" - -#, c-format -msgid "E1093: Expected %d items but got %d" -msgstr "E1093: Սպասվում էր %d տարր, բայց ստացվեց %d" - -#| msgid "E1399: Type can only be used in a script" -msgid "E1094: Import can only be used in a script" -msgstr "E1094: Ներմուծումը կարող է օգտագործվել միայն սկրիպտում" - -#| msgid "E215: Illegal character after *: %s" -msgid "E1095: Unreachable code after :%s" -msgstr "E1095: անհասանելի կոդ հետևյալից հետո՝%s" - -msgid "E1096: Returning a value in a function without a return type" -msgstr "E1096: վերադարձ առանց վերադարձի տեսակի ֆունկցիայի արժեք" - -msgid "E1097: Line incomplete" -msgstr "E1097: Գիծը թերի է" - -#| msgid "E897: List or Blob required" -msgid "E1098: String, List or Blob required" -msgstr "E1098: Պահանջվում է տող, ցուցակ կամ բլիթ" - -#| msgid "E1089: Unknown variable: %s" -msgid "E1099: Unknown error while executing %s" -msgstr "E1099: անհայտ սխալ՝ %s-ն աշխատելիս" - -#, c-format -msgid "E1100: Command not supported in Vim9 script (missing :var?): %s" -msgstr "E1100: հրամանը չի աջակցվում Vim9 սկրիպտում (բացակայում է :var?): %s" - -#| msgid "E1052: Cannot declare an option: %s" -msgid "E1101: Cannot declare a script variable in a function: %s" -msgstr "E1101: Հնարավոր չէ սկրիպտի փոփոխական հայտարարել ֆունկցիայում՝ %s" - -#| msgid "E161: Breakpoint not found: %s" -msgid "E1102: Lambda function not found: %s" -msgstr "E1102: Lambda ֆունկցիան չի գտնվել՝ %s" - -msgid "E1103: Dictionary not set" -msgstr "E1103: Բառարանը սահմանված չէ" - -msgid "E1104: Missing >" -msgstr "E1104: Բացակայող '>'" - -#| msgid "E152: Cannot open %s for writing" -msgid "E1105: Cannot convert %s to string" -msgstr "E1105: Հնարավոր չէ փոխարկել %s-ը տողի" - -#, c-format -msgid "E1106: One argument too many" -msgid_plural "E1106: %d arguments too many" -msgstr[0] "E1106: Մեկ փաստարկ չափազանց շատ է" -msgstr[1] "E1106: %d արգումենտները չափազանց շատ են" - -#| msgid "E897: List or Blob required" -msgid "E1107: String, List, Dict or Blob required" -msgstr "E1107: Պահանջվում է տող, ցուցակ, թելադրանք կամ բշտիկ" - -#| msgid "E711: List value does not have enough items" -msgid "E1109: List item %d is not a List" -msgstr "E1109: Ցուցակի %d տարրը ցուցակ չէ" - -#| msgid "E711: List value does not have enough items" -msgid "E1110: List item %d does not contain 3 numbers" -msgstr "E1110: Ցանկի %d տարրը չի պարունակում 3 թվեր" - -#, c-format -msgid "E1111: List item %d range invalid" -msgstr "E1111: Ցանկի տարրի %d միջակայքն անվավեր է" - -#, c-format -msgid "E1112: List item %d cell width invalid" -msgstr "E1112: Ցանկի տարր %d բջիջի լայնությունը անվավեր է" - -#, c-format -msgid "E1113: Overlapping ranges for 0x%lx" -msgstr "E1113: համընկնող միջակայքեր 0x%lx-ի համար" - -#| msgid "E754: Only up to %d regions supported" -msgid "E1114: Only values of 0x80 and higher supported" -msgstr "E1114: Աջակցվում են միայն 0x80 և ավելի բարձր արժեքները" - -msgid "E1115: \"assert_fails()\" fourth argument must be a number" -msgstr "E1115: \"assert_fails()\" չորրորդ արգումենտը պետք է լինի թիվ" - -#| msgid "E899: Argument of %s must be a List or Blob" -msgid "E1116: \"assert_fails()\" fifth argument must be a string" -msgstr "E1116: \"assert_fails()\" հինգերորդ արգումենտը պետք է լինի տող" - -#| msgid "E804: Cannot use '%' with Float" -msgid "E1117: Cannot use ! with nested :def" -msgstr "E1117: Հնարավոր չէ օգտագործել: բույնով :def" - -#| msgid "E742: Cannot change value" -msgid "E1118: Cannot change locked list" -msgstr "E1118: Հնարավոր չէ փոխել կողպված ցուցակը" - -#| msgid "E165: Cannot go beyond last file" -msgid "E1119: Cannot change locked list item" -msgstr "E1119: Հնարավոր չէ փոխել ցանկի արգելափակված տարրը" - -#| msgid "E742: Cannot change value" -msgid "E1120: Cannot change dict" -msgstr "E1120: Հնարավոր չէ փոխել թելադրանքը" - -#| msgid "E742: Cannot change value" -msgid "E1121: Cannot change dict item" -msgstr "E1121: Հնարավոր չէ փոխել թելադրանքի տարրը" - -#, c-format -msgid "E1122: Variable is locked: %s" -msgstr "E1122: %s արժեքը բլոկավորված է" - -#| msgid "E417: Missing argument: %s" -msgid "E1123: Missing comma before argument: %s" -msgstr "E1123: արգումենտից առաջ բացակայում է ստորակետը՝ %s" - -#| msgid "E1399: Type can only be used in a script" -msgid "E1124: \"%s\" cannot be used in legacy Vim script" -msgstr "E1124: \"%s\"-ը չի կարող օգտագործվել հին Vim սկրիպտում" - -#| msgid "E1035: % requires number arguments" -msgid "E1125: Final requires a value" -msgstr "E1125: Վերջնական արժեքը արժեք է պահանջում" - -msgid "E1126: Cannot use :let in Vim9 script" -msgstr "E1126: Հնարավոր չէ օգտագործել :let-ը Vim9 սկրիպտում" - -#| msgid "E260: Missing name after ->" -msgid "E1127: Missing name after dot" -msgstr "E1127: Անունը կետից հետո բացակայում է" - -msgid "E1128: } without {" -msgstr "E1128: } առանց {" - -#| msgid "E529: Cannot set 'term' to empty string" -msgid "E1129: Throw with empty string" -msgstr "E1129: Նետում դատարկ տեքստով" - -#| msgid "E1362: Cannot use a non-null object" -msgid "E1130: Cannot add to null list" -msgstr "E1130: Չի կարող ավելացնել զրոյական ցուցակին" - -#| msgid "E1362: Cannot use a non-null object" -msgid "E1131: Cannot add to null blob" -msgstr "E1131: Հնարավոր չէ ավելացնել null blob-ին" - -#| msgid "E126: Missing :endfunction" -msgid "E1132: Missing function argument" -msgstr "E1132: Բացակայում է ֆունկցիայի արգումենտը" - -#| msgid "E1354: Cannot extend %s" -msgid "E1133: Cannot extend a null dict" -msgstr "E1133: Չի կարող երկարաձգել անվավեր հրամանը" - -#| msgid "E1354: Cannot extend %s" -msgid "E1134: Cannot extend a null list" -msgstr "E1134: Հնարավոր չէ ընդլայնել զրո ցուցակը" - -#, c-format -msgid "E1135: Using a String as a Bool: \"%s\"" -msgstr "E1135: Օգտագործելով տողը որպես Bool. \"%s\"" - -msgid "E1136: mapping must end with before second " -msgstr "E1136: քարտեզագրումը պետք է ավարտվի վայրկյանից առաջ" - -#| msgid "E805: Using a Float as a Number" -msgid "E1138: Using a Bool as a Number" -msgstr "E1138: Bool-ի օգտագործումը որպես թիվ" - -#| msgid "E1389: Missing name after implements" -msgid "E1139: Missing matching bracket after dict key" -msgstr "E1139: Դիկտիվ ստեղնից հետո բացակայում է համապատասխան փակագիծը" - -#| msgid "E1180: Variable arguments type must be a list: %s" -msgid "E1140: :for argument must be a sequence of lists" -msgstr "E1140: :for արգումենտը պետք է լինի ցուցակների հաջորդականություն" - -#| msgid "E714: List required" -msgid "E1141: Indexable type required" -msgstr "E1141: Պահանջվում է ինդեքսավորվող տեսակ" - -msgid "E1142: Calling test_garbagecollect_now() while v:testing is not set" -msgstr "" -"E1142: Կանչել test_garbagecollect_now(), մինչդեռ v:testing-ը սահմանված չէ" - -#, c-format -msgid "E1143: Empty expression: \"%s\"" -msgstr "E1143: Դատարկ արտահայտություն: \"%s\"" - -#, c-format -msgid "E1144: Command \"%s\" is not followed by white space: %s" -msgstr "E1144: \"%s\" հրամանին չի հաջորդում բացատը՝ %s" - -#| msgid "E990: Missing end marker '%s'" -msgid "E1145: Missing heredoc end marker: %s" -msgstr "E1145: heredoc վերջի նշիչը բացակայում է՝ %s" - -#, c-format -msgid "E1146: Command not recognized: %s" -msgstr "E1146: Անծանոթ հրաման։ %s" - -#| msgid "E1103: Dictionary not set" -msgid "E1147: List not set" -msgstr "E1147: Ցանկը սահմանված չէ" - -#, c-format -msgid "E1148: Cannot index a %s" -msgstr "E1148: Անհնար է ինդեքսավորել %s" - -#, c-format -msgid "E1149: Script variable is invalid after reload in function %s" -msgstr "E1149: Սկրիպտի փոփոխականն անվավեր է %s ֆունկցիայի վերաբեռնումից հետո" - -msgid "E1150: Script variable type changed" -msgstr "E1150: Սկրիպտի փոփոխականի տեսակը փոխվել է" - -#| msgid "E1152: Mismatched enddef" -msgid "E1151: Mismatched endfunction" -msgstr "E1151: անհամապատասխան վերջնական ֆունկցիա" - -msgid "E1152: Mismatched enddef" -msgstr "E1152: Չհամընկնող enddef" - -#, c-format -msgid "E1153: Invalid operation for %s" -msgstr "E1153: Չթույլատրված գործողություն %s" - -msgid "E1154: Divide by zero" -msgstr "E1154: Բաժանել զրոյի" - -msgid "E1155: Cannot define autocommands for ALL events" -msgstr "" -"E1155: Հնարավոր չէ սահմանել ինքնահրամանները բոլոր իրադարձությունների համար" - -#| msgid "E659: Cannot invoke Python recursively" -msgid "E1156: Cannot change the argument list recursively" -msgstr "E1156: Հնարավոր չէ փոխել արգումենտների ցանկը ռեկուրսիվորեն" - -msgid "E1157: Missing return type" -msgstr "E1157: Բացակայող վերադարձի տիպ" - -msgid "E1158: Cannot use flatten() in Vim9 script, use flattennew()" -msgstr "" -"E1158: Հնարավոր չէ օգտագործել flatten() Vim9 սկրիպտում, օգտագործել " -"flattennew()" - -#| msgid "E90: Cannot unload last buffer" -msgid "E1159: Cannot split a window when closing the buffer" -msgstr "E1159: Բուֆերը փակելիս հնարավոր չէ բաժանել պատուհանը" - -#| msgid "E909: Cannot index a special variable" -msgid "E1160: Cannot use a default for variable arguments" -msgstr "E1160: Չի կարող օգտագործել լռելյայն փոփոխական արգումենտների համար" - -#| msgid "E1148: Cannot index a %s" -msgid "E1161: Cannot json encode a %s" -msgstr "E1161: json-ը չի կարող կոդավորել %s" - -#, c-format -msgid "E1162: Register name must be one character: %s" -msgstr "E1162: Ռեգիստրի անունը պետք է լինի մեկ նիշ՝ %s" - -#, c-format -msgid "E1163: Variable %d: type mismatch, expected %s but got %s" -msgstr "" -"E1163: Փոփոխական %d: տիպի անհամապատասխանություն, սպասվում է %s, բայց տրվել է " -"%s" - -#| msgid "E1163: Variable %d: type mismatch, expected %s but got %s" -msgid "E1163: Variable %d: type mismatch, expected %s but got %s in %s" -msgstr "" -"E1163: փոփոխական %d. տիպի անհամապատասխանություն, սպասվում էր %s, բայց ստացավ " -"%s %s-ում" - -#| msgid "E1356: \"super\" must be followed by a dot" -msgid "E1164: vim9cmd must be followed by a command" -msgstr "E1164: vim9cmd-ին պետք է հետևի հրաման" - -#| msgid "E1365: Cannot use a return type with the \"new\" method" -msgid "E1165: Cannot use a range with an assignment: %s" -msgstr "E1165: Հնարավոր չէ օգտագործել ընդգրկույթ հանձնարարությամբ՝ %s" - -#| msgid "E713: Cannot use empty key for Dictionary" -msgid "E1166: Cannot use a range with a dictionary" -msgstr "E1166: Հնարավոր չէ օգտագործել ընդգրկույթ բառարանով" - -#, c-format -msgid "E1167: Argument name shadows existing variable: %s" -msgstr "E1167: Արգումենտի անունը համընկնում է փոփոխականի անվան հետ: %s" - -#| msgid "E1167: Argument name shadows existing variable: %s" -msgid "E1168: Argument already declared in the script: %s" -msgstr "E1168: սկրիպտում արդեն հայտարարված արգումենտ. %s" - -#, c-format -msgid "E1169: Expression too recursive: %s" -msgstr "E1169: Արտահայտությունը շատ ռեկուրսիվ է: %s" - -msgid "E1170: Cannot use #{ to start a comment" -msgstr "E1170: Չի կարող օգտագործել #{ մեկնաբանություն սկսելու համար" - -#| msgid "E126: Missing :endfunction" -msgid "E1171: Missing } after inline function" -msgstr "E1171: Ներդիր ֆունկցիայից հետո բացակայում է }-ը" - -#| msgid "E794: Cannot set variable in the sandbox" -msgid "E1172: Cannot use default values in a lambda" -msgstr "E1172: Հնարավոր չէ օգտագործել լամբդայի լռելյայն արժեքները" - -#| msgid "E753: Not found: %s" -msgid "E1173: Text found after %s: %s" -msgstr "E1173: Տեքստը գտնվել է %s-ից հետո՝ %s" - -#| msgid "E1210: Number required for argument %d" -msgid "E1174: String required for argument %d" -msgstr "E1174: %d արգումենտի համար անհրաժեշտ է տող" - -#| msgid "E1210: Number required for argument %d" -msgid "E1175: Non-empty string required for argument %d" -msgstr "E1175: %d արգումենտի համար պահանջվում է ոչ դատարկ տող" - -msgid "E1176: Misplaced command modifier" -msgstr "E1176: սխալ տեղակայված հրամանի փոփոխիչ" - -#| msgid "E519: Option not supported" -msgid "E1177: For loop on %s not supported" -msgstr "E1177: For loop-ը %s-ում չի աջակցվում" - -#| msgid "E909: Cannot index a special variable" -msgid "E1178: Cannot lock or unlock a local variable" -msgstr "E1178: Հնարավոր չէ կողպել կամ ապակողպել տեղական փոփոխականը" - -#, c-format -msgid "" -"E1179: Failed to extract PWD from %s, check your shell's config related to " -"OSC 7" -msgstr "" -"E1179: Չհաջողվեց հանել PWD-ը %s-ից, ստուգեք ձեր վահանակի կազմաձևը՝ կապված " -"OSC 7-ի հետ" - -#, c-format -msgid "E1180: Variable arguments type must be a list: %s" -msgstr "E1180: Փոփոխական արգումնետների տիպը պետք է լինի ցանկ: %s" - -#| msgid "E862: Cannot use g: here" -msgid "E1181: Cannot use an underscore here" -msgstr "E1181: Այստեղ հնարավոր չէ օգտագործել ընդգծում" - -#| msgid "E127: Cannot redefine function %s: It is in use" -msgid "E1182: Cannot define a dict function in Vim9 script: %s" -msgstr "E1182: Vim9 սկրիպտում հնարավոր չէ դիկտի ֆունկցիա սահմանել՝ %s" - -#| msgid "E1365: Cannot use a return type with the \"new\" method" -msgid "E1183: Cannot use a range with an assignment operator: %s" -msgstr "E1183: Հնարավոր չէ օգտագործել ընդգրկույթ նշանակման օպերատորի հետ՝ %s" - -#| msgid "E846: Key code not set" -msgid "E1184: Blob not set" -msgstr "E1184: Բլոբը կարգավորված չէ" - -msgid "E1185: Missing :redir END" -msgstr "E1185: Հրամանը բացակայում է :redir END" - -#| msgid "E1169: Expression too recursive: %s" -msgid "E1186: Expression does not result in a value: %s" -msgstr "E1186: Արտահայտությունը չի բերում արժեք՝ %s" - -msgid "E1187: Failed to source defaults.vim" -msgstr "E1187: Չհաջողվեց մուտքագրել defaults.vim" - -msgid "E1188: Cannot open a terminal from the command line window" -msgstr "E1188: Հնարավոր չէ բացել տերմինալը հրամանի տողի պատուհանից" - -#| msgid "E794: Cannot set variable in the sandbox: \"%s\"" -msgid "E1189: Cannot use :legacy with this command: %s" -msgstr "E1189: Հնարավոր չէ օգտագործել :legacy այս հրամանով՝ %s" - -#, c-format -msgid "E1190: One argument too few" -msgid_plural "E1190: %d arguments too few" -msgstr[0] "E1190: Մեկ փաստարկ շատ քիչ է" -msgstr[1] "E1190: %d արգումենտները չափազանց քիչ են" - -#| msgid "E725: Calling dict function without Dictionary: %s" -msgid "E1191: Call to function that failed to compile: %s" -msgstr "E1191: Ֆունկցիայի կանչ, որը չի հաջողվել կոմպիլացնել՝ %s" - -msgid "E1192: Empty function name" -msgstr "E1192: Դատարկ ֆունկցիայի անուն" - -msgid "E1193: cryptmethod xchacha20 not built into this Vim" -msgstr "E1193: cryptmethod xchacha20-ը ներկառուցված չէ այս Vim-ում" - -msgid "E1194: Cannot encrypt header, not enough space" -msgstr "E1194: Հնարավոր չէ գաղտնագրել վերնագիրը, բավարար տարածք չկա" - -msgid "E1195: Cannot encrypt buffer, not enough space" -msgstr "E1195: Հնարավոր չէ գաղտնագրել բուֆերը, բավարար տարածք չկա" - -msgid "E1196: Cannot decrypt header, not enough space" -msgstr "E1196: Չի հաջողվում վերծանել վերնագիրը, բավարար տարածք չկա" - -#| msgid "E82: Cannot allocate any buffer, exiting..." -msgid "E1197: Cannot allocate_buffer for encryption" -msgstr "E1197: Հնարավոր չէ հատկացնել_բուֆեր կոդավորման համար" - -#| msgid "E1200: Decryption failed!" -msgid "E1198: Decryption failed: Header incomplete!" -msgstr "E1198: Ապակոդավորումը ձախողվեց. Գլխագիրն ամբողջական չէ!" - -msgid "E1199: Cannot decrypt buffer, not enough space" -msgstr "E1199: Հնարավոր չէ վերծանել բուֆերը, բավարար տարածք չկա" - -msgid "E1200: Decryption failed!" -msgstr "E1200: Չեղարկման ֆայլի ապակոդավորումն ավարտվել է անհաջողությամբ!" - -#| msgid "E1200: Decryption failed!" -msgid "E1201: Decryption failed: pre-mature end of file!" -msgstr "E1201: Ապակոդավորումը ձախողվեց. ֆայլի վաղաժամ ավարտ!" - -#, c-format -msgid "E1202: No white space allowed after '%s': %s" -msgstr "E1202: '%s'-ից հետո բացատ չի թույլատրվում: %s" - -#| msgid "E370: Could not load library %s: %s" -msgid "E1203: Dot not allowed after a %s: %s" -msgstr "E1203: %s-ից հետո կետը չի թույլատրվում. %s" - -#, c-format -msgid "E1204: No Number allowed after .: '\\%%%c'" -msgstr "E1204: '\\%%%c' հետո համարը չի թույլատրվում" - -msgid "E1205: No white space allowed between option and" -msgstr "E1205: Չի թույլատրվում սպիտակ տարածություն տարբերակի և" - -#, c-format -msgid "E1206: Dictionary required for argument %d" -msgstr "E1206: Անհրաժեշտ է բառարան %d-ի համար" - -#| msgid "E1169: Expression too recursive: %s" -msgid "E1207: Expression without an effect: %s" -msgstr "E1207: Արտահայտություն առանց էֆեկտի՝ %s" - -msgid "E1208: -complete used without allowing arguments" -msgstr "E1208: - Ամբողջական, օգտագործվում է առանց արգումենտներ թույլ տալու" - -#| msgid "E475: Invalid value for argument %s" -msgid "E1209: Invalid value for a line number: \"%s\"" -msgstr "E1209: Անվավեր արժեք տողի համարի համար: \"%s\"" - -#, c-format -msgid "E1210: Number required for argument %d" -msgstr "E1210: Անհրաժեշտ է թիվ %d-ի համար" - -#| msgid "E1210: Number required for argument %d" -msgid "E1211: List required for argument %d" -msgstr "E1211: ցանկը պահանջվում է արգումենտի համար %d" - -#| msgid "E1210: Number required for argument %d" -msgid "E1212: Bool required for argument %d" -msgstr "E1212: Բուլ պահանջվում է արգումենտի համար %d" - -#, c-format -msgid "E1213: Redefining imported item \"%s\"" -msgstr "E1213: ներմուծված \"%s\" տարրի վերասահմանում" - -#, c-format -msgid "E1214: Digraph must be just two characters: %s" -msgstr "E1214: Դիգրաֆը պետք է լինի ընդամենը երկու նիշ. %s" - -#, c-format -msgid "E1215: Digraph must be one character: %s" -msgstr "E1215: դիգրաֆը պետք է լինի մեկ նիշ՝ %s" - -msgid "" -"E1216: digraph_setlist() argument must be a list of lists with two items" -msgstr "" -"E1216: digraph_setlist() արգումենտը պետք է լինի երկու տարր ունեցող " -"ցուցակների ցանկ" - -#| msgid "E1210: Number required for argument %d" -msgid "E1217: Channel or Job required for argument %d" -msgstr "E1217: արգումենտի համար պահանջվում է ալիք կամ աշխատանք %d" - -#| msgid "E1210: Number required for argument %d" -msgid "E1218: Job required for argument %d" -msgstr "E1218: աշխատանք է պահանջվում արգումենտի համար %d" - -#| msgid "E1210: Number required for argument %d" -msgid "E1219: Float or Number required for argument %d" -msgstr "E1219: արգումենտի համար պահանջվում է float կամ համար %d" - -#| msgid "E1210: Number required for argument %d" -msgid "E1220: String or Number required for argument %d" -msgstr "E1220: %d արգումենտի համար պահանջվում է տող կամ համար" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1221: String or Blob required for argument %d" -msgstr "E1221: %d արգումենտի համար պահանջվում է տող կամ բլիթ" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1222: String or List required for argument %d" -msgstr "E1222: %d արգումենտի համար պահանջվում է տող կամ ցուցակ" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1223: String or Dictionary required for argument %d" -msgstr "E1223: %d արգումենտի համար պահանջվում է տող կամ բառարան" - -#| msgid "E1210: Number required for argument %d" -msgid "E1224: String, Number or List required for argument %d" -msgstr "E1224: %d արգումենտի համար պահանջվում է տող, համար կամ ցուցակ" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1225: String, List or Dictionary required for argument %d" -msgstr "E1225: %d արգումենտի համար պահանջվում է տող, ցուցակ կամ բառարան" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1226: List or Blob required for argument %d" -msgstr "E1226: Ցուցակ կամ Բլոբ պահանջվում է արգումենտի համար %d" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1227: List or Dictionary required for argument %d" -msgstr "E1227: արգումենտի համար պահանջվում է ցուցակ կամ բառարան %d" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1228: List, Dictionary or Blob required for argument %d" -msgstr "E1228: արգումենտի համար պահանջվում է ցուցակ, բառարան կամ բշտիկ %d" - -#, c-format -msgid "E1229: Expected dictionary for using key \"%s\", but got %s" -msgstr "" -"E1229: Բանալի \"%s\" օգտագործելու համար սպասվում էր բառարան, բայց ստացավ %s" - -#| msgid "E1200: Decryption failed!" -msgid "E1230: Encryption: sodium_mlock() failed" -msgstr "E1230: Կոդավորումը՝ sodium_mlock() ձախողվեց" - -#, c-format -msgid "E1231: Cannot use a bar to separate commands here: %s" -msgstr "" -"E1231: Հնարավոր չէ օգտագործել գիծ՝ հրամաններն այստեղ առանձնացնելու համար՝ %s" - -msgid "E1232: Argument of exists_compiled() must be a literal string" -msgstr "E1232: exists_compiled()-ի արգումենտը պետք է լինի տող" - -#| msgid "E785: complete() can only be used in Insert mode" -msgid "E1233: exists_compiled() can only be used in a :def function" -msgstr "" -"E1233: exists_compiled()-ը կարող է օգտագործվել միայն :def ֆունկցիայի մեջ" - -#| msgid "E1356: \"super\" must be followed by a dot" -msgid "E1234: legacy must be followed by a command" -msgstr "E1234: ժառանգությանը պետք է հետևի հրաման" - -#, c-format -msgid "E1236: Cannot use %s itself, it is imported" -msgstr "E1236: Չի կարող օգտագործել %s ինքնին, այն ներմուծված է" - -#, c-format -msgid "E1237: No such user-defined command in current buffer: %s" -msgstr "E1237: Հերթական բուֆերում չկա նման օգտատիրոջ սահմանած հրաման: %s" - -#| msgid "E1210: Number required for argument %d" -msgid "E1238: Blob required for argument %d" -msgstr "E1238: արգումենտի համար անհրաժեշտ է բլիթ %d" - -#| msgid "E1291: Invalid argument: %ld" -msgid "E1239: Invalid value for blob: %d" -msgstr "E1239: անվավեր արժեք blob-ի համար՝ %d" - -msgid "E1240: Resulting text too long" -msgstr "E1240: Տողն անսպասելի երկար է" - -#, c-format -msgid "E1241: Separator not supported: %s" -msgstr "E1241: Բաժանիչը չի աջակցվում: %s" - -#, c-format -msgid "E1242: No white space allowed before separator: %s" -msgstr "E1242: Չի թույլատրվում սպիտակ տարածություն բաժանարարից առաջ՝ %s" - -msgid "E1243: ASCII code not in 32-127 range" -msgstr "E1243: ASCII կոդը 32-127 միջակայքում չէ" - -#| msgid "E383: Invalid search string: %s" -msgid "E1244: Bad color string: %s" -msgstr "E1244: Վատ գույնի տող՝ %s" - -msgid "E1245: Cannot expand in a Vim9 function" -msgstr "E1245: Հնարավոր չէ ընդլայնել Vim9 ֆունկցիայի մեջ" - -#| msgid "E794: Cannot set variable in the sandbox: \"%s\"" -msgid "E1246: Cannot find variable to (un)lock: %s" -msgstr "E1246: Հնարավոր չէ գտնել փոփոխական (ապ)կողպելու համար՝ %s" - -msgid "E1247: Line number out of range" -msgstr "E1247: Տողի համարը միջակայքից անցել է" - -msgid "E1248: Closure called from invalid context" -msgstr "E1248: Փակումը կանչվել է անվավեր համատեքստից" - -msgid "E1249: Highlight group name too long" -msgstr "E1249: Գունանշման խմբի անունը շատ երկար է" - -#, c-format -msgid "E1250: Argument of %s must be a List, String, Dictionary or Blob" -msgstr "E1250: %s֊ի արգումենտը պետք է լինի ցանկ կամ բառարան" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1251: List, Dictionary, Blob or String required for argument %d" -msgstr "E1251: արգումենտի համար պահանջվում է ցուցակ, բառարան, բլոկ կամ տող %d" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1252: String, List or Blob required for argument %d" -msgstr "E1252: %d արգումենտի համար պահանջվում է տող, ցուցակ կամ բշտիկ" - -#| msgid "E794: Cannot set variable in the sandbox" -msgid "E1254: Cannot use script variable in for loop" -msgstr "E1254: Հնարավոր չէ օգտագործել սկրիպտի փոփոխական for loop-ում" - -msgid "E1255: mapping must end with " -msgstr "E1255: քարտեզագրումը պետք է ավարտվի" - -#| msgid "E1206: Dictionary required for argument %d" -msgid "E1256: String or function required for argument %d" -msgstr "E1256: %d արգումենտի համար պահանջվում է տող կամ ֆունկցիա" - -#, c-format -msgid "E1257: Imported script must use \"as\" or end in .vim: %s" -msgstr "" -"E1257: Ներմուծված սկրիպտը պետք է օգտագործի \"as\" կամ վերջանա .vim-ով: %s" - -#| msgid "E253: Fontset name: %s" -msgid "E1258: No '.' after imported name: %s" -msgstr "E1258: Ոչ \"\": ներմուծված անունից հետո՝ %s" - -#| msgid "E1389: Missing name after implements" -msgid "E1259: Missing name after imported name: %s" -msgstr "E1259: Ներմուծված անունից հետո անունը բացակայում է՝ %s" - -#, c-format -msgid "E1260: Cannot unlet an imported item: %s" -msgstr "E1260: Հնարավոր չէ ապասահմանել ներմուծված տարրը՝ %s" - -msgid "E1261: Cannot import .vim without using \"as\"" -msgstr "E1261: Հնարավոր չէ ներմուծել .vim առանց \"as\" օգտագործելու" - -#| msgid "E625: Cannot open cscope database: %s" -msgid "E1262: Cannot import the same script twice: %s" -msgstr "E1262: Հնարավոր չէ նույն սկրիպտն երկու անգամ ներմուծել՝ %s" - -msgid "E1263: Cannot use name with # in Vim9 script, use export instead" -msgstr "" -"E1263: Vim9 սկրիպտում #-ով անունը հնարավոր չէ օգտագործել, փոխարենը " -"օգտագործեք արտահանումը" - -#, c-format -msgid "E1264: Autoload import cannot use absolute or relative path: %s" -msgstr "" -"E1264: Ավտոբեռնման ներմուծումը չի կարող օգտագործել բացարձակ կամ հարաբերական " -"ճանապարհ՝ %s" - -#| msgid "E862: Cannot use g: here" -msgid "E1265: Cannot use a partial here" -msgstr "E1265: Այստեղ հնարավոր չէ մասնակին օգտագործել" - -msgid "" -"E1266: Critical error in python3 initialization, check your python3 " -"installation" -msgstr "" -"E1266: Կրիտիկական սխալ python3 սկզբնավորման ժամանակ, ստուգեք ձեր python3 " -"տեղադրումը" - -#| msgid "E128: Function name must start with a capital or \"s:\": %s" -msgid "E1267: Function name must start with a capital: %s" -msgstr "E1267: Ֆունկցիայի անունը պետք է սկսվի մեծատառով՝ %s" - -#| msgid "E1048: Item not found in script: %s" -msgid "E1268: Cannot use s: in Vim9 script: %s" -msgstr "E1268: Հնարավոր չէ օգտագործել s: Vim9 սկրիպտում՝ %s" - -#| msgid "E794: Cannot set variable in the sandbox: \"%s\"" -msgid "E1269: Cannot create a Vim9 script variable in a function: %s" -msgstr "E1269: Հնարավոր չէ ստեղծել Vim9 սցենարի փոփոխական ֆունկցիայում՝ %s" - -msgid "E1270: Cannot use :s\\/sub/ in Vim9 script" -msgstr "E1270: Հնարավոր չէ օգտագործել :s\\/sub/ Vim9 սկրիպտում" - -#, c-format -msgid "E1271: Compiling closure without context: %s" -msgstr "E1271: Կազմում է փակումը առանց համատեքստի. %s" - -#| msgid "E120: Using not in a script context: %s" -msgid "E1272: Using type not in a script context: %s" -msgstr "E1272: Օգտագործելով տիպը ոչ սցենարի համատեքստում՝ %s" - -#, c-format -msgid "E1273: (NFA regexp) missing value in '\\%%%c'" -msgstr "E1273: (NFA regexp) անսպասելի '\\%%%c'" - -#| msgid "E498: No :source file name to substitute for \"\"" -msgid "E1274: No script file name to substitute for \"