Sublime Forum

Can I disable ensure_newline_at_eof_on_save for specific files?

#1

I have ensure_newline_at_eof_on_save set to true. This is my preferred setting. But I have some files that should not contain an ending new line. Is there a way to set that to false for specific files, or maybe specific directories?

0 Likes

#2

Note, I did figure out how to disable it on a project level. See: https://www.sublimetext.com/docs/3/projects.html

1 Like

#3

You could install the packages:

  1. https://github.com/titoBouzout/BufferScroll
  2. and https://github.com/evandrocoan/SublimeQuickSettings

The package QuickSettings allows you to easily set the current view file setting, then only that view has that setting. And the BufferScroll package remember a file settings after closing.

So after opening a file, you can use QuickSettings to set the file settings, and the BufferScroll package will save the file view settings, so when you open the file again the settings is restored.

0 Likes

#4

Finally had a chance to test your idea.

I can’t seem to figure out how to use QuickSettings though. I cloned it into ~/.config/sublime-text-3/Packages and tried moving the dir from SublimeQuickSettings to QuickSettings, but I still have no options in the Command Palette for QuickSettings.

I also restarted SublimeText a couple times.

Plus, the gif demo on in the github readme is moving to fast for me to catch exactly what it happening…

Any tips?

0 Likes

#5

The command name is Quick Settings: Edit Preferences...


I just remembered it is not working because it is missing to install a required dependency for the package. The dependency is pending review to be included on the package control default channel on:

For now you can:

  1. You can install the dependency manually by cloning it directly on your Packages folder and run the package control command Satisfy dependencies.
git clone https://github.com/evandrocoan/PythonDebugTools
  1. Or add my channel to you package control and restart Sublime Text. You can see the instructions on:

If none of this work, can you post here the contents of your Sublime Text console?

  • You can Open the Sublime Text console by going on the menu View - Show Console (Ctrl+')
0 Likes

#6

Yeah, I cloned it into my packages directory. It didn’t work.

Here’s my console contents:

DPI scale: 1
startup, version: 3143 linux x64 channel: stable
executable: /opt/sublime_text/sublime_text
working dir: /home/username
packages path: /home/username/.config/sublime-text-3/Packages
state path: /home/username/.config/sublime-text-3/Local
zip path: /opt/sublime_text/Packages
zip path: /home/username/.config/sublime-text-3/Installed Packages
ignored_packages: ["Vintage"]
"Packages/Color Scheme - Default/Monokai Bright.tmTheme" is no longer maintained and is now part of "Color Scheme - Legacy"
pre session restore time: 0.069214
startup time: 0.213963
first paint time: 0.235386
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.comment
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.delete_word
reloading plugin Default.detect_indentation
reloading plugin Default.duplicate_line
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.swap_line
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.trim_trailing_white_space
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading plugin 0_package_control_loader.00-package_control
reloading plugin 0_package_control_loader.50-dateutil
reloading plugin PHP Completions Kit.plugin
reloading plugin Package Control.1_reloader
reloading plugin Package Control.2_bootstrap
reloading plugin Package Control.Package Control
reloading plugin PhpDoc.CodeDoc
reloading plugin Phpcs.phpcs
reloading plugin Unicode Character Highlighter.sublime_unicode_nbsp
reloading plugin VCS Gutter.gutter_handlers
reloading plugin VCS Gutter.vcs_gutter
reloading plugin VCS Gutter.vcs_gutter_change
reloading plugin VCS Gutter.vcs_gutter_events
reloading plugin VCS Gutter.vcs_helpers
reloading plugin VCS Gutter.view_collection
reloading plugin BufferScroll.BufferScroll
reloading plugin PlainTasks.APlainTasksCommon
reloading plugin PlainTasks.PlainTasks
reloading plugin PlainTasks.PlainTasksDates
reloading plugin PlainTasks.PlainTasksToHTML
reloading plugin PlainTasks.plist_parser
reloading plugin QuickSettings.QuickSettigns
Traceback (most recent call last):
  File "/opt/sublime_text/sublime_plugin.py", line 109, in reload_plugin
    m = importlib.import_module(modulename)
  File "./python3.3/importlib/__init__.py", line 90, in import_module
  File "<frozen importlib._bootstrap>", line 1584, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1565, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1532, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 584, in _check_name_wrapper
  File "<frozen importlib._bootstrap>", line 1022, in load_module
  File "<frozen importlib._bootstrap>", line 1003, in load_module
  File "<frozen importlib._bootstrap>", line 560, in module_for_loader_wrapper
  File "<frozen importlib._bootstrap>", line 868, in _load_module
  File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
  File "/home/username/.config/sublime-text-3/Packages/QuickSettings/QuickSettigns.py", line 18, in <module>
    from python_debug_tools import Debugger
ImportError: No module named 'python_debug_tools'
plugins loaded
Package Control: Installing 1 missing dependency
Package Control: The dependency 'PythonDebugTools' is not available
Package Control: No updated packages
Package Control: All dependencies have been satisfied
0 Likes

#7

Now you can run the command Package Control: Install Local Dependencies, then it should install the PythonDebugTools dependency. After that, restart Sublime Text.

0 Likes