如何将长命令包装到 bash 脚本文件中的下一行?
作为一个简单的例子,我想运行命令 pushd . && cd /foo/bar && ls && popd
从控制台我可以这样做:
pushd . \
&& cd /foo/bar \
&& ls \
&& popd
Run Code Online (Sandbox Code Playgroud)
这就结束了。但是脚本文件中的相同代码会产生错误。
你如何包装这些行以使其格式良好?
假设我们有一个电子表格,其中所有行都具有相同的默认高度。
在一个单元格中,我们写Hello ALT+ENTER World. 我确实有时需要在单元格中输入多行文本,写一些长笔记等。
然后,该单元格将自动启用该Wrap text按钮(在“主页”功能区菜单中),并且该特定行的高度将自动增加。
如何禁用这个自动功能Wrap text?无需Wrap text再次手动单击即可禁用它?
另请参阅(没有完美解决此问题的链接问题):
microsoft-excel-2007 cells word-wrap microsoft-excel cell-format
我正在使用konsole-4.14.3,tmux-2.6我的 shell 是 bash。在 tmux 之外,换行工作正常,文本会移动到下一行。在 tmux 中,这不起作用。我用谷歌搜索了很长时间,但没有找到任何有效的修复方法。在我的~/.bashrc我有
export PS1="\[\e[1;92m\]\u@\h: \w \\$ \[\e[m\]"
export PS2='> '
Run Code Online (Sandbox Code Playgroud)
我把它们取下来再试一次,但结果是一样的。我使用的是 Slackware 14.2,问题似乎与某些系统设置有关,因为在相同的情况下~/.tmux.conf,换行在 Ubuntu 16.04 上可以按预期工作。
当编辑我在 .vimrc 中限制为 tw=80 的文件时,当我稍后回来编辑它们时,行长度最终会到处都是。例如
lets say for the sake of argument that this line hits 80 characters
there and continues on the next line as normal
Run Code Online (Sandbox Code Playgroud)
编辑后...
lets say for the sake of argument (edit edit edit edit) that this
line hits 80 characters
there and continues on the next line as normal
Run Code Online (Sandbox Code Playgroud)
代替
lets say for the sake of argument (edit edit edit edit) that this
line hits 80 characters there and continues on the next line as …Run Code Online (Sandbox Code Playgroud) 我知道 kate 有一个功能,如果该行超过一定数量的字符(如 80),它会自动用换行符换行。
Notepad++ 在 Views 表下具有自动换行功能,但它不会插入换行符。它只是在视觉上分割长行而不插入实际的换行符。
Notepad++ 中是否有插件或功能可以自动使用换行符自动换行?
在Sublime Text 2 中有一个菜单选项可以禁用自动换行,现在似乎强制自动换行而无法禁用它。
我试图设置:"word_wrap": false在用户的语法特定设置中,但此选项无效。
那么如何禁用给定文件的自动换行呢?
我想在 Dbeaver 中默认启用自动换行。
有一个答案显示如何切换自动换行,但我不想每次打开 Dbeaver 时都这样做:-)
有没有办法将选定的文本包裹在 ',",),},],> 或 Notepad++ 中的任何符号周围?
我已经查看了所有插件,但没有什么与 Textmate 或 eclipse 可以做的类似。
word-wrap ×8
bash ×2
notepad++ ×2
cell-format ×1
cells ×1
command-line ×1
dbeaver ×1
linux ×1
selection ×1
terminal ×1
text-editors ×1
tmux ×1
vim ×1